Skip to content

Package installation - #434

Open
anshisax wants to merge 32 commits into
masterfrom
package-installation
Open

Package installation#434
anshisax wants to merge 32 commits into
masterfrom
package-installation

Conversation

@anshisax

@anshisax anshisax commented Jun 17, 2026

Copy link
Copy Markdown

Problem

Users want specific packages pre-installed so they don't have to run pip install or install.packages() every time they create an app. Custom app options are too complex for simple cases like "R Analysis with these 15 packages."

Solution

Natural language package installation - users can ask Claude for packages in plain English:

Examples:

  • "I need ggplot2" → Claude generates R installation command
  • "Set me up for machine learning" → Installs scikit-learn, xgboost, tensorflow, etc.
  • "I want tools for genomics analysis" → Installs appropriate bio packages

Two approaches:

  1. Pre-install (common-packages feature) - packages available at app startup

    {
      "features": {
        "ghcr.io/verily-src/workbench-app-devcontainers/common-packages": {
          "pythonPackages": "tensorflow scikit-learn pandas",
          "rPackages": "Seurat,DESeq2,ggplot2"
        }
      }
    }
  2. On-demand (natural language with Claude) - install as needed while working

    • User: "I need plotly for visualization"
    • Claude: !pip install plotly

What's Added

  • features/src/common-packages/ - Feature for pre-installing packages
  • features/src/llm-context/skills/INSTALL_PACKAGES.md - Natural language skill for Claude
  • PACKAGE_INSTALLATION_GUIDE.md - User documentation

Impact

Before: 69 file changes (duplicate templates, embedded features)
After: 6 net file additions (removed 63 redundant files)

Users can pre-install packages with natural language OR explicit lists - simpler and more flexible than custom app options.

Examples

Machine learning:

{"pythonPackages": "scikit-learn xgboost tensorflow torch pandas numpy matplotlib"}

Genomics:

{"rPackages": "Seurat,DESeq2,GenomicRanges,tidyverse,ggplot2"}

On-demand in Jupyter:
User: "I need deep learning packages"
Claude: !pip install tensorflow torch transformers keras

https://verily.atlassian.net/browse/BENCH-8796

anshisax and others added 4 commits June 17, 2026 12:12
Add PACKAGE_INSTALLATION_GUIDE.md with three approaches for pre-installing
packages in Workbench apps:

1. Devcontainer Features (easiest for R packages)
   - Use ghcr.io/rocker-org/devcontainer-features/r-packages
   - Simple comma-separated package list
   - Auto-installs system dependencies

2. Custom Dockerfile (best for Python packages)
   - Add RUN pip install commands
   - Cached in image layers for fast startup
   - Full version control

3. Post-create scripts (most flexible)
   - Supports mixed R + Python environments
   - Dynamic installation from requirements.txt

Includes:
- Complete working examples (R Analysis, Jupyter ML/AI stack)
- Comparison table showing when to use each approach
- FAQ section addressing common questions
- Copy-paste templates for quick setup

This addresses the common user need to avoid running pip install or
install.packages() every time they create an app, without requiring
the complexity of custom app options.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Add a devcontainer feature that solves the common use case: users want
specific packages pre-installed to avoid running pip install or
install.packages() every time they create an app.

Features:
- Curated package presets (basic, ml, bio, full)
- Works for both Python and R
- Custom package support on top of presets
- No Dockerfile needed - just add to .devcontainer.json

Example usage:
{
  "features": {
    "ghcr.io/verily-src/workbench-app-devcontainers/common-packages": {
      "pythonPackages": "basic",
      "customPythonPackages": "mypackage",
      "rPackages": "basic",
      "customRPackages": "zoo,forecast"
    }
  }
}

This is simpler than custom app options for the common case where users
just want "R Analysis with these 15 packages".

Also updated PACKAGE_INSTALLATION_GUIDE.md to feature this approach first.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Remove presets. Users just specify their package list:

{
  "features": {
    "common-packages": {
      "pythonPackages": "pandas numpy scikit-learn",
      "rPackages": "tidyverse,ggplot2,dplyr,plotly,shiny"
    }
  }
}

