Hello, recently, after I switched to M1 macbook, I...
# ask-community
h
Hello, recently, after I switched to M1 macbook, I found my prefect flow docker build and registry often frozen at this step below
Copy code
- prefect.Docker | Pushing image to the registry...
Does it happen to other people?
prefect version
Copy code
prefecthq/prefect:0.14.1-python3.8
code where it gets frozen
Copy code
flow.register(  ...  )
my laptop
Copy code
Apple M1
MacOS Big Sur v 11.6
docker-desktop v 4.0.1
k
Hey @Hui Zheng, we use M1 Macs here at Prefect to develop so it should be fine. Can you build and push without Prefect? Maybe you need to increase Docker’s memory?
h
that’s a good call. my docker memory is small, set at defult 2GB
could i know if you enabled
new Big Sur virtualization.framework
in docker or not?
k
I’m not a real dev so let me ask one
May have to get back to you tom on that. But I myself haven’t and have used Docker Storage on AWS ECR successfully
h
np. thank you for checking for me
a
I had fixed this issue by increasing docker memory to 4 GB. (i use M1) ^^ @Hui Zheng
z
@Hui Zheng I use an M1 macbook and I do not have the big sur virtualization framework enabled for Docker. I would double check docker memory (and potentially other resource limits) as Abhishek suggested as a first step
h
Hi @Abhishek and @Zach Angell. thank you. I tried to increase the memory to 4GB but doesn’t seem to help.
docker stats
shows the memory usage is not high
Copy code
CONTAINER ID   NAME              CPU %     MEM USAGE / LIMIT     MEM %     NET I/O           BLOCK I/O     PIDS
0a0348432035   naughty_ganguly   0.05%     126.7MiB / 3.827GiB   3.23%     82.2kB / 33.9kB   0B / 8.19kB   12
so it successful built the container, but hanging when pushing image to registry
Copy code
Successfully built 0e190d65e2eb
Successfully tagged <http://us.gcr.io/xxx/xxx/prefect-scheduler/xx_batch:20.06.0|us.gcr.io/xxx/xxx/prefect-scheduler/xx_batch:20.06.0>
[2021-09-22 16:50:17+0000] INFO - prefect.Docker | Pushing image to the registry...
k
What happens when you use
docker push
instead?
upvote 1
h
hi, thank you for the tip
i run
docker push
and found the error. it was due to
invalid credentials.
which i accidentally changed 2 days ago.
docker push
throw error
Copy code
unauthorized: You don't have the needed permissions to perform this operation, and you may have invalid credentials. To authenticate your request, follow the steps in: <https://cloud.google.com/container-registry/docs/advanced-authentication>
k
that’s weird that the error doesn’t surface using Prefect but Prefect is pretty much just using that under the hood
h
thank you. if any suggestion, it would be nice if
flow.register(  ...  )
could propagate the error message, it would be helpfu
k
I’ve had it propagate before with AWS ECR
h
for more context, i was push to
Copy code
The push refers to repository [<http://us.gcr.io/xxx/xxx/prefect-scheduler/xxx|us.gcr.io/xxx/xxx/prefect-scheduler/xxx>]
while i forgot in .docker/config.json to have
Copy code
"credHelpers": {
    "<http://us.gcr.io|us.gcr.io>": "gcloud",
a
@Hui Zheng did you try to do
gcloud auth configure-docker
before pushing the image? Ref: https://cloud.google.com/container-registry/docs/quickstart#auth so when i work with ECR (AWS container registry) i usually login to ECR before pushing the image
when working locally.
h
i did it as one-time setup, i don’t do it every time before pushing the image
👍 1