Scott Chamberlain
12/02/2022, 10:26 PMSean Lopp
12/02/2022, 10:32 PMScott Chamberlain
12/02/2022, 10:33 PMdaniel
12/02/2022, 10:43 PMScott Chamberlain
12/02/2022, 10:45 PMERROR - Unable to update prod:example_location. Updating location with error data: docker.errors.APIError: 500 Server Error for <http+docker://localhost/v1.41/images/create?tag=1.1.5&fromImage=657821118200.dkr.ecr.us-west-2.amazonaws.com%2Fdagster-cloud-serverless-base-py3.8>: Internal Server Error ("Head <https://657821118200.dkr.ecr.us-west-2.amazonaws.com/v2/dagster-cloud-serverless-base-py3.8/manifests/1.1.5>: no basic auth credentials")
daniel
12/02/2022, 11:53 PMScott Chamberlain
12/02/2022, 11:53 PMdaniel
12/02/2022, 11:54 PMScott Chamberlain
12/02/2022, 11:54 PMscott-testing
daniel
12/02/2022, 11:56 PMScott Chamberlain
12/02/2022, 11:57 PMdaniel
12/02/2022, 11:59 PMScott Chamberlain
12/03/2022, 6:15 AMdocker.errors.APIError: 500 Server Error for <http+docker://localhost/v1.41/images/create?tag=sometag&fromImage=gcr.io%2Fmy-project%2Ftestdaghybrid>: Internal Server Error ("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>")
- The instructions at that link leave a lot of possible places where I went wrong, but it’s hard to figure out which one. Any tips?daniel
12/03/2022, 9:11 AMScott Chamberlain
12/04/2022, 3:11 PMdaniel
12/04/2022, 3:13 PMScott Chamberlain
12/04/2022, 7:28 PMdaniel
12/04/2022, 7:35 PMScott Chamberlain
12/04/2022, 7:48 PMdaniel
12/05/2022, 3:34 PMdocker exec -it <your agent container name here> /bin/bash
then inside the shell:
docker pull <your image here>
If your credentials are set up correctly, the docker pull command there should be able to pull the image in your GCR repo with your code in itScott Chamberlain
12/05/2022, 4:15 PMdocker exec ...
, docker does not exist in the container. Looking for docs on the docker agent …daniel
12/05/2022, 4:42 PMScott Chamberlain
12/05/2022, 4:45 PMbash: dagster-docker: command not found
bash: docker: command not found
daniel
12/05/2022, 4:46 PMScott Chamberlain
12/05/2022, 4:47 PMimport docker
client = docker.from_env()
client.images.pull('<http://gcr.io/foo/bar|gcr.io/foo/bar>')
daniel
12/05/2022, 4:56 PMScott Chamberlain
12/05/2022, 4:57 PMSean Lopp
12/05/2022, 5:08 PMScott Chamberlain
12/05/2022, 5:10 PMdocker.credentials.errors.InitializationError: docker-credential-gcloud not installed or not available in PATH
docker-credential-gcloud
error is in the container, i’m surprised because it just worked for SeanSean Lopp
12/05/2022, 5:22 PMScott Chamberlain
12/05/2022, 5:22 PMdaniel
12/05/2022, 5:24 PMScott Chamberlain
12/05/2022, 5:25 PMdaniel
12/05/2022, 5:26 PMjordan
12/05/2022, 5:27 PMdocker-credential-gcr
and docker-credential-gcloud
are the same thing. We only install the former although we could probably install the latter too:
https://cloud.google.com/container-registry/docs/advanced-authenticationScott Chamberlain
12/05/2022, 6:14 PMdocker-credential-gcloud
I haven’t been able to find install instructions for it yetSean Lopp
12/05/2022, 6:22 PM~/.docker/config.json
reading some stackoverflow that recommends deleting that file or looking for a credHelpers
entry and deleting it if it refers to gcloud instead of gcr
which all sounds vaguely familiar to something I had to do when I first got my GCP stacking working a few months agoScott Chamberlain
12/05/2022, 6:23 PMjordan
12/05/2022, 6:24 PM-gcloud
might be deprecated and -gcr
is the one to use?Scott Chamberlain
12/05/2022, 6:25 PMgcloud
in the credHelpers
block with gcr
- then spun up agent again, and got Unauthorized errors that I got before.Sean Lopp
12/05/2022, 8:17 PMScott Chamberlain
12/05/2022, 8:18 PMSean Lopp
12/05/2022, 8:31 PMScott Chamberlain
12/05/2022, 8:35 PMSean Lopp
12/05/2022, 8:40 PMScott Chamberlain
12/05/2022, 8:42 PMSean Lopp
12/06/2022, 9:40 PMsudo docker run \
--network=dagster_cloud_agent \
--volume $PWD/dagster.yaml:/opt/dagster/app/dagster.yaml:ro \
--volume /var/run/docker.sock:/var/run/docker.sock \
--volume ~/.docker/config.json:/root/.docker/config.json:ro \
--restart on-failure \
-it <http://docker.io/dagster/dagster-cloud-agent:latest|docker.io/dagster/dagster-cloud-agent:latest> \
dagster-cloud agent run /opt/dagster/app
That was trying to mount the docker config from your local user ~/.docker/config.json
to be used within the agent
But since you are running docker with sudo the actual config you want is in /root/.docker/config.json
So the following sequence of steps worked for me:
1. In the GCP VM, setup docker to authenticate and ensure the image can pulled correctly
gcloud auth login
gcloud auth print-access-token | sudo docker login -u oauth2accesstoken --password-stdin us-central1-docker.pkg.dev
# verify pull
sudo docker pull us-central1-docker.pkg.dev/myhybrid-200215/dagit/loppster:latest
2. Then when you launch the agent, mount the root docker config volume
sudo docker run --network=dagster_cloud_agent --volume $PWD/dagster.yaml:/opt/dagster/app/dagster.yaml:ro --volume /var/run/docker.sock:/var/run/docker.sock --volume /root/docker/.config/:/root/docker/.config -it <http://docker.io/dagster/dagster-cloud-agent:latest|docker.io/dagster/dagster-cloud-agent:latest> dagster-cloud agent run /opt/dagster/app
That command leaves out the --restart on-failure
bit that you might want to add back inScott Chamberlain
12/07/2022, 12:07 AM/root/.docker/config.json
without success. I took a look at your Step 1 above with logging in and verifying the pull, but did you mean for me to replace the us-central1-docker.pkg.dev with a gcp equivalent - or to try the example as is?Sean Lopp
12/07/2022, 12:29 AMScott Chamberlain
12/07/2022, 12:36 AM