This solves the exact use case: 'R Analysis with these 15 packages
pre-installed' without the complexity of custom app options.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
@anshisax
anshisax requested review from a team as code owners June 17, 2026 21:28
anshisax and others added 7 commits June 17, 2026 15:31
Enables workflow:
User: 'I want R with tidyverse, ggplot2, plotly'
Claude: Generates complete devcontainer directory with those packages pre-installed

Output can go in user's own repo - doesn't need to be in workbench-app-devcontainers.

Skill teaches Claude to use the common-packages feature for package pre-installation.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
- Renamed skill to CREATE_CUSTOM_APP_WITH_PACKAGES (not just R)
- Feature works for Jupyter, VSCode, RStudio, etc.
- Supports both Python and R packages
- Simplified documentation

Users can request any app type with any packages:
- 'I want Jupyter with pandas and numpy'
- 'I want VSCode with tensorflow'
- 'I want R with tidyverse'

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
- Remove 63 files (duplicate app templates and embedded features)
- Add INSTALL_PACKAGES.md skill for natural language package requests
- Simplify PACKAGE_INSTALLATION_GUIDE.md to focus on two approaches:
  1. Natural language with Claude (easiest)
  2. Pre-install with common-packages feature
- Keep core common-packages feature for pre-installation
- Enable Claude to understand requests like 'I need ggplot2' or 'set me up for machine learning'

This reduces the PR from 69 files to 6 files while enabling more flexible package installation through natural language.
Comment thread features/src/common-packages/devcontainer-feature.json
Comment thread features/src/llm-context/skills/CREATE_CUSTOM_APP_WITH_PACKAGES.md
Comment thread features/src/llm-context/PACKAGE_INSTALLATION_GUIDE.md
anshisax and others added 3 commits July 9, 2026 14:29
…S.md

