From 45a880eacf4cb87f22907434c6c6a021d9d509f0 Mon Sep 17 00:00:00 2001 From: Chris Green Date: Tue, 28 Oct 2025 18:26:49 -0500 Subject: [PATCH 01/19] VSCode dev container setup and workspace config --- .devcontainer/devcontainer.json | 73 ++++++++++++++++++++ phlex.code-workspace | 114 ++++++++++++++++++++++++++++++++ 2 files changed, 187 insertions(+) create mode 100644 .devcontainer/devcontainer.json create mode 100644 phlex.code-workspace diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 00000000..d017d1bc --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,73 @@ +{ + "name": "Phlex CI Dev Container", + "image": "ghcr.io/framework-r-d/phlex-dev:latest", + "workspaceFolder": "/workspaces/phlex", + "containerEnv": { + "GH_CONFIG_DIR": "/home/vscode/.config/gh" + }, + "mounts": [ + "source=${env:XDG_RUNTIME_DIR}/podman/podman.sock,target=/var/run/docker.sock,type=bind", + "source=${env:HOME}/.config/gh,target=/home/vscode/.config/gh,type=bind,readonly" + ], + "customizations": { + "vscode": { + "settings": { + "cmake.generator": "Ninja", + "C_Cpp.default.cStandard": "c17", + "C_Cpp.default.cppStandard": "c++20", + "C_Cpp.default.intelliSenseMode": "linux-gcc-x64", + "C_Cpp.default.compileCommands": "${workspaceFolder}/build/compile_commands.json", + "python.languageServer": "Pylance", + "python.analysis.typeCheckingMode": "basic", + "python.analysis.diagnosticMode": "workspace" + }, + "extensions": [ + "charliermarsh.ruff", + "cheshirekow.cmake-format", + "chrisjsewell.myst-tml-syntax", + "codecov.codecov", + "codeium.codeium", + "codeium.windsurf-cpptools", + "codeium.windsurfpyright", + "davidanson.vscode-markdownlint", + "donjayamanne.githistory", + "dotjoshjohnson.xml", + "eamodio.gitlens", + "github.copilot", + "github.copilot-chat", + "github.vscode-github-actions", + "github.vscode-pull-request-github", + "jebbs.plantuml", + "lextudio.iis", + "lextudio.restructuredtext", + "lextudio.restructuredtext-pack", + "lfs.vscode-emacs-friendly", + "links-req-tracer.links-requirement-tracer", + "llvm-vs-code-extensions.vscode-clangd", + "ms-python.debugpy", + "ms-python.mypy-type-checker", + "ms-python.pylint", + "ms-python.python", + "ms-python.vscode-pylance", + "ms-python.vscode-python-envs", + "ms-vscode.cmake-tools", + "ms-vscode.cpptools", + "ms-vscode.cpptools-extension-pack", + "ms-vscode.cpptools-themes", + "ms-vscode.hexeditor", + "ms-vscode.live-server", + "ms-vscode.makefile-tools", + "ms-vscode.vscode-websearchforcopilot", + "redhat.vscode-yaml", + "saoudrizwan.claude-dev", + "shd101wyy.markdown-preview-enhanced", + "swyddfa.esbonio", + "trond-snekvik.simple-rst", + "twxs.cmake", + "vadimcn.vscode-lldb", + "wequick.coverage-gutters", + "xaver.clang-format" + ] + } + } +} diff --git a/phlex.code-workspace b/phlex.code-workspace new file mode 100644 index 00000000..3467f171 --- /dev/null +++ b/phlex.code-workspace @@ -0,0 +1,114 @@ +{ + "folders": [ + { + "name": "Phlex", + "path": "." + } + ], + "settings": { + "files.associations": { + "*.yml": "yaml", + "*.yaml": "yaml", + "codecov.yml": "plaintext" + }, + "files.exclude": { + "**/local/.*/**": true, + "**/local/*/": true + }, + "search.exclude": { + "**/local/.*/**": true, + "**/local/*/": true, + "**/build/_deps/**": true, + "**/build/CMakeFiles/**": true + }, + "files.watcherExclude": { + "**/local/.*/**": true, + "**/local/*/": true, + "**/build/_deps/**": true, + "**/build/CMakeFiles/**": true + }, + "cmake.sourceDirectory": "${workspaceFolder}", + "cmake.buildDirectory": "${workspaceFolder}/build", + "cmake.useCMakePresets": "always", + "cmake.generator": "Ninja", + "C_Cpp.default.cStandard": "c17", + "C_Cpp.default.cppStandard": "c++23", + "C_Cpp.default.intelliSenseMode": "linux-gcc-x64", + "C_Cpp.default.compileCommands": "${workspaceFolder}/build/compile_commands.json", + "C_Cpp.exclusionPolicy": "checkFolders", + "C_Cpp.files.exclude": { + "**/local/.*/**": true, + "**/local/*/": true, + "**/build/_deps/**": true, + "**/build/CMakeFiles/**": true + }, + "terminal.integrated.defaultProfile.linux": "bash", + "terminal.integrated.profiles.linux": { + "bash": { + "path": "/bin/bash", + "args": [], + "env": { + "BASH_ENV": "/entrypoint.sh" + } + } + }, + "python.languageServer": "Pylance", + "python.analysis.typeCheckingMode": "basic", + "python.analysis.diagnosticMode": "workspace", + "python.analysis.exclude": [ + "**/local/.*/**", + "**/local/*/", + "**/build/_deps/**", + "**/build/CMakeFiles/**" + ], + "python.analysis.ignore": [ + "**/local/.*/**", + "**/local/*/", + "**/build/_deps/**", + "**/build/CMakeFiles/**" + ], + "flake8.enabled": false, + "[python]": { + "editor.formatOnSave": true, + "editor.defaultFormatter": "charliermarsh.ruff", + "editor.codeActionsOnSave": { + "source.organizeImports.ruff": "explicit", + "source.fixAll.ruff": "explicit" + } + }, + "yaml.schemas": { + "https://json.schemastore.org/github-workflow.json": "./.github/workflows/*" + } + }, + "extensions": { + "recommendations": [ + "ms-vscode.cmake-tools", + "ms-vscode.cpptools", + "ms-vscode.cpptools-extension-pack", + "twxs.cmake", + "ms-vscode.vscode-json", + "redhat.vscode-yaml", + "charliermarsh.ruff", + "github.vscode-actions", + "github.copilot", + "github.copilot-chat", + "github.vscode-pull-request-github", + "ms-vscode.hexeditor" + ], + "unwantedRecommendations": [ + "reditorsupport.r", + "ms-vscode.r", + "ikuyadeu.r", + "ms-vscode.r-debugger", + "vscjava.vscode-java-pack", + "redhat.java", + "vscjava.vscode-java-debug", + "vscjava.vscode-java-test", + "vscjava.vscode-maven", + "vscjava.vscode-gradle", + "ms-python.python", + "ms-toolsai.jupyter", + "ms-python.flake8" + ] + } +} From b91b621a7a44f47feab49c97050ad99d957b0c7a Mon Sep 17 00:00:00 2001 From: Chris Green Date: Tue, 28 Oct 2025 18:26:49 -0500 Subject: [PATCH 02/19] Assorted improvements --- .devcontainer/cmake_wrapper.sh | 3 +++ .devcontainer/ctest_wrapper.sh | 3 +++ .devcontainer/devcontainer.json | 18 ++++++++++++++++++ ci/Dockerfile | 12 +++++------- 4 files changed, 29 insertions(+), 7 deletions(-) create mode 100755 .devcontainer/cmake_wrapper.sh create mode 100755 .devcontainer/ctest_wrapper.sh diff --git a/.devcontainer/cmake_wrapper.sh b/.devcontainer/cmake_wrapper.sh new file mode 100755 index 00000000..05d60472 --- /dev/null +++ b/.devcontainer/cmake_wrapper.sh @@ -0,0 +1,3 @@ +#!/bin/bash +. /entrypoint.sh +exec cmake "$@" diff --git a/.devcontainer/ctest_wrapper.sh b/.devcontainer/ctest_wrapper.sh new file mode 100755 index 00000000..dab827d5 --- /dev/null +++ b/.devcontainer/ctest_wrapper.sh @@ -0,0 +1,3 @@ +#!/bin/bash +. /entrypoint.sh +exec ctest "$@" diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index d017d1bc..7ebbe5ee 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -12,6 +12,24 @@ "customizations": { "vscode": { "settings": { + "terminal.integrated.defaultProfile.linux": "Phlex Dev", + "terminal.integrated.profiles.linux": { + "Phlex Dev": { + "path": "/bin/bash", + "args": [ + "-c", + ". /entrypoint.sh && exec bash" + ] + } + }, + "python.defaultInterpreterPath": "/opt/spack-environments/phlex-ci/.spack-env/view/bin/python", + "python.analysis.extraPaths": [ + "${workspaceFolder}/build", + "/opt/spack-environments/phlex-ci/.spack-env/view/lib/root", + "/opt/spack-environments/phlex-ci/.spack-env/view/lib/python3.14/site-packages" + ], + "cmake.cmakePath": "${workspaceFolder}/.devcontainer/cmake_wrapper.sh", + "cmake.ctestPath": "${workspaceFolder}/.devcontainer/ctest_wrapper.sh", "cmake.generator": "Ninja", "C_Cpp.default.cStandard": "c17", "C_Cpp.default.cppStandard": "c++20", diff --git a/ci/Dockerfile b/ci/Dockerfile index a96bd826..fe4ef5fb 100644 --- a/ci/Dockerfile +++ b/ci/Dockerfile @@ -15,6 +15,7 @@ FROM gcc:15.2.0 AS base ARG parallelism=18 +ENV DEBIAN_FRONTEND=noninteractive ENV LANG=en_US.UTF-8 ENV LC_ALL=en_US.UTF-8 ENV SPACK_USER_CONFIG_PATH=/dev/null @@ -72,8 +73,6 @@ COPY entrypoint.sh /entrypoint.sh RUN <<'CONFIGURE_SPACK_DEFAULTS' set -euo pipefail -. /spack/share/spack/setup-env.sh - SPACK_REPO_ROOT=/opt/spack-repos rm -rf "$SPACK_REPO_ROOT/fnal_art" "$SPACK_REPO_ROOT/phlex-spack-recipes" mkdir -p "$SPACK_REPO_ROOT" @@ -83,12 +82,11 @@ chgrp -R spack "$SPACK_REPO_ROOT" chmod -R g+rwX "$SPACK_REPO_ROOT" find "$SPACK_REPO_ROOT" -type d -exec chmod g+s {} + -spack --timestamp repo remove phlex >/dev/null 2>&1 || true -spack --timestamp repo remove fnal_art >/dev/null 2>&1 || true -spack --timestamp repo add --scope site /opt/spack-repos/phlex-spack-recipes/spack_repo/phlex -spack --timestamp repo add --scope site /opt/spack-repos/fnal_art/spack_repo/fnal_art -spack --timestamp repo set --scope site --destination /spack/var/spack/repos/builtin builtin +. /spack/share/spack/setup-env.sh +spack --timestamp repo add --scope site $SPACK_REPO_ROOT/phlex-spack-recipes/spack_repo/phlex +spack --timestamp repo add --scope site $SPACK_REPO_ROOT/fnal_art/spack_repo/fnal_art +spack --timestamp repo set --scope site --destination $SPACK_REPO_ROOT builtin spack --timestamp compiler find From 118ec55244ec181fafc2a6e46bcb9232462b45a3 Mon Sep 17 00:00:00 2001 From: Chris Green Date: Tue, 6 Jan 2026 11:38:58 -0600 Subject: [PATCH 03/19] Remove VSCode user nonsense from `Dockerfile` --- .devcontainer/devcontainer.json | 10 ++++++++++ ci/Dockerfile | 20 ++------------------ 2 files changed, 12 insertions(+), 18 deletions(-) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 7ebbe5ee..cf2627c2 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -2,6 +2,16 @@ "name": "Phlex CI Dev Container", "image": "ghcr.io/framework-r-d/phlex-dev:latest", "workspaceFolder": "/workspaces/phlex", + "remoteUser": "vscode", + "features": { + "ghcr.io/devcontainers/features/common-utils:2": { + "username": "vscode", + "userUid": "1000", + "userGid": "1000", + "configureZshAsDefaultShell": false + } + }, + "postCreateCommand": "sudo usermod -aG spack vscode", "containerEnv": { "GH_CONFIG_DIR": "/home/vscode/.config/gh" }, diff --git a/ci/Dockerfile b/ci/Dockerfile index fe4ef5fb..c7daea32 100644 --- a/ci/Dockerfile +++ b/ci/Dockerfile @@ -255,10 +255,6 @@ USER root # Dev image additions (tooling and dev user configuration) FROM base AS dev -ARG USERNAME=vscode -ARG USER_UID=1000 -ARG USER_GID=1000 -ENV HOME=/home/$USERNAME ENV SPACK_GROUP=spack ######################################################################## @@ -281,16 +277,7 @@ INSTALL_DEV_PACKAGES ######################################################################## # Create developer user and grant access to the shared spack group -RUN <<'CREATE_DEV_USER' -set -euo pipefail - -# Create developer user and grant access to the shared spack group -groupadd --gid $USER_GID $USERNAME -useradd --uid $USER_UID --gid $USER_GID --create-home $USERNAME -echo "$USERNAME ALL=(ALL) NOPASSWD:ALL" > /etc/sudoers.d/$USERNAME -chmod 0440 /etc/sudoers.d/$USERNAME -usermod -aG $SPACK_GROUP $USERNAME -CREATE_DEV_USER +# (User creation removed to be handled by devcontainer or runtime environment) ######################################################################## # Prepare workspace directory writable by the developer group @@ -299,8 +286,7 @@ RUN <<'PREP_DEV_WORKSPACE' set -euo pipefail # Prepare workspace directory writable by the developer group -mkdir -p /workspaces/phlex -chown $USERNAME:$USERNAME /workspaces +mkdir -p /workspaces chgrp $SPACK_GROUP /workspaces chmod g+rwX /workspaces PREP_DEV_WORKSPACE @@ -341,7 +327,5 @@ apt-get clean rm -rf /var/lib/apt/lists/* INSTALL_GH_CLI -USER $USERNAME -WORKDIR /workspaces/phlex SHELL ["/bin/bash", "-c"] HEALTHCHECK CMD curl -f https://github.com || exit 1 From 164d4d72badf797322bb6851890a11e4b2d556b6 Mon Sep 17 00:00:00 2001 From: Chris Green Date: Tue, 6 Jan 2026 12:00:44 -0600 Subject: [PATCH 04/19] Streamline `ci` container for current workflows --- ci/Dockerfile | 36 ++++++++++++++++++++++-------------- 1 file changed, 22 insertions(+), 14 deletions(-) diff --git a/ci/Dockerfile b/ci/Dockerfile index c7daea32..294a2352 100644 --- a/ci/Dockerfile +++ b/ci/Dockerfile @@ -152,7 +152,7 @@ set -euo pipefail spack --timestamp install --fail-fast -j $parallelism -p 1 \ --no-add --only-concrete --no-check-signature \ - cmake lcov ninja py-cmake-format py-gcovr py-pip + cmake lcov ninja py-gcovr py-pip spack clean -dfs INSTALL_TOOLING_CORE @@ -221,19 +221,6 @@ if [ -d "/build-cache" ]; then fi EXPORT_BUILDCACHE -######################################################################## -# Install ancillary Python tools (ruff) outside Spack - -RUN <<'INSTALL_PYTHON_TOOLS' -set -euo pipefail - -# Use pip to install tooling that is not packaged in Spack -. /entrypoint.sh - -PYTHONDONTWRITEBYTECODE=1 pip --isolated --no-input --disable-pip-version-check --no-cache-dir install --prefix /usr/local ruff -rm -rf ~/.spack -INSTALL_PYTHON_TOOLS - ######################################################################## # Remove transient files used during build @@ -257,6 +244,27 @@ USER root FROM base AS dev ENV SPACK_GROUP=spack +######################################################################## +# Install developer tooling (py-cmake-format, ruff) + +RUN <<'INSTALL_DEV_TOOLING' +set -euo pipefail + +# Install developer tooling not needed for CI +. /entrypoint.sh + +# Install py-cmake-format via Spack +spack --timestamp install --fail-fast -j $parallelism -p 1 \ + --no-add --only-concrete --no-check-signature \ + py-cmake-format + +spack clean -dfs + +# Install ruff via pip +PYTHONDONTWRITEBYTECODE=1 pip --isolated --no-input --disable-pip-version-check --no-cache-dir install --prefix /usr/local ruff +rm -rf ~/.spack +INSTALL_DEV_TOOLING + ######################################################################## # Install additional system packages needed for developer tooling From 141c6bc76abe431fca807b149ad003e759efca4e Mon Sep 17 00:00:00 2001 From: Chris Green Date: Tue, 6 Jan 2026 12:01:57 -0600 Subject: [PATCH 05/19] Remove development environment-specific workspace configuration --- phlex.code-workspace | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/phlex.code-workspace b/phlex.code-workspace index 3467f171..54b8df51 100644 --- a/phlex.code-workspace +++ b/phlex.code-workspace @@ -42,16 +42,6 @@ "**/build/_deps/**": true, "**/build/CMakeFiles/**": true }, - "terminal.integrated.defaultProfile.linux": "bash", - "terminal.integrated.profiles.linux": { - "bash": { - "path": "/bin/bash", - "args": [], - "env": { - "BASH_ENV": "/entrypoint.sh" - } - } - }, "python.languageServer": "Pylance", "python.analysis.typeCheckingMode": "basic", "python.analysis.diagnosticMode": "workspace", From 960c98c892b14c2bc5378a974e6bcded6eb8e462 Mon Sep 17 00:00:00 2001 From: Chris Green Date: Tue, 6 Jan 2026 12:10:23 -0600 Subject: [PATCH 06/19] Improve VSCode shell integration in devcontainers --- .devcontainer/devcontainer.json | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index cf2627c2..99e3754a 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -11,7 +11,7 @@ "configureZshAsDefaultShell": false } }, - "postCreateCommand": "sudo usermod -aG spack vscode", + "postCreateCommand": "sudo usermod -aG spack vscode && echo '. /entrypoint.sh' >> /home/vscode/.bashrc", "containerEnv": { "GH_CONFIG_DIR": "/home/vscode/.config/gh" }, @@ -22,16 +22,6 @@ "customizations": { "vscode": { "settings": { - "terminal.integrated.defaultProfile.linux": "Phlex Dev", - "terminal.integrated.profiles.linux": { - "Phlex Dev": { - "path": "/bin/bash", - "args": [ - "-c", - ". /entrypoint.sh && exec bash" - ] - } - }, "python.defaultInterpreterPath": "/opt/spack-environments/phlex-ci/.spack-env/view/bin/python", "python.analysis.extraPaths": [ "${workspaceFolder}/build", From 393444d963210a154a8e3fe97bd5b590ef9905dc Mon Sep 17 00:00:00 2001 From: Chris Green Date: Tue, 6 Jan 2026 12:57:53 -0600 Subject: [PATCH 07/19] Improve image creation instructions --- ci/Dockerfile | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ci/Dockerfile b/ci/Dockerfile index 294a2352..61ead490 100644 --- a/ci/Dockerfile +++ b/ci/Dockerfile @@ -3,8 +3,9 @@ # Multi-target Dockerfile for building the Phlex CI and development images. # Podman instructions for building tagged images with this file: -# $ podman build --target ci --tag phlex-ci: . -# $ podman build --target dev --tag phlex-dev: . +# +# $ podman build --format docker [-v :/build-cache] --target ci --tag phlex-ci: . +# $ podman build --format docker [-v :/build-cache] --target dev --tag phlex-dev: . # $ podman login ghcr.io --username -p # $ podman push phlex-ci: ghcr.io/framework-r-d/phlex-ci: # $ podman push phlex-dev: ghcr.io/framework-r-d/phlex-dev: From e84a02de7ccbafc5957b195d02afdc40f40822ea Mon Sep 17 00:00:00 2001 From: Chris Green Date: Tue, 6 Jan 2026 12:58:36 -0600 Subject: [PATCH 08/19] Enable Spack modification by user `vscode` within a devcontainer --- .devcontainer/Dockerfile | 16 ++++++++++++++++ .devcontainer/devcontainer.json | 26 ++++++++++++++++---------- 2 files changed, 32 insertions(+), 10 deletions(-) create mode 100644 .devcontainer/Dockerfile diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile new file mode 100644 index 00000000..05cbe685 --- /dev/null +++ b/.devcontainer/Dockerfile @@ -0,0 +1,16 @@ +FROM ghcr.io/framework-r-d/phlex-dev:latest + +ARG USERNAME=vscode +ARG USER_UID=1000 +ARG USER_GID=1000 +ARG SPACK_GID=2000 + +# Create the user and add to spack group +RUN groupadd --gid $USER_GID $USERNAME \ + && useradd --uid $USER_UID --gid $USER_GID --create-home $USERNAME \ + && usermod -aG $SPACK_GID $USERNAME \ + && echo "$USERNAME ALL=(ALL) NOPASSWD:ALL" > /etc/sudoers.d/$USERNAME \ + && chmod 0440 /etc/sudoers.d/$USERNAME + +# Setup entrypoint usage in bashrc +RUN echo '. /entrypoint.sh' >> /home/$USERNAME/.bashrc diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 99e3754a..0787c3f2 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -1,17 +1,13 @@ { "name": "Phlex CI Dev Container", - "image": "ghcr.io/framework-r-d/phlex-dev:latest", + "build": { + "dockerfile": "Dockerfile", + "options": [ + "--format=docker" + ] + }, "workspaceFolder": "/workspaces/phlex", "remoteUser": "vscode", - "features": { - "ghcr.io/devcontainers/features/common-utils:2": { - "username": "vscode", - "userUid": "1000", - "userGid": "1000", - "configureZshAsDefaultShell": false - } - }, - "postCreateCommand": "sudo usermod -aG spack vscode && echo '. /entrypoint.sh' >> /home/vscode/.bashrc", "containerEnv": { "GH_CONFIG_DIR": "/home/vscode/.config/gh" }, @@ -22,6 +18,16 @@ "customizations": { "vscode": { "settings": { + "terminal.integrated.defaultProfile.linux": "bash", + "terminal.integrated.profiles.linux": { + "bash": { + "path": "/bin/bash", + "args": [ + "-i" + ], + "icon": "terminal-bash" + } + }, "python.defaultInterpreterPath": "/opt/spack-environments/phlex-ci/.spack-env/view/bin/python", "python.analysis.extraPaths": [ "${workspaceFolder}/build", From 48efcc733efe814a29c8556be4f7d15a1c58ad75 Mon Sep 17 00:00:00 2001 From: Chris Green Date: Tue, 6 Jan 2026 14:56:52 -0600 Subject: [PATCH 09/19] Remove unneeded bind mount from devcontainer --- .devcontainer/devcontainer.json | 1 - 1 file changed, 1 deletion(-) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 0787c3f2..ba6b4dea 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -12,7 +12,6 @@ "GH_CONFIG_DIR": "/home/vscode/.config/gh" }, "mounts": [ - "source=${env:XDG_RUNTIME_DIR}/podman/podman.sock,target=/var/run/docker.sock,type=bind", "source=${env:HOME}/.config/gh,target=/home/vscode/.config/gh,type=bind,readonly" ], "customizations": { From 05156dfe2c70060dffa25eb23e32ddbfb1c39307 Mon Sep 17 00:00:00 2001 From: Chris Green Date: Tue, 6 Jan 2026 15:09:02 -0600 Subject: [PATCH 10/19] Disable unneeded/unhelpful message --- .devcontainer/devcontainer.json | 1 + 1 file changed, 1 insertion(+) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index ba6b4dea..fd212207 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -27,6 +27,7 @@ "icon": "terminal-bash" } }, + "terminal.integrated.shellIntegration.suggestEnablement": false, "python.defaultInterpreterPath": "/opt/spack-environments/phlex-ci/.spack-env/view/bin/python", "python.analysis.extraPaths": [ "${workspaceFolder}/build", From 4bb4dfc00b54f952b024c7d7eafb763d96b3e66e Mon Sep 17 00:00:00 2001 From: Chris Green Date: Tue, 6 Jan 2026 15:31:52 -0600 Subject: [PATCH 11/19] Remove `codecov.codecov` from devcontainer config due to conflicts --- .devcontainer/devcontainer.json | 1 - phlex.code-workspace | 1 - 2 files changed, 2 deletions(-) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index fd212207..4b47e840 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -49,7 +49,6 @@ "charliermarsh.ruff", "cheshirekow.cmake-format", "chrisjsewell.myst-tml-syntax", - "codecov.codecov", "codeium.codeium", "codeium.windsurf-cpptools", "codeium.windsurfpyright", diff --git a/phlex.code-workspace b/phlex.code-workspace index 54b8df51..00056162 100644 --- a/phlex.code-workspace +++ b/phlex.code-workspace @@ -9,7 +9,6 @@ "files.associations": { "*.yml": "yaml", "*.yaml": "yaml", - "codecov.yml": "plaintext" }, "files.exclude": { "**/local/.*/**": true, From 4b345d1f63eda1a82f551dac9c1834998ab7d856 Mon Sep 17 00:00:00 2001 From: Chris Green Date: Wed, 7 Jan 2026 09:27:59 -0600 Subject: [PATCH 12/19] Apply suggestions from code review Per https://github.com/Framework-R-D/phlex/pull/87#pullrequestreview-3632648876 Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- .devcontainer/devcontainer.json | 12 +++++------- phlex.code-workspace | 4 ++-- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 4b47e840..0815dff2 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -12,7 +12,7 @@ "GH_CONFIG_DIR": "/home/vscode/.config/gh" }, "mounts": [ - "source=${env:HOME}/.config/gh,target=/home/vscode/.config/gh,type=bind,readonly" + "source=${env:HOME}/.config/gh,target=/home/vscode/.config/gh,type=bind,readonly,required=false" ], "customizations": { "vscode": { @@ -49,9 +49,7 @@ "charliermarsh.ruff", "cheshirekow.cmake-format", "chrisjsewell.myst-tml-syntax", - "codeium.codeium", - "codeium.windsurf-cpptools", - "codeium.windsurfpyright", + "davidanson.vscode-markdownlint", "donjayamanne.githistory", "dotjoshjohnson.xml", @@ -66,11 +64,11 @@ "lextudio.restructuredtext-pack", "lfs.vscode-emacs-friendly", "links-req-tracer.links-requirement-tracer", - "llvm-vs-code-extensions.vscode-clangd", + "ms-python.debugpy", "ms-python.mypy-type-checker", "ms-python.pylint", - "ms-python.python", + "ms-python.vscode-pylance", "ms-python.vscode-python-envs", "ms-vscode.cmake-tools", @@ -82,7 +80,7 @@ "ms-vscode.makefile-tools", "ms-vscode.vscode-websearchforcopilot", "redhat.vscode-yaml", - "saoudrizwan.claude-dev", + "shd101wyy.markdown-preview-enhanced", "swyddfa.esbonio", "trond-snekvik.simple-rst", diff --git a/phlex.code-workspace b/phlex.code-workspace index 00056162..ee7b48a4 100644 --- a/phlex.code-workspace +++ b/phlex.code-workspace @@ -8,7 +8,7 @@ "settings": { "files.associations": { "*.yml": "yaml", - "*.yaml": "yaml", + "*.yaml": "yaml" }, "files.exclude": { "**/local/.*/**": true, @@ -31,7 +31,7 @@ "cmake.useCMakePresets": "always", "cmake.generator": "Ninja", "C_Cpp.default.cStandard": "c17", - "C_Cpp.default.cppStandard": "c++23", + "C_Cpp.default.cppStandard": "c++20", "C_Cpp.default.intelliSenseMode": "linux-gcc-x64", "C_Cpp.default.compileCommands": "${workspaceFolder}/build/compile_commands.json", "C_Cpp.exclusionPolicy": "checkFolders", From 22de26ff995b8559180f8625288ad05f77cd9bd4 Mon Sep 17 00:00:00 2001 From: Chris Green Date: Wed, 7 Jan 2026 11:34:13 -0600 Subject: [PATCH 13/19] Ensure `parallelism` `ARG` is available in base and dev targets. Per https://github.com/Framework-R-D/phlex/pull/87#discussion_r2666492476. --- ci/Dockerfile | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ci/Dockerfile b/ci/Dockerfile index 61ead490..1a333346 100644 --- a/ci/Dockerfile +++ b/ci/Dockerfile @@ -13,9 +13,11 @@ # where is the date (e.g. "2025-08-12"). -FROM gcc:15.2.0 AS base ARG parallelism=18 +FROM gcc:15.2.0 AS base +ARG parallelism + ENV DEBIAN_FRONTEND=noninteractive ENV LANG=en_US.UTF-8 ENV LC_ALL=en_US.UTF-8 @@ -243,6 +245,7 @@ USER root # Dev image additions (tooling and dev user configuration) FROM base AS dev +ARG parallelism ENV SPACK_GROUP=spack ######################################################################## From 856bcbf5faaca8303a051b1a7c54f320d6fd14cd Mon Sep 17 00:00:00 2001 From: Copilot <198982749+Copilot@users.noreply.github.com> Date: Wed, 7 Jan 2026 11:48:03 -0600 Subject: [PATCH 14/19] Initial plan (#226) Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> From 6645128816d21687afa8388487368475654450e2 Mon Sep 17 00:00:00 2001 From: Copilot <198982749+Copilot@users.noreply.github.com> Date: Wed, 7 Jan 2026 12:05:03 -0600 Subject: [PATCH 15/19] Confirm executable permissions on devcontainer wrapper scripts #227 A code review bot flagged .devcontainer/ctest_wrapper.sh and .devcontainer/cmake_wrapper.sh as potentially missing executable permissions. Investigation confirmed both files have correct permissions (mode 100755) tracked in Git since commit 7401741. No changes required - the wrapper scripts are properly executable. Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> From a6d80c7fe341a399e9ed7317e04427c33bc9d91b Mon Sep 17 00:00:00 2001 From: Copilot <198982749+Copilot@users.noreply.github.com> Date: Wed, 7 Jan 2026 12:05:51 -0600 Subject: [PATCH 16/19] Confirm executable permissions on devcontainer wrapper scripts #228 Addressed review comment questioning whether .devcontainer/cmake_wrapper.sh and .devcontainer/ctest_wrapper.sh have proper executable permissions. Investigation Results Both wrapper scripts have been tracked by Git with mode 100755 (executable) since creation in commit 5c77ab9 Filesystem permissions confirm executable status (-rwxrwxr-x) No changes required; original concern was incorrect The wrapper scripts are properly configured and functioning as intended. Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> From 1dd7849f0cf092ad4be4257f40e97228c9ca3685 Mon Sep 17 00:00:00 2001 From: Copilot <198982749+Copilot@users.noreply.github.com> Date: Wed, 7 Jan 2026 12:23:11 -0600 Subject: [PATCH 17/19] Validate Python site-packages symlink in devcontainer build (#229) Per [review feedback](https://github.com/Framework-R-D/phlex/pull/87#discussion_r2669581912), the devcontainer referenced a hardcoded Python version path (`python3.14/site-packages`) that requires manual updates when the Spack-installed Python version changes. ## Changes - **`.devcontainer/Dockerfile`**: Added validation step that ensures exactly one versioned Python directory exists in the Spack view, creates/updates `/opt/spack-environments/phlex-ci/.spack-env/view/lib/python` symlink to point to it, and fails the build if zero or multiple versioned directories are found - **`.devcontainer/devcontainer.json`**: Changed `python.analysis.extraPaths` from versioned path to symlink path ## Example The validation script runs during image build: ```bash # Finds python3.14/ (or whatever version Spack installed) python_dirs=("$SPACK_VIEW_LIB"/python3.*) # Errors if count != 1 if [ $count -eq 0 ]; then echo "ERROR: No versioned Python site-packages directory found" >&2 exit 1 fi # Creates lib/python -> lib/python3.14 ln -sn "$python_basename" "$python_link" ``` VSCode configuration now references the stable symlink path instead of the versioned directory. --- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: greenc-FNAL <2372949+greenc-FNAL@users.noreply.github.com> --- .devcontainer/Dockerfile | 56 +++++++++++++++++++++++++++++++++ .devcontainer/devcontainer.json | 2 +- 2 files changed, 57 insertions(+), 1 deletion(-) diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index 05cbe685..c3f20ad8 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -5,6 +5,62 @@ ARG USER_UID=1000 ARG USER_GID=1000 ARG SPACK_GID=2000 +# Validate Python site-packages symlink +RUN <<'VALIDATE_PYTHON_SYMLINK' +set -euo pipefail +shopt -s nullglob + +SPACK_VIEW_LIB=/opt/spack-environments/phlex-ci/.spack-env/view/lib + +# Find all versioned Python site-packages directories +python_dirs=("$SPACK_VIEW_LIB"/python3.*) +count=${#python_dirs[@]} + +# Ensure exactly one versioned Python site-packages directory exists +if [ $count -eq 0 ]; then + echo "ERROR: No versioned Python site-packages directory found in $SPACK_VIEW_LIB" >&2 + exit 1 +elif [ $count -gt 1 ]; then + echo "ERROR: Multiple versioned Python site-packages directories found in $SPACK_VIEW_LIB:" >&2 + printf ' %s\n' "${python_dirs[@]}" >&2 + exit 1 +fi + +# Get the single Python directory and its basename +python_dir="${python_dirs[0]}" +python_basename=$(basename "$python_dir") + +# Create the symlink if it doesn't exist or update it if it's incorrect +python_link="$SPACK_VIEW_LIB/python" +if [ -L "$python_link" ]; then + current_target=$(readlink "$python_link") + if [ "$current_target" != "$python_basename" ]; then + echo "Updating $python_link -> $python_basename" + ln -sfn "$python_basename" "$python_link" + fi +elif [ -e "$python_link" ]; then + echo "ERROR: $python_link exists but is not a symlink" >&2 + exit 1 +else + echo "Creating $python_link -> $python_basename" + ln -sn "$python_basename" "$python_link" +fi + +# Verify the symlink is correct +if [ ! -L "$python_link" ]; then + echo "ERROR: Failed to create symlink at $python_link" >&2 + exit 1 +fi + +# Verify the symlink target is a valid directory +if [ ! -d "$python_link" ]; then + echo "ERROR: Symlink $python_link does not point to a valid directory" >&2 + exit 1 +fi + +echo "Python symlink validated: $python_link -> $(readlink "$python_link")" +VALIDATE_PYTHON_SYMLINK + # Create the user and add to spack group RUN groupadd --gid $USER_GID $USERNAME \ && useradd --uid $USER_UID --gid $USER_GID --create-home $USERNAME \ diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 0815dff2..0dd904e7 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -32,7 +32,7 @@ "python.analysis.extraPaths": [ "${workspaceFolder}/build", "/opt/spack-environments/phlex-ci/.spack-env/view/lib/root", - "/opt/spack-environments/phlex-ci/.spack-env/view/lib/python3.14/site-packages" + "/opt/spack-environments/phlex-ci/.spack-env/view/lib/python/site-packages" ], "cmake.cmakePath": "${workspaceFolder}/.devcontainer/cmake_wrapper.sh", "cmake.ctestPath": "${workspaceFolder}/.devcontainer/ctest_wrapper.sh", From 3f6fd153247092282fe144b9af8e1bd5857ab3da Mon Sep 17 00:00:00 2001 From: Chris Green Date: Wed, 7 Jan 2026 14:31:13 -0600 Subject: [PATCH 18/19] Update ci/Dockerfile comment Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- ci/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/Dockerfile b/ci/Dockerfile index 1a333346..da646f57 100644 --- a/ci/Dockerfile +++ b/ci/Dockerfile @@ -289,7 +289,7 @@ INSTALL_DEV_PACKAGES ######################################################################## # Create developer user and grant access to the shared spack group -# (User creation removed to be handled by devcontainer or runtime environment) +# User creation moved to .devcontainer/Dockerfile to support flexible runtime environments ######################################################################## # Prepare workspace directory writable by the developer group From d4f7f0a2aff8d0b3aff9ac72a4aa367e11fdf6f3 Mon Sep 17 00:00:00 2001 From: Chris Green Date: Thu, 8 Jan 2026 11:54:10 -0600 Subject: [PATCH 19/19] Add gersemi to dev container --- ci/Dockerfile | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/ci/Dockerfile b/ci/Dockerfile index da646f57..ebaf833e 100644 --- a/ci/Dockerfile +++ b/ci/Dockerfile @@ -264,8 +264,10 @@ spack --timestamp install --fail-fast -j $parallelism -p 1 \ spack clean -dfs -# Install ruff via pip -PYTHONDONTWRITEBYTECODE=1 pip --isolated --no-input --disable-pip-version-check --no-cache-dir install --prefix /usr/local ruff +# Install ruff and gersemi via pip +PYTHONDONTWRITEBYTECODE=1 \ + pip --isolated --no-input --disable-pip-version-check --no-cache-dir install \ + --prefix /usr/local ruff gersemi rm -rf ~/.spack INSTALL_DEV_TOOLING