-
Notifications
You must be signed in to change notification settings - Fork 790
[SYCL][Devops] Fix DockerFile linting issues discovered by trivy
#16411
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
Merged
Merged
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
04b171b
[SYCL][Devops] Fix AVD-DS-0017
AlexeySachkov d2c634b
[SYCL][Devops] Fix AVD-DS-0002
AlexeySachkov 6be44f3
[SYCL][Devops] Fix remaining AVD-DS-0002 issues
AlexeySachkov f8ddea9
An attempt to fix docker images build
AlexeySachkov 6dde2be
Outline sycl user creation into a separate script; Make it require pa…
AlexeySachkov 6b2e414
Drop seemingly dead legacy code
AlexeySachkov 293ce52
Propagate new secret to images and use sudo with password in workflows
AlexeySachkov 4f32c5b
Run various driver installs as root when building containers
AlexeySachkov c10b986
Properly propagate secrets down to user creation script
AlexeySachkov 8d423f0
Fix trivy reported issues in a new docker file
AlexeySachkov d6f9541
Switch all containers to `sycl_ci` user and update the documentation
AlexeySachkov 127080e
Fix typos
AlexeySachkov 0de86c4
Fix new container build
AlexeySachkov ce80d93
Apply comments
AlexeySachkov db221e4
Update sycl/doc/developer/DockerBKMs.md
AlexeySachkov 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
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
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
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
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 |
---|---|---|
@@ -0,0 +1,50 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
if [[ $# -eq 0 ]]; then | ||
# When launched without arguments, we assume that it was launched as part of | ||
# CI workflow and therefore a different kind of user is created | ||
USER_NAME=sycl_ci | ||
SET_PASSWD=true | ||
|
||
# By default Ubuntu sets an arbitrary UID value, that is different from host | ||
# system. When CI passes default UID value of 1001, some of LLVM tools fail to | ||
# discover user home directory and fail a few LIT tests. Fixes UID and GID to | ||
# 1001, that is used as default by GitHub Actions. | ||
USER_ID=1001 | ||
else | ||
if [[ "${1:-}" != "--regular" ]]; then | ||
echo "The only supported argument is --regular!" | ||
exit 1 | ||
fi | ||
USER_NAME=sycl | ||
SET_PASSWD=false | ||
|
||
# Some user id which is different from the one assigned to sycl_ci user | ||
USER_ID=1234 | ||
fi | ||
|
||
groupadd -g $USER_ID $USER_NAME && useradd $USER_NAME -u $USER_ID -g $USER_ID -m -s /bin/bash | ||
# Add user to video/irc groups so that it can access GPU | ||
usermod -aG video $USER_NAME | ||
usermod -aG irc $USER_NAME | ||
|
||
# group 109 is required for user to access PVC card. | ||
groupadd -f -g 109 render | ||
usermod -aG render $USER_NAME | ||
|
||
if [[ $SET_PASSWD == true ]]; then | ||
if [[ ! -f /run/secrets/sycl_ci_passwd ]]; then | ||
echo "Password is requested, but /run/secrets/sycl_ci_passwd doesn't exist!" | ||
exit 2 | ||
fi | ||
|
||
# Set password for user | ||
echo "$USER_NAME:$(cat /run/secrets/sycl_ci_passwd)" | chpasswd | ||
|
||
# Allow user to run as sudo, but only with password | ||
echo "$USER_NAME ALL=(ALL) PASSWD:ALL" >> /etc/sudoers | ||
else | ||
echo "$USER_NAME ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers | ||
fi |
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 |
---|---|---|
@@ -1,8 +1,3 @@ | ||
#!/bin/bash | ||
|
||
if [ -d "$GITHUB_WORKSPACE" ]; then | ||
chown -R sycl:sycl $GITHUB_WORKSPACE | ||
su sycl | ||
fi | ||
|
||
exec "$@" |
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.
Uh oh!
There was an error while loading. Please reload this page.