-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlongcallR-nn.def
57 lines (44 loc) · 1.93 KB
/
longcallR-nn.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
Bootstrap: docker
From: nvidia/cuda:11.6.1-devel-ubuntu20.04
%post
apt-get update && apt-get install -y wget git curl make gcc g++ parallel libncurses5-dev zlib1g-dev libbz2-dev liblzma-dev
# create directory for tools
mkdir -p /tools
# create directory for work
mkdir -p /work
# Install Miniconda
wget https://repo.anaconda.com/miniconda/Miniconda3-py38_23.11.0-2-Linux-x86_64.sh -O /tools/miniconda3.sh
bash /tools/miniconda3.sh -b -p /tools/miniconda3
rm /tools/miniconda3.sh
# Initialize conda and add it to the PATH
export PATH=/tools/miniconda3/bin:$PATH
/tools/miniconda3/bin/conda init bash
/tools/miniconda3/bin/conda create -n pytorch python=3.9 -y
# Install longcallR-nn
git clone https://github.com/huangnengCSU/longcallR-nn.git /tools/longcallR-nn
cd /tools/longcallR-nn
/tools/miniconda3/bin/conda run -n pytorch pip install -r requirements.txt
/tools/miniconda3/bin/conda run -n pytorch pip install .
# Install torch-gpu
/tools/miniconda3/bin/conda run -n pytorch conda install pytorch==1.13.1 torchvision==0.14.1 torchaudio==0.13.1 pytorch-cuda=11.6 torchmetrics -c pytorch -c nvidia -y
# Install torch-cpu
# conda install pytorch torchvision torchaudio torchmetrics cpuonly -c pytorch -y
# Install Rust
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
export PATH=$HOME/.cargo/bin:$PATH
# Compile longcallR-dp
cd /tools/longcallR-nn/longcallR_dp
cargo build --release
export PATH=/tools/longcallR-nn/longcallR_dp/target/release:$PATH
# Clean up
apt-get clean
/tools/miniconda3/bin/conda clean -a -y
%environment
export PATH=/tools/miniconda3/bin:$PATH
. /tools/miniconda3/bin/activate pytorch
export PATH=$HOME/.cargo/bin:$PATH
export PATH=/tools/longcallR-nn/longcallR_dp/target/release:$PATH
# %runscript
# cd /work
# echo "longcallR-nn"
# longcallR-nn call -h