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

Fix/SK-1259 | Use api/v1 for set_active_package in APIClient #775

Merged
merged 5 commits into from
Jan 23, 2025
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
2 changes: 1 addition & 1 deletion .ci/tests/examples/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ python ../../.ci/tests/examples/wait_for.py reducer
python ../../.ci/tests/examples/wait_for.py combiners

>&2 echo "Upload compute package"
python ../../.ci/tests/examples/api_test.py set_package --path package.tgz --helper "$helper"
python ../../.ci/tests/examples/api_test.py set_package --path package.tgz --helper "$helper" --name test

>&2 echo "Wait for clients to connect"
python ../../.ci/tests/examples/wait_for.py clients
Expand Down
2 changes: 1 addition & 1 deletion docs/apiclient.rst
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ To set the active compute package in the FEDn Studio Project:

.. code:: python

>>> client.set_active_package("package.tgz", helper="numpyhelper")
>>> client.set_active_package("package.tgz", helper="numpyhelper", name="my-package")
>>> client.set_active_model("seed.npz")

**Start a training session**
Expand Down
2 changes: 1 addition & 1 deletion docs/developer.rst
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ so we will not require authentication of clients (insecure mode) when using the

from fedn import APIClient
client = APIClient(host="localhost", port=8092)
client.set_active_package("package.tgz", helper="numpyhelper")
client.set_active_package("package.tgz", helper="numpyhelper", name="my-package")
client.set_active_model("seed.npz")

To connect a native FEDn client to the sandbox deployment, you need to make sure that the combiner service can be resolved by the client using the name "combiner".
Expand Down
4 changes: 2 additions & 2 deletions examples/api-tutorials/API_Example.ipynb

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion examples/api-tutorials/Aggregators.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
"metadata": {},
"outputs": [],
"source": [
"client.set_active_package('../mnist-pytorch/package.tgz', 'numpyhelper')\n",
"client.set_active_package('../mnist-pytorch/package.tgz', 'numpyhelper', 'mnist-pytorch')\n",
"client.set_active_model('../mnist-pytorch/seed.npz')\n",
"seed_model = client.get_active_model()\n",
"print(seed_model)"
Expand Down
2 changes: 1 addition & 1 deletion examples/api-tutorials/Hyperparameter_Tuning.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
"metadata": {},
"outputs": [],
"source": [
"client.set_active_package('../mnist-pytorch/package.tgz', 'numpyhelper')\n",
"client.set_active_package('../mnist-pytorch/package.tgz', 'numpyhelper', 'mnist-pytorch')\n",
"client.set_active_model('../mnist-pytorch/seed.npz')\n",
"seed_model = client.get_active_model()"
]
Expand Down
2 changes: 1 addition & 1 deletion fedn/network/api/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -428,7 +428,7 @@ def download_package(self, path: str):
else:
return {"success": False, "message": "Failed to download package."}

def set_active_package(self, path: str, helper: str, name: str = None, description: str = None):
def set_active_package(self, path: str, helper: str, name: str, description: str = ""):
"""Set the compute package in the statestore.

:param path: The file path of the compute package to set.
Expand Down
Loading