Skip to content

Commit

Permalink
Merge pull request #148 from perftool-incubator/dev-kmr
Browse files Browse the repository at this point in the history
  • Loading branch information
k-rister authored Oct 8, 2024
2 parents a8879e2 + fc80bbc commit 4610c89
Show file tree
Hide file tree
Showing 8 changed files with 70 additions and 18 deletions.
File renamed without changes.
4 changes: 4 additions & 0 deletions .github/runners/self-hosted/unprivileged/.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
LANG=en_US.UTF-8

ACTIONS_RUNNER_HOOK_JOB_STARTED=/home/manager/actions-runner-hooks/job-started.sh
ACTIONS_RUNNER_HOOK_JOB_COMPLETED=/home/manager/actions-runner-hooks/job-completed.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/bin/bash

# cleanup the workspace
if [ -n "${GITHUB_WORKSPACE}" ]; then
if pushd "${GITHUB_WORKSPACE}"; then
echo "Cleaning up..."
find ! -name '.' ! -name '..' -delete
echo "...cleanup complete"

popd
else
echo "ERROR: Failed to pushd to '${GITHUB_WORKSPACE}'"
exit 1
fi
else
echo "ERROR: GITHUB_WORKSPACE is not defined"
exit 1
fi
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/bin/bash

# cleanup the workspace
if [ -n "${GITHUB_WORKSPACE}" ]; then
if pushd "${GITHUB_WORKSPACE}"; then
echo "Cleaning up..."
find ! -name '.' ! -name '..' -delete
echo "...cleanup complete"

popd
else
echo "ERROR: Failed to pushd to '${GITHUB_WORKSPACE}'"
exit 1
fi
else
echo "ERROR: GITHUB_WORKSPACE is not defined"
exit 1
fi
46 changes: 29 additions & 17 deletions .github/runners/self-hosted/update-runners.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,28 +4,40 @@ pushd $(dirname $0) > /dev/null

runner_user="manager"

if [ ! -e runners.conf ]; then
echo "ERROR: Could not find runners.conf"
exit 1
fi
for runner_type in "privileged" "unprivileged"; do
if pushd ${runner_type}; then
echo "runner_type=${runner_type}"

for runner_ip in $(cat runners.conf); do
echo "runner_ip=${runner_ip}"
if [ ! -e runners.conf ]; then
echo "ERROR: Could not find runners.conf"
exit 1
fi

echo "syncing actions-runner-hooks:"
rsync -av --progress --stats --delete actions-runner-hooks ${runner_user}@${runner_ip}:
for runner_ip in $(cat runners.conf); do
echo "runner_ip=${runner_ip}"

echo "listing actions-runner-hooks:"
ssh ${runner_user}@${runner_ip} "ls -l ~/actions-runner-hooks"
echo "syncing actions-runner-hooks:"
rsync -av --progress --stats --delete actions-runner-hooks ${runner_user}@${runner_ip}:

echo "synching .env:"
rsync -av --progress --stats .env ${runner_user}@${runner_ip}:~/actions-runner/.env
echo "listing actions-runner-hooks:"
ssh ${runner_user}@${runner_ip} "ls -l ~/actions-runner-hooks"

echo "displaying .env:"
ssh ${runner_user}@${runner_ip} "cat ~/actions-runner/.env"
echo "synching .env:"
rsync -av --progress --stats .env ${runner_user}@${runner_ip}:~/actions-runner/.env

echo "restarting the runner:"
ssh ${runner_user}@${runner_ip} "sudo reboot"
echo "displaying .env:"
ssh ${runner_user}@${runner_ip} "cat ~/actions-runner/.env"

echo "##########################################################"
echo "restarting the runner:"
ssh ${runner_user}@${runner_ip} "sudo reboot"

echo "##########################################################"
done

popd

echo "**********************************************************"
else
echo "ERROR: Failed to pushd to ${runner_type}"
fi
done
2 changes: 1 addition & 1 deletion .github/workflows/crucible-tracking.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ jobs:
echo 'ITEM_ID='$item_id >> $GITHUB_ENV
- name: Get date
run: echo "DATE=$(date +"%Y-%m-%d")" >> $GITHUB_ENV
run: echo "DATE=$(date -u +"%Y-%m-%d")" >> $GITHUB_ENV

- name: Set fields
env:
Expand Down

0 comments on commit 4610c89

Please sign in to comment.