Skip to content

Local devcontainers enablement #539

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

Closed
wants to merge 22 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .devcontainer/codespaces/Dockerfile
41 changes: 41 additions & 0 deletions .devcontainer/codespaces/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
{
"name": "nextflow-training (codespaces)",

// Update this to pin the release tag before release
"image": "ghcr.io/nextflow-io/training:latest",
// Uncomment this and comment "image" when testing Dockerfile changes
// "build": { "dockerfile": "Dockerfile", "context": ".." },

"features": {
"ghcr.io/devcontainers/features/docker-outside-of-docker:1": {
"version": "latest"
}
},
"workspaceFolder": "/workspaces/training",
"workspaceMount": "source=${localWorkspaceFolder},target=/workspaces/training,type=bind", // Used for local devcontainers, ignored in Codespaces.
"remoteEnv": {
"NXF_HOME": "/workspaces/.nextflow",
"HOST_PROJECT_PATH": "/workspaces/training" // Codespaces and local devcontainers will both work with this.
},
"postCreateCommand": "nextflow -version; if [ -z \"$CODESPACES\" ]; then echo \"Devcontainers Development\"; else echo \"Codespaces Development\"; fi",
// Configure tool-specific properties.
"customizations": {
// Configure properties specific to VS Code.
"vscode": {
// Set *default* container specific settings.json values on container create.
"settings": {
"python.defaultInterpreterPath": "/opt/conda/bin/python"
},
// Add the IDs of extensions you want installed when the container is created.
"extensions": [
"ms-python.python",
"ms-python.vscode-pylance",
"nf-core.nf-core-extensionpack", // nf-core recommended extensions
"nextflow.nextflow", // Nextflow VS Code extension
"codezombiech.gitignore", // Language support for .gitignore files
"cssho.vscode-svgviewer" // SVG viewer
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we can simplify these - nextflow.nextflow shouldn't be needed as it's already part of the nf-core extension pack, and the other two could be added to that. Then we just have the nf-core extension pack and be done with it.

I'd also like to remove a couple of the more subjective packages from the nf-core extension pack (rainbow indentation, TODO tree, code spell checker). I find myself disabling these each time in devcontainers, which is annoying.

We can do this in a separate PR, as needs upstream changes to the nf-core extension pack first.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

]
}
},
"remoteUser": "root"
}
41 changes: 0 additions & 41 deletions .devcontainer/devcontainer.json

This file was deleted.

1 change: 1 addition & 0 deletions .devcontainer/devcontainer.json
1 change: 1 addition & 0 deletions .devcontainer/local/Dockerfile
42 changes: 42 additions & 0 deletions .devcontainer/local/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
{
"name": "nextflow-training (local)",

// Update this to pin the release tag before release
"image": "ghcr.io/nextflow-io/training:latest",
// Uncomment this and comment "image" when testing Dockerfile changes
// "build": { "dockerfile": "Dockerfile", "context": ".." },

"features": {
"ghcr.io/devcontainers/features/docker-outside-of-docker:1": {
"version": "latest"
}
},
"workspaceFolder": "${localWorkspaceFolder}",
"workspaceMount": "source=${localWorkspaceFolder},target=${localWorkspaceFolder},type=bind",
"remoteEnv": {
"NXF_HOME": "/workspaces/training/.nextflow",
"HOST_PROJECT_PATH": "/workspaces/training"
},
"postCreateCommand": "sudo mkdir -p /workspaces && sudo ln -s ${localWorkspaceFolder} /workspaces/training && if [ -z \"$CODESPACES\" ]; then echo \"Local Development\"; else echo \"Codespaces Development\"; fi",
"customizations": {
// Configure properties specific to VS Code.
"vscode": {
// Set *default* container specific settings.json values on container create.
"settings": {
"python.defaultInterpreterPath": "/opt/conda/bin/python",
"terminal.integrated.cwd": "/workspaces/training",
"terminal.integrated.defaultLocation": "workspace"
},
// Add the IDs of extensions you want installed when the container is created.
"extensions": [
"ms-python.python",
"ms-python.vscode-pylance",
"nf-core.nf-core-extensionpack", // nf-core recommended extensions
"nextflow.nextflow", // Nextflow VS Code extension
"codezombiech.gitignore", // Language support for .gitignore files
"cssho.vscode-svgviewer" // SVG viewer
]
}
},
"remoteUser": "root"
}