-
Notifications
You must be signed in to change notification settings - Fork 42
99 lines (77 loc) · 2.62 KB
/
artifact-build-and-deploy.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
name: Scuda CI
# on:
# push:
# branches:
# - main
on:
pull_request:
branches: [main]
workflow_dispatch:
inputs:
cuda_version:
description: "CUDA version for the Docker build"
required: true
default: "12.4.0"
distro_version:
description: "Distribution version for the Docker build"
required: true
default: "22.04"
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
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Build Docker Image with Custom Args
run: |
docker build . -f Dockerfile.build -t scuda-builder \
--build-arg CUDA_VERSION=${{ github.event.inputs.cuda_version }} \
--build-arg DISTRO_VERSION=${{ github.event.inputs.distro_version }}
- name: Extract Artifacts from Docker
run: |
container_id=$(docker create scuda-builder)
docker cp $container_id:/home/libscuda_${{ github.event.inputs.cuda_version }}.so ./libscuda_${{ github.event.inputs.cuda_version }}.so
docker cp $container_id:/home/server_${{ github.event.inputs.cuda_version }}.so ./server_${{ github.event.inputs.cuda_version }}.so
docker rm $container_id
- name: Upload Artifacts
uses: actions/upload-artifact@v4
with:
name: scuda-artifacts
path: |
./libscuda_${{ github.event.inputs.cuda_version }}.so
./server_${{ github.event.inputs.cuda_version }}.so