Skip to content

Commit 15d82d3

Browse files
authored
feat: Introduce automated Developer Setup (Skypilot) (#499)
* feat: Introduce automated Developer Setup (Skypilot)
1 parent 5223b6a commit 15d82d3

File tree

2 files changed

+237
-0
lines changed

2 files changed

+237
-0
lines changed

Makefile

Lines changed: 117 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,117 @@
1+
.PHONY: dev check-zsh install-omz install-brew install-plugins setup-zshrc setup-ssh setup-conda help
2+
3+
# Development environment setup for Linux
4+
# Default target
5+
help:
6+
@echo "Available commands:"
7+
@echo " make dev - Install development environment (all plugins and configs)"
8+
9+
# Main development environment setup command
10+
dev: check-zsh install-omz install-brew install-plugins setup-zshrc setup-ssh setup-conda
11+
@echo "Development environment setup complete!"
12+
@echo "Please run 'source ~/.zshrc' or reopen your terminal to apply changes"
13+
14+
# Check if zsh is installed
15+
check-zsh:
16+
@echo "Checking zsh..."
17+
@if command -v zsh >/dev/null 2>&1; then \
18+
echo "zsh is installed: $$(zsh --version)"; \
19+
else \
20+
echo "zsh is not installed. Installing..."; \
21+
sudo apt install -y zsh; \
22+
echo "zsh installation complete"; \
23+
fi
24+
25+
# Install Oh My Zsh
26+
install-omz:
27+
@echo "Checking Oh My Zsh..."
28+
@if [ -d "$$HOME/.oh-my-zsh" ]; then \
29+
echo "Oh My Zsh is already installed"; \
30+
else \
31+
echo "Installing Oh My Zsh..."; \
32+
sh -c "$$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" "" --unattended || true; \
33+
echo "Oh My Zsh installation complete"; \
34+
fi
35+
36+
# Install Homebrew (Linux version)
37+
install-brew:
38+
@echo "Checking Homebrew..."
39+
@if command -v brew >/dev/null 2>&1; then \
40+
echo "Homebrew is already installed: $$(brew --version | head -n 1)"; \
41+
else \
42+
echo "Installing Homebrew for Linux..."; \
43+
/bin/bash -c "$$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"; \
44+
echo "Homebrew installation complete"; \
45+
fi
46+
47+
# Install zsh plugins
48+
install-plugins:
49+
@echo "Installing zsh plugins..."
50+
@ZSH_CUSTOM=$${ZSH_CUSTOM:-$$HOME/.oh-my-zsh/custom}; \
51+
\
52+
if [ -d "$$ZSH_CUSTOM/plugins/zsh-syntax-highlighting" ]; then \
53+
echo "zsh-syntax-highlighting is already installed"; \
54+
else \
55+
echo "Cloning zsh-syntax-highlighting..."; \
56+
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git $$ZSH_CUSTOM/plugins/zsh-syntax-highlighting; \
57+
echo "zsh-syntax-highlighting installation complete"; \
58+
fi; \
59+
\
60+
if [ -d "$$ZSH_CUSTOM/plugins/zsh-autosuggestions" ]; then \
61+
echo "zsh-autosuggestions is already installed"; \
62+
else \
63+
echo "Cloning zsh-autosuggestions..."; \
64+
git clone https://github.com/zsh-users/zsh-autosuggestions $$ZSH_CUSTOM/plugins/zsh-autosuggestions; \
65+
echo "zsh-autosuggestions installation complete"; \
66+
fi
67+
68+
# Setup .zshrc configuration file
69+
setup-zshrc:
70+
@echo "========================================"
71+
@echo " Manual Setup Required for Zsh"
72+
@echo "========================================"
73+
@echo ""
74+
@echo "⚠️ To preserve your existing configuration (tokens, PATH, aliases, etc.),"
75+
@echo " please manually add the following content to your ~/.zshrc file."
76+
@echo ""
77+
@echo "Option 1: Append the entire file"
78+
@echo " cat scripts/.zshrc >> ~/.zshrc"
79+
@echo ""
80+
@echo "Option 2: Copy specific sections you need from scripts/.zshrc"
81+
@echo ""
82+
@echo "After updating, reload your shell:"
83+
@echo " source ~/.zshrc"
84+
@echo ""
85+
@echo "Key configurations in scripts/.zshrc:"
86+
@echo " - Oh My Zsh setup with 'refined' theme"
87+
@echo " - Plugins: git, zsh-autosuggestions, zsh-syntax-highlighting"
88+
@echo " - Conda initialization"
89+
@echo ""
90+
@echo "========================================"
91+
92+
# Setup SSH key permissions
93+
setup-ssh:
94+
@echo "Setting up SSH key permissions..."
95+
@if [ -f "$$HOME/.ssh/id_rsa" ]; then \
96+
chmod 600 $$HOME/.ssh/id_rsa; \
97+
echo "SSH key permissions set to 600"; \
98+
else \
99+
echo "~/.ssh/id_rsa not found, skipping"; \
100+
fi
101+
102+
# Create conda environment
103+
setup-conda:
104+
@echo "Setting up Miniconda environment..."
105+
@if command -v conda >/dev/null 2>&1; then \
106+
if conda env list | grep -q "^sglang-jax "; then \
107+
echo "conda environment 'sglang-jax' already exists"; \
108+
else \
109+
echo "Creating conda environment 'sglang-jax'..."; \
110+
conda create --name sglang-jax python=3.12 -c conda-forge -y; \
111+
echo "conda environment creation complete"; \
112+
echo "Activate with: conda activate sglang-jax"; \
113+
fi \
114+
else \
115+
echo "conda is not installed, skipping environment creation"; \
116+
echo "Please install Miniconda or Anaconda first"; \
117+
fi

scripts/.zshrc

Lines changed: 120 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,120 @@
1+
# If you come from bash you might have to change your $PATH.
2+
# export PATH=$HOME/bin:$HOME/.local/bin:/usr/local/bin:$PATH
3+
4+
# Path to your Oh My Zsh installation.
5+
export ZSH="$HOME/.oh-my-zsh"
6+
7+
# Set name of the theme to load --- if set to "random", it will
8+
# load a random theme each time Oh My Zsh is loaded, in which case,
9+
# to know which specific one was loaded, run: echo $RANDOM_THEME
10+
# See https://github.com/ohmyzsh/ohmyzsh/wiki/Themes
11+
ZSH_THEME="refined"
12+
13+
# Set list of themes to pick from when loading at random
14+
# Setting this variable when ZSH_THEME=random will cause zsh to load
15+
# a theme from this variable instead of looking in $ZSH/themes/
16+
# If set to an empty array, this variable will have no effect.
17+
# ZSH_THEME_RANDOM_CANDIDATES=( "robbyrussell" "agnoster" )
18+
19+
# Uncomment the following line to use case-sensitive completion.
20+
# CASE_SENSITIVE="true"
21+
22+
# Uncomment the following line to use hyphen-insensitive completion.
23+
# Case-sensitive completion must be off. _ and - will be interchangeable.
24+
# HYPHEN_INSENSITIVE="true"
25+
26+
# Uncomment one of the following lines to change the auto-update behavior
27+
# zstyle ':omz:update' mode disabled # disable automatic updates
28+
# zstyle ':omz:update' mode auto # update automatically without asking
29+
# zstyle ':omz:update' mode reminder # just remind me to update when it's time
30+
31+
# Uncomment the following line to change how often to auto-update (in days).
32+
# zstyle ':omz:update' frequency 13
33+
34+
# Uncomment the following line if pasting URLs and other text is messed up.
35+
# DISABLE_MAGIC_FUNCTIONS="true"
36+
37+
# Uncomment the following line to disable colors in ls.
38+
# DISABLE_LS_COLORS="true"
39+
40+
# Uncomment the following line to disable auto-setting terminal title.
41+
# DISABLE_AUTO_TITLE="true"
42+
43+
# Uncomment the following line to enable command auto-correction.
44+
# ENABLE_CORRECTION="true"
45+
46+
# Uncomment the following line to display red dots whilst waiting for completion.
47+
# You can also set it to another string to have that shown instead of the default red dots.
48+
# e.g. COMPLETION_WAITING_DOTS="%F{yellow}waiting...%f"
49+
# Caution: this setting can cause issues with multiline prompts in zsh < 5.7.1 (see #5765)
50+
# COMPLETION_WAITING_DOTS="true"
51+
52+
# Uncomment the following line if you want to disable marking untracked files
53+
# under VCS as dirty. This makes repository status check for large repositories
54+
# much, much faster.
55+
# DISABLE_UNTRACKED_FILES_DIRTY="true"
56+
57+
# Uncomment the following line if you want to change the command execution time
58+
# stamp shown in the history command output.
59+
# You can set one of the optional three formats:
60+
# "mm/dd/yyyy"|"dd.mm.yyyy"|"yyyy-mm-dd"
61+
# or set a custom format using the strftime function format specifications,
62+
# see 'man strftime' for details.
63+
# HIST_STAMPS="mm/dd/yyyy"
64+
65+
# Would you like to use another custom folder than $ZSH/custom?
66+
# ZSH_CUSTOM=/path/to/new-custom-folder
67+
68+
# Which plugins would you like to load?
69+
# Standard plugins can be found in $ZSH/plugins/
70+
# Custom plugins may be added to $ZSH_CUSTOM/plugins/
71+
# Example format: plugins=(rails git textmate ruby lighthouse)
72+
# Add wisely, as too many plugins slow down shell startup.
73+
plugins=(git zsh-autosuggestions zsh-syntax-highlighting)
74+
75+
76+
source $ZSH/oh-my-zsh.sh
77+
78+
# User configuration
79+
80+
# export MANPATH="/usr/local/man:$MANPATH"
81+
82+
# You may need to manually set your language environment
83+
# export LANG=en_US.UTF-8
84+
85+
# Preferred editor for local and remote sessions
86+
# if [[ -n $SSH_CONNECTION ]]; then
87+
# export EDITOR='vim'
88+
# else
89+
# export EDITOR='nvim'
90+
# fi
91+
92+
# Compilation flags
93+
# export ARCHFLAGS="-arch $(uname -m)"
94+
95+
# Set personal aliases, overriding those provided by Oh My Zsh libs,
96+
# plugins, and themes. Aliases can be placed here, though Oh My Zsh
97+
# users are encouraged to define aliases within a top-level file in
98+
# the $ZSH_CUSTOM folder, with .zsh extension. Examples:
99+
# - $ZSH_CUSTOM/aliases.zsh
100+
# - $ZSH_CUSTOM/macos.zsh
101+
# For a full list of active aliases, run `alias`.
102+
#
103+
# Example aliases
104+
# alias zshconfig="mate ~/.zshrc"
105+
# alias ohmyzsh="mate ~/.oh-my-zsh"
106+
107+
# >>> conda initialize >>>
108+
# !! Contents within this block are managed by 'conda init' !!
109+
__conda_setup="$('/home/gcpuser/miniconda3/bin/conda' 'shell.bash' 'hook' 2> /dev/null)"
110+
if [ $? -eq 0 ]; then
111+
eval "$__conda_setup"
112+
else
113+
if [ -f "/home/gcpuser/miniconda3/etc/profile.d/conda.sh" ]; then
114+
. "/home/gcpuser/miniconda3/etc/profile.d/conda.sh"
115+
else
116+
export PATH="/home/gcpuser/miniconda3/bin:$PATH"
117+
fi
118+
fi
119+
unset __conda_setup
120+
# <<< conda initialize <<<

0 commit comments

Comments
 (0)