- Jupyter Notebook 99.2%
- R 0.5%
- Python 0.2%
- CSS 0.1%
| .githooks | ||
| _myst | ||
| autoscaling | ||
| tests | ||
| .gitignore | ||
| .lintr | ||
| .python-version | ||
| deploy.py | ||
| index.md | ||
| Makefile | ||
| myst.yml | ||
| pyproject.toml | ||
| README.md | ||
| uv.lock | ||
research journal
The notebook of research progress at PEG plus the notebook runtime done in MyST.
Notebook runtime
Each project folder runs notebooks through two named Jupyter kernels, registered
host-wide (--user) from the sim repo's shared script (the one source of truth for
their ids/display names, shared with the hub image build):
| Kernel id | Display | Interpreter / library |
|---|---|---|
peg-autoscaling |
autoscaling (py) |
autoscaling/.venv (editable sim libs) |
peg-autoscaling-r |
autoscaling (R) |
isolated renv library (kernelspec pins R_LIBS) |
The script to register these kernels can be found in the corresponding runtime repositories.
Environment (the PEG_* contract)
Notebooks resolve their dataset/workspace roots from environment variables. Each
project folder has a committed, self-contained .env (${HOME}-relative, no absolute
paths):
# autoscaling/.env
PEG_DATA_DIR=${HOME}/datasets
PEG_WORKSPACE_ROOT=${HOME}/workspace
PEG_RESULTS_DIR=${PEG_WORKSPACE_ROOT}/autoscaling/results
PEG_WORKLOADS_DIR=${PEG_WORKSPACE_ROOT}/autoscaling/workloads
Both kernels load the nearest .env at kernel startup, walking up from the
notebook's folder, so values resolve regardless of how the Jupyter server was launched
(VSCode, JupyterLab, console). The two loaders are machine config, not committed:
Python — ~/.ipython/profile_default/startup/00-peg-env.py (python-dotenv):
try:
from dotenv import load_dotenv, find_dotenv
load_dotenv(find_dotenv(usecwd=True)) # walk up from the kernel's CWD
except ImportError:
pass
R — ~/.Rprofile (base R's readRenviron parses the same .env format, so both
kernels share one source of truth):
local({
dir <- getwd()
repeat {
f <- file.path(dir, ".env")
if (file.exists(f)) { try(readRenviron(f), silent = TRUE); break }
parent <- dirname(dir); if (identical(parent, dir)) break; dir <- parent
}
})
Environment is read at kernel start, so restart the kernel after editing a .env.
On a JupyterHub deployment, the runtime image supplies the same vars via container ENV.