Skip to content

Commit

Permalink
Cleanup (#16)
Browse files Browse the repository at this point in the history
* remove unused files

* move to apptainer, cleanup
  • Loading branch information
espenhgn authored May 3, 2024
1 parent 3081f73 commit 45b5272
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 28 deletions.
37 changes: 11 additions & 26 deletions .github/workflows/container_build_push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ jobs:
tags: |
type=ref,event=branch
type=semver,pattern={{version}}
type=sha
type=sha
type=raw,value=latest,enable={{is_default_branch}}
-
name: Set up QEMU
uses: docker/setup-qemu-action@v3
Expand All @@ -47,28 +48,16 @@ jobs:
./dockerfiles/ldpred2/Dockerfile
platforms: linux/amd64

build-push-singularity-container:
build-apptainer-container:
needs: docker
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
container:
image: quay.io/singularity/singularity:v4.1.0
options: --privileged
name: Pull-push Singularity Container
name: Build Apptainer Container
steps:
- name: Check out code for the container builds
uses: actions/checkout@v4
- name: Install dependencies
run: |
apk add --no-cache curl
VERSION="1.1.0"
curl -LO "https://github.com/oras-project/oras/releases/download/v${VERSION}/oras_${VERSION}_linux_amd64.tar.gz"
mkdir -p oras-install/
tar -zxf oras_${VERSION}_*.tar.gz -C oras-install/
sudo mv oras-install/oras /usr/local/bin/
rm -rf oras_${VERSION}_*.tar.gz oras-install/
- name: Docker meta
id: meta
uses: docker/metadata-action@v5
Expand All @@ -78,21 +67,17 @@ jobs:
tags: |
type=semver,pattern={{version}}
type=ref,event=branch
type=sha
- name: Pull and push Singularity container
type=sha
type=raw,value=latest,enable={{is_default_branch}}
- name: Build and push Apptainer container
run: |
tags="${{ steps.meta.outputs.tags }}"
tags_array=
old_ifs="$IFS"
IFS=$'\n'
for tag in $tags; do
tags_array="$tags_array $tag"
done
IFS="$old_ifs"
echo ${{ secrets.GITHUB_TOKEN }} | oras login --username ${{ github.repository_owner }} --password-stdin ghcr.io
for tag in $tags_array; do
docker pull kaczmarj/apptainer:latest
echo "$tags"
for tag in $tags; do
echo "processing tag: $tag"
singularity pull ldpred2.sif docker://"$tag"
docker run --rm --privileged -v $(pwd):/work kaczmarj/apptainer build ldpred2.sif docker://"$tag"
oras push "$tag" --artifact-type application/vnd.acme.rocket.config ldpred2.sif
rm ldpred2.sif
done
Expand Down
14 changes: 13 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,22 @@

Software container build(s) and utilities for computing polygenic scores (PGS), based on our main development repository [CoMorMent/Containers](https://github.com/comorment/containers)

## Dependencies

To set up this project on the local machine, the following may be required:

* [git](https://git-scm.com)
* [git LFS](https://git-lfs.com)
* [Docker](https://www.docker.com)
* [Singularity](https://docs.sylabs.io) or [Apptainer](https://apptainer.org)
* [ORAS CLI](https://oras.land)

There are multiple methods to install these dependencies, and the user should choose the one that best fits their system.
Please refer to the respective websites for installation instructions.

## Obtaining these files

To use these files and codes, [clone](https://github.com/comorment/ldpred2_standalone) this repository by pressing that green [![Code](https://img.shields.io/badge/Code-green.svg)](https://github.com/comorment/ldpred2_standalone) button above and follow the instructions.

This repository also uses [git LFS](https://git-lfs.com) for large, non-code files.
After cloning the repository, initialize git LFS locally by issuing in the terminal:

Expand Down
2 changes: 1 addition & 1 deletion docker/dockerfiles/ldpred2/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
rm -rf /var/lib/apt/lists/*

# R dependencies
RUN R -e "install.packages(c('devtools', 'argparser', 'bigsnpr', 'data.table', 'essentials', 'eulerr', 'IRkernel', 'optparse', 'stringr', 'R.utils', 'tidyverse'), dependencies=c('Depends', 'Imports', 'LinkingTo'))"
RUN R -e "withCallingHandlers(install.packages(c('devtools', 'argparser', 'bigsnpr', 'data.table', 'essentials', 'eulerr', 'IRkernel', 'optparse', 'stringr', 'R.utils', 'tidyverse'), dependencies=c('Depends', 'Imports', 'LinkingTo')), warning = function(w) stop(w))"


# install plink 1.9
Expand Down

0 comments on commit 45b5272

Please sign in to comment.