Skip to content

Commit

Permalink
Merge pull request #1 from msk-access/msk-access
Browse files Browse the repository at this point in the history
Msk access
  • Loading branch information
rhshah authored Apr 6, 2022
2 parents 52227bc + 6251a8c commit 4c9984e
Show file tree
Hide file tree
Showing 8 changed files with 570 additions and 72 deletions.
63 changes: 31 additions & 32 deletions .github/workflows/deploy-pypi.yml
Original file line number Diff line number Diff line change
@@ -1,32 +1,31 @@
name: Publish MultiQC to PyPI
on:
release:
types: [published]

jobs:
build-n-publish:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
name: Check out source-code repository

- name: Set up Python 3.7
uses: actions/setup-python@v1
with:
python-version: 3.7

- name: Install python dependencies
run: |
python -m pip install --upgrade pip setuptools wheel build
pip install .
- name: Build the distribution
run: python setup.py sdist bdist_wheel

- name: Publish MultiQC to PyPI
if: github.repository == 'ewels/MultiQC'
uses: pypa/gh-action-pypi-publish@master
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
# name: Publish MultiQC to PyPI
# on:
# release:
# types: [published]
#
# jobs:
# build-n-publish:
# runs-on: ubuntu-latest
#
# steps:
# - uses: actions/checkout@v2
# name: Check out source-code repository
#
# - name: Set up Python 3.7
# uses: actions/setup-python@v1
# with:
# python-version: 3.7
#
# - name: Install python dependencies
# run: |
# python -m pip install --upgrade pip setuptools wheel build twine
# pip install .
#
# - name: Build the distribution
# run: python setup.py sdist bdist_wheel
#
# - name: Publish MultiQC-MSK to PyPI
# uses: pypa/gh-action-pypi-publish@master
# with:
# user: __token__
# password: ${{ secrets.PYPI_API_TOKEN }}
69 changes: 69 additions & 0 deletions .github/workflows/publish_docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
name: Publish Docker image
on:
release:
types: [published]
jobs:
push_to_registries:
name: Build and publish Docker image
runs-on: ubuntu-latest
steps:
-
name: Check out the repo
uses: actions/checkout@v2
-
name: Set up QEMU
uses: docker/setup-qemu-action@v1
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
-
name: Prepare
# In this preparation step, a few configurations are made
# according to tags that will be used to export the image
# for Docker Hub, as well as the name of the image itself
id: prep
run: |
DOCKER_IMAGE=ghcr.io/msk-access/multiqc
VERSION=noop
if [ "${{ github.event_name }}" = "schedule" ]; then
VERSION=nightly
elif [[ $GITHUB_REF == refs/tags/* ]]; then
VERSION=${GITHUB_REF#refs/tags/}
elif [[ $GITHUB_REF == refs/heads/* ]]; then
VERSION=$(echo ${GITHUB_REF#refs/heads/} | sed -r 's#/+#-#g')
fi
TAGS="${DOCKER_IMAGE}:${VERSION}"
if [[ $VERSION =~ ^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$ ]]; then
MINOR=${VERSION%.*}
MAJOR=${MINOR%.*}
TAGS="$TAGS,${DOCKER_IMAGE}:${MINOR},${DOCKER_IMAGE}:${MAJOR},${DOCKER_IMAGE}:latest"
elif [[ $VERSION =~ ^v[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$ ]]; then
VERSION=$(echo ${VERSION#v})
TAGS="${DOCKER_IMAGE}:${VERSION}"
elif [ "${{ github.event_name }}" = "push" ]; then
TAGS="$TAGS,${DOCKER_IMAGE}:sha-${GITHUB_SHA::8}"
fi
echo ::set-output name=version::${VERSION}
echo ::set-output name=tags::${TAGS}
-
name: Login to GitHub Container Registry
#if: github.event_name != 'pull_request'
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.RS_PAT }}
- name: Push to GitHub Packages
uses: docker/build-push-action@v2
with:
context: .
file: ./Dockerfile
registry: ghcr.io
push: true
tags: ${{ steps.prep.outputs.tags }}
build-args: |
MULTIQC_VERSION=${{ steps.prep.outputs.version }}
labels: |
org.opencontainers.image.title=${{ github.event.repository.name }}
org.opencontainers.image.description=${{ github.event.repository.description }}
org.opencontainers.image.version=${{ steps.prep.outputs.version }}
38 changes: 33 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,19 +1,47 @@
# Teeny-tiny matplotlib image based on alpine
FROM czentye/matplotlib-minimal:3.1.2
FROM python:3.6-slim

LABEL author="Phil Ewels" \
description="MultiQC" \
maintainer="phil.ewels@scilifelab.se"

RUN apk add --no-cache bash
# RUN apk add --no-cache bash gcc gfortran build-base wget freetype-dev libpng-dev openblas-dev

# Add the MultiQC source files to the container
ADD . /usr/src/multiqc
WORKDIR /usr/src/multiqc

ENV LC_ALL en_US.utf-8
ENV LANG en_US.utf-8
ENV PYTHONIOENCODING utf-8
ENV LC_ALL=en_US.utf-8
ENV LANG=en_US.utf-8
ENV PYTHONIOENCODING=utf-8

RUN apt-get -qq update && \
apt-get -q -y upgrade && \
apt-get install -y locales

RUN sed -i -e 's/# en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/' /etc/locale.gen \
&& sed -i -e 's/# pt_BR.UTF-8 UTF-8/pt_BR.UTF-8 UTF-8/' /etc/locale.gen \
&& locale-gen en_US.utf-8

# Install MultiQC
RUN pip install --upgrade pip && pip install --no-cache-dir scipy
RUN python -m pip install .

# Set up entrypoint and cmd for easy docker usage
ENTRYPOINT [ "multiqc" ]
CMD [ "." ]
ENV LC_ALL en_US.utf-8
ENV LANG en_US.utf-8
ENV PYTHONIOENCODING utf-8
ENV LC_ALL=en_US.utf-8
ENV LANG=en_US.utf-8
ENV PYTHONIOENCODING=utf-8

CMD ["/bin/bash"]

ENV LC_ALL en_US.utf-8
ENV LANG en_US.utf-8
ENV PYTHONIOENCODING utf-8
ENV LC_ALL=en_US.utf-8
ENV LANG=en_US.utf-8
ENV PYTHONIOENCODING=utf-8
Loading

0 comments on commit 4c9984e

Please sign in to comment.