forked from nebuly-ai/optimate
-
Notifications
You must be signed in to change notification settings - Fork 0
/
azure-pipelines.yml
102 lines (87 loc) · 2.98 KB
/
azure-pipelines.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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
trigger:
- main
pool:
name: gpu-t4-pool
variables:
imageName: 'nebulydocker/nebullvm'
steps:
- script: |
nvidia-smi
displayName: 'Ensure cuda is installed correctly'
- script: |
pip uninstall -y nebullvm
pip install .
displayName: 'Install nebullvm'
- script: |
cd apps/accelerate/speedster
pip uninstall -y speedster
pip install .
cd ../../..
displayName: 'Install speedster'
- script: python -m pip install torch torchvision --extra-index-url https://download.pytorch.org/whl/cu117
displayName: 'Install PyTorch'
- script: python -m nebullvm.installers.auto_installer --compilers all
displayName: 'Install deep learning compilers'
- script: python -m pip install -r "requirements-dev.txt"
displayName: 'Install requirements for testing'
- script: |
export SPEEDSTER_DISABLE_TELEMETRY=1
export PATH=$PATH:/home/AzDevOps/.local/bin
cd apps/accelerate/speedster
pytest
cd ../../..
displayName: 'Run api tests'
- script: |
export PATH=$PATH:/home/AzDevOps/.local/bin
cd nebullvm
pytest
cd ../
displayName: 'Run components tests'
- script: |
export DEBIAN_FRONTEND=noninteractive
sudo apt-get update -y
sudo apt-get install -y ca-certificates curl gnupg lsb-release
sudo mkdir -p /etc/apt/keyrings
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
echo \
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
sudo apt-get update -y
sudo apt-get install -y docker-ce docker-ce-cli containerd.io
sudo chmod 666 /var/run/docker.sock
displayName: 'Install docker'
- script: |
docker run hello-world
displayName: 'Ensure docker works correctly'
- script: |
curl -s -L https://nvidia.github.io/nvidia-docker/gpgkey | \
sudo apt-key add -
distribution=$(. /etc/os-release;echo $ID$VERSION_ID)
curl -s -L https://nvidia.github.io/nvidia-docker/$distribution/nvidia-docker.list | \
sudo tee /etc/apt/sources.list.d/nvidia-docker.list
sudo apt-get update
sudo apt-get install -y nvidia-docker2
sudo pkill -SIGHUP dockerd
sudo mkdir -p /etc/docker
sudo tee /etc/docker/daemon.json <<EOF
{
"runtimes": {
"nvidia": {
"path": "nvidia-container-runtime",
"runtimeArgs": []
}
},
"default-runtime": "nvidia"
}
EOF
sudo pkill -SIGHUP dockerd
displayName: 'Setup docker to use nvidia'
- task: Docker@2
displayName: 'Build and push the image to DockerHub'
inputs:
containerRegistry: 'docker hub'
repository: 'nebulydocker/nebullvm'
command: 'buildAndPush'
Dockerfile: 'Dockerfile'
tags: |
latest