Skip to content

Commit

Permalink
add image test build method in notebooks
Browse files Browse the repository at this point in the history
  • Loading branch information
shubham3121 committed Feb 7, 2024
1 parent d387971 commit 1a7714e
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 2 deletions.
24 changes: 23 additions & 1 deletion notebooks/api/0.8/10-container-images.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,28 @@
"docker_config = sy.DockerWorkerConfig(dockerfile=custom_dockerfile_str)"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "62762ceb-38da-46f1-acac-cdf5bbf29513",
"metadata": {},
"outputs": [],
"source": [
"# test image build locally\n",
"test_build_res = docker_config.test_image_build(tag=\"openmined/custom-worker:0.7.8\")\n",
"test_build_res"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "0235e567-c65c-48fe-825d-79ea3e219166",
"metadata": {},
"outputs": [],
"source": [
"assert isinstance(test_build_res, sy.SyftSuccess), str(test_build_res)"
]
},
{
"cell_type": "code",
"execution_count": null,
Expand Down Expand Up @@ -1406,7 +1428,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.7"
"version": "3.9.7"
}
},
"nbformat": 4,
Expand Down
1 change: 0 additions & 1 deletion packages/syft/src/syft/custom_worker/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,6 @@ def test_image_build(self, tag: str, **kwargs) -> Union[SyftSuccess, SyftError]:
kwargs["fileobj"] = io.BytesIO(self.dockerfile.encode("utf-8"))
_, logs = client.images.build(
tag=tag,
timeout=self.BUILD_MAX_WAIT,
**kwargs,
)
return SyftSuccess(message=iterator_to_string(iterator=logs))
Expand Down

0 comments on commit 1a7714e

Please sign in to comment.