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

Add support for S3-compatible storage in Result Uploader #476

Merged
merged 2 commits into from
Oct 31, 2024

Conversation

zjmletang
Copy link
Contributor

To upload files using Alibaba Cloud OSS, you must first have an Alibaba Cloud OSS account, which includes your Access Key (AK) and Secret Key (SK). Once you have these, please follow the steps below for configuration:

  1. Create an OSS Bucket: Start by setting up a new OSS bucket in your Alibaba Cloud account.
  2. Configure the alicloudoss.json File: Update this file with your bucket name and endpoint.
  3. Set Environment Variables: Configure your AK and SK as environment variables by executing:
    export AUTOHCK_ALICLOUDOSS_ACCESS_KEY_ID=<AK>
    export AUTOHCK_ALICLOUDOSS_CLIENT_SECRET=<SK>
    After completing these steps, you'll be ready to upload files to Alibaba Cloud OSS.

for the problem description
please visit #471

Signed-off-by: Zhang JianMing [email protected]

Gemfile Fixed Show fixed Hide fixed
Copy link
Contributor

@kostyanf14 kostyanf14 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please review and fix Rubocop code scanning error too.

Gemfile Outdated Show resolved Hide resolved
lib/resultuploaders/alicloudoss/alicloudoss.rb Outdated Show resolved Hide resolved
Copy link
Contributor

@akihikodaki akihikodaki left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

First, thank you for your contribution.

Please consider using AWS SDK instead; it should give chances to support many S3-compatible storages, including Alibaba Cloud OSS. If you definitely need a feature specific to Alibaba Cloud OSS, please explain it.

@zjmletang
Copy link
Contributor Author

First, thank you for your contribution.

Please consider using AWS SDK instead; it should give chances to support many S3-compatible storages, including Alibaba Cloud OSS. If you definitely need a feature specific to Alibaba Cloud OSS, please explain it.

@akihikodaki , Thank you for your valuable suggestion! I chose the Alibaba Cloud SDK primarily because I work with Alibaba Cloud, which makes maintenance and troubleshooting more convenient for me. I hadn't fully considered the potential benefits of using the AWS SDK, as I usually select the SDK that corresponds to the cloud service I'm utilizing.

I do have a question regarding the definition of "result uploader." Currently, we are using Dropbox, and my initial understanding was that each storage service would have its own dedicated "result uploader," such as Dropbox, Alibaba Cloud OSS, AWS Storage, etc. Is this understanding correct? In other words, even though they are all S3-compatible storages, will there still be individual result uploaders for different products from various companies? I would appreciate your insight on whether you envision S3-compatible storages as being treated as a single result uploader.

@kostyanf14
Copy link
Contributor

@zjmletang

I would appreciate your insight on whether you envision S3-compatible storages as being treated as a single result uploader.

We agree with the idea of having one S3-compatible result uploader with the ability to configure it for AWS, Alibaba Cloud, or even open-source storage (e.g., minio).

@zjmletang
Copy link
Contributor Author

We agree with the idea of having one S3-compatible result uploader with the ability to configure it for AWS, Alibaba Cloud, or even open-source storage (e.g., minio).

@kostyanf14 Got it. I have turned the patch into a draft as I need some time to modify and test it

@zjmletang zjmletang marked this pull request as draft September 25, 2024 01:14
@zjmletang zjmletang closed this Oct 8, 2024
@zjmletang zjmletang force-pushed the add_alicloudoss_resultuploader branch from 28dd168 to 784b42d Compare October 8, 2024 08:43
@zjmletang
Copy link
Contributor Author

@kostyanf14 Could you please reopen my patch? I accidentally closed it while resetting the branch, and I didn’t see the option to reopen it afterward. I’m not sure if this is due to permission issues.

@zjmletang zjmletang changed the title Add Alibaba Cloud OSS resultuploader Add support for S3-compatible storage in Result Uploader Oct 8, 2024
@YanVugenfirer YanVugenfirer reopened this Oct 8, 2024
@YanVugenfirer
Copy link
Contributor

@zjmletang I reopened

@kostyanf14
Copy link
Contributor

@zjmletang Can I make PR ready for review?

@zjmletang
Copy link
Contributor Author

@kostyanf14. Not ready yet; I haven't tested it thoroughly myself. I'll notify you once I finish the testing

@zjmletang zjmletang force-pushed the add_alicloudoss_resultuploader branch 2 times, most recently from bce5d51 to b4f5b97 Compare October 10, 2024 08:32
@zjmletang
Copy link
Contributor Author

zjmletang commented Oct 10, 2024

@kostyanf14 , I am ready on my side. Please see the configuration document below

