Skip to content

environment update #220

environment update

environment update #220

################################################################################
# Copyright (c) 2021 ContinualAI. #
# Copyrights licensed under the MIT License. #
# See the accompanying LICENSE file for terms. #
# #
# Date: 15-07-2021 #
# Author(s): Gabriele Graffieti #
# E-mail: [email protected] #
# Website: avalanche.continualai.org #
################################################################################
name: environment update
on:
push:
branches:
- master
paths:
- '.github/workflows/environment-update.yml'
- 'requirements.txt'
- 'setup.py'
- 'extra_dependencies.txt'
schedule:
- cron: '0 0 * * 0' # midnight of every Sunday
jobs:
environment-creation:
if: github.repository == 'ContinualAI/avalanche'
name: new environment creation
runs-on: ubuntu-latest
container:
image: condaforge/mambaforge:latest
strategy:
fail-fast: false
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11"]
defaults:
run:
shell: bash -l {0}
steps:
- uses: actions/checkout@v3
with:
token: ${{ secrets.GITHUB_TOKEN }}
- name: install opencv and quadprog dependency libs
env:
DEBIAN_FRONTEND: "noninteractive"
TZ: "Etc/UTC"
run: |
apt-get update &&
apt-get install ffmpeg libsm6 libxext6 build-essential -y
- name: install conda environment
run: |
mamba create -n avalanche-env -y -v python=${{ matrix.python-version }} -c conda-forge &&
conda run -n avalanche-env --no-capture-output pip install -r requirements.txt
- name: download datasets
env:
FAST_TEST: "True"
USE_GPU: "False"
PYTHONPATH: ${{ github.workspace }}
shell: bash -l -c "conda run -n avalanche-env --no-capture-output bash {0}"
run: |
pip install pytest-xdist &&
pytest -n 1 ./tests/benchmarks/scenarios/deprecated/test_high_level_generators.py::HighLevelGeneratorTests::test_filelist_benchmark ./tests/benchmarks/scenarios/deprecated/test_nc_mt_scenario.py::MultiTaskTests::test_mt_single_dataset
- name: python unit test
id: unittest
env:
FAST_TEST: "True"
USE_GPU: "False"
PYTHONPATH: ${{ github.workspace }}
CUBLAS_WORKSPACE_CONFIG: ":4096:8"
shell: bash -l -c "conda run -n avalanche-env --no-capture-output bash {0}"
run: |
pytest tests &&
echo "Running checkpointing tests..." &&
bash ./tests/checkpointing/test_checkpointing.sh &&
echo "Running distributed training tests..." &&
python tests/run_dist_tests.py
- name: checkout avalanche-docker repo
if: always()
uses: actions/checkout@v3
with:
repository: 'ContinualAI/avalanche-docker'
ref: master
path: 'avalanche-docker'
token: ${{ secrets.BOT_TOKEN }}
- name: test success
if: success()
shell: bash -l -c "conda run -n avalanche-env --no-capture-output bash {0}"
run: |
rm -f avalanche-docker/${{ matrix.python-version }}/environment-${{ matrix.python-version }}.yml &&
rm -f avalanche-docker/${{ matrix.python-version }}/requirements-${{ matrix.python-version }}.txt &&
pip freeze > $"avalanche-docker/"${{ matrix.python-version }}"/requirements-"${{ matrix.python-version }}".txt"
cd avalanche-docker &&
git config --local user.email ${{ secrets.BOT_EMAIL }} &&
git config --local user.name ${{ secrets.BOT_NAME }} &&
git pull &&
git add . &&
git commit -m $"Update environment with python "${{ matrix.python-version }} -a || true &&
git pull
- name: Push changes to avalanche-docker
if: success()
continue-on-error: true
uses: ad-m/github-push-action@master
with:
repository: ContinualAI/avalanche-docker
branch: master
directory: avalanche-docker
github_token: ${{ secrets.BOT_TOKEN }}