-
Notifications
You must be signed in to change notification settings - Fork 5
/
hiremate_twremat.def
101 lines (90 loc) · 3.73 KB
/
hiremate_twremat.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
Bootstrap: docker
From: anibali/pytorch:2.0.0-cuda11.8-ubuntu22.04
%environment
export GUROBI_HOME="/opt/gurobi/9.5.0/linux64"
export LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:${GUROBI_HOME}/lib"
export GRB_LICENSE_FILE="$HOME/gurobi.lic"
export PATH="${PATH}:/root/.cabal/bin:/root/.local/bin:/opt/ghc/9.2.7/bin:/opt/twremat/bin:${GUROBI_HOME}/bin"
%files
/home/ygusak/twremat_haskell/twremat /opt
/home/ygusak/tools/gurobi950.tar.gz /opt
/home/ygusak/gurobi.lic $HOME/
%post
apt-get update && \
apt-get install -y build-essential git curl wget libgmp-dev &&\
apt-get install -y libjpeg-dev libpng-dev &&\
apt-get clean
cd /opt && tar xvfz gurobi950.tar.gz
cd /opt/gurobi/9.5.0/linux64 && python3 setup.py install
rm /opt/gurobi950.tar.gz
set -eux; \
CABAL_INSTALL=3.8.1.0; \
CABAL_INSTALL_RELEASE_KEY=E9EC5616017C3EE26B33468CCE1ED8AE0B011D8C; \
cd /tmp; \
ARCH="$(dpkg-architecture --query DEB_BUILD_GNU_CPU)"; \
CABAL_INSTALL_TAR="cabal-install-$CABAL_INSTALL-$ARCH-linux-deb10.tar.xz"; \
CABAL_INSTALL_URL="https://downloads.haskell.org/~cabal/cabal-install-$CABAL_INSTALL/$CABAL_INSTALL_TAR"; \
CABAL_INSTALL_SHA256SUMS_URL="https://downloads.haskell.org/~cabal/cabal-install-$CABAL_INSTALL/SHA256SUMS"; \
# sha256 from https://downloads.haskell.org/~cabal/cabal-install-$CABAL_INSTALL/SHA256SUMS
case "$ARCH" in \
'aarch64') \
CABAL_INSTALL_SHA256='c7fa9029f2f829432dd9dcf764e58605fbb7431db79234feb3e46684a9b37214'; \
;; \
'x86_64') \
CABAL_INSTALL_SHA256='c71a1a46fd42d235bb86be968660815c24950e5da2d1ff4640da025ab520424b'; \
;; \
*) echo >&2 "error: unsupported architecture '$ARCH'"; exit 1 ;; \
esac; \
curl -fSL "$CABAL_INSTALL_URL" -o cabal-install.tar.gz; \
echo "$CABAL_INSTALL_SHA256 cabal-install.tar.gz" | sha256sum --strict --check; \
\
curl -sSLO "$CABAL_INSTALL_SHA256SUMS_URL"; \
curl -sSLO "$CABAL_INSTALL_SHA256SUMS_URL.sig"; \
GNUPGHOME="$(mktemp -d)"; export GNUPGHOME; \
gpg --batch --keyserver keyserver.ubuntu.com --receive-keys "$CABAL_INSTALL_RELEASE_KEY"; \
gpg --batch --verify SHA256SUMS.sig SHA256SUMS; \
# confirm we are verifying SHA256SUMS that matches the release + sha256
grep "$CABAL_INSTALL_SHA256 $CABAL_INSTALL_TAR" SHA256SUMS; \
gpgconf --kill all; \
\
tar -xf cabal-install.tar.gz -C /usr/local/bin; \
\
cabal --version
set -eux; \
GHC=9.2.7; \
GHC_RELEASE_KEY=88B57FCF7DB53B4DB3BFA4B1588764FBE22D19C4; \
cd /tmp; \
ARCH="$(dpkg-architecture --query DEB_BUILD_GNU_CPU)"; \
GHC_URL="https://downloads.haskell.org/~ghc/$GHC/ghc-$GHC-$ARCH-deb10-linux.tar.xz"; \
# sha256 from https://downloads.haskell.org/~ghc/$GHC/SHA256SUMS
case "$ARCH" in \
'aarch64') \
GHC_SHA256='b4829dd2f4bdaa4b21b22b50edec17616848ab22ab64188047a3eb12bb4da85a'; \
;; \
'x86_64') \
GHC_SHA256='3a76ad6b96915eebf960d1b757ee57341302a76c6a8f97af63fd84eddb45362b'; \
;; \
*) echo >&2 "error: unsupported architecture '$ARCH'" ; exit 1 ;; \
esac; \
curl -sSL "$GHC_URL" -o ghc.tar.xz; \
echo "$GHC_SHA256 ghc.tar.xz" | sha256sum --strict --check; \
\
GNUPGHOME="$(mktemp -d)"; export GNUPGHOME; \
curl -sSL "$GHC_URL.sig" -o ghc.tar.xz.sig; \
gpg --batch --keyserver keyserver.ubuntu.com --receive-keys "$GHC_RELEASE_KEY"; \
gpg --batch --verify ghc.tar.xz.sig ghc.tar.xz; \
gpgconf --kill all; \
\
tar xf ghc.tar.xz; \
cd "ghc-$GHC"; \
./configure --prefix "/opt/ghc/$GHC"; \
make install; \
\
"/opt/ghc/$GHC/bin/ghc" --version
##TODO install rotor
pip install graphviz mip gurobipy astunparse pandas numpy pydot
pip install wandb ruamel.yaml configmypy tensorly tensorly-torch torch-harmonics matplotlib opt-einsum h5py zarr neuraloperator
pip install pulp==2.7.0 transformers torchvision
export PATH="${PATH}:/root/.cabal/bin:/root/.local/bin:/opt/ghc/9.2.7/bin"
cabal update
cd /opt/twremat && rm -rf bin && cabal v2-install --installdir=bin --install-method=copy