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

feat: symlink cached runner instead of copy #25

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions cloudconfig/templates.go
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,8 @@ if [ -z "$CACHED_RUNNER" ];then
sudo ./bin/installdependencies.sh || fail "failed to install dependencies"
else
sendStatus "using cached runner found in $CACHED_RUNNER"
sudo cp -a "$CACHED_RUNNER" "/home/{{ .RunnerUsername }}/actions-runner"
sudo chown {{ .RunnerUsername }}:{{ .RunnerGroup }} -R "/home/{{ .RunnerUsername }}/actions-runner" || fail "failed to change owner"
ln -s "$CACHED_RUNNER"/actions-runner "/home/{{ .RunnerUsername}}/actions-runner" || fail "failed to create symlink"
Copy link
Member

Choose a reason for hiding this comment

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

You can quote the entire path:

ln -s "$CACHED_RUNNER/actions-runner" "/home/{{ .RunnerUsername}}/actions-runner" || fail "failed to create symlink"

Variables cannot have slashes in them and the shell does the right thing.

Copy link
Author

Choose a reason for hiding this comment

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

.. this change is very much relevant for us since it reduces our azure VM boot times quite significantly. However, we will need some more tweaks and changes, so I will close this one for now and create a new one once we're done.

Copy link
Member

Choose a reason for hiding this comment

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

I wasn't suggesting to not add the change. It was just a nit which can be ignored. The change looked ok. Feel free to reopen when ready.

sudo chown {{ .RunnerUsername }}:{{ .RunnerGroup }} -R "$CACHED_RUNNER"/actions-runner || fail "failed to change owner"
cd /home/{{ .RunnerUsername }}/actions-runner
fi

Expand Down
Loading