-
Notifications
You must be signed in to change notification settings - Fork 48
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #223 from sigven/bundle_update_2023
PCGR v.2.0rc - 2024
- Loading branch information
Showing
311 changed files
with
280,161 additions
and
20,021 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
* | ||
!conda | ||
!.dockerignore |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
name: apptainer | ||
|
||
on: | ||
push: | ||
branches: | ||
- patch1 | ||
|
||
env: | ||
VERSION: '1.4.1.9015' # versioned by bump2version | ||
jobs: | ||
docker2apptainer: | ||
name: Docker2apptainer | ||
runs-on: ubuntu-latest | ||
defaults: | ||
run: | ||
shell: bash -l {0} | ||
steps: | ||
- name: Free Disk Space | ||
uses: jlumbroso/free-disk-space@main | ||
- name: Check free space | ||
run: | | ||
echo "Free space:" | ||
df -h | ||
- name: Code checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
ref: v${{ env.VERSION }} | ||
- name: 🏰 QEMU setup | ||
uses: docker/setup-qemu-action@v3 | ||
- name: 🏯 Buildx setup | ||
uses: docker/setup-buildx-action@v3 | ||
- name: DockerHub login | ||
uses: docker/login-action@v3 | ||
with: | ||
username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
- name: 🐳 Docker img build and push to DockerHub | ||
uses: docker/build-push-action@v6 | ||
with: | ||
context: . # yes, dot | ||
push: false | ||
platforms: linux/amd64 | ||
tags: | | ||
sigven/pcgr:${{ env.VERSION }} | ||
outputs: type=docker,dest=pcgr_${{ env.VERSION }}.tar | ||
|
||
- name: Apptainer setup | ||
uses: eWaterCycle/setup-apptainer@v2 | ||
|
||
- name: Apptainer build | ||
run: | | ||
docker image ls -a | ||
#docker save sigven/pcgr:${VERSION} -o pcgr_${VERSION}.tar | ||
ls -la | ||
df -h | ||
echo "Building Apptainer SIF" | ||
echo "---------------------------------" | ||
apptainer build pcgr_singularity_${VERSION}.sif docker-archive://pcgr_${VERSION}.tar | ||
echo "---------------------------------" | ||
ls -la | ||
df -h | ||
#- name: Upload SIF to GHCR | ||
# run: | | ||
# echo ${{ secrets.GITHUB_TOKEN }} | apptainer registry login -u ${{ github.actor }} --password-stdin oras://ghcr.io | ||
# apptainer push pcgr_${VERSION}.sif oras://ghcr.io/${GITHUB_REPOSITORY}:${VERSION} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,68 +4,76 @@ on: | |
push: | ||
branches: | ||
- master | ||
- dev | ||
- bundle_update_2023 | ||
- locale | ||
env: | ||
atoken: ${{ secrets.ANACONDA_UPLOAD_TOKEN }} | ||
recipe_path: conda/recipe | ||
env_yml_path: conda/env/yml | ||
env_lock_path: conda/env/lock | ||
VERSION: '1.4.1' # versioned by bump2version | ||
VERSION: '1.4.1.9021' # versioned by bump2version | ||
jobs: | ||
build_conda_pkgs: | ||
build_pcgrr_conda_pkg: | ||
# When merging to one of the branches above and the commit message matches | ||
if: "startsWith(github.event.head_commit.message, 'Bump version:')" | ||
name: Build conda packages | ||
name: Build pcgrr conda pkg | ||
runs-on: ubuntu-latest | ||
defaults: | ||
run: | ||
shell: bash -l {0} | ||
steps: | ||
- name: Code checkout | ||
uses: actions/checkout@v4 | ||
- name: Micromamba setup | ||
uses: mamba-org/setup-micromamba@v1 | ||
with: | ||
environment-file: ${{ env.env_yml_path }}/condabuild.yml | ||
- name: 🐍 Conda pkg build and upload | ||
run: | | ||
conda mambabuild ${recipe_path}/pcgrr -c conda-forge -c bioconda --token ${atoken} | ||
build_pcgr_conda_pkg: | ||
# When merging to one of the branches above and the commit message matches | ||
if: "startsWith(github.event.head_commit.message, 'Bump version:')" | ||
name: Build pcgr conda pkg | ||
runs-on: ubuntu-latest | ||
defaults: | ||
run: | ||
shell: bash -l {0} | ||
steps: | ||
- name: Code checkout | ||
uses: actions/checkout@v3 | ||
- name: Mambaforge setup | ||
uses: conda-incubator/setup-miniconda@v2 | ||
uses: actions/checkout@v4 | ||
- name: Micromamba setup | ||
uses: mamba-org/setup-micromamba@v1 | ||
with: | ||
miniforge-variant: Mambaforge | ||
miniforge-version: "latest" | ||
show-channel-urls: true | ||
auto-activate-base: false | ||
activate-environment: condabuild | ||
environment-file: ${{ env.env_yml_path }}/condabuild.yml | ||
use-mamba: true | ||
- name: 🐍 Conda pkg build and upload | ||
run: | | ||
conda mambabuild ${recipe_path}/pcgr -c conda-forge -c bioconda --token ${atoken} --quiet | ||
conda mambabuild ${recipe_path}/pcgrr -c conda-forge -c bioconda --token ${atoken} --quiet | ||
# spin up fresh instance since conda-lock | ||
# takes ages when run on previous one | ||
# spin up fresh instance since conda-lock takes ages when run on previous one | ||
conda_lock: | ||
name: Conda lock | ||
runs-on: ubuntu-latest | ||
needs: build_conda_pkgs | ||
needs: [build_pcgr_conda_pkg, build_pcgrr_conda_pkg] | ||
defaults: | ||
run: | ||
shell: bash -l {0} | ||
|
||
steps: | ||
- name: Code checkout | ||
uses: actions/checkout@v3 | ||
- name: Set up Mambaforge | ||
uses: conda-incubator/setup-miniconda@v2 | ||
uses: actions/checkout@v4 | ||
- name: Micromamba setup | ||
uses: mamba-org/setup-micromamba@v1 | ||
with: | ||
miniforge-variant: Mambaforge | ||
miniforge-version: "latest" | ||
show-channel-urls: true | ||
auto-activate-base: false | ||
activate-environment: condabuild | ||
environment-file: ${{ env.env_yml_path }}/condabuild.yml | ||
use-mamba: true | ||
- name: Generate conda locks | ||
- name: 🔒 Conda lock | ||
run: | | ||
conda-lock lock --mamba --file ${env_yml_path}/pcgr.yml --filename-template 'pcgr-{platform}.lock' -p osx-64 -p linux-64 | ||
conda-lock lock --mamba --file ${env_yml_path}/pcgrr.yml --filename-template 'pcgrr-{platform}.lock' -p osx-64 -p linux-64 | ||
# 1. generate a combined lock file | ||
# 2. render platform-specific locks | ||
conda-lock lock --file ${env_yml_path}/pcgr.yml -p osx-64 -p linux-64 | ||
conda-lock render --kind explicit -p osx-64 -p linux-64 conda-lock.yml --filename-template 'pcgr-{platform}.lock' && rm conda-lock.yml | ||
conda-lock lock --file ${env_yml_path}/pcgrr.yml -p osx-64 -p linux-64 | ||
conda-lock render --kind explicit -p osx-64 -p linux-64 conda-lock.yml --filename-template 'pcgrr-{platform}.lock' && rm conda-lock.yml | ||
mv pcgrr-*.lock ${env_lock_path} | ||
mv pcgr-*.lock ${env_lock_path} | ||
- name: Commit changes | ||
|
@@ -77,37 +85,15 @@ jobs: | |
git add . | ||
git commit -m "${MSG}" | ||
git push | ||
pkgdown-site: | ||
name: Deploy pkgdown website | ||
runs-on: ubuntu-latest | ||
needs: build_conda_pkgs | ||
defaults: | ||
run: | ||
shell: bash -l {0} | ||
steps: | ||
- name: Code checkout | ||
uses: actions/checkout@v3 | ||
- name: Set up miniconda | ||
uses: conda-incubator/setup-miniconda@v2 | ||
with: | ||
miniforge-variant: Mambaforge | ||
miniforge-version: "latest" | ||
auto-update-conda: true | ||
auto-activate-base: true | ||
activate-environment: "" | ||
channels: "pcgr,conda-forge,bioconda" | ||
- name: Install conda packages | ||
run: mamba env create -n pkgdown -f ${env_yml_path}/pkgdown.yml | ||
- name: 🌐 Website publish | ||
if: github.ref_name == 'master' | ||
run: | | ||
git config --local user.email "[email protected]" | ||
git config --local user.name "GitHub Actions" | ||
conda activate pkgdown | ||
cp pcgrr/DESCRIPTION . # hack for pkgdown to work | ||
printf "pcgrr version:\n" | ||
Rscript -e "packageVersion('pcgrr')" | ||
Rscript -e "pkgdown::deploy_to_branch(pkg = 'pcgrr', commit_message = paste(pkgdown:::construct_commit_message('.'), '- see https://sigven.github.io/pcgr/'), branch = 'gh-pages', new_process = FALSE)" | ||
micromamba env create -n pkgdownenv -f ${env_yml_path}/pkgdown.yml | ||
micromamba activate pkgdownenv | ||
cp pcgrr/DESCRIPTION . # hack for pkgdown to work | ||
printf "pcgrr version:\n" | ||
Rscript -e "packageVersion('pcgrr')" | ||
Rscript -e "pkgdown::deploy_to_branch(pkg = 'pcgrr', commit_message = 'Built PCGR website: https://sigven.github.io/pcgr/', branch = 'gh-pages', new_process = FALSE)" | ||
docker_deploy: | ||
name: Build and deploy Docker | ||
|
@@ -116,10 +102,9 @@ jobs: | |
defaults: | ||
run: | ||
shell: bash -l {0} | ||
|
||
steps: | ||
- name: Code checkout | ||
uses: actions/checkout@v3 | ||
uses: actions/checkout@v4 | ||
- id: pull_lock_commit | ||
name: 📥 Pull lock commit | ||
run: | | ||
|
@@ -128,7 +113,7 @@ jobs: | |
LATEST_COMMIT_HASH="$(git --no-pager log -1 --format='%H')" | ||
echo "latest_commit_hash=${LATEST_COMMIT_HASH}" >> $GITHUB_OUTPUT | ||
- name: 🔖 Tag creation | ||
uses: actions/github-script@v5 | ||
uses: actions/github-script@v7 | ||
env: | ||
LATEST_COMMIT_HASH: ${{ steps.pull_lock_commit.outputs.latest_commit_hash }} | ||
with: | ||
|
@@ -142,24 +127,46 @@ jobs: | |
sha: the_sha | ||
}) | ||
- name: 🗑 Free Disk Space | ||
uses: jlumbroso/free-disk-space@main | ||
# work with tag from above | ||
- name: Code checkout | ||
uses: actions/checkout@v3 | ||
uses: actions/checkout@v4 | ||
with: | ||
ref: v${{ env.VERSION }} | ||
- name: Buildx setup | ||
id: buildx | ||
uses: docker/setup-buildx-action@v2 | ||
- name: 🏰 QEMU setup | ||
uses: docker/setup-qemu-action@v3 | ||
- name: 🏯 Buildx setup | ||
uses: docker/setup-buildx-action@v3 | ||
- name: DockerHub login | ||
uses: docker/login-action@v2 | ||
uses: docker/login-action@v3 | ||
with: | ||
username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
- name: 🐳 Docker img build and push to DockerHub | ||
uses: docker/build-push-action@v4 | ||
# use the outputs=docker with dest to directly save to tar for apptainer | ||
- name: 🐳 Docker img build, tar and push to Docker Hub | ||
uses: docker/build-push-action@v6 | ||
with: | ||
context: . # yes, dot | ||
context: . | ||
push: true | ||
platforms: linux/amd64 | ||
tags: | | ||
sigven/pcgr:${{ env.VERSION }} | ||
outputs: type=docker,dest=pcgr_${{ env.VERSION }}.tar | ||
|
||
# Apptainer | ||
- name: Apptainer setup | ||
uses: eWaterCycle/setup-apptainer@v2 | ||
- name: 🕹️ Apptainer build | ||
run: | | ||
ls -lSha | ||
df -h | ||
echo "Building Apptainer SIF" | ||
echo "---------------------------------" | ||
apptainer build pcgr_singularity_${VERSION}.sif docker-archive://pcgr_${VERSION}.tar | ||
echo "---------------------------------" | ||
ls -lSha | ||
- name: Upload SIF to GHCR | ||
run: | | ||
echo ${{ secrets.GITHUB_TOKEN }} | apptainer registry login -u ${{ github.actor }} --password-stdin oras://ghcr.io | ||
apptainer push pcgr_singularity_${VERSION}.sif oras://ghcr.io/${GITHUB_REPOSITORY}:${VERSION}.singularity |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,3 +17,5 @@ docs/_build/ | |
|
||
.Rhistory | ||
*.Rproj | ||
|
||
tests |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,19 @@ | ||
FROM ubuntu:20.04 | ||
LABEL maintainer="https://github.com/pdiakumis" | ||
LABEL org.opencontainers.image.authors='[email protected], [email protected]' \ | ||
org.opencontainers.image.description='Personal Cancer Genome Reporter (PCGR)' \ | ||
org.opencontainers.image.source='https://github.com/sigven/pcgr' \ | ||
org.opencontainers.image.url='https://github.com/sigven/pcgr' \ | ||
org.opencontainers.image.documentation='https://sigven.github.io/pcgr' \ | ||
org.opencontainers.image.licenses='MIT' | ||
|
||
ARG MINI_VERSION=4.11.0-0 | ||
ARG MINI_VERSION=24.3.0-0 | ||
ARG MINI_URL=https://github.com/conda-forge/miniforge/releases/download/${MINI_VERSION}/Mambaforge-${MINI_VERSION}-Linux-x86_64.sh | ||
|
||
# install core pkgs, mambaforge | ||
RUN apt-get update && \ | ||
apt-get install --yes --no-install-recommends \ | ||
bash bzip2 curl git less vim wget zip ca-certificates && \ | ||
bash bzip2 curl less wget zip ca-certificates && \ | ||
apt-get clean && \ | ||
rm -r /var/lib/apt/lists/* && \ | ||
rm -r /var/cache/apt/* && \ | ||
curl --silent -L "${MINI_URL}" -o "mambaforge.sh" && \ | ||
/bin/bash mambaforge.sh -b -p /opt/mambaforge/ && \ | ||
rm mambaforge.sh | ||
|
@@ -23,6 +26,10 @@ RUN mamba create -n pcgr --file ${PCGR_CONDA_ENV_DIR}/pcgr-linux-64.lock | |
RUN mamba create -n pcgrr --file ${PCGR_CONDA_ENV_DIR}/pcgrr-linux-64.lock | ||
RUN mamba clean --all --force-pkgs-dirs --yes | ||
|
||
FROM quay.io/bioconda/base-glibc-debian-bash:3.1 | ||
|
||
COPY --from=0 /opt/mambaforge/envs/ /opt/mambaforge/envs/ | ||
|
||
ARG PCGR_ENV_NAME="pcgr" | ||
# pcgr env is activated by default | ||
ENV PATH="/opt/mambaforge/envs/${PCGR_ENV_NAME}/bin:${PATH}" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.