Co-authored-by: David Shen <2984600+pantherman594@users.noreply.github.com>
Ensures common-packages installs after Python, R, and workbench-tools features are available.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Address review feedback - this file belongs in the llm-context feature directory, not the repository root.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
@anshisax
anshisax requested a review from pantherman594 July 9, 2026 21:40
Comment thread features/src/common-packages/README.md Outdated
anshisax added 6 commits July 13, 2026 09:39
Addresses NBBense feedback: packages persist across stop/restart,
not across all app creations. Only cached default configs benefit
from persistent caching.
Test app validates:
- llm-context feature loads
- common-packages feature installs Python packages
- Packages are available on first launch
Devcontainer CLI requires local features to be children of .devcontainer/
Moving from src/jupyter-test-packages to jupyter-test-packages (root level)
allows ../features/src/* paths to work correctly.
Devcontainer CLI requires local features to be children of .devcontainer/
Symlink allows ./features/src/* paths to work within the constraint.
Test app now runs Jupyter Lab on port 8888 to satisfy Workbench
proxy requirements while testing package installation features.
Python 3.11 blocks pip in system Python. Using jupyter/base-notebook
which has Jupyter pre-installed and allows pip packages.
Comment thread jupyter-test-packages/.devcontainer/devcontainer.json Outdated
anshisax added 2 commits July 13, 2026 11:56
Testing package installation feature in a working Jupyter template.
Responding to @pantherman594 feedback on jupyter-test-packages.

Test app validation complete:
- llm-context feature: natural language package installation working
- common-packages feature: pandas, numpy, scikit-learn, matplotlib,
  seaborn pre-installed successfully
- Domain-based installation validated (genomics, time series packages)

Reverted workbench-jupyter-with-llm to original state - users will
add features to their own apps as needed.

Deliverables:
- features/src/llm-context/ (natural language installation skill)
- features/src/common-packages/ (pre-install packages)
- Documentation and README
anshisax and others added 5 commits July 13, 2026 14:46
Created GEMINI_PACKAGE_INSTALL.md with simplified domain mappings
for Gemini CLI. Users can now use natural language package
installation with both Claude and Gemini.

Same domain mappings as INSTALL_PACKAGES.md but formatted for
Gemini's consumption.
Created ANTIGRAVITY_PACKAGE_INSTALL.md with domain mappings for
Antigravity AI assistant. Now supports natural language package
installation across Claude, Gemini, and Antigravity.

Same domain mappings as INSTALL_PACKAGES.md but formatted for
Antigravity's consumption.
Adds quotes around ${PYTHONPACKAGES} in pip install command to prevent
globbing and word splitting issues as flagged by shellcheck.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Rework CREATE_CUSTOM_APP_WITH_PACKAGES so the skill outputs one
copy-pasteable .devcontainer.json that a customer points their custom
app config at: prebuilt jupyter image + common-packages feature, both
by ghcr path. Fixes the prior local ./.devcontainer path and the
package-only config that didn't actually launch an app.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Rework the package-installation skills so "create me a custom app with
these packages" produces a complete app folder (.devcontainer.json +
docker-compose.yaml + devcontainer-template.json, +Dockerfile for
VSCode) that drops into src/<app-name>/ and runs as a Workbench custom
app, rather than a lone .devcontainer.json (which can't launch an app).

- CREATE_CUSTOM_APP_WITH_PACKAGES.md: full rewrite. Per-app-type
  scaffolds (Jupyter/RStudio-Shiny/VSCode) based on the real templates,
  with common-packages injected; complete worked Jupyter example.
- ANTIGRAVITY_PACKAGE_INSTALL.md: add "Create a Custom App (Full
  Folder)" section mirroring the same behavior.
- INSTALL_PACKAGES.md: fix the Creating Apps section that showed a
  conflicting single-file config; defer to the folder-scaffold skill.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
anshisax and others added 5 commits July 21, 2026 09:21
- workbench-jupyter-with-llm: add common-packages feature (local path)
  with sample python/R packages so the existing app exercises package
  pre-install.
- custom-jupyter-ml: full skill-generated custom app folder
  (.devcontainer.json + docker-compose.yaml + devcontainer-template.json
  + README) to verify the skill produces every file needed for a custom
  app. Uses the local feature path since common-packages isn't published
  to ghcr yet.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Commit 5b03bd0 quoted ${PYTHONPACKAGES} to satisfy shellcheck SC2086,
but that makes pip treat the whole space-separated list as one invalid
requirement ("pandas numpy scikit-learn") and the feature install fails,
erroring the app build. Word-splitting is intentional here; leave it
unquoted and disable SC2086 inline instead.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Full app folder generated by CREATE_CUSTOM_APP_WITH_PACKAGES for a
single-cell (Python) request: .devcontainer.json + docker-compose.yaml +
devcontainer-template.json + README, with common-packages installing
scanpy anndata leidenalg pandas numpy matplotlib. Uses the local feature
path pending ghcr publication.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The in-app skill routing table only advertised CUSTOM_APP.md, so
requests like "create a custom app with these packages" routed to the
generic guide and never hit the package skill. Add
CREATE_CUSTOM_APP_WITH_PACKAGES.md and INSTALL_PACKAGES.md to the
Available Skills table and add a trigger block that takes precedence
over CUSTOM_APP.md whenever packages/pre-install are involved.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The jupyter-template base defaults to bare debian:bullseye, so generated
Jupyter apps tried to build Python/JupyterLab from scratch and failed at
deploy (sysconfig.get_default_scheme AttributeError, post-startup.sh
exit 1). Base Jupyter apps on the prebuilt app-workbench-jupyter image
instead (custom-workbench-jupyter-template pattern: Dockerfile +
jupyter-common compose), which is the base that deploys successfully.

- CREATE_CUSTOM_APP_WITH_PACKAGES.md: Jupyter now uses the prebuilt
  template; worked example rewritten with Dockerfile + include compose;
  added a warning against jupyter-template.
- src/jupyter-single-cell: regenerated on the prebuilt base.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Hey @anshisax, looks like there are 2 other generated apps that might've been from your testing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants