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

feat: unify dependencies #155

Merged
merged 5 commits into from
Sep 1, 2023
Merged

feat: unify dependencies #155

merged 5 commits into from
Sep 1, 2023

Conversation

ThibaultFy
Copy link
Member

@ThibaultFy ThibaultFy commented Jul 25, 2023

This reverts commit b9acbe0.
Link to the reverts PR:

Changes regarding the initial commit:

  • creates the concept of compute dependencies, to build wheels, compile them and create the folder with the right tree structure
  • dependencies can be computed in a cache folder attached to the Dependency object. This allow to compute the dependencies once and for all using the compute_in_cache_folder and clean_cache_folder method

closes FL-1022, FL-1037,

CI ✅ https://github.com/owkin/substra-ci/actions/runs/5727598535

Please check if the PR fulfills these requirements

  • If the feature has an impact on the user experience, the changelog has been updated
  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)
  • The commit message follows the conventional commit specification

@ThibaultFy ThibaultFy changed the base branch from main to chore/rename-generate-wheel-to-manage-dep July 25, 2023 15:01
@ThibaultFy ThibaultFy force-pushed the feat/compile-dependencies branch 2 times, most recently from 490d192 to 252a05b Compare July 26, 2023 08:25
@ThibaultFy ThibaultFy force-pushed the chore/rename-generate-wheel-to-manage-dep branch from 64ab47d to 999d8f8 Compare July 28, 2023 07:57
Base automatically changed from chore/rename-generate-wheel-to-manage-dep to main July 28, 2023 08:07
@ThibaultFy ThibaultFy force-pushed the feat/compile-dependencies branch 3 times, most recently from 1c4f1e8 to 532594a Compare July 31, 2023 10:14
@linear
Copy link

linear bot commented Aug 1, 2023

FL-1022 Follow-up user-dependencies management

Context

#123 (comment)

Specification

Method copy_local_wheels should not be responsible for building python wheels which would rather be handled beforehand.

Acceptance criteria

copy_local_wheels does not call build_user_dependency_wheel anymore

FL-1037 revert: pip-compile on windows, Windows-compatible temp dir, unify user local dependencies

Summary

Three commits were revert to unlock the release 0.28.0. Hash of the revert commit: b9acbe01b88eb973b6e7c58cf75330bb035873ea

We want to "revert the revert" to re-integrate these changes with the following changes:

  1. Dependencies are compiled 6 times before submitting the CP. As all tasks have the same dependencies, we'd prefer this compilation to be done at object instantiation time (but this will slow down a little subprocess that does not need this compilation to work).

  2. Pinning a lot more versions forces the reinstallation of a lot of dependencies, some of which are already present in the substratools base image. Also, re-installation does not imply deletion, which means that docker images are potentially larger than before. We might want to remove the already installed library from the substratools images (aka use the minimal version of substratools image).

  3. Some tasks fail without logs, and much more recently. The last kaniko pod msg that fails is Taking snapshot of full filesystem... and sometimes triggers a timeout or similar. This symptom is widely described here: Image build process Freezes on Taking snapshot of full filesystem... GoogleContainerTools/kaniko#1333 and is potentially linked to a lack of disk space in ram, but with no real fix or diagnosis for 3 years (last message two weeks ago).

    → Failing example: Product demo Camelyon (cf test upgrade failed run here and the one launched after). To reproduce, launch this example: https://github.com/owkin/product_demo/tree/main/substrafl/camelyon, demo.py file on test-upgrade environment.

We want this PR to be validated on test-upgrade before being merged. To do so, use a compatible version of substrafl and apply this commit.

Notes

Please check if the PR fulfills these requirements

  • If the feature has an impact on the user experience, the changelog has been updated
  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)
  • The commit message follows the conventional commit specification

@ThibaultFy ThibaultFy changed the title feat: compile dependencies feat: unify dependencies Aug 1, 2023
@ThibaultFy ThibaultFy force-pushed the feat/compile-dependencies branch 3 times, most recently from 663a973 to 49d0b12 Compare August 1, 2023 14:54
@ThibaultFy ThibaultFy marked this pull request as ready for review August 1, 2023 14:57
@ThibaultFy ThibaultFy requested a review from a team as a code owner August 1, 2023 14:57
Copy link
Contributor

@SdgJlbl SdgJlbl left a comment

Choose a reason for hiding this comment

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

Thanks a lot for taking up that feature again.
It's a quite diffuse feeling, but the convolutions in some parts of the flow make me wonder if there is not some inversion in the way we are splitting responsibilities (object B should be responsible of doing X, instead of A).
I'd be interested in discussing that further, and will continue thinking about it.

CHANGELOG.md Outdated Show resolved Hide resolved
substrafl/dependency/manage_dependencies.py Show resolved Hide resolved
substrafl/dependency/manage_dependencies.py Show resolved Hide resolved
substrafl/dependency/manage_dependencies.py Show resolved Hide resolved
substrafl/dependency/schemas.py Outdated Show resolved Hide resolved
substrafl/experiment.py Outdated Show resolved Hide resolved
@ThibaultFy ThibaultFy force-pushed the feat/compile-dependencies branch 3 times, most recently from dbbb3a2 to 9a75fdd Compare August 2, 2023 14:42
@ThibaultFy
Copy link
Member Author

/e2e --mode=standalone --tests=substrafl --benchmarks=camelyon

@Owlfred
Copy link

Owlfred commented Aug 2, 2023

End to end tests: ✔️ SUCCESS

“I love it when a plan comes together.” ― Colonel John “Hannibal” Smith, The A-Team

@ThibaultFy ThibaultFy force-pushed the feat/compile-dependencies branch 2 times, most recently from d6a63a7 to cefd037 Compare August 2, 2023 15:05
@ThibaultFy ThibaultFy requested a review from SdgJlbl August 2, 2023 15:54
@ThibaultFy ThibaultFy force-pushed the feat/compile-dependencies branch 2 times, most recently from 4ec6cdf to f4b3325 Compare August 16, 2023 14:34
@ThibaultFy
Copy link
Member Author

/e2e --mode=standalone --tests=substrafl --benchmarks=camelyon

@Owlfred
Copy link

Owlfred commented Aug 16, 2023

End to end tests: ❌ FAILURE

Jobs status:

  • Camelyon / standalone-camelyon:
  • Dispatch Jobs: ✔️
  • Distributed: ⏭️
  • MNIST: ⏭️
  • Standalone / standalone-substrafl:

“Boy, that escalated quickly.” ― Ron Burgundy, Anchorman: The Legend of Ron Burgundy

@ThibaultFy ThibaultFy force-pushed the feat/compile-dependencies branch 2 times, most recently from b6fa09f to 6d04f0d Compare August 16, 2023 15:07
Signed-off-by: ThibaultFy <50656860+ThibaultFy@users.noreply.github.com>
@ThibaultFy
Copy link
Member Author

/e2e --mode=standalone --tests=substrafl --benchmarks=camelyon

@Owlfred
Copy link

Owlfred commented Aug 16, 2023

End to end tests: ✔️ SUCCESS

substrafl/dependency/manage_dependencies.py Outdated Show resolved Hide resolved
substrafl/dependency/manage_dependencies.py Show resolved Hide resolved
substrafl/dependency/schemas.py Outdated Show resolved Hide resolved
dest_dir (Path): directory where to copy the dependencies computation tree structure.
"""

self._copy_cache_directory(dest_dir=dest_dir)
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think we need a method callling another method, you can just have the content of self._copy_cache_directory here, no?

substrafl/dependency/schemas.py Outdated Show resolved Hide resolved
substrafl/dependency/schemas.py Outdated Show resolved Hide resolved
Signed-off-by: ThibaultFy <50656860+ThibaultFy@users.noreply.github.com>
Signed-off-by: ThibaultFy <50656860+ThibaultFy@users.noreply.github.com>
@ThibaultFy
Copy link
Member Author

/e2e --mode=standalone --tests=substrafl --benchmarks=camelyon

@Owlfred
Copy link

Owlfred commented Sep 1, 2023

End to end tests: ✔️ SUCCESS

“Carpe diem. Seize the day, boys.” ― John Keating, Dead Poets Society

Copy link
Contributor

@SdgJlbl SdgJlbl left a comment

Choose a reason for hiding this comment

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

Thanks a lot for all your work on this PR.

Just a minor comment to have a more Pythonic getter, and I think we're good to go 🚀

Comment on lines 138 to 139

def get_cache_directory(self) -> Path:
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
def get_cache_directory(self) -> Path:
@property
def cache_directory(self) -> Path:

Copy link
Member Author

Choose a reason for hiding this comment

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

oh thanks of course...

Signed-off-by: ThibaultFy <50656860+ThibaultFy@users.noreply.github.com>
Signed-off-by: ThibaultFy <50656860+ThibaultFy@users.noreply.github.com>
@ThibaultFy ThibaultFy merged commit 11541b5 into main Sep 1, 2023
6 checks passed
@ThibaultFy ThibaultFy deleted the feat/compile-dependencies branch September 1, 2023 14:00
@Milouu Milouu mentioned this pull request Sep 5, 2023
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.

3 participants