aljaz
12/28/2023, 2:50 PMif __name__ == "__main__":
get_repo_info.deploy(
name="my-first-deployment",
work_pool_name="render-work-pool",
image=DeploymentImage(
name="my-first-deployment-image",
tag="tutorial",
dockerfile="Dockerfile"
),
push=False
)
We are getting docker.errors.DockerException: Error while fetching server API version: request...
Is there any solution for that? It seems to be related to the requests lib versionKevin Grismore
12/28/2023, 2:53 PMaljaz
12/28/2023, 3:42 PMKevin Grismore
12/28/2023, 3:43 PMNate
12/28/2023, 3:59 PM» ipython
Python 3.11.7 | packaged by conda-forge | (main, Dec 23 2023, 14:38:07) [Clang 16.0.6 ]
In [1]: import docker
In [2]: client = docker.DockerClient.from_env()
In [3]: client.ping()
Out[3]: True
this should be (in a rough / basic sense) what we're trying to do somewhere in .deploy()
aljaz
12/28/2023, 4:23 PMModuleNotFoundError: No module named 'docker'
Eventhough the docker is installed with pip / pip3aljaz
12/28/2023, 4:24 PMNate
12/28/2023, 4:24 PMpip install ipython
and restart the sessionaljaz
12/28/2023, 4:41 PMModuleNotFoundError: No module named 'docker'
Nate
12/28/2023, 4:41 PMpip list | grep prefect
show in that same place?aljaz
12/28/2023, 5:03 PMprefect % pip list | grep prefect
prefect 2.14.12
prefect-docker 0.4.1
Nate
12/28/2023, 5:09 PMpython -c "import docker; client = docker.DockerClient.from_env(); assert client.ping()"
aljaz
12/28/2023, 5:14 PMAttributeError: module 'docker' has no attribute 'DockerClient'
aljaz
12/28/2023, 5:14 PMNate
12/28/2023, 5:15 PMNate
12/28/2023, 5:16 PMdocker
install?aljaz
12/28/2023, 5:25 PMprefect % pip3 show docker
Name: docker
Version: 6.1.3
Nate
12/28/2023, 5:31 PMpython -c
snippet works fine for me 🧐aljaz
12/28/2023, 7:21 PMaljaz
12/28/2023, 7:21 PMNate
12/28/2023, 7:33 PMaljaz
12/28/2023, 7:50 PMaljaz
12/29/2023, 4:30 PMNate
12/29/2023, 4:38 PMSerina
12/29/2023, 6:39 PMrequests
and urllib3
versions installed and the python
version you’re on?aljaz
12/29/2023, 6:48 PMexport DOCKER_HOST="unix://$HOME/.colima/docker.sock"
when using colimaaljaz
12/29/2023, 6:48 PMaljaz
12/29/2023, 6:48 PMaljaz
12/29/2023, 6:48 PMaljaz
12/29/2023, 6:49 PMget_repo_info.deploy(
name="my-first-deployment",
work_pool_name="render-work-pool",
image=DeploymentImage(
name="my-first-deployment-image",
tag="tutorial",
dockerfile="Dockerfile"
),
push=False
)
?Nate
12/29/2023, 6:54 PM.deploy
is the simplest way to programmatically (in contrast to prefect.yaml) create containerized deployments from flows - yep your use of DeploymentImage
looks valid from what I can see