-
Notifications
You must be signed in to change notification settings - Fork 213
Local devcontainers (take 2) #575
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 11 commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
89d1aac
Move features up
pinin4fjords c218f59
Adding local devcontainer config
pinin4fjords fb3652d
Apply java fix to development as well
pinin4fjords 8da3a67
Don't need sudo, we're root now
pinin4fjords 7047790
Rename existing dev config
pinin4fjords d6f967c
Give devcontainer dev configs better names
pinin4fjords f788385
Update docs
pinin4fjords 30fc9f2
Devcontainer path fixes
pinin4fjords 38bca09
Fix local config name in doc
pinin4fjords 254e471
Merge branch 'master' into local-devcontainers
pinin4fjords 544f806
Update docs/envsetup/03_devcontainer.md
pinin4fjords 918d79f
Update docs/envsetup/03_devcontainer.md
pinin4fjords c5535d2
Merge branch 'master' into local-devcontainers
pinin4fjords 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
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,50 @@ | ||
// | ||
// DEVELOPMENT DEVCONTAINER CONFIG | ||
// Base configuration that is pre-built and pushed to GitHub | ||
// See .devcontainer/devcontainer.json for production config | ||
// | ||
{ | ||
"name": "nextflow-training (local-dev)", | ||
"image": "mcr.microsoft.com/devcontainers/base:ubuntu", | ||
|
||
"features": { | ||
"../local-features/init": {}, | ||
"ghcr.io/devcontainers/features/docker-outside-of-docker:1": { | ||
"version": "latest" | ||
}, | ||
"ghcr.io/devcontainers/features/java:1": { "version": "21.0.6-ms" }, | ||
"ghcr.io/rocker-org/devcontainer-features/miniforge:2": { | ||
"version": "latest" | ||
}, | ||
"../local-features/apptainer": {}, | ||
"../local-features/tower-agent": {}, | ||
"../local-features/conda-packages": {} | ||
}, | ||
"workspaceFolder": "${localWorkspaceFolder}", | ||
"workspaceMount": "source=${localWorkspaceFolder},target=${localWorkspaceFolder},type=bind", | ||
"remoteUser": "root", | ||
"remoteEnv": { | ||
// Nextflow installation version | ||
"NXF_HOME": "/workspaces/training/.nextflow", | ||
"NXF_EDGE": "0", | ||
"NXF_VER": "24.10.4", | ||
// Other env vars | ||
"HOST_PROJECT_PATH": "/workspaces/training", | ||
"SHELL": "/bin/bash" // Ush bash | ||
}, | ||
"onCreateCommand": "bash ${localWorkspaceFolder}/.devcontainer/setup.sh", | ||
"postCreateCommand": "mkdir -p /workspaces && rm -rf /workspaces/training && ln -s ${localWorkspaceFolder} /workspaces/training", | ||
"customizations": { | ||
"vscode": { | ||
"extensions": ["nf-core.nf-core-extensionpack"], | ||
// Use Python from conda | ||
"settings": { | ||
"python.defaultInterpreterPath": "/opt/conda/bin/python", | ||
"terminal.integrated.cwd": "/workspaces/training", | ||
"terminal.integrated.defaultLocation": "workspace" | ||
}, | ||
// Use bash | ||
"terminal.integrated.defaultProfile.linux": "bash" | ||
} | ||
} | ||
} |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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
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,106 @@ | ||
# Local installation using VSCode Devcontainers extension | ||
|
||
If you have a local Docker installation or are happy to install one, the easiest way to work locally with these materials is to use Visual Studio Code's devcontainer feature. This approach provides all the necessary tools and dependencies without requiring manual installation. | ||
|
||
## Requirements | ||
|
||
To use the devcontainer setup, you'll need: | ||
|
||
- [Visual Studio Code](https://code.visualstudio.com/) | ||
- A local Docker installation, for example: | ||
- [Docker Desktop](https://docs.docker.com/get-docker/) (for Windows/macOS) | ||
- [Docker Engine](https://docs.docker.com/engine/install/) (for Linux) | ||
- [Colima](https://github.com/abiosoft/colima) (alternative for macOS) | ||
- [Docker Buildx](https://docs.docker.com/build/concepts/overview/#install-buildx) (included in Docker Desktop, but may need separate installation with other Docker setups) | ||
- [Dev Containers extension](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers) for VS Code | ||
|
||
Your Docker installation must be running before you attempt to open the devcontainer. | ||
|
||
To verify that Docker buildx is available, run: | ||
|
||
```bash | ||
docker buildx version | ||
``` | ||
|
||
If this command fails, you'll need to install the buildx extension before proceeding. | ||
|
||
## Setup Instructions | ||
|
||
Follow these steps to set up your local environment using VS Code devcontainers: | ||
|
||
### Install the "Dev Containers" extension in VS Code | ||
|
||
- Open VS Code | ||
- Go to Extensions (Ctrl+Shift+X or Cmd+Shift+X on macOS) | ||
- Search for "Dev Containers" | ||
- Click "Install" | ||
|
||
 | ||
|
||
### Clone the repository: | ||
|
||
```bash | ||
git clone https://github.com/nextflow-io/training.git | ||
cd training | ||
``` | ||
|
||
### Open the repository in VS Code: | ||
|
||
- Launch VS Code | ||
- Select **File -> Open Folder** from the menu | ||
- Navigate to and select the training repository folder you just cloned | ||
- Click **Open** | ||
|
||
### Reopen in Container | ||
|
||
When prompted by VS Code to "Reopen in Container", click on it. Alternatively: | ||
|
||
- Press F1 (or Ctrl+Shift+P / Cmd+Shift+P on macOS) | ||
- Type "Dev Containers: Reopen in Container" | ||
- **Important**: When prompted to select a configuration, choose the **local-dev** devcontainer configuration | ||
|
||
 | ||
|
||
 | ||
|
||
Wait for the container to build. This may take a few minutes the first time as it downloads and sets up all the necessary components. | ||
|
||
Once the container is built and running, you'll have a fully configured environment with all the necessary tools installed, including: | ||
|
||
- Java | ||
- Nextflow | ||
- Docker | ||
- Git | ||
- And all other dependencies required for the training | ||
|
||
 | ||
|
||
## Benefits of Using Devcontainers | ||
|
||
Using the devcontainer approach offers several advantages: | ||
|
||
- **Consistency**: Ensures a consistent development environment across different machines | ||
- **Simplicity**: All dependencies are pre-installed and configured | ||
- **Isolation**: The development environment is isolated from your local system | ||
- **Reproducibility**: Everyone using the devcontainer gets the same setup | ||
- **No manual installation**: No need to manually install Java, Nextflow, and other tools | ||
|
||
## Checking Your Environment | ||
|
||
Once your devcontainer is running, you can verify that everything is set up correctly by running: | ||
|
||
```bash | ||
nextflow info | ||
``` | ||
|
||
This should display the Nextflow version and runtime information, confirming that your environment is properly configured. | ||
|
||
## Troubleshooting | ||
|
||
If you encounter issues with the devcontainer setup: | ||
|
||
1. Ensure your Docker installation (Docker Desktop, Colima, Docker Engine, etc.) is running before opening the devcontainer | ||
2. Check that you've selected the **local-dev** configuration when prompted | ||
3. Verify that Docker buildx is installed and working by running `docker buildx version` | ||
4. If the container fails to build, try rebuilding it by running the "Dev Containers: Rebuild Container" command | ||
5. For persistent issues, refer to the [VS Code Dev Containers troubleshooting guide](https://code.visualstudio.com/docs/devcontainers/troubleshooting) |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
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
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.