-
Notifications
You must be signed in to change notification settings - Fork 0
/
flux-julia.def
145 lines (126 loc) · 5.18 KB
/
flux-julia.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
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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
BootStrap: docker
From: nvidia/cuda:10.1-cudnn7-devel-ubuntu18.04
%help
Julia 1.3 docker image with cuda & cudnn
Julia Dockerfile: https://github.com/docker-library/julia/blob/master/1.1/stretch/Dockerfile
#---------------------------------------------------------------------
%labels
#---------------------------------------------------------------------
MAINTAINER Jongsu Kim
#---------------------------------------------------------------------
%environment
#---------------------------------------------------------------------
export PATH=/bin:/usr/bin:/usr/local/bin
export JULIA_PATH=/usr/local/julia
export JULIA_BINDIR=$JULIA_PATH/bin
export HDF5_DIR=/usr/lib/x86_64-linux-gnu/hdf5/serial/
export PATH=$JULIA_PATH/bin:$PATH
export CUDA_PATH=/usr/local/cuda
export PATH=$CUDA_PATH/bin:$PATH
export LD_LIBRARY_PATH=$CUDA_PATH/lib64:/usr/lib/x86_64-linux-gnu:/lib:/lib64
export DISPLAY=:1
unset XDG_RUNTIME_DIR
# really quiet, even error
/usr/bin/X $DISPLAY -quiet > /dev/null 2>&1 &
#---------------------------------------------------------------------
%post
#---------------------------------------------------------------------
export DEBIAN_FRONTEND=noninteractive
export JULIA_PATH=/usr/local/julia
export PATH=$JULIA_PATH/bin:$PATH
export JULIA_GPG=3673DF529D9049477F76B37566E3C7DC03D6E495
export JULIA_VERSION=1.5.0
# apt packages
# select mirror
apt-get update
apt-get install -y software-properties-common
add-apt-repository universe
apt-get update
apt-get install -y --no-install-recommends python3-dev python3-pip python3-setuptools python3-wheel
pip3 install --upgrade pip
python3 -m pip install --upgrade setuptools wheel
python3 -m pip install apt-mirror-updater
# disable mirror selector
# apt-mirror-updater --auto-change-mirror
# install python package
python3 -m pip install xlrd
# update and install packages
apt-get update
apt-get install -y --no-install-recommends locales tzdata
apt-get install -y --no-install-recommends ca-certificates curl gnupg dirmngr
# HDF5
apt-get install -y --no-install-recommends libhdf5-dev hdf5-tools
# Xdummy for headless system
apt-get install -y xserver-xorg-video-dummy x11-xserver-utils
# Plots.jl dependencies
curl -fL -o xorg.conf "https://xpra.org/xorg.conf"
mv xorg.conf /etc/X11/xorg.conf
apt-get install -y libxt6 libxrender1 libxext6 libgl1-mesa-glx libqt5widgets5
#apt-get install -y --no-install-recommends gettext gettext-base
#apt-get install -y --no-install-recommends libharfbuzz libharfbuzz-subject libharfbuzz-gobject
# Install korean fonts
apt-get install -y fonts-nanum fonts-nanum-coding fonts-nanum-extra
apt-get install -y fonts-noto fonts-noto-cjk
set -eux; \
savedAptMark="$(apt-mark showmanual)"; \
if ! command -v gpg > /dev/null; then \
apt-get update; \
apt-get install -y --no-install-recommends \
gnupg \
dirmngr \
; \
rm -rf /var/lib/apt/lists/*; \
fi; \
apt-get clean
# locales
locale-gen --purge en_US.UTF-8
#echo "LC_ALL=en_US.UTF-8" >> /etc/environment
#echo "en_US.UTF-8 UTF-8" >> /etc/locale.gen
#echo "LANG=en_US.UTF-8" > /etc/locale.conf
#locale-gen en_US.UTF-8
echo -e 'LANG="en_US.UTF-8"\nLANGUAGE="en_US:en"\n' > /etc/default/locale
dpkg-reconfigure locales
# TZ
export TZ="Asia/Seoul"
ln -snf /usr/share/zoneinfo/${TZ} /etc/localtime
echo ${TZ} > /etc/timezone
dpkg-reconfigure tzdata --frontend noninteractive tzdata
# install julia
# https://julialang.org/downloads/#julia-command-line-version
# https://julialang-s3.julialang.org/bin/checksums/julia-1.3.0.sha256
# this "case" statement is generated via "update.sh"
dpkgArch="$(dpkg --print-architecture)"; \
case "${dpkgArch##*-}" in \
# amd64
amd64) tarArch='x86_64'; dirArch='x64'; sha256='be7af676f8474afce098861275d28a0eb8a4ece3f83a11027e3554dcdecddb91' ;; \
# arm64v8
arm64) tarArch='aarch64'; dirArch='aarch64'; sha256='6c6f1d3b6d16829e1ecc0528bb8bb15f9fe90b03fcee99509a3fe625cac32c51' ;; \
# i386
i386) tarArch='i686'; dirArch='x86'; sha256='dafefde1fb1387730d804c7b4bb29c904311f0a52b12bf44c0c4ed4af6ae58e6' ;; \
*) echo >&2 "error: current architecture ($dpkgArch) does not have a corresponding Julia binary release"; exit 1 ;; \
esac; \
\
folder="$(echo "$JULIA_VERSION" | cut -d. -f1-2)"; \
curl -fL -o julia.tar.gz.asc "https://julialang-s3.julialang.org/bin/linux/${dirArch}/${folder}/julia-${JULIA_VERSION}-linux-${tarArch}.tar.gz.asc"; \
curl -fL -o julia.tar.gz "https://julialang-s3.julialang.org/bin/linux/${dirArch}/${folder}/julia-${JULIA_VERSION}-linux-${tarArch}.tar.gz"; \
\
echo "${sha256} *julia.tar.gz" | sha256sum -c -; \
\
export GNUPGHOME="$(mktemp -d)"; \
gpg --batch --keyserver na.pool.sks-keyservers.net --recv-keys "$JULIA_GPG"; \
gpg --batch --verify julia.tar.gz.asc julia.tar.gz; \
command -v gpgconf > /dev/null && gpgconf --kill all; \
rm -rf "$GNUPGHOME" julia.tar.gz.asc; \
\
mkdir "$JULIA_PATH"; \
tar -xzf julia.tar.gz -C "$JULIA_PATH" --strip-components 1; \
rm julia.tar.gz; \
\
apt-mark auto '.*' > /dev/null; \
[ -z "$savedAptMark" ] || apt-mark manual $savedAptMark; \
apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \
\
# smoke test
julia --version
# create some generic mount points
mkdir -p /mnt/data /mnt/input /mnt/output /mnt/ref /mnt/code /mnt/work