From 7ac8b734702843f26914d81909688de76a2e3c1a Mon Sep 17 00:00:00 2001 From: Mike Henry <11765982+mikemhenry@users.noreply.github.com> Date: Fri, 15 Sep 2023 08:42:49 -0700 Subject: [PATCH 1/9] Added bit to free up disk on linux, added a debug command to figure out what I need to clean on mac --- .github/workflows/CI.yaml | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/.github/workflows/CI.yaml b/.github/workflows/CI.yaml index eb98e9f8..848aafc0 100644 --- a/.github/workflows/CI.yaml +++ b/.github/workflows/CI.yaml @@ -25,6 +25,41 @@ jobs: python-version: [3.9, "3.10", "3.11"] steps: + - name: Free diskspace (Linux) + if: matrix.os == 'ubuntu-latest' + run: | + sudo docker rmi $(docker image ls -aq) >/dev/null 2>&1 || true + sudo rm -rf \ + /usr/share/dotnet /usr/local/lib/android /opt/ghc \ + /usr/local/share/powershell /usr/share/swift /usr/local/.ghcup \ + /usr/lib/jvm || true + echo "some directories deleted" + sudo apt install aptitude -y >/dev/null 2>&1 + sudo aptitude purge aria2 ansible azure-cli shellcheck rpm xorriso zsync \ + esl-erlang firefox gfortran-8 gfortran-9 google-chrome-stable \ + google-cloud-sdk imagemagick \ + libmagickcore-dev libmagickwand-dev libmagic-dev ant ant-optional kubectl \ + mercurial apt-transport-https mono-complete libmysqlclient \ + unixodbc-dev yarn chrpath libssl-dev libxft-dev \ + libfreetype6 libfreetype6-dev libfontconfig1 libfontconfig1-dev \ + snmp pollinate libpq-dev postgresql-client powershell ruby-full \ + sphinxsearch subversion mongodb-org azure-cli microsoft-edge-stable \ + -y -f >/dev/null 2>&1 + sudo aptitude purge google-cloud-sdk -f -y >/dev/null 2>&1 + sudo aptitude purge microsoft-edge-stable -f -y >/dev/null 2>&1 || true + sudo apt purge microsoft-edge-stable -f -y >/dev/null 2>&1 || true + sudo aptitude purge '~n ^mysql' -f -y >/dev/null 2>&1 + sudo aptitude purge '~n ^php' -f -y >/dev/null 2>&1 + sudo aptitude purge '~n ^dotnet' -f -y >/dev/null 2>&1 + sudo apt-get autoremove -y >/dev/null 2>&1 + sudo apt-get autoclean -y >/dev/null 2>&1 + echo "some packages purged" + + - name: Free diskspace (MacOS) + if: matrix.os == 'macOS-latest' + run: | + sudo du -a * | sort -r -n | head -100 + - uses: actions/checkout@v3 - name: Additional info about the build From 2d3bb2e1fcd4f5de6a2abcf6d31d7922cacc3e0b Mon Sep 17 00:00:00 2001 From: Mike Henry <11765982+mikemhenry@users.noreply.github.com> Date: Fri, 15 Sep 2023 08:49:51 -0700 Subject: [PATCH 2/9] don't kill all jobs if one CI job fails --- .github/workflows/CI.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/CI.yaml b/.github/workflows/CI.yaml index 848aafc0..3ccbf3db 100644 --- a/.github/workflows/CI.yaml +++ b/.github/workflows/CI.yaml @@ -20,6 +20,7 @@ jobs: name: Test on ${{ matrix.os }}, Python ${{ matrix.python-version }} runs-on: ${{ matrix.os }} strategy: + fail-fast: false matrix: os: [macOS-latest, ubuntu-latest] python-version: [3.9, "3.10", "3.11"] From 240c679f7d22256025a7596e9854d5d4571f5361 Mon Sep 17 00:00:00 2001 From: Mike Henry <11765982+mikemhenry@users.noreply.github.com> Date: Fri, 15 Sep 2023 08:52:03 -0700 Subject: [PATCH 3/9] kill jobs if another push is made, also set the same shell for all steps --- .github/workflows/CI.yaml | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/.github/workflows/CI.yaml b/.github/workflows/CI.yaml index 3ccbf3db..2554541c 100644 --- a/.github/workflows/CI.yaml +++ b/.github/workflows/CI.yaml @@ -15,6 +15,14 @@ on: # (from https://help.github.com/en/actions/reference/events-that-trigger-workflows#scheduled-events-schedule) - cron: "0 0 * * 0" +concurrency: + group: "${{ github.workflow }}-${{ github.ref }}" + cancel-in-progress: true + +defaults: + run: + shell: bash -l {0} + jobs: test: name: Test on ${{ matrix.os }}, Python ${{ matrix.python-version }} @@ -64,7 +72,6 @@ jobs: - uses: actions/checkout@v3 - name: Additional info about the build - shell: bash run: | uname -a df -h @@ -81,14 +88,12 @@ jobs: - name: Install package # conda setup requires this special shell - shell: bash -l {0} run: | python -m pip install . --no-deps micromamba list - name: Run tests # conda setup requires this special shell - shell: bash -l {0} run: | pytest -v --cov=modelforge --cov-report=xml --color=yes modelforge/tests/ From 47477501db2fd218ae66e34460262413460d0eda Mon Sep 17 00:00:00 2001 From: Mike Henry <11765982+mikemhenry@users.noreply.github.com> Date: Fri, 15 Sep 2023 08:59:22 -0700 Subject: [PATCH 4/9] more cleanup of env (defaults bad) and other CI tweaks --- .github/workflows/CI.yaml | 8 ++++---- devtools/conda-envs/test_env.yaml | 6 +----- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/.github/workflows/CI.yaml b/.github/workflows/CI.yaml index 2554541c..c3ec59ff 100644 --- a/.github/workflows/CI.yaml +++ b/.github/workflows/CI.yaml @@ -78,12 +78,12 @@ jobs: ulimit -a # More info on options: https://github.com/marketplace/actions/provision-with-micromamba - - uses: mamba-org/provision-with-micromamba@main + - uses: mamba-org/setup-micromamba@v1 with: environment-file: devtools/conda-envs/test_env.yaml - environment-name: test - channels: conda-forge,defaults - extra-specs: | + cache-environment: true + cache-downloads: true + create-args: >- python=${{ matrix.python-version }} - name: Install package diff --git a/devtools/conda-envs/test_env.yaml b/devtools/conda-envs/test_env.yaml index 4ee2dd7c..240a1efd 100644 --- a/devtools/conda-envs/test_env.yaml +++ b/devtools/conda-envs/test_env.yaml @@ -1,8 +1,6 @@ name: test channels: - conda-forge - - - defaults dependencies: # Base depends - python @@ -22,7 +20,7 @@ dependencies: - openff-units - pint - # Testing + # Testing - pytest - pytest-cov - codecov @@ -30,7 +28,5 @@ dependencies: - qcportal - requests - # Pip-only installs - pip: - pedantic - # - codecov From 38722ef25972a602244897bcb13c3814bf9ccd1b Mon Sep 17 00:00:00 2001 From: Mike Henry <11765982+mikemhenry@users.noreply.github.com> Date: Fri, 15 Sep 2023 09:06:34 -0700 Subject: [PATCH 5/9] fix syntax mistake in du command --- .github/workflows/CI.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/CI.yaml b/.github/workflows/CI.yaml index c3ec59ff..eda5a5d4 100644 --- a/.github/workflows/CI.yaml +++ b/.github/workflows/CI.yaml @@ -67,7 +67,7 @@ jobs: - name: Free diskspace (MacOS) if: matrix.os == 'macOS-latest' run: | - sudo du -a * | sort -r -n | head -100 + sudo du -a / | sort -r -n | head -100 - uses: actions/checkout@v3 From f05584e14e91b3ac5fb70d92315f08d260ecaf72 Mon Sep 17 00:00:00 2001 From: Mike Henry <11765982+mikemhenry@users.noreply.github.com> Date: Fri, 15 Sep 2023 11:18:41 -0700 Subject: [PATCH 6/9] pin problematic package --- devtools/conda-envs/test_env.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/devtools/conda-envs/test_env.yaml b/devtools/conda-envs/test_env.yaml index 240a1efd..10b7bd90 100644 --- a/devtools/conda-envs/test_env.yaml +++ b/devtools/conda-envs/test_env.yaml @@ -14,7 +14,7 @@ dependencies: - loguru - gdown - tqdm - - lightning + - lightning=2.0.8 - tensorboard - torchvision - openff-units From 409623f2a891c47b1c5fd5021014d175133e0dfb Mon Sep 17 00:00:00 2001 From: Mike Henry <11765982+mikemhenry@users.noreply.github.com> Date: Fri, 15 Sep 2023 11:19:26 -0700 Subject: [PATCH 7/9] test if xdist speeds things up --- .github/workflows/CI.yaml | 37 +------------------------------ devtools/conda-envs/test_env.yaml | 1 + 2 files changed, 2 insertions(+), 36 deletions(-) diff --git a/.github/workflows/CI.yaml b/.github/workflows/CI.yaml index eda5a5d4..f799e3e2 100644 --- a/.github/workflows/CI.yaml +++ b/.github/workflows/CI.yaml @@ -34,41 +34,6 @@ jobs: python-version: [3.9, "3.10", "3.11"] steps: - - name: Free diskspace (Linux) - if: matrix.os == 'ubuntu-latest' - run: | - sudo docker rmi $(docker image ls -aq) >/dev/null 2>&1 || true - sudo rm -rf \ - /usr/share/dotnet /usr/local/lib/android /opt/ghc \ - /usr/local/share/powershell /usr/share/swift /usr/local/.ghcup \ - /usr/lib/jvm || true - echo "some directories deleted" - sudo apt install aptitude -y >/dev/null 2>&1 - sudo aptitude purge aria2 ansible azure-cli shellcheck rpm xorriso zsync \ - esl-erlang firefox gfortran-8 gfortran-9 google-chrome-stable \ - google-cloud-sdk imagemagick \ - libmagickcore-dev libmagickwand-dev libmagic-dev ant ant-optional kubectl \ - mercurial apt-transport-https mono-complete libmysqlclient \ - unixodbc-dev yarn chrpath libssl-dev libxft-dev \ - libfreetype6 libfreetype6-dev libfontconfig1 libfontconfig1-dev \ - snmp pollinate libpq-dev postgresql-client powershell ruby-full \ - sphinxsearch subversion mongodb-org azure-cli microsoft-edge-stable \ - -y -f >/dev/null 2>&1 - sudo aptitude purge google-cloud-sdk -f -y >/dev/null 2>&1 - sudo aptitude purge microsoft-edge-stable -f -y >/dev/null 2>&1 || true - sudo apt purge microsoft-edge-stable -f -y >/dev/null 2>&1 || true - sudo aptitude purge '~n ^mysql' -f -y >/dev/null 2>&1 - sudo aptitude purge '~n ^php' -f -y >/dev/null 2>&1 - sudo aptitude purge '~n ^dotnet' -f -y >/dev/null 2>&1 - sudo apt-get autoremove -y >/dev/null 2>&1 - sudo apt-get autoclean -y >/dev/null 2>&1 - echo "some packages purged" - - - name: Free diskspace (MacOS) - if: matrix.os == 'macOS-latest' - run: | - sudo du -a / | sort -r -n | head -100 - - uses: actions/checkout@v3 - name: Additional info about the build @@ -95,7 +60,7 @@ jobs: - name: Run tests # conda setup requires this special shell run: | - pytest -v --cov=modelforge --cov-report=xml --color=yes modelforge/tests/ + pytest -v -n auto --cov=modelforge --cov-report=xml --color=yes modelforge/tests/ - name: CodeCov uses: codecov/codecov-action@v3 diff --git a/devtools/conda-envs/test_env.yaml b/devtools/conda-envs/test_env.yaml index 10b7bd90..58ebd08a 100644 --- a/devtools/conda-envs/test_env.yaml +++ b/devtools/conda-envs/test_env.yaml @@ -23,6 +23,7 @@ dependencies: # Testing - pytest - pytest-cov + - pytest-xdist - codecov - qcelemental=0.25.1 - qcportal From b37aff8ac75957035393e4e29a3243078f23a658 Mon Sep 17 00:00:00 2001 From: Mike Henry <11765982+mikemhenry@users.noreply.github.com> Date: Fri, 15 Sep 2023 11:30:29 -0700 Subject: [PATCH 8/9] looks like xdist breaks some tests --- .github/workflows/CI.yaml | 2 +- devtools/conda-envs/test_env.yaml | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/CI.yaml b/.github/workflows/CI.yaml index f799e3e2..a387d7b3 100644 --- a/.github/workflows/CI.yaml +++ b/.github/workflows/CI.yaml @@ -60,7 +60,7 @@ jobs: - name: Run tests # conda setup requires this special shell run: | - pytest -v -n auto --cov=modelforge --cov-report=xml --color=yes modelforge/tests/ + pytest -v --cov=modelforge --cov-report=xml --color=yes modelforge/tests/ - name: CodeCov uses: codecov/codecov-action@v3 diff --git a/devtools/conda-envs/test_env.yaml b/devtools/conda-envs/test_env.yaml index 58ebd08a..10b7bd90 100644 --- a/devtools/conda-envs/test_env.yaml +++ b/devtools/conda-envs/test_env.yaml @@ -23,7 +23,6 @@ dependencies: # Testing - pytest - pytest-cov - - pytest-xdist - codecov - qcelemental=0.25.1 - qcportal From 9f5a6f9a678609d1b5394b210d8c5d6a485cb596 Mon Sep 17 00:00:00 2001 From: Mike Henry <11765982+mikemhenry@users.noreply.github.com> Date: Fri, 15 Sep 2023 12:09:09 -0700 Subject: [PATCH 9/9] print 10 slowest tests --- .github/workflows/CI.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/CI.yaml b/.github/workflows/CI.yaml index a387d7b3..70df4f58 100644 --- a/.github/workflows/CI.yaml +++ b/.github/workflows/CI.yaml @@ -60,7 +60,7 @@ jobs: - name: Run tests # conda setup requires this special shell run: | - pytest -v --cov=modelforge --cov-report=xml --color=yes modelforge/tests/ + pytest -v --cov=modelforge --cov-report=xml --color=yes --durations=10 modelforge/tests/ - name: CodeCov uses: codecov/codecov-action@v3