Skip to content
Draft
Show file tree
Hide file tree
Changes from 4 commits
Commits
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
58 changes: 58 additions & 0 deletions .github/studios.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@

ARG CONNECT_CLIENT_VERSION="0.8-rc"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

future improvement: the latest CONNECT_CLIENT_VERSION could be extracted from the release information in the repo https://github.com/seqeralabs/studio-templates. As we are still finalizing versioning of the connect and cliejt templates, this is something that can be added later


FROM cr.seqera.io/public/data-studio-vscode:1.101.2-${CONNECT_CLIENT_VERSION}

ARG IMAGE_TAG=2.2.1
ENV TRAINING_TAG=${IMAGE_TAG}

# Create and configure workspace
WORKDIR /workspaces
RUN mkdir -p /workspaces/.nextflow && \
mkdir -p /workspaces/.vscode-server && \
mkdir -p /workspaces/training

# Configure VS Code settings for dark mode and auto-open terminal
RUN mkdir -p /workspaces/training/.vscode
COPY <<EOF /workspaces/training/.vscode/settings.json
{
"workbench.colorTheme": "Default Dark Modern",
"terminal.integrated.defaultProfile.linux": "bash",
"terminal.integrated.cwd": "${workspaceFolder}",
"workbench.startupEditor": "none",
"workbench.panel.defaultLocation": "bottom",
"workbench.panel.opensMaximized": "never",
"terminal.integrated.showOnStartup": "always",
"cSpell.diagnosticLevel": "Hint",
"nextflow.java.home": "/usr",
"nextflow.debug": false
}
EOF

# Pre-install nf-core extension pack
RUN /home/.vscode/bin/openvscode-server --install-extension nf-core.nf-core-extensionpack --force

# Patch init script to use training directory as default folder
RUN sed -i 's|--default-folder '"'"'/workspace'"'"'|--default-folder '"'"'/workspaces/training'"'"'|g' /init

# Create setup script that downloads training materials then runs init
RUN echo -e '#!/bin/bash\n\
echo "Downloading training materials..."\n\
wget -qO- https://github.com/nextflow-io/training/archive/refs/tags/${TRAINING_TAG}.tar.gz | tar xz --strip-components=1 -C /workspaces/training\n\
echo "Initializing Nextflow..."\n\
# Set conservative JVM flags for memory management only\n\
export NXF_OPTS="-XX:+UseContainerSupport -XX:MaxRAMPercentage=50.0"\n\
# Pre-warm Nextflow\n\
nextflow help > /dev/null 2>&1\n\
sleep 2\n\
nextflow info > /dev/null 2>&1\n\
sleep 2\n\
echo "Starting VS Code..."\n\
exec /init' > /usr/local/bin/setup.sh && \
chmod +x /usr/local/bin/setup.sh

# Override the entrypoint to use connect-client
ENTRYPOINT ["/usr/bin/connect-client", "--entrypoint", "/usr/local/bin/setup.sh"]

# Default arguments (empty since setup script handles everything)
CMD []
36 changes: 36 additions & 0 deletions .github/workflows/docker-devcontainer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ on:
paths:
- ".devcontainer/**"
- ".github/workflows/docker-devcontainer.yml"
- ".github/studios.Dockerfile"
push: { branches: [master] } # Build + push ('latest' tag)
release: { types: [published] } # Build + push (release tag)
workflow_dispatch: # Build + push (custom tag)
Expand Down Expand Up @@ -68,3 +69,38 @@ jobs:
push
release
workflow_dispatch

build_studios:
needs: build_push
if: github.event_name != 'pull_request' || contains(github.event.pull_request.changed_files, '.github/studios.Dockerfile')
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Check out the repo
uses: actions/checkout@v4

- name: Set up QEMU
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build and push Studios image
uses: docker/build-push-action@v5
with:
context: .
file: .github/studios.Dockerfile
push: ${{ github.event_name != 'pull_request' }}
platforms: linux/amd64,linux/arm64
tags: ghcr.io/${{ github.repository }}-studios:${{ env.IMAGE_TAG }}
build-args: |
IMAGE_TAG=${{ env.IMAGE_TAG }}