Repository navigation
Expand file tree
/
Copy pathlinux-bootstrap.sh
More file actions
executable file
·144 lines (117 loc) · 3.59 KB
/
Copy pathlinux-bootstrap.sh
File metadata and controls
executable file
·144 lines (117 loc) · 3.59 KB
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
#!/usr/bin/env bash
CODE_DIR=$HOME/code
ARROW_DIR=$CODE_DIR/arrow
MINICONDA_DIR=$HOME/miniconda
TOOLCHAIN_DIR=$CODE_DIR/dev-toolchain
function build_user() {
adduser droairne
usermod -aG sudo droairne
su - droairne
}
# Dotfiles
function install_dotfiles() {
ln -sf $TOOLCHAIN_DIR/dotfiles/bash_personal ~/.bash_personal
BASHRC_ADDITION=$(cat <<-END
if [ -f ~/.bash_personal ]; then
. ~/.bash_personal
fi
END
)
echo "$BASHRC_ADDITION" >> ~/.bashrc
}
# packages
function install_apt_packages() {
sudo apt install -y \
filezilla \
tmux \
clang-format
}
function install_docker() {
sudo apt-get install \
apt-transport-https \
ca-certificates \
curl \
gnupg-agent \
software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository \
"deb [arch=amd64] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) \
stable"
sudo apt-get install docker-ce docker-ce-cli containerd.io
}
function install_docker_compose() {
sudo curl -L "https://github.com/docker/compose/releases/download/1.26.2/docker-compose-$(uname -s)-$(uname -m)" \
-o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
sudo ln -s /usr/local/bin/docker-compose /usr/bin/docker-compose
}
# Miniconda
function install_conda() {
MINICONDA_URL="https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh"
wget -O miniconda.sh $MINICONDA_URL
bash miniconda.sh -b -p $MINICONDA_DIR
rm -f miniconda.sh
export PATH="$MINICONDA_DIR/bin:$PATH"
conda update -y -q conda
conda config --set auto_update_conda false
conda info -a
conda config --set show_channel_urls True
conda config --add channels https://repo.continuum.io/pkgs/free
conda config --add channels conda-forge
conda init --all --verbose
}
# Install conda environments
function create_conda_dev_environments() {
conda create -yq -n a37 \
python=3.7 compilers clangxx
conda create -yq -n p37 \
python=3.7 pandas numpy ipython nb_conda_kernels
conda create -yq -n jup \
python=3.7 jupyterlab nb_conda_kernels
}
# C++ toolchain
function install_cpp_toolchain() {
conda install -y \
--file=$ARROW_DIR/ci/conda_env_cpp.yml \
--file=$ARROW_DIR/ci/conda_env_python.yml \
-n a37 -c conda-forge
}
# arrow setup
function install_arrow() {
mkdir -p $CODE_DIR
pushd $CODE_DIR
git clone https://github.com/apache/arrow.git
git clone https://github.com/cill-airne/saighead-dev.git
popd
}
# vim setup
function install_vim() {
mkdir -p ~/.vim/plugged
ln -sf $TOOLCHAIN_DIR/dotfiles/vimrc ~/.vimrc
~/.vim/autoload/plug.vim --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
}
function setup_tmux() {
git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm
ln -sf $TOOLCHAIN_DIR/dotfiles/tmux.conf ~/.tmux.conf
}
function install_git_scripts () {
mkdir -p ~/sc
ln -sf $TOOLCHAIN_DIR/scripts/rb_um.sh ~/sc/rb_um.sh
ln -sf $TOOLCHAIN_DIR/scripts/rst_um.sh ~/sc/rst_um.sh
ln -sf $TOOLCHAIN_DIR/scripts/build_arrow.sh ~/sc/ba.sh
ln -sf $TOOLCHAIN_DIR/scripts/build_pa.sh ~/sc/bpa.sh
git config --global user.name "c-jamie"
git config --global user.email "jamie.b.clery@gmail.com"
}
# install_dotfiles
# install_apt_packages
# install_conda
# create_conda_dev_environments
# install_arrow
# install_cpp_toolchain
# install_vim
# setup_tmux
# install_docker
install_git_scripts
exec bash