You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
(torchx/workspace) Add API for caching workspace build artifacts between 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
0 commit comments