Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
230 changes: 169 additions & 61 deletions .github/workflows/deploy_publish.yml
Original file line number Diff line number Diff line change
@@ -1,61 +1,169 @@
#name: deploy-on-release
#
#on:
# release:
# types: [published]
#
#jobs:
#
# # build-pypi:
# # runs-on: ubuntu-latest
#
# # steps:
# # - uses: actions/checkout@v2
#
# # - name: set up Python 3.6
# # uses: actions/setup-python@v1
# # with:
# # python-version: 3.6
#
# # - name: Generating distribution archives
# # run: |
# # pip install --upgrade setuptools wheel
# # python setup.py sdist bdist_wheel --universal
#
# # - name: Publish a Python distribution to PyPI
# # uses: pypa/gh-action-pypi-publish@master
# # with:
# # user: __token__
# # password: ${{ secrets.PYPI_PASSWORD }}
#
# build-docker:
# runs-on: ubuntu-latest
# strategy:
# matrix:
# docker: ['', '-fp16', '-dev', '-dev-fp16']
#
# steps:
# - uses: actions/checkout@v2
#
# - name: Get release version
# id: get_version
# run: echo "RELEASE_VERSION=$(echo ${GITHUB_REF:10})" >> ${GITHUB_ENV}
#
# - name: Publish Docker to Docker Hub
# uses: elgohr/Publish-Docker-Github-Action@master
# with:
# name: catalystteam/catalyst
# username: ${{ secrets.DOCKER_USERNAME }}
# password: ${{ secrets.DOCKER_PASSWORD }}
# dockerfile: docker/Dockerfile${{ matrix.docker }}
# tags: "latest,${{ env.RELEASE_VERSION }}${{ matrix.docker }}"
#
# # build-docs:
# # runs-on: ubuntu-latest
#
# # steps:
# # - uses: actions/checkout@v2
#
# # - name: Get release version
# # id: get_version
# # run: echo ::set-env name=RELEASE_VERSION::$(echo ${GITHUB_REF:10})
name: deploy-on-release

on:
release:
types: [published]

jobs:

# build-pypi:
# runs-on: ubuntu-latest

# steps:
# - uses: actions/checkout@v2

# - name: set up Python 3.6
# uses: actions/setup-python@v1
# with:
# python-version: 3.6

# - name: Generating distribution archives
# run: |
# pip install --upgrade setuptools wheel
# python setup.py sdist bdist_wheel --universal

# - name: Publish a Python distribution to PyPI
# uses: pypa/gh-action-pypi-publish@master
# with:
# user: __token__
# password: ${{ secrets.PYPI_PASSWORD }}

build-docker:
runs-on: ubuntu-latest
strategy:
matrix:
catalyst_requirements: ["base", all]
pytorch:
# - "1.9.0-cuda11.1-cudnn8-runtime"
- "1.9.0-cuda11.1-cudnn8-devel"
# - "1.8-cuda10.1-cudnn7-runtime"
- "1.8.1-cuda11.1-cudnn8-devel"
# - "1.7.0-cuda11.0-cudnn8-runtime"
- "1.7.0-cuda11.0-cudnn8-devel"
# - "1.3-cuda10.1-cudnn7-runtime"
- "1.3-cuda10.1-cudnn7-devel"

steps:
- uses: actions/checkout@v2

- name: Publish Docker to Docker Hub (base)
if: ${{ matrix.catalyst_requirements == "base" }}
uses: elgohr/Publish-Docker-Github-Action@master
env:
PYTORCH_TAG: "${{ matrix.pytorch }}"
with:
name: catalystteam/catalyst
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
dockerfile: docker/Dockerfile
tags: "${{ github.event.release.tag_name }}-pytorch-${{ matrix.pytorch }}"

- name: Publish Docker to Docker Hub ([all])
if: ${{ matrix.catalyst_requirements == "all" }}
uses: elgohr/Publish-Docker-Github-Action@master
env:
PYTORCH_TAG: "${{ matrix.pytorch }}"
CATALYST_ALL: "1"
with:
name: catalystteam/catalyst
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
dockerfile: docker/Dockerfile
tags: "${{ github.event.release.tag_name }}-all-pytorch-${{ matrix.pytorch }}"

build-docs:
name: build-docs
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
max-parallel: 4
matrix:
os: [ubuntu-18.04] # , windows-2019, macOS-10.15]
python-version: [3.6] #, 3.7, 3.8]
requires: ['latest']
# exclude:
# # excludes node 4 on macOS
# - python-version: 3.8
# requires: 'minimal'
# Timeout: 4
timeout-minutes: 30
steps:
- uses: actions/checkout@v2

- name: set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}

- name: setup ubuntu
run: |
python -c "from pip._internal.locations import USER_CACHE_DIR; print('::set-output name=dir::' + USER_CACHE_DIR)"

