-
Notifications
You must be signed in to change notification settings - Fork 0
/
sharcs.def
42 lines (33 loc) · 1.01 KB
/
sharcs.def
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
Bootstrap: docker
From: nvidia/cuda:12.1.0-cudnn8-runtime-ubuntu22.04
%setup
echo "SETUP"
echo "$HOME"
echo `pwd`
%files
/tmp/requirements.txt
/tmp/sharcs/*
%post
# Downloads the latest package lists (important).
apt-get update -y
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
python3 \
python3-pip \
python3-setuptools
# set python3 to be default python
update-alternatives --install /usr/bin/python python /usr/bin/python3 1
# Install dependencies
pip install -r /tmp/requirements.txt
cd /tmp/sharcs
pip install -e .
# Reduce the size of the image by deleting the package lists we downloaded,
# which are useless now.
apt-get autoremove -y && \
apt-get clean && \
rm -rf /root/.cache && \
rm -rf /var/lib/apt/lists/*
# see if torch works
python -m torch.utils.collect_env
python -c 'import site; print(site.getsitepackages())'
%environment
export PATH="$HOME/.local/bin:$PATH"