-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbootstrap.sh
executable file
·68 lines (54 loc) · 2.19 KB
/
bootstrap.sh
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
#!/usr/bin/env bash
# Copyright (c) 2022 by Microsoft Corporation.
# Licensed under the MIT license.
set -e
set -u
set -o pipefail
if [[ "$1" == "--branch" ]]; then
BRT_BRANCH="$2"
shift 2
fi
cd "$HOME"
rm -rf /opt/miniconda3
wget https://repo.anaconda.com/miniconda/Miniconda3-py38_4.10.3-Linux-x86_64.sh &&
bash Miniconda3-py38_4.10.3-Linux-x86_64.sh -b -p /opt/miniconda3 &&
rm -f Miniconda3-py38_4.10.3-Linux-x86_64.sh
# shellcheck disable=SC2016
echo 'export PATH=/opt/miniconda3/bin:$PATH' >>~/.bashrc
# shellcheck disable=SC2016
echo 'export PATH=/opt/miniconda3/bin:$PATH' >>~/.zshrc
export PATH=/opt/miniconda3/bin:$PATH
wget https://azcopyvnext.azureedge.net/release20221005/azcopy_linux_amd64_10.16.1.tar.gz -O azcopy.tar.gz
mkdir azcopy && tar -xzvf azcopy.tar.gz -C "$HOME/azcopy" --strip-components=1
mv azcopy/azcopy /usr/bin/azcopy && rm -rf azcopy.tar.gz azcopy
UBUNTU_DIST=$(lsb_release -sr)
wget https://packages.microsoft.com/config/ubuntu/"${UBUNTU_DIST}"/packages-microsoft-prod.deb
dpkg -i packages-microsoft-prod.deb && rm -f packages-microsoft-prod.deb
apt-get update
apt-get install -y \
blobfuse gcc libtinfo-dev zlib1g-dev build-essential \
libedit-dev libxml2-dev llvm wget git
git config --global user.name raphael
git config --global user.email [email protected]
mkdir -p ~/brainstorm_project && cd ~/brainstorm_project
git clone [email protected]:Raphael-Hao/brainstorm.git \
-b "${BRT_BRANCH:-main}" \
--recursive
cd brainstorm
pip install --upgrade pip
pip install torch==1.12.1+cu113 torchvision==0.13.1+cu113 torchaudio==0.12.1 --extra-index-url https://download.pytorch.org/whl/cu113
pip install -r requirements.txt
cd 3rdparty/tvm || exit
mkdir -p build && cd build || exit
cp ../../../cmake/config/tvm.cmake config.cmake
cmake ..
export LD_LIBRARY_PATH=/usr/local/cuda/lib64/stubs:$LD_LIBRARY_PATH &&
ln -s /usr/local/cuda/lib64/stubs/libcuda.so /usr/local/cuda/lib64/stubs/libcuda.so.1 &&
make install -j &&
rm -f /usr/local/cuda/lib64/stubs/libcuda.so.1
cd ../python && pip install .
cd ~/brainstorm_project/brainstorm || exit
pip install -v --editable .
cd ~/brainstorm_project/brainstorm/azure/blob || exit
bash mount.sh
bash download_image.sh