-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbootstrap.sh
More file actions
73 lines (62 loc) · 1.97 KB
/
bootstrap.sh
File metadata and controls
73 lines (62 loc) · 1.97 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
#!/bin/bash
set -e
echo "=== [Step 1] Updating package lists ==="
apt update
echo "=== [Step 2] Installing basic tools ==="
apt install -y \
vim \
git \
curl \
wget \
<<<<<<< HEAD
tmux \
=======
>>>>>>> 1b7f32b1b0a56389007b1385e5b6a7a269724e6a
unzip
echo "=== [Step 3] Setting up Python environment ==="
pip3 install --upgrade pip
pip3 install virtualenv ipython
<<<<<<< HEAD
# pip install -r requirements.txt
=======
pip install -r requirements.txt
>>>>>>> 1b7f32b1b0a56389007b1385e5b6a7a269724e6a
echo "=== [Step 4] Installing oh-my-bash ==="
if [ ! -d "$HOME/.oh-my-bash" ]; then
git clone https://github.com/ohmybash/oh-my-bash.git ~/.oh-my-bash
cp ~/.oh-my-bash/templates/bashrc.osh-template ~/.bashrc
sed -i 's/^OSH_THEME=.*/OSH_THEME="font"/' ~/.bashrc
fi
echo "=== [Step 5] Configuring Git ==="
# Replace the values below with your identity if needed
git config --global user.name "Yexi Jiang"
git config --global user.email "2237303+yxjiang@users.noreply.github.com"
git config --global init.defaultBranch main
git config --global core.editor vim
git config --global color.ui auto
# Soft link ssh and Git setting
mkdir -p ~/.ssh
cp /workspace/bootstrap/config/.ssh/id_ed25519 ~/.ssh/id_ed25519
cp /workspace/bootstrap/config/.ssh/id_ed25519.pub ~/.ssh/id_ed25519.pub
cp /workspace/bootstrap/config/.ssh/config ~/.ssh/config
cp /workspace/bootstrap/config/.gitconfig ~/.gitconfig
chmod 600 ~/.ssh/id_ed25519
# Start ssh-agent
eval "$(ssh-agent -s)"
ssh-add ~/.ssh/id_ed25519
echo "=== [Step 6] Install Ollama ==="
# Install Ollama
<<<<<<< HEAD
# curl -fsSL https://ollama.com/install.sh | sh
# ollama serve &
=======
curl -fsSL https://ollama.com/install.sh | sh
ollama serve &
>>>>>>> 1b7f32b1b0a56389007b1385e5b6a7a269724e6a
echo "=== [Step 7] Ramp up workspace directory ==="
source .bashrc
cat /workspace/bootstrap/.bashrc >> ~/.bashrc
echo 'export HF_HOME=/workspace/cache' >> ~/.bashrc
echo "=== Done ==="
echo "Run 'source ~/.bashrc' to activate oh-my-bash"
source ~/.bashrc