-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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(ci) fixing the file permission issue for CI runner #8311
Conversation
fyi @joshua-goldstein @dshekhar95 we should have fixed it this way. We should try to avoid adding too many cleanups to the CI steps (as they should mimic & control out test flow, NOT infrastructure cleaning or setup). I have put the correct fix towards the runner infrastructure. We can discuss next week - but pls do look to understand these changes. |
#TODO: WE NEED TO REMOVE THIS CLEANUP, and handle it more elegantly, it makes us incompatible with gh-hosted-runners | ||
cleanup: | ||
runs-on: self-hosted | ||
container: | ||
image: ubuntu:latest | ||
steps: | ||
- name: Cleaning up the $GITHUB_WORKSPACE as root from a Docker image | ||
run: find /__w/${{ github.event.repository.name }}/${{ github.event.repository.name }}/. -name . -o -prune -exec rm -rf -- {} + || true |
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.
@joshua-goldstein & @dshekhar95 this won't be needed anymore because of the fix in the infrastructure layer
#TODO: WE NEED TO REMOVE THIS CLEANUP, and handle it more elegantly, it makes us incompatible with gh-hosted-runners | ||
cleanup: | ||
runs-on: self-hosted | ||
container: | ||
image: ubuntu:latest | ||
steps: | ||
- name: Cleaning up the $GITHUB_WORKSPACE as root from a Docker image | ||
run: find /__w/${{ github.event.repository.name }}/${{ github.event.repository.name }}/. -name . -o -prune -exec rm -rf -- {} + || true |
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.
@joshua-goldstein & @dshekhar95 this won't be needed anymore because of the fix in the infrastructure layer
@@ -26,6 +26,7 @@ curl -o actions-runner-linux-x64-2.296.2.tar.gz -L https://github.com/actions/ru | |||
echo "34a8f34956cdacd2156d4c658cce8dd54c5aef316a16bbbc95eb3ca4fd76429a actions-runner-linux-x64-2.296.2.tar.gz" | shasum -a 256 -c | |||
tar xzf ./actions-runner-linux-x64-2.296.2.tar.gz | |||
./config.sh --url https://github.com/dgraph-io/dgraph --token $TOKEN | |||
sudo chown -R $USER:$USER /home/ubuntu/actions-runner/_work # fixes the test cruft cleanup issue |
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.
@joshua-goldstein @dshekhar95 this is the correct way to fix it at the infrastructure layer.
* undo changes to dgraph tests * undo changes to load tests * fixing the runner user, to handle cruft cleanup issue * fix test cruft issue * fix test cleanup
Problem
The previous fixes were introducing a cleanup step in our CI, which is not ideal & it is not consistent either - because any files created from within the container cannot be cleaned up by other steps because of root user issues. Docker runs as root.
Solution
The correct fix is to have the runner run as root, which is the ideal way of dealing with this. There are security concerns here, but I have looked further to ensure we are not impacted. This change is made in this PR. The earlier PRs #8307 #8301 & issues actions/checkout#211 Gamify-IT/issues#60 talk about the fixes.