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 errors from empty 'resources' field in YAML. #1816

Merged
merged 1 commit into from
Mar 27, 2023
Merged

Conversation

concretevitamin
Copy link
Member

Repro: create a YAML like this

resources:
  # commented out!

Previously:

» sky launch test.yaml
...
File .. sky/backends/onprem_utils.py", line 492, in check_local_cloud_args
    yaml_cloud = yaml_config['resources'].get('cloud')
AttributeError: 'NoneType' object has no attribute 'get'

Now:

» sky launch test.yaml
Task from YAML spec: test.yaml
ValueError: Invalid task YAML: None is not of type 'object'. Check problematic field(s): $.resources

The fix is we do check_local_cloud_args() after Task ctor which performs schema validation.

Tested (run the relevant ones):

  • Any manual or new tests for this PR (please specify below)
    • above

Copy link
Collaborator

@romilbhardwaj romilbhardwaj left a comment

Choose a reason for hiding this comment

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

Thanks @concretevitamin! Tried it out with a onprem cluster (and invalid onprem spec) to make sure onprem validation code path doesn't break - seems to work fine.

@concretevitamin concretevitamin merged commit 10b50a9 into master Mar 27, 2023
@concretevitamin concretevitamin deleted the minor-fix branch March 27, 2023 23:43
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