-
-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #8370 from OpenMined/yash/syft-registry
Syft Image Registry
- Loading branch information
Showing
14 changed files
with
694 additions
and
186 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,7 +22,7 @@ | |
"import os\n", | ||
"sy.requires(SYFT_VERSION)\n", | ||
"from syft.service.worker.worker_image import SyftWorkerImage\n", | ||
"from syft.service.worker.worker_pool import WorkerStatus, SyftWorker\n", | ||
"from syft.service.worker.image_registry import SyftImageRegistry\n", | ||
"from syft.custom_worker.config import DockerWorkerConfig" | ||
] | ||
}, | ||
|
@@ -57,6 +57,14 @@ | |
"domain_client = domain.login(email=\"[email protected]\", password=\"changethis\")" | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"id": "3c7a124a", | ||
"metadata": {}, | ||
"source": [ | ||
"#### Submit Dockerfile" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
|
@@ -160,6 +168,76 @@ | |
"assert isinstance(workerimage, SyftWorkerImage)" | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"id": "91a66871", | ||
"metadata": {}, | ||
"source": [ | ||
"#### Create Registry" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"id": "cde8bfff", | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"image_add_res = domain_client.api.services.image_registry.add(\"localhost:5678\")\n", | ||
"image_add_res" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"id": "82321b35", | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"assert isinstance(image_add_res, sy.SyftSuccess), str(image_add_res)" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"id": "3d4a4c33", | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"images = domain_client.api.services.image_registry.get_all()\n", | ||
"assert len(images) == 1\n", | ||
"images" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"id": "22f6e2f6", | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"local_registry = images[0]\n", | ||
"local_registry" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"id": "cb9664ca", | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"assert isinstance(local_registry, SyftImageRegistry)" | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"id": "637a9596", | ||
"metadata": {}, | ||
"source": [ | ||
"#### Build Image" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
|
@@ -168,7 +246,7 @@ | |
"outputs": [], | ||
"source": [ | ||
"docker_tag = \"openmined/test-nginx:0.7.8\"\n", | ||
"docker_build_res = domain_client.api.services.worker_image.build(uid=workerimage.id, tag=docker_tag)" | ||
"docker_build_res = domain_client.api.services.worker_image.build(image_uid=workerimage.id, tag=docker_tag)" | ||
] | ||
}, | ||
{ | ||
|
@@ -188,7 +266,7 @@ | |
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"assert isinstance(docker_build_res, sy.SyftSuccess)" | ||
"assert isinstance(docker_build_res, sy.SyftSuccess), str(docker_build_res)" | ||
] | ||
}, | ||
{ | ||
|
@@ -292,6 +370,14 @@ | |
" return None" | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"id": "f5007073", | ||
"metadata": {}, | ||
"source": [ | ||
"#### Create Worker Pool From Image" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
|
@@ -542,7 +628,7 @@ | |
"name": "python", | ||
"nbconvert_exporter": "python", | ||
"pygments_lexer": "ipython3", | ||
"version": "3.10.13" | ||
"version": "3.11.2" | ||
} | ||
}, | ||
"nbformat": 4, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.