Skip to content
This repository has been archived by the owner on Feb 11, 2023. It is now read-only.

Commit

Permalink
CI: dockers & triggers
Browse files Browse the repository at this point in the history
  • Loading branch information
Borda committed Jan 4, 2022
1 parent a930cc9 commit f1648b2
Show file tree
Hide file tree
Showing 6 changed files with 45 additions and 53 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci_pkg-install.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ name: Install package

# see: https://help.github.com/en/actions/reference/events-that-trigger-workflows
on: # Trigger the workflow on push or pull request, but only for the master branch
push:
push: {}
pull_request:
branches: [master]
pull_request: {}

jobs:
pkg-check:
Expand Down
16 changes: 6 additions & 10 deletions .github/workflows/ci_testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@ name: CI testing

# see: https://help.github.com/en/actions/reference/events-that-trigger-workflows
on: # Trigger the workflow on push or pull request, but only for the master branch
push:
push: {}
pull_request:
branches: [master]
pull_request: {}

jobs:
pytest:

pytest:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
Expand All @@ -17,12 +17,8 @@ jobs:
python-version: [3.6, 3.9]
requires: ['latest']
include:
- os: "ubuntu-18.04"
python-version: 2.7
requires: 'latest'
- os: "ubuntu-18.04"
python-version: 3.6
requires: 'minimal'
- {os: "ubuntu-18.04", python-version: 2.7, requires: 'latest'}
- {os: "ubuntu-18.04", python-version: 3.6, requires: 'oldest'}

# Timeout: https://stackoverflow.com/a/59076067/4521646
timeout-minutes: 35
Expand Down Expand Up @@ -51,7 +47,7 @@ jobs:
pip install -U backports.functools_lru_cache
- name: Set min. dependencies
if: matrix.requires == 'minimal'
if: matrix.requires == 'oldest'
run: |
for fpath in ('requirements.txt', 'tests/requirements.txt'):
req = open(fpath).read().replace('>=', '==')
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/docker-builds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@ name: Publish Docker Image
# https://www.docker.com/blog/first-docker-github-action-is-here
# https://github.com/docker/build-push-action
on: # Trigger the workflow on push or pull request, but only for the master branch
push:
branches: [master]
push: {}
pull_request:
branches: [master]
types: [opened, reopened, ready_for_review, synchronize]
Expand All @@ -14,22 +13,23 @@ jobs:
if: github.event.pull_request.draft == false
runs-on: ubuntu-20.04
strategy:
fail-fast: false
matrix:
python_version: [3.7, 3.8, 3.9]
python_version: ["3.7", "3.8", "3.9"]
steps:
- name: Checkout
uses: actions/checkout@v2
# https://github.com/docker/setup-buildx-action
# Set up Docker Buildx - to use cache-from and cache-to argument of buildx command
- uses: docker/setup-buildx-action@v1
- name: Login to DockerHub
if: ${{ github.repository_owner == 'Borda' }}
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Build and Publish to Docker Hub
# publish master
uses: docker/build-push-action@v2
# https://github.com/docker/build-push-action#cache-to-registry
with:
Expand All @@ -38,6 +38,6 @@ jobs:
cache-from: type=registry,ref=borda/birl:SOTA-py${{ matrix.python_version }}
cache-to: type=inline
file: bm_experiments/Dockerfile
push: ${{ github.ref == 'refs/heads/master' }}
push: ${{ github.ref == 'refs/heads/master' && github.event_name == 'push' }}
tags: borda/birl:SOTA-py${{ matrix.python_version }}
timeout-minutes: 240
4 changes: 2 additions & 2 deletions .github/workflows/docs-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ name: "Docs check"

# see: https://help.github.com/en/actions/reference/events-that-trigger-workflows
on: # Trigger the workflow on push or pull request, but only for the master branch
push:
push: {}
pull_request:
branches: [master]
pull_request: {}

jobs:

Expand Down
7 changes: 6 additions & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,13 @@ repos:
hooks:
- id: end-of-file-fixer
- id: trailing-whitespace
- id: check-case-conflict
- id: check-yaml
- id: pretty-format-json
- id: check-toml
- id: check-json
- id: check-added-large-files
- id: check-docstring-first
- id: detect-private-key

#- repo: https://github.com/pre-commit/mirrors-autopep8
# rev: v1.5.7
Expand Down
57 changes: 24 additions & 33 deletions bm_experiments/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ SHELL ["/bin/bash", "-c"]
# for installing tzdata see: https://stackoverflow.com/a/58264927/4521646
ENV DEBIAN_FRONTEND=noninteractive

RUN apt-get update && \
RUN apt-get update -qq --fix-missing && \
apt-get install -y --no-install-recommends software-properties-common && \
add-apt-repository ppa:deadsnakes/ppa && \
apt-get update && \
apt-get update -qq --fix-missing && \
apt-get install -y --no-install-recommends \
python${PYTHON_VERSION} \
python${PYTHON_VERSION}-dev \
Expand Down Expand Up @@ -45,31 +45,9 @@ RUN apt-get update && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*

RUN \
# BIRL requirement
apt-get update && \
apt-get install -y --no-install-recommends \
openslide-tools \
&& \

# Download BIRL from master
wget https://github.com/Borda/BIRL/archive/master.zip --progress=bar:force:noscroll && \
unzip -q master.zip && \
rm master.zip && \
mv BIRL-master BIRL && \

# Install BIRL
# v46 crashes openslide-python install
pip install "setuptools<46" -U && \
pip install ./BIRL --no-cache-dir && \
python -c "import birl ; print(birl.__version__)" && \
mkdir BIRL/Applications && \
# Cleaning
apt-get clean && \
rm -rf /var/lib/apt/lists/*

ENV BIRL_APPs_PATH="/BIRL/Applications"

RUN mkdir -p $BIRL_APPs_PATH

RUN \
cd $BIRL_APPs_PATH && \
Expand All @@ -84,7 +62,7 @@ RUN \
ENV ANTs_VERSION="2.3.4"

RUN \
apt-get update && \
apt-get update -qq && \
apt-get install -y --no-install-recommends \
zlib1g-dev \
&& \
Expand Down Expand Up @@ -127,7 +105,7 @@ RUN \
ENV ANTSPY_VERSION="0.2.5"

RUN \
apt-get update && \
apt-get update -qq && \
apt-get install -y --no-install-recommends \
libopenblas-dev \
liblapack-dev \
Expand Down Expand Up @@ -163,8 +141,7 @@ RUN \
ENV LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$BIRL_APPs_PATH/elastix/lib/"

RUN \
# add required libs
apt-get update && \
apt-get update -qq && \
apt-get install -y --no-install-recommends \
libtbb-dev \
libboost-all-dev \
Expand Down Expand Up @@ -228,8 +205,7 @@ RUN \
$BIRL_APPs_PATH/DROP2/dropreg --help

RUN \
# add required libs
apt-get update && \
apt-get update -qq && \
apt-get install -y --no-install-recommends \
r-base-core \
r-base-dev \
Expand Down Expand Up @@ -258,10 +234,25 @@ RUN \
# try to run RNiftyReg
R -e 'library(RNiftyReg)'

COPY ./ /BIRL/

RUN \
apt-get update -qq && \
apt-get install -y --no-install-recommends \
openslide-tools \
&& \
# Install BIRL
# v46 crashes openslide-python install
pip install "setuptools<46" -U && \
pip install ./BIRL --no-cache-dir && \
python -c "import birl ; print(birl.__version__)" && \
# Cleaning
apt-get clean && \
rm -rf /var/lib/apt/lists/*


RUN \
# show installed applications
apt-get update && \
apt-get update -qq && \
apt-get install -y --no-install-recommends \
tree \
&& \
Expand Down

0 comments on commit f1648b2

Please sign in to comment.