Skip to content

Commit 26096c1

Browse files
authored
Add self hosted runners to ci (needed for cuda related kernels) (#464)
1 parent 569e5d7 commit 26096c1

1 file changed

Lines changed: 47 additions & 1 deletion

File tree

.github/workflows/main.yml

Lines changed: 47 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,60 @@ concurrency:
1616
cancel-in-progress: true
1717

1818
jobs:
19+
prepare-dell:
20+
name: Activate self-host infrastructure
21+
runs-on: [self-hosted, spotter]
22+
steps:
23+
- name: Send Magic Packet
24+
env:
25+
TARGET_IP: 192.168.100.30
26+
MAC_ADDR: a4:bb:6d:51:d5:d2
27+
# The container has no ping, emulate it.
28+
run: |
29+
# Mask the IP and potential broadcast to keep logs clean
30+
echo "::add-mask::$MAC_ADDR"
31+
echo "::add-mask::$BROADCAST"
32+
echo "::add-mask::$TARGET_IP"
33+
BROADCAST=$(echo $TARGET_IP | sed 's/\.[0-9]*$/ .255/' | tr -d ' ')
34+
PING="timeout 1 bash -c 'cat < /dev/null > /dev/tcp/$TARGET_IP/22' 2>/dev/null"
35+
36+
# Install tool silently
37+
sudo apt-get update -qq && sudo apt-get install -y -qq wakeonlan > /dev/null
38+
39+
# Check if already awake (using the Bash TCP PING variable)
40+
if eval "$PING"; then
41+
echo "Target machine is already awake. Exiting."
42+
exit 0
43+
fi
44+
45+
# If offline, send WoL
46+
echo "Machine is offline. Sending WoL..."
47+
wakeonlan -i $BROADCAST $MAC_ADDR > /dev/null
48+
49+
# Wait & Verify Loop (checks every 10s for 4 minutes)
50+
echo "Waiting for response (checking Port 22)..."
51+
for i in {1..24}; do
52+
if eval "$PING"; then
53+
echo "Machine is online and SSH is ready."
54+
exit 0
55+
fi
56+
sleep 10
57+
done
58+
59+
echo "Error: Target hardware did not respond within the timeout period."
60+
exit 1
61+
1962
build:
20-
63+
needs: prepare-dell
2164
runs-on: ${{ matrix.os }}
2265

2366
strategy:
2467
fail-fast: false
2568
matrix:
2669
include:
70+
- name: selfh-ubu22-x86
71+
os: [self-hosted, cuda, heavy]
72+
micromamba_shell_init: bash
2773
- name: ubu24
2874
os: ubuntu-24.04
2975
micromamba_shell_init: bash

0 commit comments

Comments
 (0)