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

Add codespaces template for creating new repo's. #1957

Merged
merged 26 commits into from
Nov 3, 2022
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
765ed75
Add codespaces template for creating new repo's.
vsmalladi Oct 18, 2022
c2a2e91
Update change log.
vsmalladi Oct 18, 2022
f9722a6
Update readme with codepsaces.
vsmalladi Oct 18, 2022
20ca392
Update README.md
vsmalladi Oct 18, 2022
492d6f5
Change to absolute url
vsmalladi Oct 19, 2022
dc4e4d6
Add nextflow extension pack.
vsmalladi Oct 27, 2022
e8f0502
Update syntax.
vsmalladi Oct 27, 2022
d8bd517
Moved section to root Contributing directory.
vsmalladi Oct 27, 2022
3817949
Make more parity with Gitpod.
vsmalladi Oct 27, 2022
862fa6b
Make more parity with Gitpod.
vsmalladi Oct 27, 2022
cc144b3
Add a codspaces for the tools repo.
vsmalladi Oct 27, 2022
f4205ad
Merge branch 'dev' into dev
vsmalladi Oct 28, 2022
efee035
Sync gitpod and codespaces.
vsmalladi Oct 28, 2022
6a77c35
Merge branch 'dev' of github.com:vsmalladi/tools into dev
vsmalladi Oct 28, 2022
3274319
Fix build of nfcore tools.
vsmalladi Oct 28, 2022
1f6a256
Sync gitpod and codespaces.
vsmalladi Oct 28, 2022
430463d
Merge branch 'dev' into dev
vsmalladi Oct 28, 2022
a51bfec
[automated] Fix code linting
nf-core-bot Oct 28, 2022
ae7fae1
Remove redundant extensions
vsmalladi Nov 2, 2022
c6fb549
Remove redundant extensions
vsmalladi Nov 2, 2022
e604cb7
Update CONTRIBUTING.md
vsmalladi Nov 2, 2022
2ed9ecf
Merge branch 'dev' into dev
vsmalladi Nov 2, 2022
2a16a60
Merge branch 'dev' into dev
mahesh-panchal Nov 3, 2022
1539777
[automated] Fix code linting
nf-core-bot Nov 3, 2022
6654027
Apply suggestions from code review
ewels Nov 3, 2022
0146a89
Add Codespaces instructions to pipeline template CONTRIBUTING too
ewels Nov 3, 2022
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 CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
### Template

