Skip to content

Commit 1159796

Browse files
committed
VSCode dev container setup and workspace config
Improve `apt` operation and Spack repo handling
1 parent de2d683 commit 1159796

File tree

5 files changed

+216
-7
lines changed

5 files changed

+216
-7
lines changed

.devcontainer/cmake_wrapper.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/bin/bash
2+
. /entrypoint.sh
3+
exec cmake "$@"

.devcontainer/ctest_wrapper.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/bin/bash
2+
. /entrypoint.sh
3+
exec ctest "$@"

.devcontainer/devcontainer.json

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
{
2+
"name": "Phlex CI Dev Container",
3+
"image": "ghcr.io/framework-r-d/phlex-dev:latest",
4+
"workspaceFolder": "/workspaces/phlex",
5+
"containerEnv": {
6+
"GH_CONFIG_DIR": "/home/vscode/.config/gh"
7+
},
8+
"mounts": [
9+
"source=${env:XDG_RUNTIME_DIR}/podman/podman.sock,target=/var/run/docker.sock,type=bind",
10+
"source=${env:HOME}/.config/gh,target=/home/vscode/.config/gh,type=bind,readonly"
11+
],
12+
"customizations": {
13+
"vscode": {
14+
"settings": {
15+
"terminal.integrated.defaultProfile.linux": "Phlex Dev",
16+
"terminal.integrated.profiles.linux": {
17+
"Phlex Dev": {
18+
"path": "/bin/bash",
19+
"args": [
20+
"-c",
21+
". /entrypoint.sh && exec bash"
22+
]
23+
}
24+
},
25+
"python.defaultInterpreterPath": "/opt/spack-environments/phlex-ci/.spack-env/view/bin/python",
26+
"python.analysis.extraPaths": [
27+
"${workspaceFolder}/build",
28+
"/opt/spack-environments/phlex-ci/.spack-env/view/lib/root",
29+
"/opt/spack-environments/phlex-ci/.spack-env/view/lib/python3.14/site-packages"
30+
],
31+
"cmake.cmakePath": "${workspaceFolder}/.devcontainer/cmake_wrapper.sh",
32+
"cmake.ctestPath": "${workspaceFolder}/.devcontainer/ctest_wrapper.sh",
33+
"cmake.generator": "Ninja",
34+
"C_Cpp.default.cStandard": "c17",
35+
"C_Cpp.default.cppStandard": "c++20",
36+
"C_Cpp.default.intelliSenseMode": "linux-gcc-x64",
37+
"C_Cpp.default.compileCommands": "${workspaceFolder}/build/compile_commands.json",
38+
"python.languageServer": "Pylance",
39+
"python.analysis.typeCheckingMode": "basic",
40+
"python.analysis.diagnosticMode": "workspace"
41+
},
42+
"extensions": [
43+
"charliermarsh.ruff",
44+
"cheshirekow.cmake-format",
45+
"chrisjsewell.myst-tml-syntax",
46+
"codecov.codecov",
47+
"codeium.codeium",
48+
"codeium.windsurf-cpptools",
49+
"codeium.windsurfpyright",
50+
"davidanson.vscode-markdownlint",
51+
"donjayamanne.githistory",
52+
"dotjoshjohnson.xml",
53+
"eamodio.gitlens",
54+
"github.copilot",
55+
"github.copilot-chat",
56+
"github.vscode-github-actions",
57+
"github.vscode-pull-request-github",
58+
"jebbs.plantuml",
59+
"lextudio.iis",
60+
"lextudio.restructuredtext",
61+
"lextudio.restructuredtext-pack",
62+
"lfs.vscode-emacs-friendly",
63+
"links-req-tracer.links-requirement-tracer",
64+
"llvm-vs-code-extensions.vscode-clangd",
65+
"ms-python.debugpy",
66+
"ms-python.mypy-type-checker",
67+
"ms-python.pylint",
68+
"ms-python.python",
69+
"ms-python.vscode-pylance",
70+
"ms-python.vscode-python-envs",
71+
"ms-vscode.cmake-tools",
72+
"ms-vscode.cpptools",
73+
"ms-vscode.cpptools-extension-pack",
74+
"ms-vscode.cpptools-themes",
75+
"ms-vscode.hexeditor",
76+
"ms-vscode.live-server",
77+
"ms-vscode.makefile-tools",
78+
"ms-vscode.vscode-websearchforcopilot",
79+
"redhat.vscode-yaml",
80+
"saoudrizwan.claude-dev",
81+
"shd101wyy.markdown-preview-enhanced",
82+
"swyddfa.esbonio",
83+
"trond-snekvik.simple-rst",
84+
"twxs.cmake",
85+
"vadimcn.vscode-lldb",
86+
"wequick.coverage-gutters",
87+
"xaver.clang-format"
88+
]
89+
}
90+
}
91+
}

ci/Dockerfile

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
FROM gcc:15.2.0 AS base
1616
ARG parallelism=18
1717

18+
ENV DEBIAN_FRONTEND=noninteractive
1819
ENV LANG=en_US.UTF-8
1920
ENV LC_ALL=en_US.UTF-8
2021
ENV SPACK_USER_CONFIG_PATH=/dev/null
@@ -72,8 +73,6 @@ COPY entrypoint.sh /entrypoint.sh
7273
RUN <<'CONFIGURE_SPACK_DEFAULTS'
7374
set -euo pipefail
7475

