open-component-model / ocm

Open Component Model (Software Bill of Delivery) Toolset
https://ocm.software
Apache License 2.0
35 stars 23 forks source link

Not able to push component to AWS ECR #301

Closed mayankraipure12 closed 1 year ago

mayankraipure12 commented 1 year ago

What happened: ocm transfer component ./component-archive 671041269596.dkr.ecr.ap-south-1.amazonaws.com/mayankr-registry/podinfo-component transferring version "github.com/acme/podinfo:v1.0.0"... ...resource 0... Error: github.com/acme/podinfo:v1.0.0: transferring resource 0: unable to add blob: unable to add blob: failed to push: failed to do request: Post "https://671041269596.dkr.ecr.ap-south-1.amazonaws.com/v2/mayankr-registry/podinfo-component/component-descriptors/github.com/acme/podinfo/blobs/uploads/": EOF 1 versions transferred Error: transfer finished with 1 error(s) What you expected to happen: Component should get uploaded. How to reproduce it (as minimally and precisely as possible):

Anything else we need to know:

Environment: Ubuntu to AWS

shivenduverma-sap commented 1 year ago

Root Cause: Unlike GCP, AWS does not create folders/repositories automatically in a registry and the error is caused by lack of repositories. The error can be confirmed from CloudTrail "The repository with name '<path to image>' does not exist in the registry with id '<account-id>'" The issue is known but has still not been implemented: https://github.com/aws/containers-roadmap/issues/853

Intermediate Solution: Creating the repositories manually via the aws ecr create-repository --repository-name <path to docker image> solves the issue, but has to be repeated for all repositories hosting images. ie. Consider a component archive with 1 local resource, 2 repositories have to be created, 1 for the image of the local resource and 1 for the component-descriptor.

shivenduverma-sap commented 1 year ago

Team Decision: