Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert to conda-lock matrix job #562

Merged
merged 1 commit into from
Jun 28, 2024
Merged
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
63 changes: 32 additions & 31 deletions .github/workflows/CondaLock.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,45 +34,49 @@ jobs:
cache-environment: true
environment-file: environment-condalock.yml

# Could run as single step in parallel, but would complicate logs...
- name: Run conda-lock ${{ matrix.IMAGE }}
timeout-minutes: 10
run: |
cd base-notebook
conda-lock lock -p linux-64 -p linux-aarch64 -p osx-64 -p osx-arm64
cd ${{ matrix.IMAGE }}
if [ ${{ matrix.IMAGE }} = "base-notebook" ]; then
conda-lock lock -p linux-64 -p linux-aarch64 -p osx-64 -p osx-arm64
elif [ ${{ matrix.IMAGE }} = "pangeo-notebook" ]; then
conda-lock lock -f environment.yml -f ../base-notebook/environment.yml -p linux-64 -p linux-aarch64 -p osx-64 -p osx-arm64
else
# Linux-64 ONLY
conda-lock lock -f environment.yml -f ../pangeo-notebook/environment.yml -f ../base-notebook/environment.yml -p linux-64
fi
# Keep this format around for easy `conda install` w/o conda-lock or micromamba
conda-lock render -k explicit -p linux-64
../generate-packages-list.py conda-linux-64.lock > packages.txt

- name: Run conda-lock pangeo-notebook
timeout-minutes: 5
continue-on-error: true
run: |
cd pangeo-notebook
conda-lock lock -f environment.yml -f ../base-notebook/environment.yml -p linux-64 -p linux-aarch64 -p osx-64 -p osx-arm64
conda-lock render -k explicit -p linux-64
../generate-packages-list.py conda-linux-64.lock > packages.txt
- name: Upload lockfiles
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.image }}
path: ${{ matrix.image }}

- name: Run conda-lock ml-notebook
timeout-minutes: 5
continue-on-error: true
run: |
cd ml-notebook
conda-lock lock -f environment.yml -f ../pangeo-notebook/environment.yml -f ../base-notebook/environment.yml -p linux-64
conda-lock render -k explicit -p linux-64
../generate-packages-list.py conda-linux-64.lock > packages.txt
# Each job will commit files, so we know it succeeds based on commits
commit-lockfiles:
needs: condalock
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4
with:
token: ${{ secrets.PANGEOBOT_TOKEN }}
# These lines are critical, otherwise Pangeo-bot pushes changes directly to master from PRs!
repository: ${{ github.event.client_payload.pull_request.head.repo.full_name }}
ref: ${{ github.event.client_payload.pull_request.head.ref }}

- name: Run conda-lock pytorch-notebook
timeout-minutes: 5
continue-on-error: true
run: |
cd pytorch-notebook
conda-lock lock -f environment.yml -f ../pangeo-notebook/environment.yml -f ../base-notebook/environment.yml -p linux-64
conda-lock render -k explicit -p linux-64
../generate-packages-list.py conda-linux-64.lock > packages.txt
# Download all artifacts from previous matrix job
- uses: actions/download-artifact@v4

- name: Commit condalock files to PR
run: |
git config --global user.name 'pangeo-bot'
git config --global user.email '[email protected]'
git status
git add */conda*.lock */conda-lock.yml */packages.txt
git commit -m "[condalock-command] autogenerated conda-lock files"
git push
Expand All @@ -83,7 +87,4 @@ jobs:
token: ${{ secrets.GITHUB_TOKEN }}
repository: ${{ github.event.client_payload.github.payload.repository.full_name }}
comment-id: ${{ github.event.client_payload.github.payload.comment.id }}
reaction-type: hooray
# repository: ${{ github.event.client_payload.github.payload.repository.full_name }}
# comment-id: ${{ github.event.client_payload.github.payload.comment.id }}
# reaction-type: hooray
reactions: hooray
Loading