Skip to content

Commit b733e75

Browse files
authored
Merge pull request #1 from vaggeliskls/feat/upgrade
feat: upgrade
2 parents e8e9b9d + 4ed9694 commit b733e75

File tree

7 files changed

+15
-16
lines changed

7 files changed

+15
-16
lines changed

.env

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1+
# Runners settings
2+
# ex. org: https://github.com/<org name>/staging-monorepo or repo: https://github.com/<org name>/<repo name>
13
PAT=<Replace with your personal access token>
2-
ORGANIZATION_URL=<Organization url>
4+
RUNNER_URL=<org url or repo url>
35
RUNNERS=2
46
# Vagrant image settings
57
MEMORY=8000 # 8GB

.github/pull_request_template.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Current Behaviour
2+
3+
# Expected Behaviour

Dockerfile

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,15 @@ FROM ghcr.io/vaggeliskls/windows-in-docker-container:latest
33

44
# Github action settings
55
ENV GITHUB_RUNNER_NAME=windows_x64_vagrant
6-
ENV GITHUB_RUNNER_VERSION=2.307.1
6+
ENV GITHUB_RUNNER_VERSION=2.315.0
77
ENV GITHUB_RUNNER_FILE=actions-runner-win-x64-${GITHUB_RUNNER_VERSION}.zip
88
ENV GITHUB_RUNNER_URL=https://github.com/actions/runner/releases/download/v${GITHUB_RUNNER_VERSION}/${GITHUB_RUNNER_FILE}
99
ENV GITHUB_RUNNER_LABELS=windows,win_x64,windows_x64,windows_vagrant_action
1010
ENV PRIVILEGED=true
1111
ENV INTERACTIVE=true
1212
ENV DOLLAR=$
1313

14-
RUN rm -rf /Vagrantfile
15-
RUN rm -rf /Vagrantfile.tmp
16-
RUN rm -rf /startup.sh
14+
RUN rm -rf /Vagrantfile /Vagrantfile.tmp /startup.sh
1715

1816
COPY Vagrantfile /Vagrantfile.tmp
1917
COPY startup.sh /

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@ A implementation of windows github custom runner (x64) based on vagrant VM, libv
99
# Deployment Guide
1010

1111
1. Create/Update the environmental file `.env`
12-
- Organization URL
12+
- Runner URL
1313
- PAT: Personal access token
1414
```
1515
PAT=<Replace with your personal access token>
16-
ORGANIZATION_URL=<Organization url>
16+
RUNNER_URL=<runner url>
1717
RUNNERS=1
1818
# Vagrant image settings
1919
MEMORY=8000 # 8GB

Vagrantfile

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
Vagrant.configure("2") do |config|
22

3-
config.vm.box = "peru/windows-server-2022-standard-x64-eval"
3+
config.vm.box = "${VAGRANT_BOX}"
44
config.vm.network "private_network", ip: "192.168.121.10"
55
config.vm.network "forwarded_port", guest: 445, host: 445
66
config.vm.provision "shell", inline: "Set-NetFirewallProfile -Profile Domain,Public,Private -Enabled False"
77
config.vm.provider "libvirt" do |libvirt|
88
libvirt.memory = ${MEMORY}
99
libvirt.cpus = ${CPU}
1010
libvirt.machine_virtual_size = ${DISK_SIZE}
11+
libvirt.forward_ssh_port = true
1112
end
1213
config.winrm.max_tries = 300 # default is 20
1314
config.winrm.retry_delay = 5 #seconds. This is the defaul value and just here for documentation.
@@ -42,7 +43,7 @@ Vagrant.configure("2") do |config|
4243
Write-Host "Running $runner";
4344
$random = -join ((48..57) + (97..122) | Get-Random -Count 8 | % {[char]$_});
4445
Expand-Archive -LiteralPath ${GITHUB_RUNNER_FILE} -DestinationPath runner-$random -Force;
45-
Invoke-Expression -Command "C:\\runner-$random\\config.cmd --name ${GITHUB_RUNNER_NAME}_$random --replace --unattended --url ${ORGANIZATION_URL} --labels ${GITHUB_RUNNER_LABELS} --pat ${PAT}";
46+
Invoke-Expression -Command "C:\\runner-$random\\config.cmd --name ${GITHUB_RUNNER_NAME}_$random --replace --unattended --url ${RUNNER_URL} --labels ${GITHUB_RUNNER_LABELS} --pat ${PAT}";
4647
Start-Process "C:\\runner-$random\\run.cmd" -Credential ($credentials);
4748
}
4849
SHELL

docker-compose.yml

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ version: "3.9"
22

33
services:
44
win10:
5+
image: ghcr.io/vaggeliskls/windows-github-custom-runner:latest
56
build:
67
dockerfile: ./Dockerfile
78
context: .
@@ -10,14 +11,8 @@ services:
1011
tty: true
1112
privileged: true
1213
# runtime: nvidia
13-
cap_add:
14-
- NET_ADMIN
15-
- SYS_ADMIN
1614
volumes:
1715
- /sys/fs/cgroup:/sys/fs/cgroup
18-
devices:
19-
- /dev/kvm
20-
- /dev/net/tun
2116
ports:
2217
- 3389:3389
2318
deploy:

startup.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ export RANDOM_STR=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 10 | head -n
88
if [ ! -f Vagrantfile ]
99
then
1010
envsubst \
11-
'${PRIVILEGED},${INTERACTIVE},${MEMORY},${CPU},${DISK_SIZE},${GITHUB_RUNNER_FILE},${GITHUB_RUNNER_NAME},${RANDOM_STR},${RUNNERS},${GITHUB_RUNNER_LABELS},${ORGANIZATION_URL},${PAT},${GITHUB_RUNNER_URL}' \
11+
'${VAGRANT_BOX},${PRIVILEGED},${INTERACTIVE},${MEMORY},${CPU},${DISK_SIZE},${GITHUB_RUNNER_FILE},${GITHUB_RUNNER_NAME},${RANDOM_STR},${RUNNERS},${GITHUB_RUNNER_LABELS},${RUNNER_URL},${PAT},${GITHUB_RUNNER_URL}' \
1212
< Vagrantfile.tmp > Vagrantfile
1313
fi
1414

0 commit comments

Comments
 (0)