Skip to content
This repository was archived by the owner on Mar 11, 2026. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 15 additions & 11 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,9 @@
"ghcr.io/devcontainers/features/docker-in-docker:2": {},
"ghcr.io/devcontainers/features/git:1": {},
"ghcr.io/devcontainers/features/azure-cli:1": {
"extensions": "connectedk8s,k8s-extension,azure-iot-ops,amg,eventgrid"
"extensions": "connectedk8s,k8s-extension,azure-iot-ops,amg,eventgrid,ml"
},
"ghcr.io/devcontainers/features/github-cli:1": {},
"ghcr.io/devcontainers-extra/features/pipx-package:1": {},
"ghcr.io/devcontainers-extra/features/pre-commit:2": {},
"ghcr.io/devcontainers/features/node:1": {},
"ghcr.io/devcontainers/features/terraform:1": {
"installTerraformDocs": true
Expand All @@ -35,6 +33,13 @@
"bash": {
"path": "/bin/bash"
}
},
"[python]": {
"editor.defaultFormatter": "charliermarsh.ruff",
"editor.codeActionsOnSave": {
"source.fixAll": "explicit",
"source.organizeImports": "explicit"
}
}
},
"extensions": [
Expand All @@ -47,9 +52,7 @@
"GitHub.vscode-pull-request-github",
"hashicorp.terraform",
"ms-azuretools.vscode-azureterraform",
"ms-azuretools.vscode-bicep",
"ms-azuretools.vscode-docker",
"ms-dotnettools.csdevkit",
"ms-python.debugpy",
"ms-python.python",
"ms-python.vscode-pylance",
Expand All @@ -63,14 +66,12 @@
"ms-kubernetes-tools.vscode-kubernetes-tools",
"github.vscode-github-actions",
"bierner.markdown-mermaid",
"ms-python.autopep8",
"ms-azuretools.vscode-azurefunctions",
"ms-azuretools.vscode-azureresourcegroups",
"ms-python.black-formatter",
"ms-azuretools.vscode-containers",
"tamasfe.even-better-toml",
"ms-python.flake8",
"redhat.vscode-yaml",
"ms-toolsai.vscode-ai",
"GitHub.copilot@prerelease",
"GitHub.copilot-chat@prerelease"
]
Expand All @@ -86,10 +87,13 @@
},

"onCreateCommand": {
// "pip": "pip install -r requirements.txt",
"apt": "sudo apt update && sudo apt install -y shellcheck",
"setup-dev": "./setup-dev.sh --disable-venv",
"apt": "sudo apt update && sudo apt install -y shellcheck jq unzip",
"tflint": "curl -s https://raw.githubusercontent.com/terraform-linters/tflint/master/install_linux.sh | bash",
"update-bashrc": "echo 'export PATH=\"${containerWorkspaceFolder}/scripts:$PATH\"' | sudo tee -a ~/.bashrc"
"update-bashrc": "echo 'export PATH=\"${containerWorkspaceFolder}/scripts:$PATH\"' | sudo tee -a ~/.bashrc",
"osmo-cli": "curl -fsSL https://raw.githubusercontent.com/NVIDIA/OSMO/refs/heads/main/install.sh | bash || true",
"ngc-cli": "wget -qO /tmp/ngccli.zip https://ngc.nvidia.com/downloads/ngccli_linux.zip && sudo unzip -o /tmp/ngccli.zip -d /usr/local/bin && rm /tmp/ngccli.zip && sudo chmod u+x /usr/local/bin/ngc || true",
Copy link

Copilot AI Dec 11, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The NGC CLI installation uses sudo chmod u+x which only sets execute permission for the owner. Since the file is installed to /usr/local/bin (a system directory), it should use sudo chmod +x to ensure the executable is runnable by all users. The current approach may prevent other users from executing the ngc command.

Suggested change
"ngc-cli": "wget -qO /tmp/ngccli.zip https://ngc.nvidia.com/downloads/ngccli_linux.zip && sudo unzip -o /tmp/ngccli.zip -d /usr/local/bin && rm /tmp/ngccli.zip && sudo chmod u+x /usr/local/bin/ngc || true",
"ngc-cli": "wget -qO /tmp/ngccli.zip https://ngc.nvidia.com/downloads/ngccli_linux.zip && sudo unzip -o /tmp/ngccli.zip -d /usr/local/bin && rm /tmp/ngccli.zip && sudo chmod +x /usr/local/bin/ngc || true",

Copilot uses AI. Check for mistakes.
"az-ml": "az extension add -n ml --yes || true"
},

// DONT USE 'postCreateCommand', it ruins your global .gitconfig https://github.com/devcontainers/cli/issues/787
Expand Down
133 changes: 99 additions & 34 deletions setup-dev.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,55 +3,120 @@ set -euo pipefail

SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
VENV_DIR="${SCRIPT_DIR}/.venv"
DISABLE_VENV=false

echo "Setting up local development environment..."
while [[ $# -gt 0 ]]; do
case $1 in
--disable-venv)
DISABLE_VENV=true
shift
;;
*)
echo "Unknown option: $1" >&2
exit 1
;;
esac
done