- Fix lint warnings for `samplesheet_check.nf` module
- Add codespaces template ([#1957](https://github.com/nf-core/tools/pull/1957))

### Linting

Expand Down
21 changes: 21 additions & 0 deletions nf_core/pipeline-template/.devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# See here for image contents: https://github.com/microsoft/vscode-dev-containers/tree/v0.245.2/containers/python-3-anaconda/.devcontainer/base.Dockerfile

FROM mcr.microsoft.com/vscode/devcontainers/anaconda:0-3
ewels marked this conversation as resolved.
Show resolved Hide resolved

# [Choice] Node.js version: none, lts/*, 16, 14, 12, 10
ARG NODE_VERSION="none"
RUN if [ "${NODE_VERSION}" != "none" ]; then su vscode -c "umask 0002 && . /usr/local/share/nvm/nvm.sh && nvm install ${NODE_VERSION} 2>&1"; fi

# Copy environment.yml (if found) to a temp location so we update the environment. Also
# copy "noop.txt" so the COPY instruction does not fail if no environment.yml exists.
COPY environment.yml* .devcontainer/noop.txt /tmp/conda-tmp/
ewels marked this conversation as resolved.
Show resolved Hide resolved
RUN if [ -f "/tmp/conda-tmp/environment.yml" ]; then umask 0002 && /opt/conda/bin/conda env update -n base -f /tmp/conda-tmp/environment.yml; fi \
&& rm -rf /tmp/conda-tmp

# [Optional] Uncomment this section to install additional OS packages.
# RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
# && apt-get -y install --no-install-recommends <your-package-list-here>

RUN conda install -c bioconda nextflow
RUN pip install nf-core

20 changes: 20 additions & 0 deletions nf_core/pipeline-template/.devcontainer/add-notice.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Display a notice when not running in GitHub Codespaces

cat << 'EOF' > /usr/local/etc/vscode-dev-containers/conda-notice.txt
When using "conda" from outside of GitHub Codespaces, note the Anaconda repository
contains restrictions on commercial use that may impact certain organizations. See
https://aka.ms/vscode-remote/conda/anaconda

EOF

notice_script="$(cat << 'EOF'
if [ -t 1 ] && [ "${IGNORE_NOTICE}" != "true" ] && [ "${TERM_PROGRAM}" = "vscode" ] && [ "${CODESPACES}" != "true" ] && [ ! -f "$HOME/.config/vscode-dev-containers/conda-notice-already-displayed" ]; then
cat "/usr/local/etc/vscode-dev-containers/conda-notice.txt"
mkdir -p "$HOME/.config/vscode-dev-containers"
((sleep 10s; touch "$HOME/.config/vscode-dev-containers/conda-notice-already-displayed") &)
fi
EOF
)"

echo "${notice_script}" | tee -a /etc/bash.bashrc >> /etc/zsh/zshrc

55 changes: 55 additions & 0 deletions nf_core/pipeline-template/.devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
// For format details, see https://aka.ms/devcontainer.json. For config options, see the README at:
// https://github.com/microsoft/vscode-dev-containers/tree/v0.245.2/containers/python-3-anaconda
{
"name": "Anaconda (Python 3)",
"build": {
"context": "..",
"dockerfile": "Dockerfile",
"args": {
"NODE_VERSION": "lts/*"
}
},

// 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",
"python.linting.enabled": true,
"python.linting.pylintEnabled": true,
"python.formatting.autopep8Path": "/opt/conda/bin/autopep8",
"python.formatting.yapfPath": "/opt/conda/bin/yapf",
"python.linting.flake8Path": "/opt/conda/bin/flake8",
"python.linting.pycodestylePath": "/opt/conda/bin/pycodestyle",
"python.linting.pydocstylePath": "/opt/conda/bin/pydocstyle",
"python.linting.pylintPath": "/opt/conda/bin/pylint"
vsmalladi marked this conversation as resolved.
Show resolved Hide resolved
},

// Add the IDs of extensions you want installed when the container is created.
"extensions": [
vsmalladi marked this conversation as resolved.
Show resolved Hide resolved
"ms-python.python",
"ms-python.vscode-pylance"
]
}
},

// Use 'forwardPorts' to make a list of ports inside the container available locally.
// "forwardPorts": [],

// Use 'postCreateCommand' to run commands after the container is created.
// "postCreateCommand": "python --version",

// Comment out to connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root.
"remoteUser": "vscode",
"features": {
"docker-in-docker": "20.10",
"git": "os-provided",
"ghcr.io/devcontainers/features/conda:1": {},
"ghcr.io/devcontainers/features/docker-from-docker:1": {},
"ghcr.io/devcontainers/features/git:1": {}
}
}


3 changes: 3 additions & 0 deletions nf_core/pipeline-template/.devcontainer/noop.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
This file copied into the container along with environment.yml* from the parent
ewels marked this conversation as resolved.
Show resolved Hide resolved
folder. This file is included to prevents the Dockerfile COPY instruction from
failing if no environment.yml is found.
13 changes: 13 additions & 0 deletions nf_core/pipeline-template/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,19 @@ The results obtained from the full-sized test can be viewed on the [nf-core webs

{% if branded -%}

## Codespaces
ewels marked this conversation as resolved.
Show resolved Hide resolved
This repo includes a devcontainer configuration which will create a GitHub Codespace for Nextflow development!

Devcontainer specs:
- [DevContainer config](.devcontainer/devcontainer.json)
- [Dockerfile](.devcontainer/Dockerfile)

# Getting started
ewels marked this conversation as resolved.
Show resolved Hide resolved
- Open the repo in [Codespaces](../../codespaces)
vsmalladi marked this conversation as resolved.
Show resolved Hide resolved
- Tools installed
- nf-core
- nextflow

## Documentation

The {{ name }} pipeline comes with documentation about the pipeline [usage](https://nf-co.re/{{ short_name }}/usage), [parameters](https://nf-co.re/{{ short_name }}/parameters) and [output](https://nf-co.re/{{ short_name }}/output).
Expand Down