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: typo in go further examples #331

Merged
merged 2 commits into from
Jul 26, 2023
Merged

fix: typo in go further examples #331

merged 2 commits into from
Jul 26, 2023

Conversation

ThibaultFy
Copy link
Member

@ThibaultFy ThibaultFy commented Jul 26, 2023

closes FL-1119

Copy link
Contributor

@RomainGoussault RomainGoussault left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR!

@ThibaultFy ThibaultFy marked this pull request as ready for review July 26, 2023 07:31
@ThibaultFy ThibaultFy requested a review from a team as a code owner July 26, 2023 07:31
@linear
Copy link

linear bot commented Jul 26, 2023

FL-1119 SubstraFL diabetes example fails in remote mode

Context

Running the SubstraFL diabetes example in substra-documentation in remote mode causes an error:

$ python run_diabetes_substrafl.py 
Dataset key for MyOrg2MSP: 4b2fd188-d300-4c0f-8a0a-9f7e5ad38911
Dataset key for MyOrg3MSP: be7d9933-7fad-4714-a319-1e16186a2718
2023-07-25 18:16:43,029 - INFO - Building the compute plan.
2023-07-25 18:16:43,029 - INFO - Registering the functions to Substra.
2023-07-25 18:16:43,767 - INFO - Registering the compute plan to Substra.
2023-07-25 18:16:43,768 - INFO - Experiment summary saved to /Users/oleobal/projects/documentation/substrafl_examples/go_further/tmp/experiment_summaries/2023_07_25_18_16_43_7e8db06b-a5d8-4fc9-a36b-e3d4fe98e2ee.json
Requests error status 403: {"message":"OE0102: not authorized to process datamanager \"4b2fd188-d300-4c0f-8a0a-9f7e5ad38911\""}
Traceback (most recent call last):
  File "/Users/oleobal/projects/documentation/.venv/lib/python3.10/site-packages/substra/sdk/backends/remote/rest_client.py", line 103, in __request
    r.raise_for_status()
  File "/Users/oleobal/projects/documentation/.venv/lib/python3.10/site-packages/requests/models.py", line 1021, in raise_for_status
    raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 403 Client Error: Forbidden for url: https://api.org-1.test-upgrade.cg.owkin.tech/task/bulk_create/

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/oleobal/projects/documentation/substrafl_examples/go_further/run_diabetes_substrafl.py", line 517, in <module>
    compute_plan = execute_experiment(
  File "/Users/oleobal/projects/documentation/.venv/lib/python3.10/site-packages/substrafl/experiment.py", line 342, in execute_experiment
    compute_plan = client.add_compute_plan(
  File "/Users/oleobal/projects/documentation/.venv/lib/python3.10/site-packages/substra/sdk/client.py", line 48, in wrapper
    return f(*args, **kwargs)
  File "/Users/oleobal/projects/documentation/.venv/lib/python3.10/site-packages/substra/sdk/client.py", line 518, in add_compute_plan
    return self._backend.add(spec, spec_options=spec_options)
  File "/Users/oleobal/projects/documentation/.venv/lib/python3.10/site-packages/substra/sdk/backends/remote/backend.py", line 184, in add
    self._add_tasks_from_computeplan(spec, spec_options, auto_batching, batch_size)
  File "/Users/oleobal/projects/documentation/.venv/lib/python3.10/site-packages/substra/sdk/backends/remote/backend.py", line 226, in _add_tasks_from_computeplan
    self._add_tasks(batch, spec_options)
  File "/Users/oleobal/projects/documentation/.venv/lib/python3.10/site-packages/substra/sdk/backends/remote/backend.py", line 239, in _add_tasks
    return self._client.request(
  File "/Users/oleobal/projects/documentation/.venv/lib/python3.10/site-packages/substra/sdk/backends/remote/rest_client.py", line 192, in request
    response = self._request(
  File "/Users/oleobal/projects/documentation/.venv/lib/python3.10/site-packages/substra/sdk/utils.py", line 214, in wrapper
    return f(*args, **kwargs)
  File "/Users/oleobal/projects/documentation/.venv/lib/python3.10/site-packages/substra/sdk/backends/remote/rest_client.py", line 148, in _request
    return self.__request(request_name, url, **request_kwargs)
  File "/Users/oleobal/projects/documentation/.venv/lib/python3.10/site-packages/substra/sdk/backends/remote/rest_client.py", line 121, in __request
    raise exceptions.AuthorizationError.from_request_exception(e)
substra.sdk.exceptions.AuthorizationError: 403 Client Error: Forbidden for url: https://api.org-1.test-upgrade.cg.owkin.tech/task/bulk_create/: OE0102: not authorized to process datamanager "4b2fd188-d300-4c0f-8a0a-9f7e5ad38911"

The error disappears by editing permissions line 128:

# from
permissions_dataset = Permissions(public=False, authorized_ids=DATA_PROVIDER_ORGS_ID)
# to
permissions_dataset = Permissions(public=True, authorized_ids=DATA_PROVIDER_ORGS_ID)

Specification

Acceptance criteria

The SubstraFL diabetes example runs successfully

@ThibaultFy ThibaultFy merged commit c31588f into main Jul 26, 2023
2 checks passed
@ThibaultFy ThibaultFy deleted the fix/examples-go-further branch July 26, 2023 07:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants