Skip to content

Commit 6a04cda

Browse files
committed
feat: restructure workflows and add deployment for ARC Runner with Docker support
1 parent 3fe517f commit 6a04cda

File tree

8 files changed

+498
-20
lines changed

8 files changed

+498
-20
lines changed

.github/workflows/build-arc-docker.yaml

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@ on:
55
paths:
66
- 'robot.yaml'
77
- 'conda.yaml'
8-
- 'arc-docker/Dockerfile'
8+
- 'repos/fetch-repos/Dockerfile'
99
pull_request:
1010
paths:
1111
- 'robot.yaml'
1212
- 'conda.yaml'
13-
- 'arc-docker/Dockerfile'
13+
- 'repos/fetch-repos/Dockerfile'
1414
workflow_dispatch:
1515

1616
env:
@@ -39,10 +39,10 @@ jobs:
3939
username: ${{ github.actor }}
4040
password: ${{ secrets.CR_PAT }}
4141

42-
- name: Copy configuration files to arc-docker directory
42+
- name: Copy configuration files to repos/fetch-repos directory
4343
run: |
44-
cp robot.yaml arc-docker/
45-
cp conda.yaml arc-docker/
44+
cp robot.yaml repos/fetch-repos/
45+
cp conda.yaml repos/fetch-repos/
4646
4747
- name: Extract metadata
4848
id: meta
@@ -64,8 +64,8 @@ jobs:
6464
- name: Build and push Docker image
6565
uses: docker/[email protected]
6666
with:
67-
context: ./arc-docker
68-
file: ./arc-docker/Dockerfile
67+
context: ./repos/fetch-repos
68+
file: ./repos/fetch-repos/Dockerfile
6969
push: true
7070
tags: ${{ steps.meta.outputs.tags }}
7171
labels: ${{ steps.meta.outputs.labels }}
@@ -75,16 +75,16 @@ jobs:
7575

7676
- name: Clean up copied files
7777
run: |
78-
rm -f arc-docker/robot.yaml arc-docker/conda.yaml
78+
rm -f repos/fetch-repos/robot.yaml repos/fetch-repos/conda.yaml
7979
8080
- name: Update image tag in values.yaml only
8181
env:
8282
NEW_TAG: ${{ steps.set_tag.outputs.NEW_TAG }}
8383
uses: mikefarah/[email protected]
8484
with:
8585
cmd: |
86-
echo "Updating arc-docker/values.yaml to use tag $NEW_TAG"
87-
yq -i '.template.spec.containers[0].image = env(NEW_TAG)' arc-docker/values.yaml
86+
echo "Updating repos/fetch-repos/values.yaml to use tag $NEW_TAG"
87+
yq -i '.template.spec.containers[0].image = env(NEW_TAG)' repos/fetch-repos/values.yaml
8888
8989
- name: Create or update tag-bump PR
9090
uses: peter-evans/[email protected]
@@ -96,7 +96,7 @@ jobs:
9696
title: "chore: bump runner image → ${{ steps.set_tag.outputs.NEW_TAG }}"
9797
body: |
9898
Automated build updated:
99-
arc-docker/values.yaml
99+
repos/fetch-repos/values.yaml
100100
101101
_Generated by the Build & Push workflow._
102102
reviewers: joshyorko

.github/workflows/deploy-arc.yaml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: Deploy ARC Runner
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
paths:
8+
- 'repos/fetch-repos/values.yaml'
9+
10+
jobs:
11+
deploy:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Checkout repository
15+
uses: actions/checkout@v4
16+
17+
- name: Set up Helm
18+
uses: azure/setup-helm@v4
19+
with:
20+
version: 'latest'
21+
22+
- name: Set up kubectl
23+
uses: azure/setup-kubectl@v4
24+
with:
25+
version: 'latest'
26+
27+
- name: Set up Kubeconfig
28+
run: |
29+
mkdir -p $HOME/.kube
30+
echo "${{ secrets.KUBECONFIG_DATA }}" | base64 -d > $HOME/.kube/config
31+
echo "Kubeconfig created at $HOME/.kube/config"
32+
kubectl get nodes # Test command
33+
env:
34+
KUBECONFIG_DATA: ${{ secrets.KUBECONFIG_DATA }}
35+
36+
- name: Create ARC Private Key file from secret
37+
run: |
38+
# The filename must match what install-upgrade-arc.sh expects or can find.
39+
echo "${{ secrets.ARC_PRIVATE_KEY }}" | base64 -d > arc-private-key.pem
40+
echo "arc-private-key.pem created from secret."
41+
env:
42+
ARC_PRIVATE_KEY: ${{ secrets.ARC_PRIVATE_KEY }}
43+
44+
- name: Run install script
45+
run: |
46+
chmod +x scripts/install-upgrade-arc.sh
47+
./scripts/install-upgrade-arc.sh fetch-repos

