Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upload function to upload whole folder to cloud storage #7

Closed
abskrj opened this issue Dec 26, 2022 · 26 comments · Fixed by #38
Closed

Upload function to upload whole folder to cloud storage #7

abskrj opened this issue Dec 26, 2022 · 26 comments · Fixed by #38
Assignees
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@abskrj
Copy link
Member

abskrj commented Dec 26, 2022

Write a function in utils folder, which takes a folder path and cloud storage name (was, gcp, azure) and uploads the whole folder to the cloud storage

@abskrj abskrj added enhancement New feature or request good first issue Good for newcomers labels Dec 26, 2022
@scoobhidu
Copy link

Hi abhishek I would like to pickup this issue,
Which provider would you like to use?, or should i keep it configurable acc to .env?

@scoobhidu
Copy link

scoobhidu commented Dec 27, 2022

also should I make it for AWS S3 as well or only azure blob and gcp bucket?

@abskrj
Copy link
Member Author

abskrj commented Dec 27, 2022

it should be configurable, and any new cloud provider could be added in future

@scoobhidu
Copy link

@abhishekraj272 are these going to be temp files? gcp has an option for those as well

@abskrj
Copy link
Member Author

abskrj commented Dec 28, 2022

yes, temp files, we need support for was, gcp and azure, all three

@abskrj
Copy link
Member Author

abskrj commented Dec 30, 2022

@loyaltytrooper working on this?

@scoobhidu
Copy link

Sorry abhishek i am not well from last 3 days you can remove me from this issue

@Shofiya2003
Copy link
Collaborator

can I work on the issue?
we need a function which takes the path and the cloud storage name(you can add any new one in the future) and upload the folder to that storage. Right?

@abskrj
Copy link
Member Author

abskrj commented Dec 31, 2022

Yes @Shofiya2003
Assigning it it to you

@abskrj
Copy link
Member Author

abskrj commented Jan 1, 2023

@Shofiya2003 working on this?

@Shofiya2003
Copy link
Collaborator

Yes

@Shofiya2003
Copy link
Collaborator

hey!
the function to upload the folder will take the folder path and the cloud platform as the parameter, and will write independent functions for each of the cloud storage.
I am planning to use filepath.Walk to get the files in the folder.
Apologies for the time, trying to figure things out, new to Golang

@Shofiya2003
Copy link
Collaborator

@abhishekraj272

@abskrj
Copy link
Member Author

abskrj commented Jan 1, 2023

yes, right
you can use filepath.Walk

@abskrj
Copy link
Member Author

abskrj commented Jan 1, 2023

let me know if you stuck somewhere

@Shofiya2003
Copy link
Collaborator

yo!
wrote the functions to upload on s3 bucket and gcp bucket.
Having troubles configuring the AWS SDK to test my function. working on it

@Shofiya2003
Copy link
Collaborator

I used environment variables for aws access key and the secret key but it seems it cannot find the environment variables in the environment. I also used os.Getenv() function to print the keys but it does not work. Do I need some package to access the environment variables in golang?
I used this to configure the SDK, created sessions successfully but stuck on credentials.
https://docs.aws.amazon.com/sdk-for-go/v1/developer-guide/configuring-sdk.html

@abskrj
Copy link
Member Author

abskrj commented Jan 2, 2023

have you put these values in the .env file

AWS_ACCESS_KEY_ID=YOUR_AKID
AWS_SECRET_ACCESS_KEY=YOUR_SECRET_KEY
AWS_SESSION_TOKEN=TOKEN

and are you running this function in main configs.LoadEnv() before running your function?

@Shofiya2003
Copy link
Collaborator

yes i have those values in .env file
not running the function
will get back to you after making the changes

@Shofiya2003
Copy link
Collaborator

done with aws. thanks a ton
I had to use configs.LoadEnv().

@abskrj
Copy link
Member Author

abskrj commented Jan 2, 2023

thats great

@Shofiya2003
Copy link
Collaborator

hey!
created a function for the three cloud storage. I did run a test for all of them, it seems to be working fine.
will make the changes after the review
Thank you for the help

@Shofiya2003
Copy link
Collaborator

@abhishekraj272

@abskrj
Copy link
Member Author

abskrj commented Jan 3, 2023

that's great, also thanks for contribution :)

@abskrj
Copy link
Member Author

abskrj commented Jan 3, 2023

hey @Shofiya2003,
could you take this issue after this is merged #47?

@Shofiya2003
Copy link
Collaborator

sure

@abskrj abskrj closed this as completed in #38 Jan 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants