Skip to content

Commit

Permalink
chore: release 0.26.0 (#293)
Browse files Browse the repository at this point in the history
Signed-off-by: Olivier Léobal <[email protected]>
Signed-off-by: ThibaultFy <[email protected]>
Co-authored-by: ThibaultFy <[email protected]>
  • Loading branch information
oleobal and ThibaultFy authored Apr 7, 2023
1 parent 7158577 commit 904686b
Show file tree
Hide file tree
Showing 7 changed files with 106 additions and 67 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,7 @@ docs/source/substrafl_doc/examples
# Data folder when run locally
**/data_iris
**/data_mnist
**/data

# Algo files folder when run locally
**/algo_files
Expand Down
46 changes: 36 additions & 10 deletions docs/source/additional/release.rst
Original file line number Diff line number Diff line change
Expand Up @@ -28,24 +28,50 @@ This is an overview of the main changes, please have a look at the changelog of
- `backend changelog <https://github.com/Substra/substra-backend/blob/main/CHANGELOG.md>`__
- `orchestrator changelog <https://github.com/Substra/orchestrator/blob/main/CHANGELOG.md>`__

Substra 0.25.0 - 2023-02-17
^^^^^^^^^^^^^^^^^^^^^^^^^^^
Substra 0.26.0 --- 2023-04-03
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

- Improve backend performance when handling large amounts of compute plans and tasks. This will result in faster front-end pages.
- Rename Algo to Function.
- SSO Login
- Experimental: Add a task duration breakdown for every task in the front-end. Note that this is an experimental feature and only works on the current backend you are logged into.

.. figure:: ../static/images/substra-0.26-task-duration.png
:align: center
:alt: Screenshot of task duration

Front-end:

- Fix issue where a performance of ``0`` was displayed as ``-``.

SubstraFL:

- **BREAKING CHANGE**: ``algo`` are now passed as a parameter to the ``strategy`` and not to ``execute_experiement`` anymore.
- **BREAKING CHANGE**: a ``strategy`` needs to implement a new method ``build_graph`` to build the graph of tasks to be executed in ``execute_experiment``.
- **BREAKING CHANGE**: ``predict`` method of ``strategy`` has been renamed to ``perform_predict``.
- **BREAKING CHANGE**: clarify ``EvaluationStrategy`` arguments: change ``rounds`` to ``eval_frequency`` and ``eval_rounds``.
- Fix an issue where ``aggregation_lr`` could not be changed in the Scaffold strategy.
- Add Initialization task to each strategy in SubstraFL


Substra 0.25.0 --- 2023-02-17
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

- **BREAKING CHANGE**: ``DataSampleSpec`` does not have a ``test_only`` field anymore.
- SubstraFL: It is now possible to test on an organization where no training have been performed.
- New ``creator`` field in Compute Plan.
- Fix an issue where Skaffold spawned too many backends.
- Add contributing guide & code of conduct to all repos.

Substra 0.24.0 - 2023-01-13
^^^^^^^^^^^^^^^^^^^^^^^^^^^
Substra 0.24.0 --- 2023-01-13
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

- Fix issue where launching a large compute sometimes fails with: ``ERROR: could not serialize access due to read/write dependencies among transactions (SQLSTATE 40001)``
- Documentation: add **contributing guide** and **code of conduct**
- Update **Substra Tools** base docker image to ``substra-tools:0.20.0-nvidiacuda11.6.0-base-ubuntu20.04-python3.*``

Substra 0.23.1 - 2022-11-24
^^^^^^^^^^^^^^^^^^^^^^^^^^^
Substra 0.23.1 --- 2022-11-24
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Main changes

Expand Down Expand Up @@ -195,8 +221,8 @@ Substra Backend:

- Prevent use of ``__`` in asset metadata keys

Substra 0.22.0 - 2022-10-20
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Substra 0.22.0 --- 2022-10-20
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Main changes

Expand Down Expand Up @@ -350,8 +376,8 @@ could be replace with:
tools.metrics.execute(AUC())
Substra 0.21.0 - 2022-09-12
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Substra 0.21.0 --- 2022-09-12
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

This is our first open source release since 2021! When the product was closed source it used to be named Connect. It is now renamed Substra.

Expand Down
38 changes: 38 additions & 0 deletions docs/source/additional/releases.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,44 @@ components: # for table headers
- substra-tests

releases:
- version: 0.26.0
components:
substrafl:
version: 0.35.0
link: https://github.com/Substra/substrafl/releases/tag/0.35.0
substra:
version: 0.43.0
link: https://github.com/Substra/substra/releases/tag/0.43.0
substra-tools:
version: 0.20.0
link: https://github.com/Substra/substra-tools/releases/tag/0.20.0
substra-backend:
version: 0.36.0
link: https://github.com/Substra/substra-backend/releases/tag/0.36.0
helm:
version: 22.4.2
link: https://artifacthub.io/packages/helm/substra/substra-backend/22.4.2
orchestrator:
version: 0.33.0
link: https://github.com/Substra/orchestrator/releases/tag/0.33.0
helm:
version: 7.4.12
link: https://artifacthub.io/packages/helm/substra/orchestrator/7.4.12
substra-frontend:
version: 0.40.0
link: https://github.com/Substra/substra-frontend/releases/tag/0.40.0
helm:
version: 1.0.16
link: https://artifacthub.io/packages/helm/substra/substra-frontend/1.0.16
hlf-k8s:
version: 0.2.3
link: https://github.com/Substra/hlf-k8s/releases/tag/0.2.3
helm:
version: 10.2.3
link: https://artifacthub.io/packages/helm/substra/hlf-k8s/10.2.3
substra-tests:
version: 0.39.0
link: https://github.com/Substra/substra-tests/releases/tag/0.39.0
- version: 0.25.0
components:
substrafl:
Expand Down
4 changes: 2 additions & 2 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@
TMP_FOLDER = Path(__file__).parents[2] / "tmp"

if os.environ.get("READTHEDOCS_VERSION_TYPE") == "tag":
SUBSTRA_VERSION = "0.42.0"
SUBSTRA_VERSION = "0.43.0"
TOOLS_VERSION = "0.20.0"
SUBSTRAFL_VERSION = "0.34.0"
SUBSTRAFL_VERSION = "0.35.0"

else:
SUBSTRA_VERSION = "main"
Expand Down
8 changes: 4 additions & 4 deletions docs/source/documentation/get_performances.rst
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,11 @@ This script will automatically end if the :code:`performance.json` file has not
df = pd.DataFrame(dict_perf)
for _, row in df.iterrows():
if row["testtuple_key"] in logged_rows:
if row["task_key"] in logged_rows:
continue
logged_rows.append(row["testtuple_key"])
logged_rows.append(row["task_key"])
step = int(row["round_idx"]) if row["round_idx"] is not None else int(row["testtuple_rank"])
step = int(row["round_idx"]) if row["round_idx"] is not None else int(row["task_rank"])
log_metric(f"{row['metric_name']}_{row['worker']}", row["performance"], step)
log_metric(f"{row['function_name']}_{row['worker']}", row["performance"], step)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
76 changes: 25 additions & 51 deletions examples/diabetes_example/run_diabetes.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,9 @@
# - Permissions allow you to execute a function on a certain dataset.
#

permissions = Permissions(public=False, authorized_ids=[ANALYTICS_PROVIDER_ORG_ID])
permissions_local = Permissions(public=False, authorized_ids=DATA_PROVIDER_ORGS_ID)
permissions_aggregation = Permissions(public=False, authorized_ids=[ANALYTICS_PROVIDER_ORG_ID])

# %%
# Next, we need to define the asset directory. You should have already downloaded the assets folder as stated above.
#
Expand Down Expand Up @@ -136,15 +138,12 @@
type="csv",
data_opener=assets_directory / "dataset" / "diabetes_opener.py",
description=data_path / "description.md",
permissions=permissions,
logs_permission=permissions,
permissions=permissions_local,
logs_permission=permissions_local,
)

