Skip to content
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

Open
wants to merge 39 commits into
base: master
Choose a base branch
from

Conversation

christopher-hakkaart
Copy link
Contributor

@christopher-hakkaart christopher-hakkaart commented Nov 8, 2024

Added a new guide for creating development environment page. Added tabs to help split Windows/macOS/Linux.

Development environment

  • VS Code
  • Extensions
    • Nextflow
    • nf-core
    • Remote development
  • Docker
  • Git
  • WSL

Updates:

  • Moved from Getting started to Tutorials
  • Dev containers section has been removed

@netlify /developer-env

Signed-off-by: Christopher Hakkaart <[email protected]>
Signed-off-by: Christopher Hakkaart <[email protected]>
Signed-off-by: Christopher Hakkaart <[email protected]>
Signed-off-by: Christopher Hakkaart <[email protected]>
Signed-off-by: Christopher Hakkaart <[email protected]>
Signed-off-by: Christopher Hakkaart <[email protected]>
Signed-off-by: Christopher Hakkaart <[email protected]>
Signed-off-by: Christopher Hakkaart <[email protected]>
Signed-off-by: Christopher Hakkaart <[email protected]>
Signed-off-by: Christopher Hakkaart <[email protected]>
Copy link

netlify bot commented Nov 8, 2024

Deploy Preview for nextflow-docs-staging ready!

Name Link
🔨 Latest commit b315a5a
🔍 Latest deploy log https://app.netlify.com/sites/nextflow-docs-staging/deploys/67518ddbf4db290008847429
😎 Deploy Preview https://deploy-preview-5486--nextflow-docs-staging.netlify.app/developer-env
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link
Member

@ewels ewels left a 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 Show resolved Hide resolved
docs/developer-env.md Show resolved Hide resolved
docs/developer-env.md Show resolved Hide resolved
docs/developer-env.md Outdated Show resolved Hide resolved
docs/developer-env.md Outdated Show resolved Hide resolved
docs/developer-env.md Show resolved Hide resolved
docs/developer-env.md Show resolved Hide resolved
docs/developer-env.md Outdated Show resolved Hide resolved
docs/developer-env.md Outdated Show resolved Hide resolved
Comment on lines 418 to 472
### 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.
Copy link
Member

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

Copy link
Contributor Author

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.

Copy link
Member

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:

  1. People who are new to developing in Nextflow and don't have any of these tools installed on their computer
  2. 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.
  3. 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).

Copy link
Member

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.

@pditommaso
Copy link
Member

Not sure this is material for nextflow documentation, this is more material for tutorial or blog post

@kenibrewer
Copy link
Member

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.

@pditommaso
Copy link
Member

I've had four people in the last week ..

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

Copy link
Collaborator

@justinegeffen justinegeffen left a 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. :)

docs/developer-env.md Outdated Show resolved Hide resolved
docs/developer-env.md Outdated Show resolved Hide resolved
docs/developer-env.md Outdated Show resolved Hide resolved
docs/developer-env.md Outdated Show resolved Hide resolved
docs/developer-env.md Outdated Show resolved Hide resolved
docs/developer-env.md Outdated Show resolved Hide resolved
docs/developer-env.md Outdated Show resolved Hide resolved
docs/developer-env.md Outdated Show resolved Hide resolved
docs/developer-env.md Outdated Show resolved Hide resolved
docs/developer-env.md Outdated Show resolved Hide resolved
christopher-hakkaart and others added 8 commits November 11, 2024 20:46
Co-authored-by: Justine Geffen <[email protected]>
Signed-off-by: Christopher Hakkaart <[email protected]>
Co-authored-by: Justine Geffen <[email protected]>
Signed-off-by: Christopher Hakkaart <[email protected]>
Co-authored-by: Justine Geffen <[email protected]>
Signed-off-by: Christopher Hakkaart <[email protected]>
Co-authored-by: Justine Geffen <[email protected]>
Signed-off-by: Christopher Hakkaart <[email protected]>
Co-authored-by: Justine Geffen <[email protected]>
Signed-off-by: Christopher Hakkaart <[email protected]>
Co-authored-by: Justine Geffen <[email protected]>
Signed-off-by: Christopher Hakkaart <[email protected]>
Co-authored-by: Justine Geffen <[email protected]>
Signed-off-by: Christopher Hakkaart <[email protected]>
Co-authored-by: Justine Geffen <[email protected]>
Signed-off-by: Christopher Hakkaart <[email protected]>
christopher-hakkaart and others added 11 commits November 11, 2024 20:48
Co-authored-by: Justine Geffen <[email protected]>
Signed-off-by: Christopher Hakkaart <[email protected]>
Co-authored-by: Justine Geffen <[email protected]>
Signed-off-by: Christopher Hakkaart <[email protected]>
Co-authored-by: Justine Geffen <[email protected]>
Signed-off-by: Christopher Hakkaart <[email protected]>
Co-authored-by: Justine Geffen <[email protected]>
Signed-off-by: Christopher Hakkaart <[email protected]>
Co-authored-by: Justine Geffen <[email protected]>
Signed-off-by: Christopher Hakkaart <[email protected]>
Co-authored-by: Justine Geffen <[email protected]>
Signed-off-by: Christopher Hakkaart <[email protected]>
Co-authored-by: Justine Geffen <[email protected]>
Signed-off-by: Christopher Hakkaart <[email protected]>
Co-authored-by: Justine Geffen <[email protected]>
Signed-off-by: Christopher Hakkaart <[email protected]>
Co-authored-by: Justine Geffen <[email protected]>
Signed-off-by: Christopher Hakkaart <[email protected]>
Co-authored-by: Justine Geffen <[email protected]>
Signed-off-by: Christopher Hakkaart <[email protected]>
Signed-off-by: Christopher Hakkaart <[email protected]>
@bentsherman bentsherman added dependencies Pull requests that update a dependency file docs and removed dependencies Pull requests that update a dependency file labels Nov 13, 2024
Copy link
Member

@ewels ewels left a 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! 👏🏻

docs/developer-env.md Outdated Show resolved Hide resolved
docs/developer-env.md Outdated Show resolved Hide resolved
docs/developer-env.md Outdated Show resolved Hide resolved
docs/developer-env.md Outdated Show resolved Hide resolved
docs/developer-env.md Show resolved Hide resolved
docs/developer-env.md Show resolved Hide resolved
docs/developer-env.md Show resolved Hide resolved
docs/developer-env.md Outdated Show resolved Hide resolved
@christopher-hakkaart
Copy link
Contributor Author

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.

@christopher-hakkaart christopher-hakkaart marked this pull request as ready for review December 5, 2024 11:26
@christopher-hakkaart christopher-hakkaart requested a review from a team as a code owner December 5, 2024 11:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants