Brodey | Build system #6
Workflow file for this run
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: Artifact Build + Deploy | |
on: | |
pull_request: | |
branches: [main] | |
# on: | |
# push: | |
# branches: | |
# - main | |
concurrency: | |
group: ci | |
cancel-in-progress: true | |
jobs: | |
tests: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Set up Tailscale | |
uses: tailscale/github-action@v2 | |
with: | |
oauth-client-id: k4oU8AFYf121CNTRL | |
oauth-secret: ${{ secrets.TS_OAUTH_SECRET }} | |
tags: tag:ci,tag:production | |
- name: Verify Tailscale IP | |
run: tailscale ip | |
- name: Run tests | |
run: | | |
ssh -o StrictHostKeyChecking=no -i ~/.ssh/id_rsa [email protected] 'bash -s' <<'EOF' | |
#!/bin/bash | |
cd /home/brodey/scuda-latest | |
ls | |
SCUDA_PORT=14834 ./local.sh server & | |
sleep 5 | |
export SCUDA_SERVER=0.0.0.0:14834 | |
test_output=$(./local.sh test) | |
test_exit_code=$? | |
if [ $test_exit_code -eq 0 ]; then | |
echo "Tests passed successfully!" | |
fi | |
kill $(ps aux | grep '[s]cuda' | awk '{print $2}') | |
echo "server process and its children terminated. exiting..." | |
exit $test_exit_code | |
EOF | |
build-and-artifacts: | |
runs-on: ubuntu-latest | |
needs: tests | |
strategy: | |
matrix: | |
cuda_version: [12.0.0, 12.1.0, 12.2.0, 12.3.0, 12.4.0] | |
distro_version: [22.04] | |
os_distro: [ubuntu] | |
cudnn_tag: [cudnn] | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Build Docker Image | |
run: | | |
docker build . -f Dockerfile.build -t scuda-builder-${{ matrix.cuda_version }} \ | |
--build-arg CUDA_VERSION=${{ matrix.cuda_version }} \ | |
--build-arg DISTRO_VERSION=${{ matrix.distro_version }} \ | |
--build-arg OS_DISTRO=${{ matrix.os_distro }} \ | |
--build-arg CUDNN_TAG=${{ matrix.cudnn_tag }} | |
- name: Extract Artifacts from Docker | |
run: | | |
container_id=$(docker create scuda-builder-${{ matrix.cuda_version }}) | |
docker cp $container_id:/home/libscuda_${{ matrix.cuda_version }}.so ./libscuda_${{ matrix.cuda_version }}.so | |
docker cp $container_id:/home/server_${{ matrix.cuda_version }}.so ./server_${{ matrix.cuda_version }}.so | |
docker rm $container_id | |
- name: Upload Artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: scuda-artifacts-${{ matrix.cuda_version }} | |
path: | | |
./libscuda_${{ matrix.cuda_version }}.so | |
./server_${{ matrix.cuda_version }}.so |