75-
. /spack/share/spack/setup-env.sh
76-
7776
SPACK_REPO_ROOT=/opt/spack-repos
7877
rm -rf "$SPACK_REPO_ROOT/fnal_art" "$SPACK_REPO_ROOT/phlex-spack-recipes"
7978
mkdir -p "$SPACK_REPO_ROOT"
@@ -83,12 +82,11 @@ chgrp -R spack "$SPACK_REPO_ROOT"
8382
chmod -R g+rwX "$SPACK_REPO_ROOT"
8483
find "$SPACK_REPO_ROOT" -type d -exec chmod g+s {} +
8584

86-
spack --timestamp repo remove phlex >/dev/null 2>&1 || true
87-
spack --timestamp repo remove fnal_art >/dev/null 2>&1 || true
88-
spack --timestamp repo add --scope site /opt/spack-repos/phlex-spack-recipes/spack_repo/phlex
89-
spack --timestamp repo add --scope site /opt/spack-repos/fnal_art/spack_repo/fnal_art
90-
spack --timestamp repo set --scope site --destination /spack/var/spack/repos/builtin builtin
85+
. /spack/share/spack/setup-env.sh
9186

87+
spack --timestamp repo add --scope site $SPACK_REPO_ROOT/phlex-spack-recipes/spack_repo/phlex
88+
spack --timestamp repo add --scope site $SPACK_REPO_ROOT/fnal_art/spack_repo/fnal_art
89+
spack --timestamp repo set --scope site --destination $SPACK_REPO_ROOT builtin
9290
spack --timestamp compiler find
9391

9492

phlex.code-workspace

Lines changed: 114 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,114 @@
1+
{
2+
"folders": [
3+
{
4+
"name": "Phlex",
5+
"path": "."
6+
}
7+
],
8+
"settings": {
9+
"files.associations": {
10+
"*.yml": "yaml",
11+
"*.yaml": "yaml",
12+
"codecov.yml": "plaintext"
13+
},
14+
"files.exclude": {
15+
"**/local/.*/**": true,
16+
"**/local/*/": true
17+
},
18+
"search.exclude": {
19+
"**/local/.*/**": true,
20+
"**/local/*/": true,
21+
"**/build/_deps/**": true,
22+
"**/build/CMakeFiles/**": true
23+
},
24+
"files.watcherExclude": {
25+
"**/local/.*/**": true,
26+
"**/local/*/": true,
27+
"**/build/_deps/**": true,
28+
"**/build/CMakeFiles/**": true
29+
},
30+
"cmake.sourceDirectory": "${workspaceFolder}",
31+
"cmake.buildDirectory": "${workspaceFolder}/build",
32+
"cmake.useCMakePresets": "always",
33+
"cmake.generator": "Ninja",
34+
"C_Cpp.default.cStandard": "c17",
35+
"C_Cpp.default.cppStandard": "c++23",
36+
"C_Cpp.default.intelliSenseMode": "linux-gcc-x64",
37+
"C_Cpp.default.compileCommands": "${workspaceFolder}/build/compile_commands.json",
38+
"C_Cpp.exclusionPolicy": "checkFolders",
39+
"C_Cpp.files.exclude": {
40+
"**/local/.*/**": true,
41+
"**/local/*/": true,
42+
"**/build/_deps/**": true,
43+
"**/build/CMakeFiles/**": true
44+
},
45+
"terminal.integrated.defaultProfile.linux": "bash",
46+
"terminal.integrated.profiles.linux": {
47+
"bash": {
48+
"path": "/bin/bash",
49+
"args": [],
50+
"env": {
51+
"BASH_ENV": "/entrypoint.sh"
52+
}
53+
}
54+
},
55+
"python.languageServer": "Pylance",
56+
"python.analysis.typeCheckingMode": "basic",
57+
"python.analysis.diagnosticMode": "workspace",
58+
"python.analysis.exclude": [
59+
"**/local/.*/**",
60+
"**/local/*/",
61+
"**/build/_deps/**",
62+
"**/build/CMakeFiles/**"
63+
],
64+
"python.analysis.ignore": [
65+
"**/local/.*/**",
66+
"**/local/*/",
67+
"**/build/_deps/**",
68+
"**/build/CMakeFiles/**"
69+
],
70+
"flake8.enabled": false,
71+
"[python]": {
72+
"editor.formatOnSave": true,
73+
"editor.defaultFormatter": "charliermarsh.ruff",
74+
"editor.codeActionsOnSave": {
75+
"source.organizeImports.ruff": "explicit",
76+
"source.fixAll.ruff": "explicit"
77+
}
78+
},
79+
"yaml.schemas": {
80+
"https://json.schemastore.org/github-workflow.json": "./.github/workflows/*"
81+
}
82+
},
83+
"extensions": {
84+
"recommendations": [
85+
"ms-vscode.cmake-tools",
86+
"ms-vscode.cpptools",
87+
"ms-vscode.cpptools-extension-pack",
88+
"twxs.cmake",
89+
"ms-vscode.vscode-json",
90+
"redhat.vscode-yaml",
91+
"charliermarsh.ruff",
92+
"github.vscode-actions",
93+
"github.copilot",
94+
"github.copilot-chat",
95+
"github.vscode-pull-request-github",
96+
"ms-vscode.hexeditor"
97+
],
98+
"unwantedRecommendations": [
99+
"reditorsupport.r",
100+
"ms-vscode.r",
101+
"ikuyadeu.r",
102+
"ms-vscode.r-debugger",
103+
"vscjava.vscode-java-pack",
104+
"redhat.java",
105+
"vscjava.vscode-java-debug",
106+
"vscjava.vscode-java-test",
107+
"vscjava.vscode-maven",
108+
"vscjava.vscode-gradle",
109+
"ms-python.python",
110+
"ms-toolsai.jupyter",
111+
"ms-python.flake8"
112+
]
113+
}
114+
}

0 commit comments

Comments
 (0)