if command -v pyenv &> /dev/null; then
PYTHON_VERSION="$(cat "${SCRIPT_DIR}/.python-version")"
echo "Python version from .python-version: ${PYTHON_VERSION}"
echo "Installing Python ${PYTHON_VERSION} via pyenv..."
pyenv install -s "${PYTHON_VERSION}"
# 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 "Python Environment Setup"

PYTHON_VERSION="$(cat "${SCRIPT_DIR}/.python-version")"
info "Target Python version: ${PYTHON_VERSION}"

if command -v pyenv &>/dev/null; then
info "Installing Python ${PYTHON_VERSION} via pyenv..."
pyenv install -s "${PYTHON_VERSION}"
PYTHON_CMD="python"
elif command -v python3 &>/dev/null; then
warn "pyenv not found, using system python3"
PYTHON_CMD="python3"
else
fatal "Neither pyenv nor python3 found. Please install Python 3.11+"
fi

echo "Using pyenv Python $(python --version)"
info "Using Python: $($PYTHON_CMD --version)"

if [[ ! -d "${VENV_DIR}" ]]; then
echo "Creating virtual environment at ${VENV_DIR}..."
python -m venv "${VENV_DIR}"
if [[ "${DISABLE_VENV}" == "true" ]]; then
info "Virtual environment disabled, installing packages directly..."
else
echo "Virtual environment already exists at ${VENV_DIR}"
if [[ ! -d "${VENV_DIR}" ]]; then
info "Creating virtual environment at ${VENV_DIR}..."
$PYTHON_CMD -m venv "${VENV_DIR}"
Copy link

Copilot AI Dec 11, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The variable $PYTHON_CMD should be quoted to prevent word splitting in case the path contains spaces. While unlikely for Python executables, it's a best practice for shell scripts to quote variable expansions. Change to "$PYTHON_CMD".

Suggested change
$PYTHON_CMD -m venv "${VENV_DIR}"
"$PYTHON_CMD" -m venv "${VENV_DIR}"

Copilot uses AI. Check for mistakes.
else
info "Virtual environment already exists at ${VENV_DIR}"
fi
info "Activating virtual environment..."
source "${VENV_DIR}/bin/activate"
fi

echo "Activating virtual environment..."
source "${VENV_DIR}/bin/activate"
info "Upgrading pip..."
pip install --upgrade pip --quiet

echo "Upgrading pip..."
pip install --upgrade pip
info "Installing root dependencies..."
if ! pip install -r "${SCRIPT_DIR}/requirements.txt" --quiet 2>/dev/null; then
warn "Some packages failed to install (expected on macOS for Linux-only packages)"
fi
Comment on lines +80 to +82
Copy link

Copilot AI Dec 11, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The pip install commands redirect stderr to /dev/null (2>/dev/null), which completely suppresses error messages. This makes debugging difficult when installations fail. Consider redirecting stderr to a log file or at least letting critical errors through while only suppressing warnings. This would help users understand what went wrong during setup.

Copilot uses AI. Check for mistakes.

echo "Installing root dependencies..."
pip install -r "${SCRIPT_DIR}/requirements.txt"
info "Installing training dependencies..."
if ! pip install -r "${SCRIPT_DIR}/src/training/requirements.txt" --quiet 2>/dev/null; then
warn "Some training packages failed to install"
fi
Comment on lines +85 to +87
Copy link

Copilot AI Dec 11, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similar to the root dependencies installation, stderr is completely suppressed with 2>/dev/null, hiding potentially useful error information. Consider redirecting to a log file or showing critical errors to help with debugging installation issues.

Copilot uses AI. Check for mistakes.

echo "Installing training dependencies..."
pip install -r "${SCRIPT_DIR}/src/training/requirements.txt"
section "IsaacLab Setup"

echo ""
echo "Setting up IsaacLab for local development..."
ISAACLAB_DIR="${SCRIPT_DIR}/external/IsaacLab"

if [[ -d "${ISAACLAB_DIR}" ]]; then
echo "IsaacLab already cloned at ${ISAACLAB_DIR}"
echo "To update, run: cd ${ISAACLAB_DIR} && git pull"
info "IsaacLab already cloned at ${ISAACLAB_DIR}"
info "To update, run: cd ${ISAACLAB_DIR} && git pull"
else
echo "Cloning IsaacLab for intellisense/Pylance support..."
mkdir -p "${SCRIPT_DIR}/external"
git clone https://github.com/isaac-sim/IsaacLab.git "${ISAACLAB_DIR}"
echo "✓ IsaacLab cloned successfully"
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

echo ""
echo "✓ Development environment setup complete!"
echo ""
echo "To activate the environment, run:"
echo " source .venv/bin/activate"
echo ""
echo "Python path: ${VENV_DIR}/bin/python"
section "Setup Complete"

echo
echo "✅ Development environment setup complete!"
echo
if [[ "${DISABLE_VENV}" == "false" ]]; then
warn "Run this command to activate the virtual environment:"
Copy link

Copilot AI Dec 11, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The warning message says "Run this command to activate the virtual environment" but uses the warn function which outputs to stderr with a yellow [WARN] prefix. This is more of an informational message than a warning. Consider using info instead, or use plain echo for this instructional message.

Suggested change
warn "Run this command to activate the virtual environment:"
info "Run this command to activate the virtual environment:"

Copilot uses AI. Check for mistakes.
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