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(CAS): AWS S3 blob storage support #390

Merged
merged 6 commits into from
Oct 17, 2023

Conversation

migmartri
Copy link
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

internal/blobmanager/s3/backend.go Show resolved Hide resolved
internal/blobmanager/s3/provider.go Show resolved Hide resolved
app/artifact-cas/cmd/main.go Show resolved Hide resolved
Copy link
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

@@ -84,7 +84,8 @@ func resourceName(digest string) string {
// Exists check that the artifact is already present in the repository
func (b *Backend) Exists(ctx context.Context, digest string) (bool, error) {
_, 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
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
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.

internal/blobmanager/backend.go Show resolved Hide resolved
internal/blobmanager/s3/provider.go Outdated Show resolved Hide resolved
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>
@migmartri migmartri merged commit 070208f into chainloop-dev:main Oct 17, 2023
12 checks passed
@migmartri migmartri deleted the aws-s3 branch October 17, 2023 13:29
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