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 - 3 #72

Merged
merged 19 commits into from
Apr 30, 2024

Conversation

anjanikshree12
Copy link
Contributor

@anjanikshree12 anjanikshree12 commented Apr 28, 2024

Follow up PR to #71

This PR includes:

  • Definition of APIs and Implementation of handler functions that interacts with grpc services to fetch the required files.
  • Unit tests added for helper functions.
  • Created a cmd for provider-storage-service
  • Update allInOne, gateway, providers-v1-rest & browse services.

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.

Anjani Kumar Srivastava added 2 commits April 28, 2024 08:55
Copy link
Contributor

@adcharre adcharre left a comment

Choose a reason for hiding this comment

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

Only a few minor comments, looking good

internal/restapi/providers/v1/handler.go Outdated Show resolved Hide resolved
internal/restapi/providers/v1/handler.go Outdated Show resolved Hide resolved
internal/restapi/providers/v1/handler.go Outdated Show resolved Hide resolved
@anjanikshree12 anjanikshree12 requested a review from adcharre April 30, 2024 04:00
@anjanikshree12 anjanikshree12 merged commit 8ee56e1 into ciedev-3259-2 Apr 30, 2024
1 check passed
@anjanikshree12 anjanikshree12 deleted the ciedev-3259-3 branch April 30, 2024 15:29
anjanikshree12 added a commit that referenced this pull request Apr 30, 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 added a commit that referenced this pull request Apr 30, 2024
* protobuff definitions for consumer service

* updated gen_proto.sh

* removed ConsumerService as not required

* format

* [Terrarium - Providers]: Implementation of Storage Feature - 2 (#71)

* 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]>

---------

Co-authored-by: Anjani Kumar Srivastava <[email protected]>
Co-authored-by: Adam Charrett <[email protected]>
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.

2 participants