# We register the dataset for each of the organisations
dataset_keys = {
client_id: clients[client_id].add_dataset(dataset)
for client_id in DATA_PROVIDER_ORGS_ID
}
dataset_keys = {client_id: clients[client_id].add_dataset(dataset) for client_id in DATA_PROVIDER_ORGS_ID}

for client_id, key in dataset_keys.items():
print(f"Dataset key for {client_id}: {key}")
Expand Down Expand Up @@ -210,6 +209,7 @@

# %%


local_first_order_computation_docker_files = [
assets_directory / "functions" / "federated_analytics_functions.py",
assets_directory / "functions" / "local_first_order_computation" / "Dockerfile",
Expand All @@ -227,15 +227,11 @@
optional=False,
multiple=True,
),
FunctionInputSpec(
identifier="opener", kind=AssetKind.data_manager, optional=False, multiple=False
),
FunctionInputSpec(identifier="opener", kind=AssetKind.data_manager, optional=False, multiple=False),
]

local_first_order_function_outputs = [
FunctionOutputSpec(
identifier="local_analytics_first_moments", kind=AssetKind.model, multiple=False
)
FunctionOutputSpec(identifier="local_analytics_first_moments", kind=AssetKind.model, multiple=False)
]

local_first_order_function = FunctionSpec(
Expand All @@ -244,13 +240,12 @@
outputs=local_first_order_function_outputs,
description=assets_directory / "functions" / "description.md",
file=local_archive_first_order_computation_path,
permissions=permissions,
permissions=permissions_local,
)


local_first_order_function_keys = {
client_id: clients[client_id].add_function(local_first_order_function)
for client_id in DATA_PROVIDER_ORGS_ID
client_id: clients[client_id].add_function(local_first_order_function) for client_id in DATA_PROVIDER_ORGS_ID
}

print(f"Local function key for step 1: computing first order moments {local_first_order_function_keys}")
Expand All @@ -271,9 +266,7 @@
assets_directory / "functions" / "aggregation" / "Dockerfile",
]

aggregate_archive_path = (
assets_directory / "functions" / "aggregate_function_analytics.zip"
)
aggregate_archive_path = assets_directory / "functions" / "aggregate_function_analytics.zip"
with zipfile.ZipFile(aggregate_archive_path, "w") as z:
for filepath in aggregate_function_docker_files:
z.write(filepath, arcname=os.path.basename(filepath))
Expand All @@ -287,17 +280,15 @@
),
]

aggregate_function_outputs = [
FunctionOutputSpec(identifier="shared_states", kind=AssetKind.model, multiple=False)
]
aggregate_function_outputs = [FunctionOutputSpec(identifier="shared_states", kind=AssetKind.model, multiple=False)]

aggregate_function = FunctionSpec(
name="Aggregate Federated Analytics",
inputs=aggregate_function_inputs,
outputs=aggregate_function_outputs,
description=assets_directory / "functions" / "description.md",
file=aggregate_archive_path,
permissions=permissions,
permissions=permissions_aggregation,
)


Expand Down Expand Up @@ -335,12 +326,8 @@
optional=False,
multiple=True,
),
FunctionInputSpec(
identifier="opener", kind=AssetKind.data_manager, optional=False, multiple=False
),
FunctionInputSpec(
identifier="shared_states", kind=AssetKind.model, optional=False, multiple=False
),
FunctionInputSpec(identifier="opener", kind=AssetKind.data_manager, optional=False, multiple=False),
FunctionInputSpec(identifier="shared_states", kind=AssetKind.model, optional=False, multiple=False),
]

local_second_order_function_outputs = [
Expand All @@ -357,13 +344,12 @@
outputs=local_second_order_function_outputs,
description=assets_directory / "functions" / "description.md",
file=local_archive_second_order_computation_path,
permissions=permissions,
permissions=permissions_local,
)


local_second_order_function_keys = {
client_id: clients[client_id].add_function(local_second_order_function)
for client_id in DATA_PROVIDER_ORGS_ID
client_id: clients[client_id].add_function(local_second_order_function) for client_id in DATA_PROVIDER_ORGS_ID
}

print(f"Local function key for step 2: computing second order moments {local_second_order_function_keys}")
Expand All @@ -379,25 +365,19 @@
#

data_manager_input = {
client_id: [InputRef(identifier="opener", asset_key=key)]
for client_id, key in dataset_keys.items()
client_id: [InputRef(identifier="opener", asset_key=key)] for client_id, key in dataset_keys.items()
}

datasample_inputs = {
client_id: [InputRef(identifier="datasamples", asset_key=key)]
for client_id, key in datasample_keys.items()
client_id: [InputRef(identifier="datasamples", asset_key=key)] for client_id, key in datasample_keys.items()
}

local_task_1_keys = {
client_id: clients[client_id].add_task(
TaskSpec(
function_key=local_first_order_function_keys[client_id],
inputs=data_manager_input[client_id] + datasample_inputs[client_id],
outputs={
"local_analytics_first_moments": ComputeTaskOutputSpec(
permissions=permissions
)
},
outputs={"local_analytics_first_moments": ComputeTaskOutputSpec(permissions=permissions_aggregation)},
worker=client_id,
)
)
Expand Down Expand Up @@ -429,7 +409,7 @@
aggregation_task_1 = TaskSpec(
function_key=aggregate_function_key,
inputs=aggregation_1_inputs,
outputs={"shared_states": ComputeTaskOutputSpec(permissions=permissions)},
outputs={"shared_states": ComputeTaskOutputSpec(permissions=permissions_local)},
worker=ANALYTICS_PROVIDER_ORG_ID,
)

Expand All @@ -450,14 +430,8 @@
client_id: clients[client_id].add_task(
TaskSpec(
function_key=local_second_order_function_keys[client_id],
inputs=data_manager_input[client_id]
+ datasample_inputs[client_id]
+ shared_inputs,
outputs={
"local_analytics_second_moments": ComputeTaskOutputSpec(
permissions=permissions
)
},
inputs=data_manager_input[client_id] + datasample_inputs[client_id] + shared_inputs,
outputs={"local_analytics_second_moments": ComputeTaskOutputSpec(permissions=permissions_aggregation)},
worker=client_id,
)
)
Expand All @@ -477,7 +451,7 @@
aggregation_task_2 = TaskSpec(
function_key=aggregate_function_key,
inputs=aggregation_2_inputs,
outputs={"shared_states": ComputeTaskOutputSpec(permissions=permissions)},
outputs={"shared_states": ComputeTaskOutputSpec(permissions=permissions_local)},
worker=ANALYTICS_PROVIDER_ORG_ID,
)

Expand Down

0 comments on commit 904686b

Please sign in to comment.