-
Notifications
You must be signed in to change notification settings - Fork 10
VSCode dev container setup and workspace config #87
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
45a880e
VSCode dev container setup and workspace config
greenc-FNAL b91b621
Assorted improvements
greenc-FNAL 118ec55
Remove VSCode user nonsense from `Dockerfile`
greenc-FNAL 164d4d7
Streamline `ci` container for current workflows
greenc-FNAL 141c6bc
Remove development environment-specific workspace configuration
greenc-FNAL 960c98c
Improve VSCode shell integration in devcontainers
greenc-FNAL 393444d
Improve image creation instructions
greenc-FNAL e84a02d
Enable Spack modification by user `vscode` within a devcontainer
greenc-FNAL 48efcc7
Remove unneeded bind mount from devcontainer
greenc-FNAL 05156df
Disable unneeded/unhelpful message
greenc-FNAL 4bb4dfc
Remove `codecov.codecov` from devcontainer config due to conflicts
greenc-FNAL 4b345d1
Apply suggestions from code review
greenc-FNAL 22de26f
Ensure `parallelism` `ARG` is available in base and dev targets.
greenc-FNAL 856bcbf
Initial plan (#226)
Copilot 6645128
Confirm executable permissions on devcontainer wrapper scripts #227
Copilot a6d80c7
Confirm executable permissions on devcontainer wrapper scripts #228
Copilot 1dd7849
Validate Python site-packages symlink in devcontainer build (#229)
Copilot 3f6fd15
Update ci/Dockerfile comment
greenc-FNAL d4f7f0a
Add gersemi to dev container
greenc-FNAL File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,72 @@ | ||
| FROM ghcr.io/framework-r-d/phlex-dev:latest | ||
|
|
||
| ARG USERNAME=vscode | ||
| 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 \ | ||
| && 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 | ||
greenc-FNAL marked this conversation as resolved.
Show resolved
Hide resolved
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| #!/bin/bash | ||
| . /entrypoint.sh | ||
| exec cmake "$@" | ||
greenc-FNAL marked this conversation as resolved.
Show resolved
Hide resolved
greenc-FNAL marked this conversation as resolved.
Show resolved
Hide resolved
greenc-FNAL marked this conversation as resolved.
Show resolved
Hide resolved
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| #!/bin/bash | ||
| . /entrypoint.sh | ||
| exec ctest "$@" | ||
greenc-FNAL marked this conversation as resolved.
Show resolved
Hide resolved
greenc-FNAL marked this conversation as resolved.
Show resolved
Hide resolved
greenc-FNAL marked this conversation as resolved.
Show resolved
Hide resolved
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,94 @@ | ||
| { | ||
| "name": "Phlex CI Dev Container", | ||
| "build": { | ||
| "dockerfile": "Dockerfile", | ||
| "options": [ | ||
| "--format=docker" | ||
| ] | ||
| }, | ||
| "workspaceFolder": "/workspaces/phlex", | ||
| "remoteUser": "vscode", | ||
| "containerEnv": { | ||
| "GH_CONFIG_DIR": "/home/vscode/.config/gh" | ||
| }, | ||
| "mounts": [ | ||
| "source=${env:HOME}/.config/gh,target=/home/vscode/.config/gh,type=bind,readonly,required=false" | ||
| ], | ||
| "customizations": { | ||
| "vscode": { | ||
| "settings": { | ||
| "terminal.integrated.defaultProfile.linux": "bash", | ||
| "terminal.integrated.profiles.linux": { | ||
| "bash": { | ||
| "path": "/bin/bash", | ||
| "args": [ | ||
| "-i" | ||
| ], | ||
| "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", | ||
| "/opt/spack-environments/phlex-ci/.spack-env/view/lib/root", | ||
| "/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", | ||
| "cmake.generator": "Ninja", | ||
| "C_Cpp.default.cStandard": "c17", | ||
| "C_Cpp.default.cppStandard": "c++20", | ||
greenc-FNAL marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| "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", | ||
|
|
||
| "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", | ||
|
|
||
| "ms-python.debugpy", | ||
| "ms-python.mypy-type-checker", | ||
| "ms-python.pylint", | ||
|
|
||
| "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", | ||
|
|
||
| "shd101wyy.markdown-preview-enhanced", | ||
| "swyddfa.esbonio", | ||
| "trond-snekvik.simple-rst", | ||
| "twxs.cmake", | ||
| "vadimcn.vscode-lldb", | ||
| "wequick.coverage-gutters", | ||
| "xaver.clang-format" | ||
| ] | ||
| } | ||
| } | ||
| } | ||
greenc-FNAL marked this conversation as resolved.
Show resolved
Hide resolved
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.