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

Run .devcontainer/launch.sh with bash + add error checking #407

Merged
merged 5 commits into from
Sep 18, 2023

Conversation

wence-
Copy link
Contributor

@wence- wence- commented Sep 6, 2023

Description

For the shebang line to work, it must be the first line of the file (not the second as at present).

While here, add set -euo pipefail and notice, and provide, a useful error message if we've requested a CTK + compiler combo that doesn't have a prebaked devcontainer.json. Previously, we would get errors from cp and sed and then launch vscode anyway.

A partial step towards #126, in that unknown devcontainer combinations are now at least noticed.

Checklist

  • New or existing tests cover these changes.
  • The documentation is up to date with these changes.

Otherwise the script will be run with the user's shell, not bash.
Previously if an invalid combination was specified we would get errors
from cp and sed, and then launch vscode anyway. Instead, check for
existence of the devcontainer.json and exit, providing a useful error
message, if it doesn't.
After the update to 12.2 containers, the example usage in launch.sh
does not boot a valid container.
@wence- wence- requested review from a team as code owners September 6, 2023 13:50
@wence- wence- requested review from jarmak-nv and elstehle and removed request for a team September 6, 2023 13:50
@copy-pr-bot
Copy link

copy-pr-bot bot commented Sep 6, 2023

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@miscco
Copy link
Contributor

miscco commented Sep 6, 2023

Thanks a lot for the contribution 🎉

Copy link
Collaborator

@jrhemstad jrhemstad left a comment

Choose a reason for hiding this comment

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

Thanks @wence-!

Admittedly, I have been neglecting the launch.sh ever since I hit a roadblock in supporting custom CTK/host compiler combinations. I wrote up the status quo here: #126 (comment)

@miscco
Copy link
Contributor

miscco commented Sep 18, 2023

@wence- could you please add the [skip-tests] tag to your commit message.

We want to avoid running expensive GPU tests for pure infrastructure fixes. Any issues with the changes will be found by the CPU-only build tests

This way, we get a useful early exit if some other command later in
the script bails.
@wence- wence- force-pushed the wence/fix/launch-error-checking branch from 1367fad to ca806e0 Compare September 18, 2023 08:10
@wence-
Copy link
Contributor Author

wence- commented Sep 18, 2023

could you please add the [skip-tests] tag to your commit message.

Done, thanks!

@miscco
Copy link
Contributor

miscco commented Sep 18, 2023

/ok to test

@miscco miscco merged commit 6317f61 into NVIDIA:main Sep 18, 2023
@miscco
Copy link
Contributor

miscco commented Sep 18, 2023

Thanks a lot for fixing the launch script 🥇

@wence- wence- deleted the wence/fix/launch-error-checking branch September 18, 2023 09:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

[BUG]: devcontainer/launch.sh fails if host shell is not bash
3 participants