Skip to content

Devcontainers cleanup #513

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 26 commits into from
Mar 5, 2025
Merged
Show file tree
Hide file tree
Changes from 8 commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
a82b0fb
Remove mention of completely
ewels Feb 18, 2025
322eb0f
Consolidate Dockerfiles
ewels Feb 18, 2025
5b7d253
Change base image, remove some stuff I hope isn't needed
ewels Feb 18, 2025
d485cef
Clean up devcontainer, move to Dockerfile
ewels Feb 18, 2025
76b756e
Fix syntax error in Dockerfile
ewels Feb 18, 2025
363d9e2
Merge branch 'master' into devcontainers-cleanup
ewels Feb 18, 2025
1b8be5c
Remove devcontainer 'remoteUser' 'gitpod'
ewels Feb 18, 2025
394bfc1
Inline comments to explain devcontainer config
ewels Feb 18, 2025
c91b490
Merge branch 'master' into devcontainers-cleanup
pinin4fjords Feb 27, 2025
6bbfe27
Fix postCreateCommand if statement
ewels Feb 27, 2025
d3d3713
Add workflow_dispatch to docker GHA workflow
ewels Feb 27, 2025
f58886b
Change GHA logic for testing on forks
ewels Feb 27, 2025
9d7b067
Simplify GHA docker action
ewels Feb 27, 2025
1708f15
Fix env access
ewels Feb 27, 2025
8b98f17
Add permissions to push to registry
ewels Feb 27, 2025
0754ab6
Use github actions cache
ewels Feb 27, 2025
c159028
Set up buildx
ewels Feb 27, 2025
1a8042a
Update Nextflow to 24.10.4
ewels Feb 27, 2025
101cae0
Testing: Use pre-built image
ewels Feb 27, 2025
918fa6b
I take it back, it was the right way around already
ewels Feb 27, 2025
f3b73e0
Set user to root to fix permissions error with conda
ewels Feb 27, 2025
502e54b
Try removing common-utils to make codespaces boot faster
ewels Feb 27, 2025
b6df003
Run nextflow -version in postCreateCommand for devcontainer
ewels Feb 27, 2025
4ff37d3
Add back the nextflow org docker image
ewels Feb 28, 2025
264a925
Merge branch 'master' into devcontainers-cleanup
ewels Mar 5, 2025
0a6b45f
Merge branch 'master' into devcontainers-cleanup
pinin4fjords Mar 5, 2025
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
69 changes: 67 additions & 2 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,69 @@
FROM ghcr.io/nextflow-io/training:latest
FROM mcr.microsoft.com/devcontainers/universal:linux

ENV NXF_VER=24.10.0
# Install util tools.
# software-properties-common is needed to add ppa support for Apptainer installation
RUN apt-get update --quiet && \
export DEBIAN_FRONTEND=noninteractive && \
apt-get install --quiet --yes \
apt-transport-https \
apt-utils \
sudo \
git \
less \
wget \
curl \
tree \
graphviz \
software-properties-common && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*

# Install Apptainer (Singularity)
RUN add-apt-repository -y ppa:apptainer/ppa && \
apt-get update --quiet && \
apt install -y apptainer && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*

# Install Seqera Platform "Tower Agent"
RUN curl -fSL https://github.com/seqeralabs/tower-agent/releases/latest/download/tw-agent-linux-x86_64 > tw-agent && \
chmod +x tw-agent && \
mv tw-agent /usr/local/bin/tw-agent

# Set up directories
RUN mkdir -p /workspaces/.nextflow && \
mkdir -p /workspaces/training/

# Uncomment if we need to pin the Nextflow version
ENV NXF_EDGE=0
ENV NXF_VER=24.10.0
ENV NXF_HOME=/workspaces/.nextflow

# Install nextflow, nf-core, Mamba, and pytest-workflow
RUN conda config --remove channels defaults && \
conda config --add channels bioconda && \
conda config --add channels conda-forge && \
conda config --set channel_priority strict && \
conda update --quiet --yes --all && \
conda install --quiet --yes --name base \
mamba \
nextflow \
nf-core \
nf-test \
black \
prettier \
pre-commit \
linkify-it-py \
pytest-workflow && \
conda clean --all --force-pkgs-dirs --yes

# Cleanup
RUN printf 'unset JAVA_TOOL_OPTIONS\n' >> $HOME/.bashrc

# Update Nextflow
RUN nextflow self-update && nextflow -version

RUN unset JAVA_TOOL_OPTIONS

# RUN export PS1='\t -> '
RUN export PS1='\[\e[3;36m\]${PWD/*//} ->\[\e[0m\] '
39 changes: 18 additions & 21 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,18 +1,21 @@
{
"name": "nfcore",
"build": {
"dockerfile": "Dockerfile",
"context": ".."
},
"remoteUser": "gitpod",
"name": "nextflow-training",

// Comment this and uncomment "build" if testing Dockerfile
// "image": "ghcr.io/nextflow-io/training:latest",

// Comment this and uncomment "image" before release
"build": { "dockerfile": "Dockerfile", "context": ".." },

"features": {
"ghcr.io/devcontainers/features/docker-outside-of-docker:1": {}
"ghcr.io/devcontainers/features/docker-outside-of-docker:1": {
"version": "latest"
},
"ghcr.io/devcontainers/features/common-utils:2": { "version": "latest" }
},
"workspaceFolder": "/workspaces/training/",
"workspaceMount": "source=${localWorkspaceFolder},target=${localWorkspaceFolder},type=bind",
"remoteEnv": {
"NXF_HOME": "/workspaces/.nextflow",
"HOST_PROJECT_PATH": "${localWorkspaceFolder}"
"HOST_PROJECT_PATH": "/workspaces/training/"
},
// Configure tool-specific properties.
"customizations": {
Expand All @@ -26,17 +29,11 @@
"extensions": [
"ms-python.python",
"ms-python.vscode-pylance",
"nf-core.nf-core-extensionpack",
"nextflow.nextflow",
"codezombiech.gitignore"
"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
]
}
},
"portsAttributes": {
"3000": {
"label": "Application",
"onAutoForward": "openPreview"
}
},
"postCreateCommand": "mkdir -p /workspace && ln -s /workspaces /workspace/gitpod"
}
}
76 changes: 0 additions & 76 deletions .github/gitpod.Dockerfile

This file was deleted.

10 changes: 5 additions & 5 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Build and push the Docker image for GitPod
# Build and push the Docker image for GitHub Codespaces
# - Only pushes if push or release
# - Builds without push for PRs to check the Dockerfile

name: Build GitPod Docker image
name: Build dev Docker image

on:
pull_request:
Expand All @@ -14,7 +14,7 @@ on:
jobs:
push_to_registry:
if: github.repository == 'nextflow-io/training'
name: Build + Push Gitpod Docker image
name: Build + Push dev Docker image
runs-on: ubuntu-latest
steps:
- name: Check out the repo
Expand All @@ -31,14 +31,14 @@ jobs:
uses: docker/build-push-action@v5
if: github.event_name != 'release'
with:
file: .github/gitpod.Dockerfile
file: .devcontainer/Dockerfile
push: ${{ github.event_name == 'push' }}
tags: ghcr.io/nextflow-io/training:latest

- name: Push release image
uses: docker/build-push-action@v5
if: github.event_name == 'release'
with:
file: .github/gitpod.Dockerfile
file: .devcontainer/Dockerfile
push: true
tags: ghcr.io/nextflow-io/training:${{ github.event.release.tag_name }}