Skip to content

Commit

Permalink
MNT: use GitHUB Actions, use mambaforge
Browse files Browse the repository at this point in the history
  • Loading branch information
kmuehlbauer committed Jun 1, 2021
1 parent f83a251 commit cf04c99
Show file tree
Hide file tree
Showing 7 changed files with 91 additions and 47 deletions.
77 changes: 77 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
name: Build & Deploy

on:
push:
branches: [ master ]
release:
types:
- created

workflow_dispatch:

jobs:
build:
name: create base image
runs-on: ubuntu-latest
defaults:
run:
shell: bash -l {0}
env:
DOCKER_REPO: wradlib-docker
strategy:
fail-fast: false
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: set release-tag env var
run: |
echo "WRADLIB_VERSION=${{ github.event.release.tag_name }}" >> $GITHUB_ENV
echo "fetch_status=`docker pull wradlib/${DOCKER_REPO}:base > /dev/null && echo 1 || echo 0`" >> $GITHUB_ENV
- name: check release-tag
run: |
echo wradlib_version "$WRADLIB_VERSION"
echo wradlib_version2 "$GITHUB_REF"
echo fetch_status "$fetch_status"
- name: build base image
env:
DOCKER_ID: ${{ secrets.DOCKER_ID }}
DOCKER_PW: ${{ secrets.DOCKER_PW }}
run: |
cd base
if [ "${fetch_status}" == "0" ]; then
docker build -t wradlib/$DOCKER_REPO:base .
docker images
echo "$DOCKER_PW" | docker login -u $DOCKER_ID --password-stdin
docker push wradlib/$DOCKER_REPO:base
fi
- name: add env vars
run: |
if [ "${WRADLIB_VERSION}" == "" ]; then
echo "WRADLIB_VERSION=master" >> $GITHUB_ENV
fi
echo "WRADLIB_DOCKER_TAG=min" >> $GITHUB_ENV
- name: build min image
env:
DOCKER_ID: ${{ secrets.DOCKER_ID }}
DOCKER_PW: ${{ secrets.DOCKER_PW }}
run: |
docker build --build-arg WRADLIB_VERSION --build-arg WRADLIB_DOCKER_TAG --build-arg DOCKER_REPO -t wradlib/$DOCKER_REPO:$WRADLIB_VERSION-${WRADLIB_DOCKER_TAG} .
docker images
echo "$DOCKER_PW" | docker login -u $DOCKER_ID --password-stdin
docker push wradlib/$DOCKER_REPO:$WRADLIB_VERSION-${WRADLIB_DOCKER_TAG}
- name: add env vars
run: |
if [ "${WRADLIB_VERSION}" == "" ]; then
echo "WRADLIB_VERSION=master" >> $GITHUB_ENV
fi
echo "WRADLIB_DOCKER_TAG=full" >> $GITHUB_ENV
- name: build full image
env:
DOCKER_ID: ${{ secrets.DOCKER_ID }}
DOCKER_PW: ${{ secrets.DOCKER_PW }}
run: |
docker build --build-arg WRADLIB_VERSION --build-arg WRADLIB_DOCKER_TAG --build-arg DOCKER_REPO -t wradlib/$DOCKER_REPO:$WRADLIB_VERSION-${WRADLIB_DOCKER_TAG} .
docker images
echo "$DOCKER_PW" | docker login -u $DOCKER_ID --password-stdin
docker push wradlib/$DOCKER_REPO:$WRADLIB_VERSION-${WRADLIB_DOCKER_TAG}
37 changes: 0 additions & 37 deletions .travis.yml

This file was deleted.

6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ RUN conda run -n base conda install --quiet --yes nb_conda_kernels && \
conda clean -tipy

# Install wradlib
ARG WRADLIB_VER
ENV WRL_VER=$WRADLIB_VER
ENV WRADLIB git+https://github.com/wradlib/wradlib.git@${WRL_VER}
ARG WRADLIB_VERSION
ENV WRL_VERSION=$WRADLIB_VERSION
ENV WRADLIB git+https://github.com/wradlib/wradlib.git@${WRL_VERSION}
SHELL ["conda", "run", "-n", "wradlib", "/bin/bash", "-c"]
RUN python -m pip install ${WRADLIB} --no-deps --ignore-installed --no-cache-dir

Expand Down
2 changes: 1 addition & 1 deletion LICENSE.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2017-2020 wradlib developers
Copyright (c) 2017-2021 wradlib developers

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ This repo consists of two docker files:
- based on `centos:7`
- basic x11 stack
- su-exec
- miniforge3 4.8.3-4
- miniforge3 4.10.1-4

- Dockerfile
- builds tags `min` and `full`
Expand Down
8 changes: 4 additions & 4 deletions base/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,11 @@ ENV PATH $CONDA_DIR/bin:$PATH
ENV SHELL /bin/bash
ENV LC_ALL=en_US.UTF-8 LANG=en_US.UTF-8 LANGUAGE=en_US.UTF-8

# Configure Miniconda3
ENV MINIFORGE_VER 4.8.3-4
ENV MINIFORGE Miniforge3-${MINIFORGE_VER}-Linux-x86_64.sh
# Configure Mambaforge
ENV MINIFORGE_VER 4.10.1-4
ENV MINIFORGE Mambaforge-${MINIFORGE_VER}-Linux-x86_64.sh
ENV MINIFORGE_URL https://github.com/conda-forge/miniforge/releases/download/${MINIFORGE_VER}/${MINIFORGE}
ENV MINIFORGE_SHA256_SUM 24951262a126582f5f2e1cf82c9cd0fa20e936ef3309fdb8397175f29e647646
ENV MINIFORGE_SHA256_SUM 9eb335cb559644a6e462c077ebc129af51b7329817574fb707b994dafdddf2af

# Install Miniconda3
RUN buildDeps="bzip2" && \
Expand Down
6 changes: 5 additions & 1 deletion environment_full.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ channels:
- conda-forge
- nodefaults
dependencies:
- python=3.8
- python=3.9
- black
- bottleneck
- cartopy
Expand All @@ -27,6 +27,9 @@ dependencies:
- notebook
- numpy
- pandoc
- pint
- pint-xarray
- pip
- psutil
- pytest
- pytest-cov
Expand All @@ -39,5 +42,6 @@ dependencies:
- sphinxcontrib-bibtex
- sphinx_rtd_theme
- tqdm
- wetterdienst
- xarray
- xmltodict

0 comments on commit cf04c99

Please sign in to comment.