-
Notifications
You must be signed in to change notification settings - Fork 146
(torchx/workspace) Add API for caching workspace build artifacts between roles #1149
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
Conversation
@kiukchung has exported this pull request. If you are a Meta employee, you can view the originating Diff in D84466900. |
…een roles (#1149) Summary: Since we now allow each `Role` to specify its own workspace through the `Role.workspace` attribute, there are cases where all the roles have the same workspace and base image. In this case, we don't have to re-build the workspace image for each role since the ephemerals will all have the same content! This diff introduces the `caching_build_workspace_and_update_role()` method to the `WorkspaceMixIn`. This is the preferred method (over `build_workspace_and_update_role()`) that subclasses of `WorkspaceMixIn` should implement. Until we can completely deprecate `build_workspace_and_update_role()`, we bridge the two by having the default implementation of `caching_build_workspace_and_update_role()` call `build_workspace_and_update_role()`. To support `caching_build_workspace_and_update_role()`, this diff also does the following: 1. Renames `build_workspace_and_udpate_role2()` to `caching_build_workspace_and_update_role()`. 2. Iterating over the roles and building the workspace for each role is now pushed into the `WorkspaceMixIn.build_workspace_and_update_roles()` instead of it being in the runner. 3. Pushes the logic of merging of multi-directory workspace into a single tmp dir to the `Workspace` class's `merge_into()` method. Reviewed By: AbishekS Differential Revision: D84466900
d7e7413
to
3e4daf8
Compare
…een roles (#1149) Summary: Since we now allow each `Role` to specify its own workspace through the `Role.workspace` attribute, there are cases where all the roles have the same workspace and base image. In this case, we don't have to re-build the workspace image for each role since the ephemerals will all have the same content! This diff introduces the `caching_build_workspace_and_update_role()` method to the `WorkspaceMixIn`. This is the preferred method (over `build_workspace_and_update_role()`) that subclasses of `WorkspaceMixIn` should implement. Until we can completely deprecate `build_workspace_and_update_role()`, we bridge the two by having the default implementation of `caching_build_workspace_and_update_role()` call `build_workspace_and_update_role()`. To support `caching_build_workspace_and_update_role()`, this diff also does the following: 1. Renames `build_workspace_and_udpate_role2()` to `caching_build_workspace_and_update_role()`. 2. Iterating over the roles and building the workspace for each role is now pushed into the `WorkspaceMixIn.build_workspace_and_update_roles()` instead of it being in the runner. 3. Pushes the logic of merging of multi-directory workspace into a single tmp dir to the `Workspace` class's `merge_into()` method. Reviewed By: AbishekS Differential Revision: D84466900
…een roles (#1149) Summary: Since we now allow each `Role` to specify its own workspace through the `Role.workspace` attribute, there are cases where all the roles have the same workspace and base image. In this case, we don't have to re-build the workspace image for each role since the ephemerals will all have the same content! This diff introduces the `caching_build_workspace_and_update_role()` method to the `WorkspaceMixIn`. This is the preferred method (over `build_workspace_and_update_role()`) that subclasses of `WorkspaceMixIn` should implement. Until we can completely deprecate `build_workspace_and_update_role()`, we bridge the two by having the default implementation of `caching_build_workspace_and_update_role()` call `build_workspace_and_update_role()`. To support `caching_build_workspace_and_update_role()`, this diff also does the following: 1. Renames `build_workspace_and_udpate_role2()` to `caching_build_workspace_and_update_role()`. 2. Iterating over the roles and building the workspace for each role is now pushed into the `WorkspaceMixIn.build_workspace_and_update_roles()` instead of it being in the runner. 3. Pushes the logic of merging of multi-directory workspace into a single tmp dir to the `Workspace` class's `merge_into()` method. Reviewed By: AbishekS Differential Revision: D84466900
3e4daf8
to
3499942
Compare
…een roles (#1149) Summary: Since we now allow each `Role` to specify its own workspace through the `Role.workspace` attribute, there are cases where all the roles have the same workspace and base image. In this case, we don't have to re-build the workspace image for each role since the ephemerals will all have the same content! This diff introduces the `caching_build_workspace_and_update_role()` method to the `WorkspaceMixIn`. This is the preferred method (over `build_workspace_and_update_role()`) that subclasses of `WorkspaceMixIn` should implement. Until we can completely deprecate `build_workspace_and_update_role()`, we bridge the two by having the default implementation of `caching_build_workspace_and_update_role()` call `build_workspace_and_update_role()`. To support `caching_build_workspace_and_update_role()`, this diff also does the following: 1. Renames `build_workspace_and_udpate_role2()` to `caching_build_workspace_and_update_role()`. 2. Iterating over the roles and building the workspace for each role is now pushed into the `WorkspaceMixIn.build_workspace_and_update_roles()` instead of it being in the runner. 3. Pushes the logic of merging of multi-directory workspace into a single tmp dir to the `Workspace` class's `merge_into()` method. Reviewed By: AbishekS Differential Revision: D84466900
3499942
to
ced220d
Compare
…een roles (#1149) Summary: Since we now allow each `Role` to specify its own workspace through the `Role.workspace` attribute, there are cases where all the roles have the same workspace and base image. In this case, we don't have to re-build the workspace image for each role since the ephemerals will all have the same content! This diff introduces the `caching_build_workspace_and_update_role()` method to the `WorkspaceMixIn`. This is the preferred method (over `build_workspace_and_update_role()`) that subclasses of `WorkspaceMixIn` should implement. Until we can completely deprecate `build_workspace_and_update_role()`, we bridge the two by having the default implementation of `caching_build_workspace_and_update_role()` call `build_workspace_and_update_role()`. To support `caching_build_workspace_and_update_role()`, this diff also does the following: 1. Renames `build_workspace_and_udpate_role2()` to `caching_build_workspace_and_update_role()`. 2. Iterating over the roles and building the workspace for each role is now pushed into the `WorkspaceMixIn.build_workspace_and_update_roles()` instead of it being in the runner. 3. Pushes the logic of merging of multi-directory workspace into a single tmp dir to the `Workspace` class's `merge_into()` method. Reviewed By: AbishekS Differential Revision: D84466900
ced220d
to
5226c01
Compare
…een roles (#1149) Summary: Since we now allow each `Role` to specify its own workspace through the `Role.workspace` attribute, there are cases where all the roles have the same workspace and base image. In this case, we don't have to re-build the workspace image for each role since the ephemerals will all have the same content! This diff introduces the `caching_build_workspace_and_update_role()` method to the `WorkspaceMixIn`. This is the preferred method (over `build_workspace_and_update_role()`) that subclasses of `WorkspaceMixIn` should implement. Until we can completely deprecate `build_workspace_and_update_role()`, we bridge the two by having the default implementation of `caching_build_workspace_and_update_role()` call `build_workspace_and_update_role()`. To support `caching_build_workspace_and_update_role()`, this diff also does the following: 1. Renames `build_workspace_and_udpate_role2()` to `caching_build_workspace_and_update_role()`. 2. Iterating over the roles and building the workspace for each role is now pushed into the `WorkspaceMixIn.build_workspace_and_update_roles()` instead of it being in the runner. 3. Pushes the logic of merging of multi-directory workspace into a single tmp dir to the `Workspace` class's `merge_into()` method. Reviewed By: AbishekS Differential Revision: D84466900
5226c01
to
173beab
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1149 +/- ##
==========================================
- Coverage 91.69% 91.56% -0.13%
==========================================
Files 83 83
Lines 6539 6593 +54
==========================================
+ Hits 5996 6037 +41
- Misses 543 556 +13
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
…een roles (#1149) Summary: Since we now allow each `Role` to specify its own workspace through the `Role.workspace` attribute, there are cases where all the roles have the same workspace and base image. In this case, we don't have to re-build the workspace image for each role since the ephemerals will all have the same content! This diff introduces the `caching_build_workspace_and_update_role()` method to the `WorkspaceMixIn`. This is the preferred method (over `build_workspace_and_update_role()`) that subclasses of `WorkspaceMixIn` should implement. Until we can completely deprecate `build_workspace_and_update_role()`, we bridge the two by having the default implementation of `caching_build_workspace_and_update_role()` call `build_workspace_and_update_role()`. To support `caching_build_workspace_and_update_role()`, this diff also does the following: 1. Renames `build_workspace_and_udpate_role2()` to `caching_build_workspace_and_update_role()`. 2. Iterating over the roles and building the workspace for each role is now pushed into the `WorkspaceMixIn.build_workspace_and_update_roles()` instead of it being in the runner. 3. Pushes the logic of merging of multi-directory workspace into a single tmp dir to the `Workspace` class's `merge_into()` method. Reviewed By: AbishekS Differential Revision: D84466900
173beab
to
a40ad61
Compare
…een roles (#1149) Summary: Since we now allow each `Role` to specify its own workspace through the `Role.workspace` attribute, there are cases where all the roles have the same workspace and base image. In this case, we don't have to re-build the workspace image for each role since the ephemerals will all have the same content! This diff introduces the `caching_build_workspace_and_update_role()` method to the `WorkspaceMixIn`. This is the preferred method (over `build_workspace_and_update_role()`) that subclasses of `WorkspaceMixIn` should implement. Until we can completely deprecate `build_workspace_and_update_role()`, we bridge the two by having the default implementation of `caching_build_workspace_and_update_role()` call `build_workspace_and_update_role()`. To support `caching_build_workspace_and_update_role()`, this diff also does the following: 1. Renames `build_workspace_and_udpate_role2()` to `caching_build_workspace_and_update_role()`. 2. Iterating over the roles and building the workspace for each role is now pushed into the `WorkspaceMixIn.build_workspace_and_update_roles()` instead of it being in the runner. 3. Pushes the logic of merging of multi-directory workspace into a single tmp dir to the `Workspace` class's `merge_into()` method. Reviewed By: AbishekS Differential Revision: D84466900
a40ad61
to
ef852bd
Compare
Summary:
Since we now allow each
Role
to specify its own workspace through theRole.workspace
attribute, there are cases where all the roles have the same workspace and base image. In this case, we don't have to re-build the workspace image for each role since the ephemerals will all have the same content!This diff introduces the
caching_build_workspace_and_update_role()
method to theWorkspaceMixIn
. This is the preferred method (overbuild_workspace_and_update_role()
) that subclasses ofWorkspaceMixIn
should implement.Until we can completely deprecate
build_workspace_and_update_role()
, we bridge the two by having the default implementation ofcaching_build_workspace_and_update_role()
callbuild_workspace_and_update_role()
.To support
caching_build_workspace_and_update_role()
, this diff also does the following:Renames
build_workspace_and_udpate_role2()
tocaching_build_workspace_and_update_role()
.Iterating over the roles and building the workspace for each role is now pushed into the
WorkspaceMixIn.build_workspace_and_update_roles()
instead of it being in the runner.Pushes the logic of merging of multi-directory workspace into a single tmp dir to the
Workspace
class'smerge_into()
method.Reviewed By: AbishekS
Differential Revision: D84466900