From 2909708e02f7dafc7034459c42f9de0ba4d46058 Mon Sep 17 00:00:00 2001 From: Tamal Saha Date: Tue, 3 Oct 2023 07:28:23 -0700 Subject: [PATCH] Update script Signed-off-by: Tamal Saha --- hack/scripts/start-runner.sh | 19 +++++++------------ pkg/providers/firecracker/cloud_init.go | 2 +- 2 files changed, 8 insertions(+), 13 deletions(-) diff --git a/hack/scripts/start-runner.sh b/hack/scripts/start-runner.sh index 021fe4a9..4a1fd0b5 100755 --- a/hack/scripts/start-runner.sh +++ b/hack/scripts/start-runner.sh @@ -192,16 +192,11 @@ sudo -E -u ${svc_user} ./config.sh --unattended --url $runner_url --token $RUNNE # Configuring as a service #--------------------------------------- echo -# echo "Configuring as a service ..." -# prefix="" -# if [ "${runner_plat}" == "linux" ]; then -# prefix="sudo " -# fi - -# ${prefix}./svc.sh install ${svc_user} -# ${prefix}./svc.sh start - -# echo "USER=$USER , svc_user=${svc_user}" -# whoami +echo "Configuring as a service ..." +prefix="" +if [ "${runner_plat}" == "linux" ]; then + prefix="sudo " +fi -sudo -E -u ${svc_user} ./run.sh +${prefix}./svc.sh install ${svc_user} +${prefix}./svc.sh start diff --git a/pkg/providers/firecracker/cloud_init.go b/pkg/providers/firecracker/cloud_init.go index d53f19da..c218d133 100644 --- a/pkg/providers/firecracker/cloud_init.go +++ b/pkg/providers/firecracker/cloud_init.go @@ -237,7 +237,7 @@ export RUNNER_NAME=%s # curl -s https://raw.githubusercontent.com/actions/runner/main/scripts/create-latest-svc.sh | bash -s -- -s ${RUNNER_OWNER} -n ${RUNNER_NAME} -f # ephemeral runner: https://docs.github.com/en/actions/hosting-your-own-runners/autoscaling-with-self-hosted-runners#using-ephemeral-runners-for-autoscaling # https://github.blog/changelog/2021-09-20-github-actions-ephemeral-self-hosted-runners-new-webhooks-for-auto-scaling/ -curl -fsSL https://gist.githubusercontent.com/tamalsaha/af2f99c80f84410253bd1e532bdfabc7/raw/49e6cbdd461afe4cff930e2a5323507827b7718a/start-runner.sh | bash -s -- -n ${RUNNER_NAME} -l firecracker -f +curl -fsSL https://gist.githubusercontent.com/tamalsaha/af2f99c80f84410253bd1e532bdfabc7/raw/4e6cff5d2a391d1b625e72a1cc15ff6560d5863c/start-runner.sh | bash -s -- -n ${RUNNER_NAME} -l firecracker -f `, DefaultOptions.NatsURL, DefaultOptions.NatsUsername, DefaultOptions.NatsPassword, ghToken, runnerName) udBytes, err := PrepareCloudInitUserData(userData, script)