# https://github.com/actions/cache/blob/master/examples.md
# Note: This uses an internal pip API and may not always work
# https://github.com/actions/cache/blob/master/examples.md#multiple-oss-in-a-workflow
- name: get pip cache dir
id: pip-cache
run: |
python -c "from pip._internal.locations import USER_CACHE_DIR; print('::set-output name=dir::' + USER_CACHE_DIR)"

- name: cache pip
uses: actions/cache@v2
with:
path: ${{ steps.pip-cache.outputs.dir }}
key: ${{ runner.os }}-${{ matrix.python-version }}-pip -${{ hashFiles('./requirements/requirements.txt') }} -${{ hashFiles('./requirements/requirements-dev.txt') }}
restore-keys: |
${{ runner.os }}-${{ matrix.python-version }}-pip-

- name: cache pip contrib
uses: actions/cache@v2
with:
path: ${{ steps.pip-cache.outputs.dir }}
key: ${{ runner.os }}-${{ matrix.python-version }}-pip -${{hashFiles('./requirements/requirements-cv.txt') }} -${{hashFiles('./requirements/requirements-nifti.txt') }} -${{ hashFiles('./requirements/requirements-hydra.txt') }} -${{ hashFiles('./requirements/requirements-ml.txt') }} -${{ hashFiles('./requirements/requirements-optuna.txt') }} -${{ hashFiles('./requirements/requirements-mlflow.txt') }} -${{ hashFiles('./requirements/requirements-neptune.txt') }}
restore-keys: |
${{ runner.os }}-${{ matrix.python-version }}-pip-contrib

- name: cache pip contrib [2]
uses: actions/cache@v2
with:
path: ${{ steps.pip-cache.outputs.dir }}
key: ${{ runner.os }}-${{ matrix.python-version }}-pip -${{ hashFiles('./requirements/requirements-albu.txt') }}
restore-keys: |
${{ runner.os }}-${{ matrix.python-version }}-pip-contrib

- name: install dependencies
run: |
# python -m pip install --upgrade --user pip
pip install -r ./requirements/requirements.txt -r ./requirements/requirements-cv.txt -r ./requirements/requirements-dev.txt -r ./requirements/requirements-hydra.txt -r ./requirements/requirements-ml.txt -r ./requirements/requirements-nifti.txt -r ./requirements/requirements-optuna.txt -r ./requirements/requirements-mlflow.txt -r ./requirements/requirements-neptune.txt -r ./requirements/requirements-albu.txt
python --version
pip --version
pip list
shell: bash

- name: make docs
run: |
REMOVE_BUILDS=0 make check-docs

- name: commit documentation changes
env:
TAG: "${{ github.event.release.tag_name }}"
run: |
git clone https://github.com/catalyst-team/catalyst.git --branch gh-pages --single-branch gh-pages
cd gh-pages
cp -a ../builds "${{ github.event.release.tag_name }}"
# add link to new version into `versions.html`
master_version_link='<li class="toctree-l1"><a class="reference internal" href="index.html">master<\/a><\/li>'
new_version_link="\ <li class=\"toctree-l1\"><a class=\"reference internal\" href=\"${TAG}/index.html\">${TAG}<\/a><\/li>"
sed -i "/${master_version_link}/a ${new_version_link}" versions.html
# commit changes
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
git add .
git commit -m "$(git log -1 --pretty=%B)" || true

- name: push changes
uses: ad-m/github-push-action@master
with:
branch: gh-pages
directory: gh-pages
github_token: ${{ secrets.GITHUB_TOKEN }}
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).
### Added