To upload files using S3-Compatible storage (supports AWS S3, Alibaba Cloud OSS, etc.), please follow the steps below for configuration:

  1. Create an Account
    For AWS S3: Sign up for an AWS account and obtain your Access Key (AK) and Secret Key (SK).
    For Alibaba Cloud OSS: Similarly, create an Alibaba Cloud account and get your Access Key (AK) and Secret Key (SK).
  2. Create a Storage Bucket
    Log in to your cloud provider's console (AWS or Alibaba Cloud) and create a new storage bucket.
  3. Set Bucket Permissions
    Ensure that your bucket is configured to have public read permissions.
  4. Configure s3compatible.json File
    Update the s3compatible.json file in your project directory with the following content:
    {
    "bucket_name": "<your_bucket_name>",
    "region": "<your_region>",
    "endpoint": "<your_endpoint>"
    }
    Example Configurations:
    For AWS S3:
    {
    "bucket_name": "auto-hck-result",
    "region": "us-east-1",
    "endpoint": "s3.amazonaws.com"
    }
    For Alibaba Cloud OSS:
    {
    "bucket_name": "auto-hck-result",
    "region": "oss-cn-hangzhou",
    "endpoint": "oss-cn-hangzhou.aliyuncs.com"
    }
    For specific values of region and endpoint, please refer to the official documentation of your cloud provider.
  5. Set Environment Variables
    Configure your AK and SK as environment variables by executing the following commands:
    export AUTOHCK_S3_ACCESS_KEY_ID=<AK>
    export AUTOHCK_S3_SECRET_ACCESS_KEY=<SK>

@zjmletang zjmletang marked this pull request as ready for review October 10, 2024 08:41
Copy link
Contributor

@akihikodaki akihikodaki left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I prefer it to be named S3 instead of S3compatible for conciseness. Anything compatible with S3 should work with an uploader for S3 anyway so "compatible" adds no semantic value.

lib/resultuploaders/s3compatible/s3compatible.rb Outdated Show resolved Hide resolved
lib/resultuploaders/s3compatible/s3compatible.rb Outdated Show resolved Hide resolved
lib/resultuploaders/s3compatible/s3compatible.rb Outdated Show resolved Hide resolved
lib/resultuploaders/s3compatible/s3compatible.rb Outdated Show resolved Hide resolved
lib/resultuploaders/s3compatible/s3compatible.rb Outdated Show resolved Hide resolved
@zjmletang zjmletang marked this pull request as draft October 14, 2024 13:49
@zjmletang zjmletang force-pushed the add_alicloudoss_resultuploader branch from b4f5b97 to c43994a Compare October 15, 2024 08:03
@zjmletang zjmletang force-pushed the add_alicloudoss_resultuploader branch from c43994a to b0f0a16 Compare October 15, 2024 08:06
@zjmletang zjmletang marked this pull request as ready for review October 15, 2024 08:57
lib/resultuploaders/s3/s3.rb Outdated Show resolved Hide resolved
lib/resultuploaders/s3/s3.rb Outdated Show resolved Hide resolved
lib/resultuploaders/s3/s3.rb Outdated Show resolved Hide resolved
lib/templates/index.html.erb Outdated Show resolved Hide resolved
lib/resultuploaders/s3/s3.rb Outdated Show resolved Hide resolved
lib/resultuploaders/s3/s3.rb Show resolved Hide resolved
@zjmletang zjmletang force-pushed the add_alicloudoss_resultuploader branch from b0f0a16 to 7ca5839 Compare October 24, 2024 13:34
lib/resultuploaders/s3/s3.rb Outdated Show resolved Hide resolved
lib/resultuploaders/s3/s3.rb Outdated Show resolved Hide resolved
lib/resultuploaders/s3/s3.rb Outdated Show resolved Hide resolved
@zjmletang zjmletang force-pushed the add_alicloudoss_resultuploader branch from 7ca5839 to 9655726 Compare October 25, 2024 05:28
lib/resultuploaders/s3/s3.rb Outdated Show resolved Hide resolved
@zjmletang zjmletang force-pushed the add_alicloudoss_resultuploader branch 2 times, most recently from dd86ca9 to 1edecdb Compare October 28, 2024 09:02
Copy link
Contributor

@akihikodaki akihikodaki left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are few nits remaining and this pull request will be ready once they are handled. Thank you for keeping working on this feature!

lib/resultuploaders/s3/s3.rb Outdated Show resolved Hide resolved
lib/resultuploaders/s3/s3.rb Outdated Show resolved Hide resolved
- Implemented support for S3-compatible cloud storage, including but not limited to AWS S3, Alibaba Cloud OSS, and others.

For the problem description, please visit HCK-CI#471

Signed-off-by: Zhang JianMing [email protected]
@zjmletang zjmletang force-pushed the add_alicloudoss_resultuploader branch from 1edecdb to 480e44e Compare October 31, 2024 08:32
Copy link
Contributor

@akihikodaki akihikodaki left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now all my feedback is addressed. Thank you for your contribution!

@zjmletang
Copy link
Contributor Author

There are few nits remaining and this pull request will be ready once they are handled. Thank you for keeping working on this feature!

I have made the changes. Thank you very much for your thorough guidance; I have learned a lot @akihikodaki @kostyanf14 @YanVugenfirer

@kostyanf14 kostyanf14 merged commit ea35b99 into HCK-CI:master Oct 31, 2024
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants