Skip to content

feat(CAS): AWS S3 blob storage support#390

Merged
migmartri merged 6 commits into
chainloop-dev:mainfrom
migmartri:aws-s3
Oct 17, 2023
Merged

feat(CAS): AWS S3 blob storage support#390
migmartri merged 6 commits into
chainloop-dev:mainfrom
migmartri:aws-s3

Conversation

@migmartri
Copy link
Copy Markdown
Member

@migmartri migmartri commented Oct 16, 2023

Add support for AWS S3 as Content Addressable Storage.

NOTE: The implementation is very similar to the Azure one #357. The main enhancement in this case in comparison to Azure is that we can rely on sha256 integrity verification on their side easily.

Register storage backend in your Control plane

chainloop cas-backend add aws-s3 --bucket chainloop-test --access-key-id [REDACTED-ACCESS-KEY]  --secret-access-key [REDACTED_SECRET] --region us-east-1 --default
┌──────────────────────────────────────┬────────────────┬──────────┬─────────────┬───────────────┬─────────┐
│ ID                                   │ LOCATION       │ PROVIDER │ DESCRIPTION │ LIMITS        │ DEFAULT │
├──────────────────────────────────────┼────────────────┼──────────┼─────────────┼───────────────┼─────────┤
│ d8da26f0-e427-4c20-9676-91a32c101114 │ chainloop-test │ AWS-S3   │             │ MaxSize: 100M │ true    │
└──────────────────────────────────────┴────────────────┴──────────┴─────────────┴───────────────┴─────────┘

image

and metadata set

image

Closes #269

@migmartri migmartri requested review from danlishka and gr0 October 16, 2023 13:18
Comment thread internal/blobmanager/s3/backend.go
Comment thread internal/blobmanager/s3/provider.go
Comment thread app/artifact-cas/cmd/main.go
Copy link
Copy Markdown
Member

@danlishka danlishka left a comment

Choose a reason for hiding this comment

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

LGTM

_, err := b.Describe(ctx, digest)
if err != nil && errors.As(err, &backend.ErrNotFound{}) {
notFoundErr := &backend.ErrNotFound{}
if err != nil && errors.As(err, &notFoundErr) {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

can you please provide more info why this change here?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

The context is that this wasn't working before, as the error wasn't cast properly. I noticed it because of the tests in AWS which hit a similar code.

Comment thread internal/blobmanager/backend.go
Comment thread internal/blobmanager/s3/provider.go Outdated
Signed-off-by: Miguel Martinez Trivino <miguel@chainloop.dev>
Signed-off-by: Miguel Martinez Trivino <miguel@chainloop.dev>
Signed-off-by: Miguel Martinez Trivino <miguel@chainloop.dev>
Signed-off-by: Miguel Martinez Trivino <miguel@chainloop.dev>
Signed-off-by: Miguel Martinez Trivino <miguel@chainloop.dev>
Signed-off-by: Miguel Martinez Trivino <miguel@chainloop.dev>
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.

AWS S3 in CAS proxy

2 participants