Hey all, I am testing the new <https://prefect-com...
# prefect-cloud
r
Hey all, I am testing the new Automatic infrastructure provisioning for ECS push work pools. Is it possible to create a deployment with a private docker hub repo? I get the following error:
Copy code
Flow run could not be submitted to infrastructure: TaskFailedToStart - CannotPullContainerError: pull image manifest has been retried 1 time(s): failed to resolve ref <http://docker.io/privaterepo/prefect-ecs-test:test|docker.io/privaterepo/prefect-ecs-test:test>: pull access denied, repository does not exist or may require authorization: server message: insufficient_scope: authorization failed
With the following code:
Copy code
awesome_flow.deploy(
    name=deployment_name,
    work_pool_name="my-pool",
    image=DeploymentImage(
        name="privaterepo/prefect-ecs-test",
        tag="test",
        dockerfile="Dockerfile"
),
push=True
)
How can I provide the private access to the dockerhub (or any other registry like AWS ECR)?
a
IIRC @alex has spent time thinking about this
r
@alex?
a
It is possible to create a deployment with a private registry. You’ll need to ensure you’re authenticated with the private registry on your local machine and in your execution environment. Authenticating with
docker login
will work in the large majority of cases.
r
OK!
Is there a simple way to add the login command to the
Automatic infrastructure provisioning for ECS push work pools
?
a
It’s definitely something we can look into adding!
❤️ 1
r
Or do I add it in the
base-job-template
?
a
I made a mistake in my first statement. Your local would need to be authenticated with your private registry, and your task definition would need to have info about how to authenticate. That is something that you can add to your base job template. It looks like this page from the AWS docs shows what you would need to add to the
task_definition
section of your base job template.
🙌 1
r
Thanks, will check this out later today and let you know 🙂
This seems frustratingly complicated. I tried to add
repositoryCredentials
to the task definition, but that errs with the error message, that an
executionRoleArn
must be provided and those related IAM roles. Hence, it seems easier to just set everything up properly with e.g. pulumi directly.