Skip to content

Commit 43ae8ad

Browse files
chore: remove gce-github-runner, use GitHub-hosted runners (PDE-229)
Remove self-hosted GCE runner infrastructure in favor of GitHub-hosted runners. This eliminates the security risk from shared service accounts mounted into workflows. Changes: - Remove create-runner and delete-runner jobs - Switch to ubuntu-latest runners - GCP auth via Workload Identity Federation remains unchanged Co-authored-by: Ona <no-reply@ona.com>
1 parent ae4bafe commit 43ae8ad

3 files changed

Lines changed: 23 additions & 54 deletions

File tree

.github/workflows/pull-request.yml

Lines changed: 21 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -3,29 +3,26 @@ on:
33
pull_request:
44

55
jobs:
6-
create-runner:
7-
uses: gitpod-io/gce-github-runner/.github/workflows/create-vm.yml@main
8-
secrets:
9-
runner_token: ${{ secrets.SELF_HOSTED_GITHUB_RUNNER_TOKEN }}
10-
gcp_credentials: ${{ secrets.SELF_HOSTED_GITHUB_RUNNER_GCP_CREDENTIALS }}
11-
concurrency:
12-
group: ${{ github.ref == 'refs/heads/main' && github.run_id || github.sha }}-create-runner
13-
cancel-in-progress: false
14-
156
build:
16-
runs-on: ${{ needs.create-runner.outputs.label }}
17-
needs: create-runner
7+
runs-on: ubuntu-latest
188
concurrency:
199
group: ${{ github.ref == 'refs/heads/main' && github.run_id || github.sha }}-build
2010
cancel-in-progress: true
2111
env:
2212
DAZZLE_VERSION: 0.1.17
2313
BUILDKIT_VERSION: 0.12.3
2414
steps:
15+
- name: 🧹 Free disk space
16+
run: |
17+
echo "Before cleanup:"
18+
df -h
19+
sudo rm -rf /usr/share/dotnet /usr/local/lib/android /opt/ghc /opt/hostedtoolcache/CodeQL
20+
sudo docker image prune --all --force
21+
echo "After cleanup:"
22+
df -h
23+
2524
- name: 📥 Checkout workspace-images
2625
uses: actions/checkout@v5
27-
with:
28-
repository: gitpod-io/workspace-images
2926

3027
- name: 🔧 Setup pre-commit
3128
run: |
@@ -40,14 +37,20 @@ jobs:
4037
4138
- name: 🔆 Install dazzle
4239
run: |
43-
curl -sSL https://github.com/gitpod-io/dazzle/releases/download/v${{env.DAZZLE_VERSION}}/dazzle_${{env.DAZZLE_VERSION}}_Linux_x86_64.tar.gz | sudo tar -xvz -C /usr/local/bin
40+
curl -fsSL --retry 3 --retry-delay 5 -o /tmp/dazzle.tar.gz https://github.com/gitpod-io/dazzle/releases/download/v${{env.DAZZLE_VERSION}}/dazzle_${{env.DAZZLE_VERSION}}_Linux_x86_64.tar.gz
41+
sudo tar -xvzf /tmp/dazzle.tar.gz -C /usr/local/bin
42+
rm /tmp/dazzle.tar.gz
4443
4544
- name: 🏗️ Setup buildkit
4645
run: |
47-
curl -sSL https://github.com/moby/buildkit/releases/download/v${{env.BUILDKIT_VERSION}}/buildkit-v${{env.BUILDKIT_VERSION}}.linux-amd64.tar.gz | sudo tar xvz -C /usr
48-
sudo buildkitd --oci-worker=true --oci-worker-net=host --debug --group docker &
49-
sudo su -c "while ! test -S /run/buildkit/buildkitd.sock; do sleep 0.1; done"
50-
sudo chmod +777 /run/buildkit/buildkitd.sock
46+
curl -fsSL --retry 3 --retry-delay 5 -o /tmp/buildkit.tar.gz https://github.com/moby/buildkit/releases/download/v${{env.BUILDKIT_VERSION}}/buildkit-v${{env.BUILDKIT_VERSION}}.linux-amd64.tar.gz
47+
sudo tar -xvzf /tmp/buildkit.tar.gz -C /usr
48+
rm /tmp/buildkit.tar.gz
49+
sudo nohup buildkitd --oci-worker=true --oci-worker-net=host --debug --group docker > /tmp/buildkitd.log 2>&1 &
50+
echo "Waiting for buildkitd socket..."
51+
timeout 30 bash -c 'while ! test -S /run/buildkit/buildkitd.sock; do sleep 0.5; done'
52+
sudo chmod 777 /run/buildkit/buildkitd.sock
53+
echo "buildkitd is ready"
5154
5255
# A hack as GH action does not allow you to force override cache storing if there was a cache hit
5356
# https://github.com/actions/cache/issues/628#issuecomment-986118455
@@ -76,15 +79,3 @@ jobs:
7679
- name: 🖇️ Dazzle combine
7780
run: |
7881
dazzle combine localhost:5000/workspace-base-images --all
79-
80-
delete-runner:
81-
if: always()
82-
needs:
83-
- create-runner
84-
- build
85-
uses: gitpod-io/gce-github-runner/.github/workflows/delete-vm.yml@main
86-
secrets:
87-
gcp_credentials: ${{ secrets.SELF_HOSTED_GITHUB_RUNNER_GCP_CREDENTIALS }}
88-
with:
89-
runner-label: ${{ needs.create-runner.outputs.label }}
90-
machine-zone: ${{ needs.create-runner.outputs.machine-zone }}

.github/workflows/push-main.yml

Lines changed: 1 addition & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -6,24 +6,14 @@ on:
66
- main
77

88
jobs:
9-
create-runner:
10-
uses: gitpod-io/gce-github-runner/.github/workflows/create-vm.yml@main
11-
secrets:
12-
runner_token: ${{ secrets.SELF_HOSTED_GITHUB_RUNNER_TOKEN }}
13-
gcp_credentials: ${{ secrets.SELF_HOSTED_GITHUB_RUNNER_GCP_CREDENTIALS }}
14-
concurrency:
15-
group: ${{ github.ref == 'refs/heads/main' && github.run_id || github.sha }}-create-runner
16-
cancel-in-progress: false
17-
189
# Build images using artifactory as image registry.
1910
# To implement manual approvals, the workflow uses an Environment.
2011
#
2112
# From your GitHub repo click Settings. In the left menu, click Environments.
2213
# Click New environment, set the name production, and click Configure environment.
2314
# Check the "Required reviewers" box and enter at least one user or team name.
2415
sync:
25-
runs-on: ${{ needs.create-runner.outputs.label }}
26-
needs: create-runner
16+
runs-on: ubuntu-latest
2717
concurrency:
2818
group: ${{ github.ref == 'refs/heads/main' && github.run_id || github.sha }}-sync
2919
cancel-in-progress: true
@@ -199,15 +189,3 @@ jobs:
199189
--keep-going \
200190
--dest docker \
201191
/.github/promote-images.yml "${DH_IMAGE_REGISTRY}/gitpod"
202-
203-
delete-runner:
204-
if: always()
205-
needs:
206-
- create-runner
207-
- sync
208-
uses: gitpod-io/gce-github-runner/.github/workflows/delete-vm.yml@main
209-
secrets:
210-
gcp_credentials: ${{ secrets.SELF_HOSTED_GITHUB_RUNNER_GCP_CREDENTIALS }}
211-
with:
212-
runner-label: ${{ needs.create-runner.outputs.label }}
213-
machine-zone: ${{ needs.create-runner.outputs.machine-zone }}

chunks/tool-vnc/gp-vncsession

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ if test ! -e /tmp/.X0-lock; then {
5252
# Start vncserver
5353
log::info "Starting tigerVNC server on port $VNC_PORT"
5454
# vncserver -kill "${DISPLAY}"
55-
start_service "$(command -v vncserver)" -geometry "${TIGERVNC_GEOMETRY:-1920x1080}" -SecurityTypes None $DISPLAY
55+
start_service "$(command -v vncserver)" -geometry "${TIGERVNC_GEOMETRY:-1920x1080}" -SecurityTypes None "$DISPLAY"
5656

5757
# Wait
5858
log::info "Waiting for the desktop to be fully loaded ..."

0 commit comments

Comments
 (0)