-
Notifications
You must be signed in to change notification settings - Fork 3
76 lines (62 loc) · 2.76 KB
/
getting-started.yml
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
# File: getting-started.yml
# Author: Ryoichi Ando ([email protected])
# License: Apache v2.0
name: Getting Started
on:
workflow_dispatch:
env:
DOCKER_IMAGE: nvidia/cuda:11.8.0-devel-ubuntu22.04
TMP_CONTAINER_NAME: tmp-ppf-dev
TMP_ROOT: /root/ppf-contact-solver
jobs:
headless:
runs-on: ppf-contact-solver-NVIDIA # replace with your runner name
timeout-minutes: 15
steps:
- name: check out repo
uses: actions/checkout@v3
- name: print info
run: bash .github/workflows/print-info.sh
- name: prepare env
run: |
echo "EXEC=docker exec ${{env.TMP_CONTAINER_NAME}}" >> $GITHUB_ENV
echo "EXEC_W=docker exec -w ${{env.TMP_ROOT}} ${{env.TMP_CONTAINER_NAME}}" >> $GITHUB_ENV
- name: check env
run: |
echo "DOCKER_IMAGE: $DOCKER_IMAGE"
echo "TMP_CONTAINER_NAME: $TMP_CONTAINER_NAME"
echo "TMP_ROOT: $TMP_ROOT"
echo "EXEC: $EXEC"
echo "EXEC_W: $EXEC_W"
# optional
#
# - name: install NVIDIA container toolkit
# run: |
# curl -fSsL -O https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/cuda-keyring_1.1-1_all.deb
# sudo dpkg -i cuda-keyring_1.1-1_all.deb
# sudo apt-get update
# sudo apt-get -y install cuda-toolkit-12-6
# curl -fsSL https://nvidia.github.io/libnvidia-container/gpgkey | sudo gpg --dearmor -o /usr/share/keyrings/nvidia-container-toolkit-keyring.gpg && curl -s -L https://nvidia.github.io/libnvidia-container/stable/deb/nvidia-container-toolkit.list | sed 's#deb https://#deb [signed-by=/usr/share/keyrings/nvidia-container-toolkit-keyring.gpg] https://#g' | sudo tee /etc/apt/sources.list.d/nvidia-container-toolkit.list
# sudo chmod 644 /usr/share/keyrings/nvidia-container-toolkit-keyring.gpg
# sudo apt update
# sudo apt install -y nvidia-container-toolkit nvidia-container-runtime
# sudo service docker restart
- name: setup container
run: |
docker pull $DOCKER_IMAGE
docker run -d -t --gpus all -e TERM -e LANG=en_US.UTF-8 --hostname ppf-dev --name $TMP_CONTAINER_NAME -e NVIDIA_DRIVER_CAPABILITIES=graphics,compute,utility $DOCKER_IMAGE
$EXEC nvidia-smi
$EXEC apt update
$EXEC apt install -y git python3
docker cp . $TMP_CONTAINER_NAME:$TMP_ROOT
- name: warmup
run: $EXEC_W python3 warmup.py
- name: build
run: $EXEC_W /root/.cargo/bin/cargo build --release
- name: run headless
run: $EXEC_W python3 examples/headless.py
- name: remove container
if: always()
run: |
docker stop $TMP_CONTAINER_NAME
docker rm $TMP_CONTAINER_NAME