Skip to content

Latest commit

 

History

61 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

New Request

Description

As an HPC facilitator I assist researchers with troubleshooting or optimizing their code. To keep my work organized I created this tooling that generates a directory structure to support my work for any new request I receive, plus helper scripts and Claude Code assets for diagnosing common build/environment problems.

Requirements

Git needs to be installed. Helper scripts under bin/ use LMOD module commands (BU SCC). Add bin/ to your PATH for the common tools (new_request.sh, triage_build_log.sh) — e.g. in ~/.bashrc:

export PATH="/path/to/new_request/bin:$PATH"

Per-language tools live in bin/<lang>/ and are activated per request via the workspace's module_load.sh (see Usage), so they aren't all on your PATH at once.

Usage

Syntax: new_request.sh CLIENT TICKET [DIR] [--lang LANGS]
Arguments:
    CLIENT     A client identifier (e.g. username).
    TICKET     Request identifier (e.g. ticket number).
    DIR        Location to create directory hierarchy (if blank defaults to pwd).
    --lang     Comma-separated language toolset(s) to activate, e.g. --lang r
               or --lang r,python . Puts bin/<lang> on PATH when the workspace's
               module_load.sh is sourced.

new_request.sh lives in this repo's bin/; with bin/ on your PATH you can run it from anywhere. It creates a new request directory using CLIENT and TICKET as unique identifiers and initializes it as a git repository. For example:

new_request.sh bob 123456 --lang r
Initialized empty Git repository in /projectnb/dvm-rcs/client/bob/123456/.git/

Helper scripts (bin/)

Scripts are organized by language and maintained once (not copied into each workspace):

  • Common (top-level bin/):
    • new_request.sh — scaffold a request workspace.
    • triage_build_log.sh [LOG|WORKSPACE] — analyze any build/compile/install log: strips warning noise, finds the real error, detects the ecosystem, and classifies it (SUCCESS / COMPILE-ERROR / LINK-ERROR / OOM-KILL / MISSING-DEPENDENCY / CONFIGURE-ERROR / ENV-NOT-ACTIVATED / UNKNOWN). Backs the triage-build-log Claude skill.
  • R (bin/r/):
    • r_env.sh [R_MODULE] [WORKSPACE] — one-time setup: loads the R module, makes a per-module package library in the workspace, installs the packages VSCode needs, and records the R env in the workspace's module_load.sh + .gitignore. Run it (don't source); activate afterwards with source <workspace>/module_load.sh.
    • r_snapshot.sh [WORKSPACE] — records the workspace's R library into env_setup/renv.lock (a manifest). Uses renv only to document the library, not change it.
    • r_install.sh <pkg> [WORKSPACE] — reproduce a researcher's R package install in the workspace and report a classified outcome (via triage_build_log.sh).
  • bin/python/ — placeholder for future Python tools.

Reproducing a researcher's R environment

Reproduce the researcher's R environment inside the request's isolated library and capture a manifest; step 3 (the copy) is manual:

  1. Set up the R environment (one-time; run by path — it needs nothing on PATH and writes the R block into module_load.sh):
    /path/to/new_request/bin/r/r_env.sh R/4.5.2 /path/to/request
  2. Activate (now and every future session — loads R, sets R_LIBS_USER, and puts the common bin/ + the R toolset on PATH):
    source /path/to/request/module_load.sh
  3. Copy the researcher's R library into $R_LIBS_USER — done manually with scp (it requires logging in as the researcher). Byte-for-byte copy, valid only on the same cluster / same R version.
  4. Record the manifest:
    r_snapshot.sh /path/to/request

To switch R versions later, just re-run step 1 with a different R/X.Y; r_env.sh replaces the R block in module_load.sh (re-source to pick it up).

renv.lock is committed (the record of what was reproduced); the reproduced R/<version>/ library is not. You do not need the researcher to have used renv.

Diagnosing build/install failures

  • For a failing R package install, ask Claude Code to use the r-install-debugger subagent (or run r_install.sh <pkg> yourself): it reproduces the install in the workspace and returns a classified verdict.
  • For any build log (R, Python, C/C++, Fortran), run triage_build_log.sh <log> or invoke the /triage-style triage-build-log skill in Claude Code. It declares the ecosystems it supports and reports back if a log's language is outside that set, instead of guessing.

Directory Structure

The scaffolder creates:

  • data — relevant data used by the client's scripts.
  • env_setup — holds renv.lock (the reproduced-package manifest, tracked) and .renv-tools/ (gitignored). The helper scripts live centrally in this repo's bin/<lang>/, not here.
  • scripts — the client's scripts.
  • output — output generated by the client's scripts (e.g. *_install.log).
  • context — request context: problem.md and links.md for you to fill in; /init-request also writes SUMMARY.md. Drop researcher-provided build/job logs in context/logs/ (gitignored; the folder is kept via .gitkeep) — /init-request samples each log's head + tail and triages build logs rather than reading them whole.
  • CLAUDE.md — per-workspace map of the layout + conventions, so Claude Code has context.
  • module_load.sh — sourced to activate the workspace: loads modules, puts the request's bin/<lang> toolset(s) on PATH, and exports XDG_*, RENV_PATHS_ROOT, and R_ENVIRON_USER/R_PROFILE_USER/R_HISTFILE into the request directory so caches/config/data/history stay in the workspace, not your home (~/.cache, ...). Best-effort — scripts that hardcode ~ or absolute home paths can still escape; use a container or throwaway user for hard isolation.

Troubleshooting context for Claude

Each request workspace gives Claude Code the context it needs:

  1. Describe the issue in context/problem.md and add relevant URLs/tickets to context/links.md.
  2. Run the /init-request slash command in the workspace — it reads CLAUDE.md, context/, scripts/, and the environment, writes context/SUMMARY.md, and reports.

Each workspace's .claude/ is a symlink to this repo's own .claude/, so every Claude command/skill/agent lives in one place: add or edit one here (.claude/commands/, .claude/skills/, .claude/agents/) and every workspace — existing and new — picks it up, no re-scaffolding. (The workspace .claude symlink is gitignored.)

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages