Skip to content

Commit

Permalink
Merge branch 'W1D2-updates' into W1D2_curriculum_specialist_updates
Browse files Browse the repository at this point in the history
  • Loading branch information
nsea-log authored Mar 14, 2024
2 parents f297e9f + d4db9c8 commit 1791fe6
Show file tree
Hide file tree
Showing 211 changed files with 7,313 additions and 2,261 deletions.
46 changes: 24 additions & 22 deletions .github/actions/check-notebooks/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ inputs:
description: 'flag for execution'
required: true
type: string
exercice-continue-on-error:
exercise-continue-on-error:
description: 'Should continue on Error in exercices'
required: false
default: 'false'
default: false
type: string

runs:
Expand Down Expand Up @@ -62,23 +62,24 @@ runs:
rm -f $HOME/.matplotlib/fontList.cache
shell: bash -l {0}

- name: Install C++ compiler in conda environment
run: conda install -c conda-forge gxx_linux-64
shell: bash -l {0}
# Necessary for SDFC to work
- name: Install eigen/SDFC
run: |
sudo apt-get install -y libeigen3-dev
echo "CC=gcc-9" >> $GITHUB_ENV
echo "CXX=g++-9" >> $GITHUB_ENV
echo "/usr/bin/gcc-9" >> $GITHUB_PATH
echo "/usr/bin/g++-9" >> $GITHUB_PATH
git clone https://github.com/yrobink/SDFC-python.git
cd SDFC-python
python setup.py install
pip show SDFC
cd ..
shell: bash -l {0}
# - name: Install C++ compiler in conda environment
# run: conda install -c conda-forge gxx_linux-64
# shell: bash -l {0}
# # Necessary for SDFC to work
# - name: Install eigen/SDFC
# run: |
# sudo apt-get install -y libeigen3-dev
# echo "CC=gcc-9" >> $GITHUB_ENV
# echo "CXX=g++-9" >> $GITHUB_ENV
# echo "/usr/bin/gcc-9" >> $GITHUB_PATH
# echo "/usr/bin/g++-9" >> $GITHUB_PATH
# git clone https://github.com/yrobink/SDFC-python.git
# cd SDFC-python
# pip install pybind11
# python setup.py install
# pip show SDFC
# cd ..
# shell: bash -l {0}

- name: Process notebooks
id: process_notebooks
Expand All @@ -87,10 +88,11 @@ runs:
python ci/process_notebooks.py ${{ env.NBS }} ${{ inputs.exec_flag}}
shell: bash -l {0}

- name: verify exercices
continue-on-error: ${{ inputs.exercice-continue-on-error }}
- name: verify exercises
# continue-on-error: ${{ inputs.exercise-continue-on-error }}
continue-on-error: ${{ true }}
if: ${{ env.NBS != '' }}
id: verify_exercices
id: verify_exercises
run: |
python ci/verify_exercises.py ${{ env.NBS }} --c "$COMMIT_MESSAGE"
shell: bash -l {0}
Expand Down
116 changes: 100 additions & 16 deletions .github/actions/setup/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,21 +10,34 @@ inputs:
runs:
using: composite
steps:
- name: Set up Python (conda)
uses: conda-incubator/setup-miniconda@v2
# - name: Set up Python (conda)
# uses: conda-incubator/setup-miniconda@v2
# with:
# miniforge-variant: Mambaforge
# miniforge-version: latest
# activate-environment: climatematch
# use-mamba: true

- uses: actions/checkout@v2 # This step checks out the repository code

- name: Set up Python
uses: actions/setup-python@v2
with:
miniforge-variant: Mambaforge
miniforge-version: latest
activate-environment: climatematch
use-mamba: true
python-version: 3.9

- uses: actions/cache@v3
with:
path: /usr/share/miniconda3/envs/climatematch
# This should create a key that looks like 'linux-64-conda-environment.yml-[HASH]'
# Logic inspired by https://dev.to/epassaro/caching-anaconda-environments-on-github-actions-2d08
key: ${{ format('linux-64-conda-environment.yml-{0}', hashFiles('environment.yml') )}}
id: cache
- name: Set up virtual environment
run: |
python -m venv env
source ./env/bin/activate
shell: bash -l {0}

# - uses: actions/cache@v3
# with:
# path: /usr/share/miniconda3/envs/climatematch
# # This should create a key that looks like 'linux-64-conda-environment.yml-[HASH]'
# # Logic inspired by https://dev.to/epassaro/caching-anaconda-environments-on-github-actions-2d08
# key: ${{ format('linux-64-conda-environment.yml-{0}', hashFiles('environment.yml') )}}
# id: cache

- name: Get commit message
run: |
Expand All @@ -44,11 +57,82 @@ runs:
echo ci/ >> .gitignore
shell: bash -l {0}

- name: Install numpy
run: |
pip install numpy
shell: bash -l {0}

- name: Install GEOS/Proj (dep for cartopy)
run: |
sudo apt update
sudo apt install libgeos++-dev libgeos3.10.2 libgeos-c1v5 libgeos-dev libgeos-doc
sudo apt-get install proj-bin libproj-dev proj-data
shell: bash -l {0}


- name: Install HDF5 (dep for netCDF4)
run: |
sudo apt-get install libhdf5-serial-dev netcdf-bin libnetcdf-dev
shell: bash -l {0}

- name: Build/Install esmf/esmpy/xesmf
run: |
wget https://github.com/esmf-org/esmf/archive/refs/tags/v8.6.0.zip
unzip v8.6.0.zip
cd esmf-8.6.0
export ESMF_DIR=$(pwd)
make
# Append ENV VAR to GH ENV so that vars can persist between runs
ESMFMKFILE=$(find $(pwd) -name 'esmf.mk')
echo "ESMFMKFILE=$ESMFMKFILE" >> $GITHUB_ENV
echo $ESMFMKFILE
sudo apt install mpich
pip install mpi4py nose
# cd src/addon/ESMPy
cd src/addon/esmpy
pip install -U numpy
python3 -m pip install .
cd ../../../
pip install git+https://github.com/pangeo-data/xesmf.git
shell: bash -l {0}

# Necessary for SDFC to work
- name: Install eigen/SDFC
run: |
sudo apt-get install -y libeigen3-dev
echo "CC=gcc-9" >> $GITHUB_ENV
echo "CXX=g++-9" >> $GITHUB_ENV
# echo "/usr/bin/gcc-9" >> $GITHUB_PATH
# echo "/usr/bin/g++-9" >> $GITHUB_PATH
pip install pybind11
git clone https://github.com/neuromatch/SDFC-python.git
cd SDFC-python
python setup.py install
pip show SDFC
cd ..
shell: bash -l {0}

- name: Update environment
if: ${{steps.cache.outputs.cache-hit != 'true' || inputs.force_env_update == 'true'}}
run: |
mamba env update -n climatematch -f environment.yml
# mamba env update -n climatematch -f environment.yml
pip install -r ci/requirements.txt
# pip install -r requirements.txt
pip install jupyter-book==0.10.2 ghp-import jupyter-client==6.1.12 cftime
pip install -r requirements.txt
pip install requests aiohttp
pip install jupyter-book==0.14.0 ghp-import cftime pyleoclim importlib-metadata==4.13.0
# pip install climlab==0.8.2
shell: bash -l {0}

- name: Build climlab from source
run: |
git clone https://github.com/climlab/climlab.git
cd climlab
pip install . --no-deps -vv
pip show climlab
cd ..
git clone https://github.com/climlab/climlab-rrtmg.git
cd climlab-rrtmg
pip install . --no-deps -vv
pip show climlab-rrtmg
cd ..
shell: bash -l {0}
4 changes: 2 additions & 2 deletions .github/workflows/nightly-notebook-check.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
name: notebook-nightly
on:
workflow_dispatch:
schedule:
- cron: "0 0 * * *"
# schedule:
# - cron: "0 0 * * *"

env:
NB_KERNEL: python
Expand Down
19 changes: 18 additions & 1 deletion .github/workflows/notebook-pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,24 @@ jobs:
process-notebooks:

runs-on: ubuntu-latest
# runs-on: ubuntu-20.04
steps:
- name: Free up disk space
uses: jlumbroso/free-disk-space@main
with:
# this might remove tools that are actually needed,
# if set to "true" but frees about 6 GB
tool-cache: false

# all of these default to true, but feel free to set to
# "false" if necessary for your workflow
android: true
dotnet: true
haskell: true
large-packages: true
docker-images: true
swap-storage: true

- name: Checkout
uses: actions/checkout@v3
with:
Expand All @@ -38,7 +55,7 @@ jobs:
run_all: 'true'
# exec_flag: '--check-only'
exec_flag: '--execute'
exercice-continue-on-error: 'true'
# exercise-continue-on-error: true

# - name: Add PR comment
# if: ${{ env.NBS != '' }}
Expand Down
Loading

0 comments on commit 1791fe6

Please sign in to comment.