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

feat: Add GCS support #400

Merged
merged 38 commits into from
Jul 23, 2020
Merged

Conversation

aleksandrmelnikov
Copy link
Contributor

@aleksandrmelnikov aleksandrmelnikov commented Jul 10, 2020

What this PR does:
Updated code to support Google cloud storage if available.

Which issue(s) this PR fixes:

Fixes #331

Special notes for your reviewer:

Aleksandr Melnikov and others added 23 commits July 6, 2020 17:04
- These will be unmarshalled into via CLI from params.yaml.
- Added helper function, MarshalToYaml.
- Returns client that can interact with google cloud storage.
S3 or GCS are set.
- If not, throw an error.
- GCS has necessary credentials in serviceAccount as json
Adding explicit error checking for opts.SetRange.
Added switch statement for GCS versus S3.
- Do not write the value of ServiceAccount to Config Map. This
exposes credentials.
- Properly write the reference the argo expects. The reference
points to the secret that contains the credentials.
…o use.

Adding another field to struct, which will store the ServiceAccountJSON.
- This will be generated by the API and used by the API for the GCS client.
google.golang.org/genproto v0.0.0-20200430143042-b979b6f78d84
google.golang.org/grpc v1.28.0
google.golang.org/protobuf v1.22.0
gopkg.in/yaml.v2 v2.2.8
gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776
Copy link
Contributor

Choose a reason for hiding this comment

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

Why do we need this too? Now we have are using 4 different libraries. Can you use "sigs.k8s.io/yaml" instead? I'd like to eventually refactor everything to use that.

Copy link
Contributor Author

@aleksandrmelnikov aleksandrmelnikov Jul 14, 2020

Choose a reason for hiding this comment

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

Going to create a separate ticket to investigate this.

  • We use yaml.v3 to support reading (and writing) YAML with comments, inline comments, and other metadata.
  • We use pkg/config_types.go as a library in CLI to marshal / unmarshal params.yaml
  • Same package is used in core to dynamically generate the s3 access and secret keys, for Workflows

I think, ideally, we should use yaml.v3

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@aleksandrmelnikov aleksandrmelnikov marked this pull request as ready for review July 14, 2020 19:19
@aleksandrmelnikov aleksandrmelnikov changed the title Feat/core.331 support.gcs.artifact.repository feat: core.331 support.gcs.artifact.repository Jul 14, 2020
Aleksandr Melnikov and others added 2 commits July 14, 2020 14:05
Added GetObject function to be consistent with S3 functionality.
Note
- pkg/client.go, line 88 passes in the JSON.
If ArtifactRepositoryGCSCondig was imported inside gcs.NewClient
code, an import cycle would be created.
AccessKey string
Secretkey string
AccessKey string `yaml:"accessKey"`
Secretkey string `yaml:"secretKey"`
Copy link
Contributor

Choose a reason for hiding this comment

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

should be SecretKey

Copy link
Contributor

Choose a reason for hiding this comment

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

Do we need this if we have ArtifactRepositoryS3Provider? Can't we just move AccessKey and SecretKey fields to ArtifactRepositoryS3Provider and use that across the board?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

should be SecretKey

Sorry, do you mean the yaml: "secretKey"?

Copy link
Contributor

Choose a reason for hiding this comment

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

@aleksandrmelnikov the K in the actual field name is lower case now, should be uppercase.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@rushtehrani I was able to move the attributes from S3Config to S3Provider.

Did you to remove the S3Config struct when you said "use across the board"?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Made changes.

@rushtehrani rushtehrani merged commit bdc3d99 into dev Jul 23, 2020
@rushtehrani rushtehrani deleted the feat/core.331-support.gcs.artifact.repository branch July 23, 2020 20:12
@rushtehrani rushtehrani added this to the v0.12.0 milestone Jul 23, 2020
@rushtehrani rushtehrani changed the title feat: core.331 support.gcs.artifact.repository feat: Add GCS support Jul 24, 2020
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.

2 participants