Skip to content

Commit

Permalink
Merge pull request #8903 from OpenMined/fix-custom-image-pip-installs
Browse files Browse the repository at this point in the history
Update custom image pip install commands in notebooks to add uv and add import statement to syft function
  • Loading branch information
madhavajay authored Jul 1, 2024
2 parents a92b06d + dbd079e commit 1a811e5
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 8 deletions.
2 changes: 1 addition & 1 deletion notebooks/admin/Custom API + Custom Worker.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@
"custom_dockerfile_str = f\"\"\"\n",
"FROM {registry}/openmined/grid-backend:{backend_version}\n",
"\n",
"RUN pip install google-cloud-bigquery[all]==3.20.1 db-dtypes==1.2.0\n",
"RUN uv pip install google-cloud-bigquery[all]==3.20.1 db-dtypes==1.2.0\n",
"\n",
"\"\"\".strip()\n",
"print(custom_dockerfile_str)"
Expand Down
8 changes: 4 additions & 4 deletions notebooks/api/0.8/10-container-images.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@
"opendp_dockerfile_str = f\"\"\"\n",
"FROM openmined/grid-backend:{syft_base_worker_tag}\n",
"\n",
"RUN pip install opendp\n",
"RUN uv pip install opendp\n",
"\n",
"\"\"\".strip()\n",
"\n",
Expand Down Expand Up @@ -1082,7 +1082,7 @@
"custom_dockerfile_str_2 = f\"\"\"\n",
"FROM openmined/grid-backend:{syft_base_worker_tag}\n",
"\n",
"RUN pip install opendp\n",
"RUN uv pip install opendp\n",
"\"\"\".strip()\n",
"\n",
"docker_config_2 = sy.DockerWorkerConfig(dockerfile=custom_dockerfile_str_2)"
Expand Down Expand Up @@ -1298,7 +1298,7 @@
"custom_dockerfile_str_3 = f\"\"\"\n",
"FROM openmined/grid-backend:{syft_base_worker_tag}\n",
"\n",
"RUN pip install recordlinkage\n",
"RUN uv pip install recordlinkage\n",
"\"\"\".strip()\n",
"\n",
"docker_config_3 = sy.DockerWorkerConfig(dockerfile=custom_dockerfile_str_3)\n",
Expand All @@ -1320,7 +1320,7 @@
" num_workers=2,\n",
" tag=docker_tag_3,\n",
" config=docker_config_3,\n",
" reason=\"I want to do some more cool data science with PySyft and OpenDP\",\n",
" reason=\"I want to do some more cool data science with PySyft and recordlinkage\",\n",
" pull_image=pull,\n",
" )\n",
")\n",
Expand Down
10 changes: 7 additions & 3 deletions notebooks/api/0.8/11-container-images-k8s.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@
"custom_dockerfile_str = f\"\"\"\n",
"FROM {registry}/{repo}:{tag}\n",
"\n",
"RUN pip install pydicom\n",
"RUN uv pip install pydicom\n",
"\n",
"\"\"\".strip()"
]
Expand Down Expand Up @@ -814,6 +814,10 @@
" worker_pool_name=worker_pool_name,\n",
")\n",
"def custom_worker_func(x):\n",
" # third party\n",
" import pydicom\n",
"\n",
" print(pydicom.__version__)\n",
" return {\"y\": x + 1}"
]
},
Expand Down Expand Up @@ -987,7 +991,7 @@
"dockerfile_opendp = f\"\"\"\n",
"FROM {registry}/{repo}:{tag}\n",
"\n",
"RUN pip install opendp\n",
"RUN uv pip install opendp\n",
"\"\"\".strip()\n",
"\n",
"docker_config_opendp = sy.DockerWorkerConfig(dockerfile=dockerfile_opendp)"
Expand Down Expand Up @@ -1282,7 +1286,7 @@
"dockerfile_recordlinkage = f\"\"\"\n",
"FROM {registry}/{repo}:{tag}\n",
"\n",
"RUN pip install recordlinkage\n",
"RUN uv pip install recordlinkage\n",
"\"\"\".strip()\n",
"\n",
"docker_config_recordlinkage = sy.DockerWorkerConfig(dockerfile=dockerfile_recordlinkage)\n",
Expand Down

0 comments on commit 1a811e5

Please sign in to comment.