-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathsetup-dev.sh
More file actions
executable file
·120 lines (99 loc) · 3.31 KB
/
setup-dev.sh
File metadata and controls
executable file
·120 lines (99 loc) · 3.31 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
#!/bin/bash
set -euo pipefail
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
VENV_DIR="${SCRIPT_DIR}/.venv"
DISABLE_VENV=false
while [[ $# -gt 0 ]]; do
case $1 in
--disable-venv)
DISABLE_VENV=true
shift
;;
*)
echo "Unknown option: $1" >&2
exit 1
;;
esac
done
# shellcheck source=deploy/002-setup/lib/common.sh
source "${SCRIPT_DIR}/deploy/002-setup/lib/common.sh"
# Preamble: Recommend devcontainer for easier setup
echo
echo "💡 RECOMMENDED: Use the Dev Container for the best experience."
echo
echo "The devcontainer includes all tools pre-configured:"
echo " • Azure CLI, Terraform, kubectl, helm, jq"
echo " • Python with all dependencies"
echo " • VS Code extensions for Terraform and Python"
echo
echo "To use:"
echo " VS Code → Reopen in Container (F1 → Dev Containers: Reopen)"
echo " Codespaces → Open in Codespace from GitHub"
echo
echo "If this script fails, the devcontainer is your fallback."
echo
section "Tool Verification"
require_tools az terraform kubectl helm jq
info "All required tools found"
section "UV Package Manager Setup"
if ! command -v uv &>/dev/null; then
info "Installing uv package manager..."
curl -LsSf https://astral.sh/uv/install.sh | sh
export PATH="$HOME/.local/bin:$HOME/.cargo/bin:$PATH"
fi
info "Using uv: $(uv --version)"
section "Python Environment Setup"
PYTHON_VERSION="$(cat "${SCRIPT_DIR}/.python-version")"
info "Target Python version: ${PYTHON_VERSION}"
if [[ "${DISABLE_VENV}" == "true" ]]; then
info "Virtual environment disabled, installing packages directly..."
else
if [[ ! -d "${VENV_DIR}" ]]; then
info "Creating virtual environment at ${VENV_DIR} with Python ${PYTHON_VERSION}..."
uv venv "${VENV_DIR}" --python "${PYTHON_VERSION}"
else
info "Virtual environment already exists at ${VENV_DIR}"
fi
fi
info "Syncing dependencies from pyproject.toml..."
uv sync
info "Locking dependencies..."
uv lock
section "IsaacLab Setup"
ISAACLAB_DIR="${SCRIPT_DIR}/external/IsaacLab"
if [[ -d "${ISAACLAB_DIR}" ]]; then
info "IsaacLab already cloned at ${ISAACLAB_DIR}"
info "To update, run: cd ${ISAACLAB_DIR} && git pull"
else
info "Cloning IsaacLab for intellisense/Pylance support..."
mkdir -p "${SCRIPT_DIR}/external"
git clone https://github.com/isaac-sim/IsaacLab.git "${ISAACLAB_DIR}"
info "IsaacLab cloned successfully"
fi
section "hve-core Check"
if [[ ! -d "${SCRIPT_DIR}/../hve-core" ]]; then
warn "hve-core not found at ${SCRIPT_DIR}/../hve-core"
warn "Install for Copilot workflows: https://github.com/microsoft/hve-core/blob/main/docs/getting-started/install.md"
warn "Or install the VS Code Extension: ise-hve-essentials.hve-core"
else
info "hve-core found at ${SCRIPT_DIR}/../hve-core"
fi
section "Setup Complete"
echo
echo "✅ Development environment setup complete!"
echo
if [[ "${DISABLE_VENV}" == "false" ]]; then
warn "Run this command to activate the virtual environment:"
echo
echo " source .venv/bin/activate"
echo
fi
echo "Next steps:"
echo " 1. Run: source deploy/000-prerequisites/az-sub-init.sh"
echo " 2. Configure: deploy/001-iac/terraform.tfvars"
echo " 3. Deploy: cd deploy/001-iac && terraform init && terraform apply"
echo
echo "Documentation:"
echo " - README.md - Quick start guide"
echo " - deploy/README.md - Deployment overview"
echo