- added `pre-commit` hook to run codestyle checker on commit ([#1257](https://github.com/catalyst-team/catalyst/pull/1257))
- `on publish` github action for docker and docs added [#1260](https://github.com/catalyst-team/catalyst/pull/1260)

### Changed

Expand Down
9 changes: 8 additions & 1 deletion docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,17 @@ RUN pip install -U catalyst --no-cache-dir
RUN if [ "$CATALYST_DEV" = "1" ] ; then pip install -U catalyst[dev] --no-cache-dir ; else echo "catalyst[dev] is not required" ; fi
RUN if [ "$CATALYST_CV" = "1" ] ; then pip install -U catalyst[cv] --no-cache-dir ; else echo "catalyst[cv] is not required" ; fi
RUN if [ "$CATALYST_ML" = "1" ] ; then pip install -U catalyst[ml] --no-cache-dir ; else echo "catalyst[ml] is not required" ; fi
RUN if [ "$CATALYST_ALBU" = "1" ] ; then pip install -U catalyst[albu] --no-cache-dir ; else echo "catalyst[albu] is not required" ; fi
RUN if [ "$CATALYST_NIFTI" = "1" ] ; then pip install -U catalyst[nifti] --no-cache-dir ; else echo "catalyst[nifti] is not required" ; fi
RUN if [ "$CATALYST_HYDRA" = "1" ] ; then pip install -U catalyst[hydra] --no-cache-dir ; else echo "catalyst[hydra] is not required" ; fi
RUN if [ "$CATALYST_OPTUNA" = "1" ] ; then pip install -U catalyst[optuna] --no-cache-dir ; else echo "catalyst[optuna] is not required" ; fi
RUN if [ "$CATALYST_ONNX" = "1" ] ; then pip install -U catalyst[onnx] --no-cache-dir ; else echo "catalyst[onnx] is not required" ; fi
RUN if [ "$CATALYST_ONNX_GPU" = "1" ] ; then pip install -U catalyst[onnx-gpu] --no-cache-dir ; else echo "catalyst[onnx-gpu] is not required" ; fi
RUN if [ "$CATALYST_MLFLOW" = "1" ] ; then pip install -U catalyst[mlflow] --no-cache-dir ; else echo "catalyst[mlflow] is not required" ; fi
RUN if [ "$CATALYST_NEPTUNE" = "1" ] ; then pip install -U catalyst[neptune] --no-cache-dir ; else echo "catalyst[neptune] is not required" ; fi
RUN if [ "$CATALYST_WANDB" = "1" ] ; then pip install -U catalyst[wandb] --no-cache-dir ; else echo "catalyst[wandb] is not required" ; fi
RUN if [ "$CATALYST_FAIRSCALE" = "1" ] ; then pip install -U catalyst[fairscale] --no-cache-dir ; else echo "catalyst[fairscale] is not required" ; fi
RUN if [ "$CATALYST_DEEPSPEED" = "1" ] ; then pip install -U catalyst[deepspeed] --no-cache-dir ; else echo "catalyst[deepspeed] is not required" ; fi
RUN if [ "$CATALYST_ALBU" = "1" ] ; then pip install -U catalyst[albu] --no-cache-dir ; else echo "catalyst[albu] is not required" ; fi
RUN if [ "$CATALYST_ALL" = "1" ] ; then pip install -U catalyst[all] --no-cache-dir ; else echo "catalyst[all] is not required" ; fi

WORKDIR /workspace
8 changes: 8 additions & 0 deletions docker/Dockerfile-dev
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,17 @@ COPY requirements/ /workspace/
RUN if [ "$CATALYST_DEV" = "1" ] ; then pip install -r /workspace/requirements-dev.txt --no-cache-dir ; else echo "catalyst[dev] is not required" ; fi
RUN if [ "$CATALYST_CV" = "1" ] ; then pip install -r /workspace/requirements-cv.txt --no-cache-dir ; else echo "catalyst[cv] is not required" ; fi
RUN if [ "$CATALYST_ML" = "1" ] ; then pip install -r /workspace/requirements-ml.txt --no-cache-dir ; else echo "catalyst[ml] is not required" ; fi
RUN if [ "$CATALYST_NIFTI" = "1" ] ; then pip install -r /workspace/requirements-nifti.txt --no-cache-dir ; else echo "catalyst[nifti] is not required" ; fi
RUN if [ "$CATALYST_HYDRA" = "1" ] ; then pip install -r /workspace/requirements-hydra.txt --no-cache-dir ; else echo "catalyst[hydra] is not required" ; fi
RUN if [ "$CATALYST_OPTUNA" = "1" ] ; then pip install -r /workspace/requirements-optuna.txt --no-cache-dir ; else echo "catalyst[optuna] is not required" ; fi
RUN if [ "$CATALYST_ONNX" = "1" ] ; then pip install -r /workspace/requirements-onnx.txt --no-cache-dir ; else echo "catalyst[onnx] is not required" ; fi
RUN if [ "$CATALYST_ONNX_GPU" = "1" ] ; then pip install -r /workspace/requirements-onnx-gpu.txt --no-cache-dir ; else echo "catalyst[onnx-gpu] is not required" ; fi
RUN if [ "$CATALYST_MLFLOW" = "1" ] ; then pip install -r /workspace/requirements-mlflow.txt --no-cache-dir ; else echo "catalyst[mlflow] is not required" ; fi
RUN if [ "$CATALYST_NEPTUNE" = "1" ] ; then pip install -r /workspace/requirements-neptune.txt --no-cache-dir ; else echo "catalyst[neptune] is not required" ; fi
RUN if [ "$CATALYST_WANDB" = "1" ] ; then pip install -r /workspace/requirements-wandb.txt --no-cache-dir ; else echo "catalyst[wandb] is not required" ; fi
RUN if [ "$CATALYST_FAIRSCALE" = "1" ] ; then pip install -r /workspace/requirements-fairscale.txt --no-cache-dir ; else echo "catalyst[fairscale] is not required" ; fi
RUN if [ "$CATALYST_DEEPSPEED" = "1" ] ; then pip install -r /workspace/requirements-deepspeed.txt --no-cache-dir ; else echo "catalyst[deepspeed] is not required" ; fi
RUN if [ "$CATALYST_ALBU" = "1" ] ; then pip install -r /workspace/requirements-albu.txt --no-cache-dir ; else echo "catalyst[albu] is not required" ; fi
RUN if [ "$CATALYST_ALL" = "1" ] ; then pip install -r /workspace/requirements-all.txt --no-cache-dir ; else echo "catalyst[all] is not required" ; fi

WORKDIR /workspace