Skip to content

Commit

Permalink
fix gh runner setup and integration test
Browse files Browse the repository at this point in the history
Signed-off-by: JooYoung Park <[email protected]>
  • Loading branch information
JooyoungPark73 committed Mar 5, 2024
1 parent 07c149a commit e493f69
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 13 deletions.
7 changes: 6 additions & 1 deletion .github/workflows/integration_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,11 @@ jobs:
sudo apt update
sudo apt install git -y
- name: Add rsync
run: |
sudo apt update
sudo apt install rsync -y
- name: Check out code into the Go module directory
uses: actions/checkout@v4
with:
Expand All @@ -68,7 +73,7 @@ jobs:
if: ${{ always() }}
uses: actions/upload-artifact@v4
with:
name: ctrd-logs
name: ctrd-logs-${{ matrix.test-name }}
path: |
/tmp/ctrd-logs/
${{ github.workspace }}/*.log
Expand Down
20 changes: 12 additions & 8 deletions scripts/github_runner/conf.json
Original file line number Diff line number Diff line change
@@ -1,20 +1,24 @@
{
"ghOrg": "<GitHub account>",
"ghBranch": "<GitHub branch>",
"ghPat": "<GitHub PAT>",
"hostUsername": "ubuntu",
"hostUsername": "root",
"runners": {
"pc91.cloudlab.umass.edu": {
"10.96.190.31": {
"type": "cri",
"sandbox": "firecracker"
},
"pc101.cloudlab.umass.edu": {
"10.96.190.176": {
"type": "cri",
"sandbox": "gvisor",
"restart": true
"sandbox": "gvisor"
},
"pc72.cloudlab.umass.edu": {
"10.96.190.94": {
"type": "integ",
"num": 2
"num": 2,
"restart": false
},
"10.96.190.53": {
"type": "profile"
}
}
}
}
10 changes: 9 additions & 1 deletion scripts/github_runner/deploy_runners.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ type RunnerConf struct {

type DeployerConf struct {
GhOrg string `json:"ghOrg"`
GhBranch string `json:"ghBranch"`
GhPat string `json:"ghPat"`
HostUsername string `json:"hostUsername"`
RunnerConfs map[string]RunnerConf `json:"runners"`
Expand Down Expand Up @@ -121,8 +122,15 @@ func deployRunner(host string, runnerConf RunnerConf, deployerConf *DeployerConf
log.Fatalf("Failed to connect to %s@%s: %s", deployerConf.HostUsername, host, err)
}

log.Debug("Remove unattended-upgrades")
out, err := client.Exec("sudo systemctl stop unattended-upgrades && sudo apt remove -y unattended-upgrades")
log.Debug(string(out))
if err != nil {
log.Fatalf("Cannot disable unattended-upgrades")
}

log.Debugf("Cloning vHive repository on %s@%s", deployerConf.HostUsername, host)
out, err := client.Exec(fmt.Sprintf("rm -rf ./vhive ./actions-runner && git clone --depth=1 https://github.com/%s/vhive", deployerConf.GhOrg))
out, err = client.Exec(fmt.Sprintf("rm -rf ./vhive ./actions-runner && git clone --depth=1 --branch=%s https://github.com/%s/vhive", deployerConf.GhBranch, deployerConf.GhOrg))
log.Debug(string(out))
if err != nil {
log.Fatalf("Failed to clone vHive repository on %s@%s: %s", deployerConf.HostUsername, host, err)
Expand Down
8 changes: 5 additions & 3 deletions scripts/github_runner/setup_bare_metal_runner.sh
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,12 @@ else
echo "No service file, no need to clean"
fi


VHIVE_ROOT="$(git rev-parse --show-toplevel)"
"$VHIVE_ROOT"/scripts/cloudlab/setup_node.sh "$SANDBOX"
SCRIPTS=$VHIVE_ROOT/scripts

source $SCRIPTS/install_go.sh
pushd $SCRIPTS && go build -o setup_tool && popd
$SCRIPTS/setup_tool setup_node "$SANDBOX"

cd
export RUNNER_ALLOW_RUNASROOT=1
Expand All @@ -58,4 +61,3 @@ RUNNER_LABEL=$SANDBOX-cri
curl -s https://raw.githubusercontent.com/actions/runner/main/scripts/create-latest-svc.sh | bash -s - -s "$GH_ORG"/vhive -n "$RUNNER_NAME" -l "$RUNNER_LABEL" -f

echo "0 4 * * * root reboot" | sudo tee -a /etc/crontab

0 comments on commit e493f69

Please sign in to comment.