Ajith Kumara Beragala Acharige Lal
02/23/2021, 1:07 AMInterruptedError: denied: access forbidden
error when trying prefect.Docker | Pushing image to the registry..., Can anyone help me - how to /where to specify the registry username passwords in the code ? or anywhere it mattersimport prefect
from prefect import task, Flow
from prefect.environments.storage import Docker
from prefect.run_configs import KubernetesRun
@task(log_stdout=True)
def log_my_stdout(print_message):
print("I will log this ",print_message)
with Flow("KubeTestFlow") as f:
log_my_stdout("Example!")
f.storage = Docker( registry_url="hakko.sekai.dev:5050/sekai-backend/", image_name="k8s-job-flow", image_tag="0.1.0" )
f.run_config = KubernetesRun(labels=["DEV"],job_template_path="/home/ajith/prefect/job_spec.yaml")
out = f.register(project_name="kubeTest")
Successfully tagged hakko.sekai.dev:5050/sekai-backend/k8s-job-flow:0.1.0
[2021-02-23 06:35:32+0530] INFO - prefect.Docker | Pushing image to the registry...
Traceback (most recent call last):
File "kubeTutorial.py", line 20, in <module>
out = f.register(project_name="kubeTest")
File "/usr/local/lib/python3.8/dist-packages/prefect/core/flow.py", line 1668, in register
registered_flow = client.register(
File "/usr/local/lib/python3.8/dist-packages/prefect/client/client.py", line 783, in register
serialized_flow = flow.serialize(build=build) # type: Any
File "/usr/local/lib/python3.8/dist-packages/prefect/core/flow.py", line 1450, in serialize
storage = self.storage.build() # type: Optional[Storage]
File "/usr/local/lib/python3.8/dist-packages/prefect/storage/docker.py", line 303, in build
self._build_image(push=push)
File "/usr/local/lib/python3.8/dist-packages/prefect/storage/docker.py", line 378, in _build_image
self.push_image(full_name, self.image_tag)
File "/usr/local/lib/python3.8/dist-packages/prefect/storage/docker.py", line 586, in push_image
raise InterruptedError(line.get("error"))
InterruptedError: denied: access forbidden
Fina Silva-Santisteban
02/23/2021, 1:10 AMAjith Kumara Beragala Acharige Lal
02/23/2021, 1:16 AMFina Silva-Santisteban
02/23/2021, 1:29 AMrun_task_kwargs
which I use for setting things like cluster name and launchtype, but for that to work I must have set the permissions correctly on aws. I save env variables in my Docker storage using the env_vars
param and then use prefect secrets to make them available. Even though it’s not Kubernetes or gitlab registry setup, I hope this helps!Ajith Kumara Beragala Acharige Lal
02/23/2021, 2:00 AMChris White
docker push
commands from the command line might help you identify where the issue is