-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathApptainerfile_CUDA_11_8
63 lines (48 loc) · 2.11 KB
/
Apptainerfile_CUDA_11_8
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
Bootstrap: docker
From: us-docker.pkg.dev/deeplearning-platform-release/gcr.io/tf2-gpu.2-12.py310
%files
%post
TERM=xterm-256color
echo "PS1='\e[97m\u\e[0m@\e[94m\h\e[0m:\e[35m\w\e[0m# '" >> /root/.bashrc
mkdir -p /docker_install
cd /docker_install
# Install requirements. Don't "apt-get upgrade" or else all the NVIDIA tools and drivers will update.
apt-get update \
&& apt-get install -y --no-install-recommends \
htop \
cifs-utils \
winbind \
smbclient \
&& rm -rf /var/lib/apt/lists/*
# Git-lfs install
curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | bash && apt-get update && apt-get install git-lfs && rm -rf /var/lib/apt/lists/*
# Make the dockerfile use the current branch (passed in as a command line argument to "docker build")
# some helpful shortcuts
cloneit="git clone -b {{BRANCH_NAME}} --recurse-submodules https://github.com/abcucberkeley/opticalaberrations.git"
echo 'alias repo="cd /app/opticalaberrations/src"' >> ~/.bashrc
echo 'alias cloneit=${cloneit}' >> ~/.bashrc
# Download the current github commit page for this branch. This will invalidate the cache for later Docker layers when the commit changes things.
# git clone "requirements.txt" into a junk directory, then pip install. --filter=blob:none will only download the files in HEAD
mkdir -p /docker_install
cd /docker_install
echo "branch={{BRANCH_NAME}}" && git clone -n -b {{BRANCH_NAME}} --depth 1 --filter=blob:none https://github.com/abcucberkeley/opticalaberrations.git
mkdir -p /docker_install/opticalaberrations
cd /docker_install/opticalaberrations
git checkout HEAD requirements_CUDA_11_8.txt
pip install --upgrade pip
pip uninstall --yes ydata-profiling && \
pip uninstall --yes pandas-profiling && \
pip install --no-cache-dir -r requirements_CUDA_11_8.txt --progress-bar off && pip cache purge
mkdir -p /app
cd /app
%environment
BRANCH_NAME=develop
export BRANCH_NAME
export TERM=xterm-256color
export cloneit="git clone -b {{BRANCH_NAME}} --recurse-submodules https://github.com/abcucberkeley/opticalaberrations.git"
%runscript
cd /app
exec /bin/bash -l -c "$@"
%startscript
cd /app
exec /bin/bash -l -c "$@"