https://prefect.io logo
v

Vitaly Shulgin

12/19/2020, 9:47 AM
Hello Team, I built base image, configured flow to use it as base, specified local environment, but agent tries to pull image from docker.io, any ideas? How to prevent it to try pull image from docker.io?
1
Copy code
<http://logging.info|logging.info>("Updating flow configuration ...")
flow.storage = Docker(base_image=runner_image, local_image=True)
flow.environment = LocalEnvironment(labels=agent_labels)
flow.schedule = IntervalSchedule(interval=timedelta(minutes=visitors_minutes))
flow registration
Copy code
Successfully tagged process-visitors:2020-12-19t09-41-40-990021-00-00
Flow URL: <http://localhost:8080/default/flow/05a9ac75-dcd0-4638-b77b-e81ee75f53f7>
 └── ID: 27067e92-dd8c-4626-91d9-0d2cd6f9793c
 └── Project: talywalker
 └── Labels: ['any', 'talynuc']
Error in flow run
Copy code
[19 Dec 2020 12:44pm]: Kubernetes Error: rpc error: code = Unknown desc = failed to pull and unpack image "<http://docker.io/library/process-visitors:2020-12-19t09-41-40-990021-00-00|docker.io/library/process-visitors:2020-12-19t09-41-40-990021-00-00>": failed to resolve reference "<http://docker.io/library/process-visitors:2020-12-19t09-41-40-990021-00-00|docker.io/library/process-visitors:2020-12-19t09-41-40-990021-00-00>": pull access denied, repository does not exist or may require authorization: server message: insufficient_scope: authorization failed
The agent is running in k8s, as well as server and other stuff, in local kind cluster
I tried to change registration to
Copy code
<http://logging.info|logging.info>("Updating flow configuration ...")
        flow.storage = Docker(base_image=runner_image, local_image=True)
        flow.environment = KubernetesJobEnvironment(labels=agent_labels,)
        flow.schedule = IntervalSchedule(interval=timedelta(minutes=visitors_minutes))
result is the same
Copy code
[19 Dec 2020 1:04pm]: Kubernetes Error: rpc error: code = Unknown desc = failed to pull and unpack image "<http://docker.io/library/process-visitors:2020-12-19t10-03-13-787740-00-00|docker.io/library/process-visitors:2020-12-19t10-03-13-787740-00-00>": failed to resolve reference "<http://docker.io/library/process-visitors:2020-12-19t10-03-13-787740-00-00|docker.io/library/process-visitors:2020-12-19t10-03-13-787740-00-00>": pull access denied, repository does not exist or may require authorization: server message: insufficient_scope: authorization failed
Looks like the only way to solve it, is to run local registry
I started local registry, now the problem is that the agent is trying to use https, while local registry is runnin on plain insecure http
is there a way to configure agent to pull images by http?
ok, finally, I got it to work with local registry, and now KubernetesEnvironemnt fails to run job
5 Views