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

[Terrarium - Providers]: Implementation of Storage Feature - 1 #70

Merged
merged 5 commits into from
Apr 30, 2024

Conversation

anjanikshree12
Copy link
Contributor

@anjanikshree12 anjanikshree12 commented Apr 25, 2024

This PR includes:

  • Protobuff definitions for storage service having functionalities such as download provider binary, shasum and signature files which is a required metadata that a particular version and platform of a provider requires.

  • gRPC code generated by protoc compiler tool from the protobuff definitions.

Description:

  • The plan is to extend the rest protocol implementation of providers v1, to design 3 APIs that could be used to download the required files/provider binaries as per the provider registry protocol from the storage system.
https://<host-name>/providers/v1/{organization_name}/{name}/{version}/{os}/{arch}/terraform-provider-{name}_{version}_{os}_{arch}.zip
https://<host-name>/providers/v1/{organization_name}/{name}/{version}/terraform-provider-{name}_{version}_SHA256SUMS
https://<host-name>/providers/v1/{organization_name}/{name}/{version}/terraform-provider-{name}_{version}_SHA256SUMS.sig
  • The files needed as per the provider registry protocol for download through the URL is provider binary archive, shasum file & shasum signature file.
"download_url": "https://<host-name>/providers/v1/{organization_name}/{name}/{version}/{os}/{arch}/terraform-provider-{name}_{version}_{os}_{arch}.zip",
"shasums_url": "https://<host-name>/providers/v1/{organization_name}/{name}/{version}/terraform-provider-{name}_{version}_SHA256SUMS",
"shasums_signature_url": "https://<host-name>/providers/v1/{organization_name}/{name}/{version}/terraform-provider-{name}_{version}_SHA256SUMS.sig"

S3 Directory tree structure to be followed.

--organisation1
     |---- provider1
              |------ version
                         |----- terraform-provider-<provider-name>_<version>_SHA256SUMS
                         |----- terraform-provider-<provider-name>_<version>_SHA256SUMS.sig
                         |----- terraform-provider-<provider-name>_<version>_<os>_<arch>.zip
                         |----- terraform-provider-<provider-name>_<version>_<os>_<arch>.zip
                         continued ...
              |------ version2
                         |----- terraform-provider-<provider-name>_<version>_SHA256SUMS
                         |----- terraform-provider-<provider-name>_<version>_SHA256SUMS.sig
                         |----- terraform-provider-<provider-name>_<version>_<os>_<arch>.zip
                         |----- terraform-provider-<provider-name>_<version>_<os>_<arch>.zip
                         continued ...
     |---- provider2
              |------ version
                         |----- terraform-provider-<provider-name>_<version>_SHA256SUMS
                         |----- terraform-provider-<provider-name>_<version>_SHA256SUMS.sig
                         |----- terraform-provider-<provider-name>_<version>_<os>_<arch>.zip
                         |----- terraform-provider-<provider-name>_<version>_<os>_<arch>.zip
                         continued ...
              |------ version2
                         |----- terraform-provider-<provider-name>_<version>_SHA256SUMS
                         |----- terraform-provider-<provider-name>_<version>_SHA256SUMS.sig
                         |----- terraform-provider-<provider-name>_<version>_<os>_<arch>.zip
                         |----- terraform-provider-<provider-name>_<version>_<os>_<arch>.zip
                         continued ...

Note: Shasum file and signature is common for each version, so getting stored at version level.

Copy link
Contributor

@odelanno odelanno left a comment

Choose a reason for hiding this comment

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

gen_proto.sh needs to be upgraded to include the storage protocol buffer file so that everything is re generated correctly.

odelanno
odelanno previously approved these changes Apr 26, 2024
pb/terrarium/provider/provider.proto Outdated Show resolved Hide resolved
pb/terrarium/provider/provider.proto Outdated Show resolved Hide resolved
adcharre
adcharre previously approved these changes Apr 29, 2024
* implementation of consumer service

* update in functions as we remove consumer service

* go fmt

* Update internal/provider/services/storage/storage.go

Co-authored-by: Adam Charrett <[email protected]>

* updated storage.go

* enhance error logs

* updated storage_test

* fix

* fix

* updated storage_test and mock server

* [Terrarium - Providers]: Implementation of Storage Feature - 3 (#72)

---------

Co-authored-by: Anjani Kumar Srivastava <[email protected]>
Co-authored-by: Adam Charrett <[email protected]>
@anjanikshree12 anjanikshree12 merged commit 7c5a688 into main Apr 30, 2024
1 check passed
@anjanikshree12 anjanikshree12 deleted the ciedev-3259 branch April 30, 2024 15:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants