Improve scripts, readd vllm, add new iso build mode - "gui", update … #70
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build ISO on selfhosted runner (ROCm, normal) | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
vm-start: | |
if: always() | |
runs-on: ubuntu-latest | |
steps: | |
- name: Save ssh configuration | |
run: | | |
# Create ssh directory | |
mkdir ~/.ssh | |
# Save ssh config | |
echo "${{ secrets.SSH_CONFIG }}" | base64 -d > ~/.ssh/config | |
# Save ssh known hosts | |
echo "${{ secrets.SSH_KNOWN_HOSTS }}" | base64 -d > ~/.ssh/known_hosts | |
# Save ssh private key | |
echo "${{ secrets.SSH_PRIVATE_KEY }}" | base64 -d > /tmp/private.key | |
# Fix permissions for private key | |
chmod 600 /tmp/private.key | |
- name: Wait 0 seconds | |
run: | | |
sleep 0 | |
- name: Wait until Github Actions Runner VM is stopped | |
run: | | |
ok="0" | |
while true; do | |
status=$(ssh runner "virsh domstate GithubActions") | |
if [ "$status" = "shutoff" ]; then | |
if [ "$ok" = "1" ]; then | |
echo "VM is shut off. Exiting." | |
break | |
else | |
sleep $((10 + $RANDOM % 10)) | |
ok="1" | |
fi | |
else | |
ok="0" | |
fi | |
echo "VM is not shut off yet. Waiting for 5 seconds..." | |
sleep 5 | |
done | |
- name: Start Github Actions Runner VM | |
run: | | |
ssh runner "virsh start GithubActions" | |
build: | |
needs: vm-start | |
runs-on: self-hosted | |
steps: | |
- name: Remove previous artifacts | |
run: | | |
sudo rm -fr out/ | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Build image | |
uses: addnab/docker-run-action@v3 | |
with: | |
image: archlinux:latest | |
options: --privileged --rm --volume ${{ github.workspace }}:/workspace | |
run: | | |
# Exit on error | |
set -eu | |
# Enter project directory | |
pushd /workspace | |
# Install dependencies | |
.ci/dependencies.sh | |
# Patch mkarchiso | |
.ci/mkarchiso.sh | |
# Configure to use ROCm | |
.ci/configure.py rocm normal | |
popd | |
# Build image | |
mkarchiso -v -m iso -w /_work -o /workspace/out /workspace | |
- name: Create summary | |
run: | | |
# Exit on error | |
set -eu | |
# Print checksums to summary | |
sha256sum out/* > "$GITHUB_STEP_SUMMARY" | |
- name: Upload artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: archiso-output | |
path: out/ | |
vm-stop: | |
if: always() | |
needs: build | |
runs-on: ubuntu-latest | |
steps: | |
- name: Save ssh configuration | |
run: | | |
# Create ssh directory | |
mkdir ~/.ssh | |
# Save ssh config | |
echo "${{ secrets.SSH_CONFIG }}" | base64 -d > ~/.ssh/config | |
# Save ssh known hosts | |
echo "${{ secrets.SSH_KNOWN_HOSTS }}" | base64 -d > ~/.ssh/known_hosts | |
# Save ssh private key | |
echo "${{ secrets.SSH_PRIVATE_KEY }}" | base64 -d > /tmp/private.key | |
# Fix permissions for private key | |
chmod 600 /tmp/private.key | |
- name: Stop Github Actions Runner VM | |
run: | | |
# Invoke regular shutdown | |
ssh runner "virsh shutdown GithubActions" | |
# Wait 2 minutes | |
sleep 120 |