feat(scripts): Add Dockerfile linting tools#28
Conversation
…ensions and commands - add 'ml' extension to Azure CLI - include new Python formatting settings - install OSMO and NGC CLI tools in onCreateCommand - update apt installation to include jq and unzip 🔧 - Generated by Copilot
…ent setup - recommend using devcontainer for easier setup - add tool verification and installation steps for Azure CLI and ML extension - improve Python environment setup with pyenv and system Python fallback - streamline virtual environment creation and package installation - update IsaacLab setup instructions for clarity ✅ - Generated by Copilot
…onment - add --disable-venv option to setup-dev.sh - modify onCreateCommand in devcontainer.json to use setup-dev script 🔧 - Generated by Copilot
There was a problem hiding this comment.
Pull request overview
This PR enhances the development environment setup by improving the devcontainer configuration and rewriting the setup-dev.sh script for better developer experience. The changes consolidate Python tooling around Ruff, add NVIDIA-specific tools (OSMO CLI, NGC CLI), and improve the setup script with better error handling, colored output, and optional virtual environment support.
Key Changes:
- Rewrote setup-dev.sh with improved UX: tool verification, colored output using common.sh helpers, --disable-venv flag for devcontainer environments, and graceful fallback when pyenv is unavailable
- Consolidated Python formatting to Ruff with auto-fix on save, replacing autopep8, black-formatter, and flake8 extensions
- Added NVIDIA tools (OSMO CLI, NGC CLI) and Azure ML extension to devcontainer onCreateCommand
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
| setup-dev.sh | Complete rewrite with argument parsing, tool verification section, improved error handling with quiet pip installs, colored output using common.sh utilities, and helpful preamble recommending devcontainer usage |
| .devcontainer/devcontainer.json | Added Azure ML CLI extension, consolidated to Ruff for Python formatting with editor settings, added NVIDIA tool installations (OSMO CLI, NGC CLI), added jq/unzip packages, removed unused extensions (Bicep, C# DevKit, pipx, pre-commit, autopep8, black, flake8) |
| "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", |
There was a problem hiding this comment.
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.
| "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", |
| 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 |
There was a problem hiding this comment.
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.
| if ! pip install -r "${SCRIPT_DIR}/src/training/requirements.txt" --quiet 2>/dev/null; then | ||
| warn "Some training packages failed to install" | ||
| fi |
There was a problem hiding this comment.
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.
| echo "✅ Development environment setup complete!" | ||
| echo | ||
| if [[ "${DISABLE_VENV}" == "false" ]]; then | ||
| warn "Run this command to activate the virtual environment:" |
There was a problem hiding this comment.
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.
| warn "Run this command to activate the virtual environment:" | |
| info "Run this command to activate the virtual environment:" |
| 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}" |
There was a problem hiding this comment.
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".
| $PYTHON_CMD -m venv "${VENV_DIR}" | |
| "$PYTHON_CMD" -m venv "${VENV_DIR}" |
Enhanced the devcontainer configuration and setup script for a more streamlined developer experience. Consolidated Python formatting to use Ruff, added NVIDIA tools (OSMO CLI, NGC CLI), and improved the setup script with better error handling and optional virtual environment support.
feat(devcontainer): Added Azure ML CLI extension to Azure CLI features and VS Code AI extension for machine learning workflows
feat(devcontainer): Consolidated Python formatting to Ruff, replacing autopep8, black-formatter, and flake8 extensions
feat(devcontainer): Added NVIDIA tool installations in onCreateCommand
/usr/local/binaz extension addrefactor(devcontainer): Removed unused extensions (Bicep, C# DevKit, pipx-package, pre-commit features)
feat(devcontainer): Added
jqandunzipto apt packages for CLI tool supportfeat(scripts): Rewrote setup-dev.sh with improved developer experience
--disable-venvflag for devcontainer environmentsfeat(scripts): Improved setup script output with colored sections using common.sh utilities
fix(scripts): Added quiet mode to pip installs with graceful error handling for platform-specific packages
🐳 - Generated by Copilot