-
Notifications
You must be signed in to change notification settings - Fork 881
[Core/Docs] Add Warning for Lost File Mount on RollingUpdate w/ Consolidation Mode #8350
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
Open
lloyd-brown
wants to merge
5
commits into
master
Choose a base branch
from
rollingupdate-docs
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+58
−0
Open
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -25,6 +25,7 @@ | |||||||||||||||||||||
| from sky.backends import backend_utils | ||||||||||||||||||||||
| from sky.backends import cloud_vm_ray_backend | ||||||||||||||||||||||
| from sky.catalog import common as service_catalog_common | ||||||||||||||||||||||
| from sky.data import data_utils | ||||||||||||||||||||||
| from sky.data import storage as storage_lib | ||||||||||||||||||||||
| from sky.jobs import constants as managed_job_constants | ||||||||||||||||||||||
| from sky.jobs import state as managed_job_state | ||||||||||||||||||||||
|
|
@@ -93,6 +94,51 @@ | |||||||||||||||||||||
| ] | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
|
|
||||||||||||||||||||||
| def _warn_file_mounts_rolling_update(dag: 'sky.Dag') -> None: | ||||||||||||||||||||||
| """Warn if local file mounts or workdir may be lost during rolling update. | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| When rolling update is enabled with consolidation mode but no jobs bucket | ||||||||||||||||||||||
| is configured, local file mounts and workdirs are stored locally on the API | ||||||||||||||||||||||
| server pod and will be lost during a rolling update. | ||||||||||||||||||||||
| """ | ||||||||||||||||||||||
| # If rolling update is not enabled, don't warn. | ||||||||||||||||||||||
| if os.environ.get(skylet_constants.SKYPILOT_ROLLING_UPDATE_ENABLED) is None: | ||||||||||||||||||||||
| return | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| # If consolidation mode is not enabled, don't warn. | ||||||||||||||||||||||
| if not managed_job_utils.is_consolidation_mode(): | ||||||||||||||||||||||
| return | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| # If a jobs bucket is configured, don't warn. | ||||||||||||||||||||||
| if skypilot_config.get_nested(('jobs', 'bucket'), None) is not None: | ||||||||||||||||||||||
| return | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| # Check if any task has local file_mounts (not cloud store URLs) or workdir | ||||||||||||||||||||||
| has_local_file_mounts = False | ||||||||||||||||||||||
| has_local_workdir = False | ||||||||||||||||||||||
| for task_ in dag.tasks: | ||||||||||||||||||||||
| if task_.file_mounts: | ||||||||||||||||||||||
| for src in task_.file_mounts.values(): | ||||||||||||||||||||||
| if not data_utils.is_cloud_store_url(src): | ||||||||||||||||||||||
| has_local_file_mounts = True | ||||||||||||||||||||||
| break | ||||||||||||||||||||||
| if task_.workdir and isinstance(task_.workdir, str): | ||||||||||||||||||||||
| has_local_workdir = True | ||||||||||||||||||||||
| break | ||||||||||||||||||||||
| if has_local_file_mounts: | ||||||||||||||||||||||
| break | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| if not has_local_file_mounts and not has_local_workdir: | ||||||||||||||||||||||
| return | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| logger.warning( | ||||||||||||||||||||||
| f'{colorama.Fore.YELLOW}WARNING: Local file mounts or workdir detected ' | ||||||||||||||||||||||
| 'with rolling update enabled for API server. ' | ||||||||||||||||||||||
| 'To persist files across API server restarts/update, configure a cloud ' | ||||||||||||||||||||||
| f'bucket in your SkyPilot config under `jobs.bucket`.' | ||||||||||||||||||||||
| f'{colorama.Style.RESET_ALL}') | ||||||||||||||||||||||
|
Comment on lines
+135
to
+139
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||||||||||||
|
|
||||||||||||||||||||||
|
|
||||||||||||||||||||||
| def _upload_files_to_controller(dag: 'sky.Dag') -> Dict[str, str]: | ||||||||||||||||||||||
| """Upload files to the controller. | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
|
|
@@ -353,6 +399,9 @@ def launch( | |||||||||||||||||||||
| f'with:\n\n`sky down {cluster_name} --purge`\n\n' | ||||||||||||||||||||||
| f'Reason: {common_utils.format_exception(e)}') | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| # Warn if file mounts may be lost during rolling update | ||||||||||||||||||||||
| _warn_file_mounts_rolling_update(dag) | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| local_to_controller_file_mounts = _upload_files_to_controller(dag) | ||||||||||||||||||||||
| controller = controller_utils.Controllers.JOBS_CONTROLLER | ||||||||||||||||||||||
| controller_name = controller.value.cluster_name | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.