Luca's post-PhD research results and reports
  • Jupyter Notebook 99.2%
  • R 0.5%
  • Python 0.2%
  • CSS 0.1%
Find a file
2026-07-07 22:22:32 +02:00
.githooks Restructure layout 2026-06-30 14:37:24 +02:00
_myst Add old contribution about Redset 2026-07-07 22:21:27 +02:00
autoscaling Update workload forecasting contribution 2026-07-07 22:22:32 +02:00
tests Add old contribution about Redset 2026-07-07 22:21:27 +02:00
.gitignore Add old contribution about Redset 2026-07-07 22:21:27 +02:00
.lintr Update workload exploration notebooks 2026-06-30 13:18:36 +02:00
.python-version Apply README and environment updates 2026-06-22 12:32:01 +02:00
deploy.py Restructure layout 2026-06-30 14:37:24 +02:00
index.md Lab progress site: autoscaling literature review + interactive demo 2026-06-15 12:05:22 +02:00
Makefile Restructure layout 2026-06-30 14:37:24 +02:00
myst.yml Add old contribution about Redset 2026-07-07 22:21:27 +02:00
pyproject.toml Restructure layout 2026-06-30 14:37:24 +02:00
README.md Apply README and environment updates 2026-06-22 12:32:01 +02:00
uv.lock Restructure layout 2026-06-30 14:37:24 +02:00

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.