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

pipelines: BundlingOptions Docker Login #25808

Open
argarinpauljohn opened this issue Jun 1, 2023 · 6 comments
Open

pipelines: BundlingOptions Docker Login #25808

argarinpauljohn opened this issue Jun 1, 2023 · 6 comments
Labels
@aws-cdk/aws-codepipeline Related to AWS CodePipeline effort/medium Medium work item – several days of effort feature-request A feature should be added or improved. p2

Comments

@argarinpauljohn
Copy link

argarinpauljohn commented Jun 1, 2023

Describe the bug

We are using CodePipeline in which we correctly specified our Docker Hub secret. It is correctly retrieved by the codebuild project. In this pipeline, we have a stage in which we are building a stack that has an aws_s3_assets.s3_assets resource. In this resource, we use `BundlingOptions' like this:

bundling=BundlingOptions(
                image=DockerImage.from_registry("python:3.10"),
                command=[
                    "sh",
                    "-c",
                    """
                    pip install poetry;
                ],
                user="root",
            ),

However, pulling the image python:3.10 still results in a rate-limit issue. It seems like it's not using the specified Docker Hub secret we specified in the pipeline level. I verified using some command that we still haven't reached our account's rate limit.

Our pipeline looks like this:

        pipeline = CodePipeline(
            self,
            "DataPipeline",
            pipeline_name="DataPipeline",
            docker_credentials=[DockerCredential.docker_hub(cdk.aws_secretsmanager.Secret.from_secret_name_v2(scope, "DockerHubSecret", secret_name="DockerHubSecret"))],
            synth=ShellStep(
                "Synth",
                input=github_source,
                commands=[
                    "pip install poetry",
                    "cd cdk",
                    "poetry install --no-dev",
                ],
                primary_output_directory="./cdk/cdk.out",
            ),
            code_build_defaults=CodeBuildOptions(role_policy=self._get_read_only_access_statements()),
            docker_enabled_for_synth=True,
        )

to which we add the stage that creates the s3_assets.

Expected Behavior

Use the specified Docker Hub secrets then login to avoid the rate limit issue.

Current Behavior

Unable to find image 'python:3.10' locally
266 | docker: Error response from daemon: toomanyrequests: You have reached your pull rate limit. You may increase the limit by authenticating and upgrading: https://www.docker.com/increase-rate-limit.

Reproduction Steps

N/A

Possible Solution

No response

Additional Information/Context

No response

CDK CLI Version

2.81.0

Framework Version

No response

Node.js Version

v16.17.0

OS

macOS Ventura 13.3.1

Language

Python

Language Version

No response

Other information

No response

@argarinpauljohn argarinpauljohn added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Jun 1, 2023
@github-actions github-actions bot added the @aws-cdk/aws-secretsmanager Related to AWS Secrets Manager label Jun 1, 2023
@peterwoodworth peterwoodworth changed the title BundlingOptions: Docker Login pipelines: BundlingOptions Docker Login Jun 1, 2023
@peterwoodworth peterwoodworth removed the @aws-cdk/aws-secretsmanager Related to AWS Secrets Manager label Jun 1, 2023
@github-actions github-actions bot added the @aws-cdk/pipelines CDK Pipelines library label Jun 1, 2023
@pahud
Copy link
Contributor

pahud commented Jun 5, 2023

Hi

If you need python:3.10 you should consider pulling from ECR public to avoid throttling.

You can select your favorite image tags here:
https://gallery.ecr.aws/docker/library/python

Let me know if it works for you.

@pahud pahud added response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days. p2 feature-request A feature should be added or improved. effort/medium Medium work item – several days of effort and removed needs-triage This issue or PR still needs to be triaged. bug This issue is a bug. labels Jun 5, 2023
@pahud pahud self-assigned this Jun 5, 2023
@github-actions
Copy link

github-actions bot commented Jun 7, 2023

This issue has not received a response in a while. If you want to keep this issue open, please leave a comment below and auto-close will be canceled.

@github-actions github-actions bot added the closing-soon This issue will automatically close in 4 days unless further comments are made. label Jun 7, 2023
@hoegertn
Copy link
Contributor

hoegertn commented Jun 7, 2023

I think this is a broader problem. assets that are bundled in the synth step (S3, Lambda Containers) do not honor the Docker credentials. This is also true for ECR logins to private registries.

@github-actions github-actions bot removed closing-soon This issue will automatically close in 4 days unless further comments are made. response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days. labels Jun 8, 2023
@argarinpauljohn
Copy link
Author

Hi

If you need python:3.10 you should consider pulling from ECR public to avoid throttling.

You can select your favorite image tags here: https://gallery.ecr.aws/docker/library/python

Let me know if it works for you.

Thanks @pahud! Will git it a try!

@argarinpauljohn
Copy link
Author

I think this is a broader problem. assets that are bundled in the synth step (S3, Lambda Containers) do not honor the Docker credentials. This is also true for ECR logins to private registries.

+1!

@pahud
Copy link
Contributor

pahud commented Jun 13, 2023

I think this is a broader problem. assets that are bundled in the synth step (S3, Lambda Containers) do not honor the Docker credentials. This is also true for ECR logins to private registries.

Agree. I am making it a p2 feature request. Please help us prioritize it by upvotes 👍 on the issue.

@pahud pahud removed their assignment Jun 13, 2023
@vinayak-kukreja vinayak-kukreja added @aws-cdk/aws-codepipeline Related to AWS CodePipeline and removed @aws-cdk/pipelines CDK Pipelines library labels Apr 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
@aws-cdk/aws-codepipeline Related to AWS CodePipeline effort/medium Medium work item – several days of effort feature-request A feature should be added or improved. p2
Projects
None yet
Development

No branches or pull requests

5 participants