Hi! I am currently trying to deploy a prefect work...
# ask-community
m
Hi! I am currently trying to deploy a prefect workflow using the Google cloud infrastructure. I am using the
.deploy()
in my main file to deploy this workflow. I keep getting this error
Copy code
raise PushError(event["error"])
prefect.utilities.dockerutils.PushError: denied: Permission "artifactregistry.repositories.uploadArtifacts" denied on resource "projects/luminr-data-engineering/locations/europe-west2/repositories/instagram-pipeline" (or it may not exist)
b
Hi Michael! At first glance it looks like you don't have the right permissions set in your environment to push images to your artifact registry. Have you logged in to gcloud and configured docker? • Log into gcloud:
gcloud auth login
• Configure docker:
gcloud auth configure-docker <http://europe-west2-docker.pkg.dev|europe-west2-docker.pkg.dev>
(make sure to specify correct region)
m
Hi @Bianca Hoch, I have done all this, The push was working till I changed a line in my Docker file from
_FROM_ prefecthq/prefect:3-python3.10
to
FROM
_--platform_=linux/amd64 prefecthq/prefect:3-python3.10
I did this because this link https://docs-3.prefect.io/integrations/prefect-gcp/gcp-worker-guide Says to change it from A to B when you are deploying from a macbook
Prior to this, my previous deployment returns an error that looks like this
Copy code
Flow run infrastructure exited with non-zero status code:
 Task colossal-cassowary-mh7lx-task0 failed with message: The container exited with an error. (Error Code: 1)
This may be caused by attempting to run an image with a misspecified platform or architecture.
b
Gotcha, ty for confirming. When setting the platform, did you also specify it in your build step? Or did you only manually add it to your dockerfile? šŸ‘€ ie:
Copy code
# build section allows you to manage and build docker image
build:
- prefect_docker.deployments.steps.build_docker_image:
    id: build_image
    requires: prefect-docker>=0.3.1
    image_name: <PATH-TO-ARTIFACT-REGISTRY>/gcp-weather-image
    tag: latest
    dockerfile: auto
    platform: linux/amd64
m
I found the issue. I manually added it to the Docker file which was causing the PushError When I changed it to be used in the
.deploy(platform= "linux/amd64")
. The error disappeared.
b
oh nice, great work!
were you able to run the cloud run job successfully?
m
Yes I was, it was a big relief🫠.
šŸŽŠ 1
wizard2 1
šŸ’Æ 1