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 - 2 #71

Merged
merged 13 commits into from
Apr 30, 2024

Conversation

anjanikshree12
Copy link
Contributor

@anjanikshree12 anjanikshree12 commented Apr 26, 2024

Follow up PR to #70

This PR includes:

  • Implementation of storage service having features that enables us to download provider binary, shasum file & shasum signature file.
  • Unit tests added for each functionalities.

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.

@anjanikshree12 anjanikshree12 self-assigned this Apr 26, 2024
@anjanikshree12 anjanikshree12 changed the base branch from main to ciedev-3259 April 26, 2024 07:12
internal/provider/services/storage/storage.go Outdated Show resolved Hide resolved
internal/provider/services/storage/storage.go Outdated Show resolved Hide resolved
internal/provider/services/storage/storage.go Outdated Show resolved Hide resolved
internal/provider/services/test_helper.go Outdated Show resolved Hide resolved
internal/provider/services/storage/storage.go Outdated Show resolved Hide resolved
internal/provider/services/storage/storage.go Outdated Show resolved Hide resolved
internal/provider/services/storage/storage.go Outdated Show resolved Hide resolved
internal/provider/services/storage/storage.go Outdated Show resolved Hide resolved
internal/provider/services/storage/storage_test.go Outdated Show resolved Hide resolved
internal/provider/services/storage/storage_test.go Outdated Show resolved Hide resolved
@anjanikshree12 anjanikshree12 requested a review from adcharre April 29, 2024 17:25
Anjani Kumar Srivastava added 2 commits April 29, 2024 17:41
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.

Just a few more.

internal/provider/services/storage/storage_test.go Outdated Show resolved Hide resolved
internal/provider/services/storage/storage_test.go Outdated Show resolved Hide resolved
internal/provider/services/storage/storage_test.go Outdated Show resolved Hide resolved
@anjanikshree12 anjanikshree12 requested a review from adcharre April 30, 2024 09:59
@anjanikshree12 anjanikshree12 merged commit bb6b5b7 into ciedev-3259 Apr 30, 2024
1 check passed
@anjanikshree12 anjanikshree12 deleted the ciedev-3259-2 branch April 30, 2024 15:30
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.

3 participants