-
Notifications
You must be signed in to change notification settings - Fork 642
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
Development environment guide #5486
base: master
Are you sure you want to change the base?
Development environment guide #5486
Conversation
Signed-off-by: Christopher Hakkaart <chris.hakkaart@seqera.io>
Signed-off-by: Christopher Hakkaart <chris.hakkaart@seqera.io>
Signed-off-by: Christopher Hakkaart <chris.hakkaart@seqera.io>
Signed-off-by: Christopher Hakkaart <chris.hakkaart@seqera.io>
Signed-off-by: Christopher Hakkaart <chris.hakkaart@seqera.io>
Signed-off-by: Christopher Hakkaart <chris.hakkaart@seqera.io>
Signed-off-by: Christopher Hakkaart <chris.hakkaart@seqera.io>
Signed-off-by: Christopher Hakkaart <chris.hakkaart@seqera.io>
Signed-off-by: Christopher Hakkaart <chris.hakkaart@seqera.io>
Signed-off-by: Christopher Hakkaart <chris.hakkaart@seqera.io>
✅ Deploy Preview for nextflow-docs-staging ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very nice!
docs/developer-env.md
Outdated
### Development Containers extension | ||
|
||
The VS Code Dev Containers extension lets you use a container as a full-featured development environment. It allows you to open any folder inside (or mounted into) a container and take advantage of VS Code's full feature set. | ||
|
||
The Dev Containers extension is included as a part of the [Remote Development extension pack](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.vscode-remote-extensionpack). See {ref}`remote-development-ext` for installation instructions. | ||
|
||
### Create and run a dev container | ||
|
||
A `devcontainer.json` file in your project directory instructs VS Code how to access, create, and configure a development container. It can be used to run an application or to separate tools, libraries, or runtimes. | ||
|
||
The `devcontainer.json` can be used to: | ||
|
||
- Install additional tools in the container. | ||
- Automatically install extensions. | ||
- Forward or publish additional ports. | ||
- Set runtime arguments. | ||
- Reuse or extend your existing Docker Compose setup. | ||
- Add more Advanced container configuration. | ||
|
||
To create a dev container with an existing image: | ||
|
||
1. Create `.devcontainer/devcontainer.json` in the root of your project. | ||
1. Add an image with the Nextflow tooling and VS Code customizations to the `devcontainer.json`. For example: | ||
|
||
```json | ||
{ | ||
"name": "Nextflow Dev Container", | ||
"image": "nfcore/gitpod:latest", | ||
"remoteUser": "vscode", | ||
"runArgs": ["--privileged"], | ||
|
||
// 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", "nextflow.nextflow"] | ||
} | ||
} | ||
} | ||
``` | ||
|
||
:::{note} | ||
Instead of using a prebuilt image, a custom Dockerfile may also live in the `.devcontainer` folder. You can replace the image property in `devcontainer.json` with dockerfile and utilize the custom container. See [Create a Dev Container](https://code.visualstudio.com/docs/devcontainers/create-dev-container) for more information. | ||
::: | ||
|
||
1. Enter **Dev Containers: Reopen in Container** in the VS Code Command Palette and reopen your project. You should now see the name of the container ("Nextflow Dev Container" if using the above example) in the bottom left corner of VS Code. | ||
|
||
:::{note} | ||
Dev Containers can also be used by GitHub Codespaces in VS Code or the browser. See [GitHub Codespaces](https://code.visualstudio.com/docs/remote/codespaces) for more information. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not sure this makes much sense in the context of nextflow workflow in which each process can have its own container. Our best practice is Conda + Wave for container reproducibility and portability
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fair point. I'm not committed to keeping this. It's very thin on details and can get complicated quickly. I'll comment it out.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I want to push back on p's argument. The intent of a devcontainer isn't to have a single container with all processes for your pipeline (I agree conda + wave is best-practice for that). Instead the devcontainer has all of the pre-requisites like conda, nextflow, nf-core, nf-test, etc installed and updated to their latest versions.
Devcontainers works really well for the following use cases:
- People who are new to developing in Nextflow and don't have any of these tools installed on their computer
- Folks who only occasionally develop Nextflow pipelines and don't want all of those tools cluttering up their system when they're not working on nextflow stuff.
- Teams who want to ensure everyone is working off the same version of all the base tools.
Especially with devcontainers being supported by both gitpod and Codespaces there's also major benefits to being able to boot up into a repo-specific cloud environment quite easily. (part of why I'd love Data Studios to support devcontainers.json down the line too).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah agree with this. I think that devcontainers for the pipeline development environment is not incompatible with using conda / wave etc for actually running the pipeline.
Signed-off-by: Christopher Hakkaart <chris.hakkaart@seqera.io>
Signed-off-by: Christopher Hakkaart <chris.hakkaart@seqera.io>
Not sure this is material for nextflow documentation, this is more material for tutorial or blog post |
I've had four people in the last week (1 at summit and 3 at ASHG) tell me that they had a hard time figuring out how to install Nextflow from the documentation. Two of them gave up and quit and never used Nextflow, one of them needed personal help from me, and one was running an ancient version of nextflow that came pre-installed as a workaround. Those user experiences make me think this is a very important addition to the main docs. I also think it would be better featured prominently as one of the first pages new users encounter on the docs page. A separate tutorial page or blog post will be harder to find and won't get continued ongoing attention to make sure we keep it up to date. |
Signed-off-by: Christopher Hakkaart <chris.hakkaart@seqera.io>
Understand and it makes sense. However, I'm contrary having dev containers in this context. Provided it could help, it should not make part of the best practices we are promoting for container usage both for dev and production deployment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is awesome!
Please don't be alarmed at the number of comments - the content is great - just a few editorial tweaks here and there. Happy to workshop the feedback if it's unclear. :)
Co-authored-by: Justine Geffen <justinegeffen@users.noreply.github.com> Signed-off-by: Christopher Hakkaart <chris.hakkaart@seqera.io>
Co-authored-by: Justine Geffen <justinegeffen@users.noreply.github.com> Signed-off-by: Christopher Hakkaart <chris.hakkaart@seqera.io>
Co-authored-by: Justine Geffen <justinegeffen@users.noreply.github.com> Signed-off-by: Christopher Hakkaart <chris.hakkaart@seqera.io>
Co-authored-by: Justine Geffen <justinegeffen@users.noreply.github.com> Signed-off-by: Christopher Hakkaart <chris.hakkaart@seqera.io>
Co-authored-by: Justine Geffen <justinegeffen@users.noreply.github.com> Signed-off-by: Christopher Hakkaart <chris.hakkaart@seqera.io>
Co-authored-by: Justine Geffen <justinegeffen@users.noreply.github.com> Signed-off-by: Christopher Hakkaart <chris.hakkaart@seqera.io>
Co-authored-by: Justine Geffen <justinegeffen@users.noreply.github.com> Signed-off-by: Christopher Hakkaart <chris.hakkaart@seqera.io>
Co-authored-by: Justine Geffen <justinegeffen@users.noreply.github.com> Signed-off-by: Christopher Hakkaart <chris.hakkaart@seqera.io>
Co-authored-by: Justine Geffen <justinegeffen@users.noreply.github.com> Signed-off-by: Christopher Hakkaart <chris.hakkaart@seqera.io>
Co-authored-by: Justine Geffen <justinegeffen@users.noreply.github.com> Signed-off-by: Christopher Hakkaart <chris.hakkaart@seqera.io>
Co-authored-by: Justine Geffen <justinegeffen@users.noreply.github.com> Signed-off-by: Christopher Hakkaart <chris.hakkaart@seqera.io>
Co-authored-by: Justine Geffen <justinegeffen@users.noreply.github.com> Signed-off-by: Christopher Hakkaart <chris.hakkaart@seqera.io>
Co-authored-by: Justine Geffen <justinegeffen@users.noreply.github.com> Signed-off-by: Christopher Hakkaart <chris.hakkaart@seqera.io>
Co-authored-by: Justine Geffen <justinegeffen@users.noreply.github.com> Signed-off-by: Christopher Hakkaart <chris.hakkaart@seqera.io>
Co-authored-by: Justine Geffen <justinegeffen@users.noreply.github.com> Signed-off-by: Christopher Hakkaart <chris.hakkaart@seqera.io>
Co-authored-by: Justine Geffen <justinegeffen@users.noreply.github.com> Signed-off-by: Christopher Hakkaart <chris.hakkaart@seqera.io>
Co-authored-by: Justine Geffen <justinegeffen@users.noreply.github.com> Signed-off-by: Christopher Hakkaart <chris.hakkaart@seqera.io>
Co-authored-by: Justine Geffen <justinegeffen@users.noreply.github.com> Signed-off-by: Christopher Hakkaart <chris.hakkaart@seqera.io>
Signed-off-by: Christopher Hakkaart <chris.hakkaart@seqera.io>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Content is looking great, though I think that the VSCode part can be condensed a bit to help with general readability and maybe yank the devcontainers into a blog post. Otherwise, comments are very minor.
Great work! 👏🏻
Signed-off-by: Christopher Hakkaart <chris.hakkaart@seqera.io>
Signed-off-by: Christopher Hakkaart <chris.hakkaart@seqera.io>
Signed-off-by: Christopher Hakkaart <chris.hakkaart@seqera.io>
Signed-off-by: Christopher Hakkaart <chris.hakkaart@seqera.io>
I've removed the dev containers section, removed repeating text boxes, removed bullet point examples, and move the whole page down to the tutorials section. |
Added a new guide for creating development environment page. Added tabs to help split Windows/macOS/Linux.
Development environment
Updates:
@netlify /developer-env