Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

removed hardcoded syft versions #8496

Merged
merged 2 commits into from
Feb 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions notebooks/api/0.8/10-container-images.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,8 @@
"metadata": {},
"outputs": [],
"source": [
"custom_dockerfile_str = \"\"\"\n",
"FROM openmined/grid-backend:0.8.4-beta.12\n",
"custom_dockerfile_str = f\"\"\"\n",
"FROM openmined/grid-backend:{sy.__version__}\n",
"\n",
"RUN pip install pydicom\n",
"\n",
Expand Down Expand Up @@ -1069,8 +1069,8 @@
"metadata": {},
"outputs": [],
"source": [
"custom_dockerfile_str_2 = \"\"\"\n",
"FROM openmined/grid-backend:0.8.4-beta.12\n",
"custom_dockerfile_str_2 = f\"\"\"\n",
"FROM openmined/grid-backend:{sy.__version__}\n",
"\n",
"RUN pip install opendp\n",
"\"\"\".strip()\n",
Expand Down Expand Up @@ -1220,8 +1220,8 @@
"metadata": {},
"outputs": [],
"source": [
"custom_dockerfile_str_3 = \"\"\"\n",
"FROM openmined/grid-backend:0.8.4-beta.12\n",
"custom_dockerfile_str_3 = f\"\"\"\n",
"FROM openmined/grid-backend:{sy.__version__}\n",
"\n",
"RUN pip install recordlinkage\n",
"\"\"\".strip()\n",
Expand Down Expand Up @@ -1428,7 +1428,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.9.7"
"version": "3.11.5"
}
},
"nbformat": 4,
Expand Down
7 changes: 4 additions & 3 deletions packages/syft/tests/syft/custom_worker/config_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
import yaml

# syft absolute
import syft as sy
from syft.custom_worker.config import CustomBuildConfig
from syft.custom_worker.config import CustomWorkerConfig
from syft.custom_worker.config import DockerWorkerConfig
Expand Down Expand Up @@ -167,8 +168,8 @@ def test_load_custom_worker_config(


DOCKER_METHODS = ["from_str", "from_path"]
DOCKER_CONFIG_OPENDP = """
FROM openmined/grid-backend:0.8.4-beta.12
DOCKER_CONFIG_OPENDP = f"""
FROM openmined/grid-backend:{sy.__version__}
RUN pip install opendp
"""

Expand Down Expand Up @@ -201,6 +202,6 @@ def test_docker_worker_config(dockerfile_path: Path, method: str) -> None:

assert docker_config.dockerfile == dockerfile_path.read_text().strip()
assert docker_config.description == description
new_description = description + " (syft version is 0.8.4-beta.12)"
new_description = description + f" (syft version is {sy.__version__})"
docker_config.set_description(description_text=new_description)
assert docker_config.description == new_description
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
from faker import Faker

# syft absolute
import syft as sy
from syft.custom_worker.config import DockerWorkerConfig
from syft.node.worker import Worker
from syft.service.request.request import CreateCustomWorkerPoolChange
Expand All @@ -24,8 +25,8 @@ def test_create_image_and_pool_request_accept(faker: Faker, worker: Worker):
assert root_client.credentials != ds_client.credentials

# the DS makes a request to create an image and a pool based on the image
custom_dockerfile = """
FROM openmined/grid-backend:0.8.4-beta.12
custom_dockerfile = f"""
FROM openmined/grid-backend:{sy.__version__}

RUN pip install recordlinkage
"""
Expand Down Expand Up @@ -71,8 +72,8 @@ def test_create_pool_request_accept(faker: Faker, worker: Worker):
assert root_client.credentials != ds_client.credentials

# the DO submits the docker config to build an image
custom_dockerfile_str = """
FROM openmined/grid-backend:0.8.4-beta.12
custom_dockerfile_str = f"""
FROM openmined/grid-backend:{sy.__version__}

RUN pip install opendp
"""
Expand Down
5 changes: 3 additions & 2 deletions packages/syft/tests/syft/worker_pool/worker_test.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# syft absolute
import syft as sy
from syft.custom_worker.config import DockerWorkerConfig
from syft.node.worker import Worker
from syft.service.response import SyftSuccess
Expand All @@ -8,8 +9,8 @@

def get_docker_config():
# the DS makes a request to create an image and a pool based on the image
custom_dockerfile = """
FROM openmined/grid-backend:0.8.4-beta.12
custom_dockerfile = f"""
FROM openmined/grid-backend:{sy.__version__}
RUN pip install recordlinkage
"""
return DockerWorkerConfig(dockerfile=custom_dockerfile)
Expand Down
12 changes: 6 additions & 6 deletions tests/integration/container_workload/pool_image_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ def test_image_build(domain_1_port) -> None:
)

# Submit Docker Worker Config
docker_config_rl = """
FROM openmined/grid-backend:0.8.4-beta.12
docker_config_rl = f"""
FROM openmined/grid-backend:{sy.__version__}
RUN pip install recordlinkage
"""
docker_config = DockerWorkerConfig(dockerfile=docker_config_rl)
Expand Down Expand Up @@ -78,8 +78,8 @@ def test_pool_launch(domain_1_port) -> None:
assert len(domain_client.worker_pools.get_all()) == 1

# Submit Docker Worker Config
docker_config_opendp = """
FROM openmined/grid-backend:0.8.4-beta.12
docker_config_opendp = f"""
FROM openmined/grid-backend:{sy.__version__}
RUN pip install opendp
"""
docker_config = DockerWorkerConfig(dockerfile=docker_config_opendp)
Expand Down Expand Up @@ -178,8 +178,8 @@ def test_pool_image_creation_job_requests(domain_1_port) -> None:
ds_client = sy.login(email=ds_email, password="secret_pw", port=domain_1_port)

# the DS makes a request to create an image and a pool based on the image
docker_config_np = """
FROM openmined/grid-backend:0.8.4-beta.12
docker_config_np = f"""
FROM openmined/grid-backend:{sy.__version__}
RUN pip install numpy
"""
docker_config = DockerWorkerConfig(dockerfile=docker_config_np)
Expand Down
Loading