Skip to content
Draft
Show file tree
Hide file tree
Changes from all 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
45 changes: 45 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# Git files
.git
.gitignore
.branch-info.md

# Nextflow files
work/
.nextflow/
.nextflow.log*
.nextflow.pid

# Reports and outputs
*.html
timeline.html
report.html
trace.txt
dag.dot
dag.svg

# Build artifacts
*.sif
*.simg

# Documentation (include only essential docs in container)
BRANCH_SETUP.md
.branch-info.md
OPTIMIZATION_NOTES.md
GPU_IMPLEMENTATION_NOTES.md

# Test and temporary files
*.tmp
*.log
*.out
*.err
serialJob.*

# Output directories
DEobs/
DErand/
FDR/
chunks/
Manhattan_plots/

# Keep only what's needed for the container
# Include: script/, Dockerfile, Singularity.def
103 changes: 103 additions & 0 deletions .github/workflows/build-container.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
# GitHub Actions workflow for building and publishing container images
# This workflow builds Docker images and optionally pushes them to Docker Hub
#
# To use this workflow:
# 1. Uncomment the workflow triggers below
# 2. Add Docker Hub credentials as GitHub secrets:
# - DOCKERHUB_USERNAME
# - DOCKERHUB_TOKEN
# 3. Update the image name in the env section

name: Build Container Images

# Uncomment to enable automatic builds
# on:
# push:
# branches:
# - main
# - dev_mn
# paths:
# - 'script/**'
# - 'Dockerfile'
# - 'Singularity.def'
# pull_request:
# branches:
# - main
# release:
# types: [published]
# workflow_dispatch:

env:
IMAGE_NAME: nf-pyspade
VERSION: 0.1.7-nf

jobs:
build-docker:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v3

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

- name: Log in to Docker Hub
if: github.event_name != 'pull_request'
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
token: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Extract metadata
id: meta
uses: docker/metadata-action@v4
with:
images: ${{ secrets.DOCKERHUB_USERNAME }}/${{ env.IMAGE_NAME }}
tags: |
type=ref,event=branch
type=ref,event=pr
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=raw,value=${{ env.VERSION }}
type=raw,value=latest,enable=${{ github.ref == format('refs/heads/{0}', 'main') }}

- name: Build and push Docker image
uses: docker/build-push-action@v4
with:
context: .
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max

- name: Test Docker image
run: |
docker run --rm ${{ secrets.DOCKERHUB_USERNAME }}/${{ env.IMAGE_NAME }}:${{ env.VERSION }} pySpade --help || echo "pySpade help command completed"
docker run --rm ${{ secrets.DOCKERHUB_USERNAME }}/${{ env.IMAGE_NAME }}:${{ env.VERSION }} ls -la /opt/nf-pyspade/script/

# Optional: Build Singularity image (requires Singularity installation)
# build-singularity:
# runs-on: ubuntu-latest
# needs: build-docker
#
# steps:
# - name: Checkout code
# uses: actions/checkout@v3
#
# - name: Set up Singularity
# uses: eWaterCycle/setup-singularity@v7
# with:
# singularity-version: 3.8.0
#
# - name: Build Singularity image
# run: |
# singularity build ${{ env.IMAGE_NAME }}_${{ env.VERSION }}.sif Singularity.def
#
# - name: Upload Singularity image as artifact
# uses: actions/upload-artifact@v3
# with:
# name: singularity-image
# path: ${{ env.IMAGE_NAME }}_${{ env.VERSION }}.sif
# retention-days: 30
46 changes: 46 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# Nextflow work directory
work/

# Nextflow files
.nextflow/
.nextflow.log*
.nextflow.pid

# Nextflow reports
*.html
*.html.*
timeline.html
report.html
trace.txt
dag.dot
dag.svg

# Python cache
__pycache__/
*.py[cod]
*$py.class
*.so
.Python

# Test and temporary files
/tmp/
*.tmp

# Output directories (optional - comment out if you want to track outputs)
# DEobs/
# DErand/
# FDR/
# chunks/
# Manhattan_plots/

# Log files
*.log
*.out
*.err
serialJob.*

# Singularity cache and images
.singularity/
singularity/
*.sif
*.simg
Loading