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.
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
clp-package: Package building platform's
/etc/os-release
and determineexecution_container
from the file. #322clp-package: Package building platform's
/etc/os-release
and determineexecution_container
from the file. #322Changes from 2 commits
a8c85ad
6a92955
6b4bd88
4d6d552
2068fec
c107dc0
2deaa20
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
Just for sanity check, have you tested and made sure that the container specified in the clp-config will be properly picked up?
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.
Yes. I have updated the "Validation" section in the PR description to include the related instructions.
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.
technically we can add a guard to ensure split does return two items, but since the os release file should have a relatively fixed format, this code should be fine
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.
Right, I was thinking about adding
try ... except
blocks to handle such errors / FileNotFoundError, but since users are not expected to modify this<clp-package>/etc/os-release
file, such handlings could be redundant. In any case, users will get notified by the Exception stack.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.
can we store parsed["ID"] in a local variable?
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.
When I drafted the code, I thought about extracting those into variables
parsed_id
,parsed_version_id
/parsed_version_codename
, and even better webreak
the for-loop if all info we need has been parsed. However, that might be less clean and less extensible if we (ever) plan to support CentOS / RHEL in the future. That's becauseVERSION_ID
is common across all Linux distributions, butVERSION_CODENAME
is specific to Ubuntu / Debian distributions.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.
Should we add Debian into the if condition?
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.
I thought about adding Debian and other RHEL distributions here, but that does not seem meaningful until we add (building support and most importantly,) execution container support in
tools/docker-images
. For now, I think raising an NotImplementedError here is a good notification to users.