.gitignore

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,4 @@ testrun/*
1818
*.pkl
1919
.venv/
2020

21-
# Ignore copied configuration files in arc-docker directory
22-
arc-docker/robot.yaml
23-
arc-docker/conda.yaml
21+

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ author: Joshua Yorko, [@joshyorko](https://github.com/joshyorko), joshua.yorko@g
4040
- `output/` — Output directory for artifacts and results.
4141
- `.github/workflows/` — Contains GitHub Actions workflows:
4242
- `fetch-repos-matrix.yaml` — Matrix-based producer-consumer workflow for parallel execution. This is the primary workflow for the bot.
43-
- `arc-docker/` — Contains files for building a custom GitHub Actions Runner image with pre-installed dependencies:
43+
- `repos/` — Contains files for building a custom GitHub Actions Runner image with pre-installed dependencies:
4444
- `Dockerfile` — Defines the Docker image build process, including Node.js, Playwright, and Robocorp RCC.
4545
- `conda.yaml` — Conda environment specification for the Docker image, ensuring necessary Python packages are available.
4646
- `robot.yaml` — Robocorp robot configuration specific to the Docker environment, if needed.
@@ -93,7 +93,7 @@ author: Joshua Yorko, [@joshyorko](https://github.com/joshyorko), joshua.yorko@g
9393
- The primary workflow for this project.
9494
- Supports parallel consumer jobs using matrix strategy.
9595
- Accepts `org_name` and `max_workers` as inputs.
96-
- Can be configured to use the custom Docker image built from the `arc-docker` directory for self-hosted runners, ensuring all dependencies are pre-installed for faster and more reliable execution.
96+
- Can be configured to use the custom Docker image built from the `repos` directory for self-hosted runners, ensuring all dependencies are pre-installed for faster and more reliable execution.
9797

9898
---
9999

arc-docker/Dockerfile renamed to repos/fetch-repos/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ RUN curl -o rcc https://cdn.sema4.ai/rcc/releases/latest/linux64/rcc \
2626
&& mv rcc /usr/local/bin/
2727

2828
# Copy configuration and values for fetch-repos
29-
# These files are copied to arc-docker/ by the GitHub Action before building
29+
# These files are copied to repos/ by the GitHub Action before building
3030
COPY conda.yaml /workspace/conda.yaml
3131
COPY robot.yaml /workspace/robot.yaml
3232

arc-docker/values.yaml renamed to repos/fetch-repos/values.yaml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,19 @@
11
# --------------------------------------------------------------------
22
# GitHub configuration
33
# --------------------------------------------------------------------
4-
githubConfigUrl: "https://github.com/joshyorko/fetch-repos-bot" # Replace with your GitHub URL
4+
githubConfigUrl: "https://github.com/joshyorko/fetch-repos-bot" # Replace with your GitHub URL
5+
56
githubConfigSecret: pre-defined-secret
7+
68
# --------------------------------------------------------------------
79
# Runner scale set configuration
810
# --------------------------------------------------------------------
9-
runnerScaleSetName: "fetch-repos-bot-runner-k8s" # Name of the runner scale set
11+
runnerScaleSetName: "fetch-repos-bot-runner-k8s" # Name of the runner scale set
12+
13+
1014
# --------------------------------------------------------------------
1115
# Runner Pod template configuration
1216
# --------------------------------------------------------------------
13-
1417
template:
1518
spec:
1619
dnsPolicy: None

0 commit comments

Comments
 (0)