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

Implementing conda lock #1164

Merged
merged 77 commits into from
Jan 25, 2022
Merged
Show file tree
Hide file tree
Changes from 15 commits
Commits
Show all changes
77 commits
Select commit Hold shift + click to select a range
075d1af
Update version number and release date for version 2.3.0
Jun 8, 2021
b948b21
added conda lock file
valeriupredoi Jun 8, 2021
4ff602d
added test GH wkflow
valeriupredoi Jun 8, 2021
e559cc9
explicitly create the env
valeriupredoi Jun 8, 2021
765d7c2
see what pip is being used
valeriupredoi Jun 9, 2021
1b39e61
detect if env actually activates
valeriupredoi Jun 9, 2021
917ca5c
try create the empty env before the actual deps get in
valeriupredoi Jun 9, 2021
959a504
ga workflow to create and veryfy lock file
valeriupredoi Jun 9, 2021
8b71b8d
run action every 10 days at 4am
valeriupredoi Jun 9, 2021
a307b66
Merge branch 'main' into condalock
valeriupredoi Jun 9, 2021
83911e7
fixed syntax in cron
valeriupredoi Jun 9, 2021
53cca74
added osx lock file
valeriupredoi Jun 10, 2021
43b67e3
added documentation
valeriupredoi Jun 10, 2021
a47de98
deactivate osx lock file creation and verification
valeriupredoi Jun 11, 2021
3aa2c7b
Merge branch 'main' into condalock
valeriupredoi Jun 11, 2021
f0175e6
prettyfied the docs for conda lock
valeriupredoi Jun 14, 2021
5b6629a
reactivate conda lock file creation in actions
bvreede Jun 15, 2021
e5b86ab
Merge branch 'condalock' of github.com:ESMValGroup/ESMValCore into co…
bvreede Jun 15, 2021
d3da6ea
try a dict approach
valeriupredoi Jun 15, 2021
6cc3236
try with if
valeriupredoi Jun 15, 2021
9be4e86
reindent
valeriupredoi Jun 15, 2021
90a5d0b
try conditional at step level
valeriupredoi Jun 15, 2021
64c5260
set env variable
valeriupredoi Jun 15, 2021
b067050
set env upstream and delete linux file setter
valeriupredoi Jun 15, 2021
9119556
try again with modern syntax gahh
valeriupredoi Jun 15, 2021
171a703
try using it as sys variable
valeriupredoi Jun 15, 2021
6b64ab0
export only inside step
valeriupredoi Jun 15, 2021
867be9a
indent, GA are very silly in places
valeriupredoi Jun 15, 2021
9e9c3ce
seriously running out of ideas wo rewriting the whole thing
valeriupredoi Jun 15, 2021
32f0231
put it in one step
valeriupredoi Jun 15, 2021
cb79514
sod it, separate job it is then
valeriupredoi Jun 15, 2021
d40418f
Merge branch 'main' into condalock
valeriupredoi Jun 15, 2021
a1fa826
suggestion by Barbara
valeriupredoi Jun 15, 2021
83aff2e
Merge branch 'main' into condalock
valeriupredoi Nov 11, 2021
80dc847
renamed file
valeriupredoi Nov 11, 2021
5b18479
renamed file
valeriupredoi Nov 11, 2021
3c3fb80
olde file
valeriupredoi Nov 11, 2021
d99a833
olde file
valeriupredoi Nov 11, 2021
96e071e
regenerated file
valeriupredoi Nov 11, 2021
90f5624
regenerated file
valeriupredoi Nov 11, 2021
65e6abf
use mamba
valeriupredoi Nov 11, 2021
77c8a39
use mamba
valeriupredoi Nov 11, 2021
7d9fb60
set use mamba true
valeriupredoi Nov 11, 2021
bd1c90b
remove pin on esmpy
valeriupredoi Nov 11, 2021
b3dba41
remove pin on esmpy
valeriupredoi Nov 11, 2021
46ef0fe
use miniconda proper
valeriupredoi Nov 11, 2021
276693c
try with lock file directly
valeriupredoi Nov 12, 2021
5309a64
back to mamma conda
valeriupredoi Nov 12, 2021
5cf0d7c
back to mamma conda
valeriupredoi Nov 12, 2021
49b56ce
remove py36
valeriupredoi Nov 12, 2021
8ae965e
remove py36 and try with update on OSX
valeriupredoi Nov 12, 2021
5bf264c
turned of osx support for now
valeriupredoi Nov 15, 2021
69dcde5
test automated PR
valeriupredoi Nov 15, 2021
42d58ec
twear auto pr
valeriupredoi Nov 15, 2021
4965cc9
try github token
valeriupredoi Nov 15, 2021
a04cd14
added link to GA source
valeriupredoi Nov 15, 2021
c21137a
cleanup auto PR job
valeriupredoi Nov 16, 2021
b49124f
cleanup auto PR job
valeriupredoi Nov 16, 2021
5668bdc
set run priority and correct branch name
valeriupredoi Nov 16, 2021
2e00eb9
changed PR branch name
valeriupredoi Nov 16, 2021
a43bd89
Merge branch 'main' into condalock
valeriupredoi Dec 9, 2021
e7c315b
removed osx condalock file
valeriupredoi Dec 9, 2021
d0f4758
overhauled the doc
valeriupredoi Dec 9, 2021
667c9b3
read pin
valeriupredoi Dec 9, 2021
b1a2f28
readd pin on esmpy
valeriupredoi Dec 9, 2021
2699dc6
re-add HPC instructions and add mention why conda lock
valeriupredoi Dec 9, 2021
ae0fbd6
Merge branch 'main' into condalock
valeriupredoi Jan 13, 2022
9d7fa8d
removed OSX bits for good
valeriupredoi Jan 17, 2022
8f9428e
fix issue with file not being reused between jobs
valeriupredoi Jan 17, 2022
a1c7d77
removed OX stuffs
valeriupredoi Jan 17, 2022
e27a20a
all steps in one flow
valeriupredoi Jan 17, 2022
b78491c
remove obsolete comment and add python 3.10
valeriupredoi Jan 17, 2022
69b41b0
quotes around floats for python versions how silly
valeriupredoi Jan 17, 2022
c43a79c
Update .github/workflows/create-condalock-file.yml
valeriupredoi Jan 25, 2022
87a0322
Update doc/quickstart/install.rst
valeriupredoi Jan 25, 2022
682c684
Merge branch 'main' into condalock
valeriupredoi Jan 25, 2022
b3333cf
remove feature branch for GA test
valeriupredoi Jan 25, 2022
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
86 changes: 86 additions & 0 deletions .github/workflows/action-create-condalock.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
name: Conda lock file creation

on:
push:
branches:
- main
- condalock
schedule:
- cron: '0 4 */10 * *'

jobs:
create-lock-file:
name: Create conda lock file for latest Python
runs-on: 'ubuntu-latest'
steps:
- uses: actions/checkout@v2
- uses: conda-incubator/setup-miniconda@v2
with:
auto-update-conda: true
python-version: "3.9"
miniconda-version: "latest"
channels: conda-forge
- name: Show conda config
shell: bash -l {0}
run: |
conda info
conda list
conda config --show-sources
conda config --show
- name: Python info
shell: bash -l {0}
run: |
which python
python --version
- name: Install conda-lock
shell: bash -l {0}
run: conda install -y conda-lock
- name: Create conda lock file for linux-64
shell: bash -l {0}
run: conda-lock lock --platform linux-64 -f environment.yml --mamba
# - name: Create conda lock file for osx-64
# shell: bash -l {0}
# run: conda-lock lock --platform osx-64 -f environment.yml --mamba
verify:
name: verify / python-${{ matrix.python-version }} / ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: ['ubuntu-latest'] # 'macos-latest' currently having issues with conda creation of env
python-version: ["3.6", "3.7", "3.8", "3.9"]
runs-on: ${{ matrix.os }}
needs: create-lock-file
steps:
- uses: actions/checkout@v2
- uses: conda-incubator/setup-miniconda@v2
with:
activate-environment: esmvaltool-fromlock
python-version: ${{ matrix.python-version }}
miniconda-version: "latest"
channels: conda-forge
- shell: bash -l {0}
run: mkdir -p source_install_linux_artifacts_python_${{ matrix.python-version }}
- shell: bash -l {0}
run: conda --version 2>&1 | tee source_install_linux_artifacts_python_${{ matrix.python-version }}/conda_version.txt
- shell: bash -l {0}
run: which python
- shell: bash -l {0}
run: python -V 2>&1 | tee source_install_linux_artifacts_python_${{ matrix.python-version }}/python_version.txt
- shell: bash -l {0}
run: conda create --name esmvaltool-fromlock --file conda-linux-64.lock
- shell: bash -l {0}
run: conda install pip
- shell: bash -l {0}
run: which python
- shell: bash -l {0}
run: pip --version
- shell: bash -l {0}
run: pip install -e .[develop]
- shell: bash -l {0}
run: esmvaltool --help
- shell: bash -l {0}
run: esmvaltool version 2>&1 | tee source_install_linux_artifacts_python_${{ matrix.python-version }}/version.txt
- shell: bash -l {0}
run: pytest -n 2 -m "not installation and not sequential"
- shell: bash -l {0}
run: pytest -n 0 -m "sequential"
106 changes: 106 additions & 0 deletions .github/workflows/action-install-from-condalock.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
# Install esmvalcore from a conda lock file
# To build a conda lock file install conda-lock first then
# run conda-lock lock --platform linux-64 -f environment.yml --mamba
# (mamba activated for speed). Change platform for osx-64 or win-64.
# Env creation then happens as per normal use with
# conda create --name esmvaltool-fromlock --file conda-linux-64.lock
# note that pip and conda are NOT installed.

name: Conda-lock Install
on:
push:
branches:
- main
- condalock
# run the test only if the PR is to main
# turn it on if required
#pull_request:
# branches:
# - main
schedule:
- cron: '0 0 * * *'

jobs:
linux:
runs-on: "ubuntu-latest"
strategy:
matrix:
python-version: [3.6, 3.7, 3.8, 3.9]
fail-fast: false
name: Linux Python ${{ matrix.python-version }}
steps:
- uses: actions/checkout@v2
- uses: conda-incubator/setup-miniconda@v2
with:
activate-environment: esmvaltool-fromlock
# environment-file: conda-linux-64.lock
python-version: ${{ matrix.python-version }}
miniconda-version: "latest"
channels: conda-forge
- shell: bash -l {0}
run: mkdir -p source_install_linux_artifacts_python_${{ matrix.python-version }}
- shell: bash -l {0}
run: conda --version 2>&1 | tee source_install_linux_artifacts_python_${{ matrix.python-version }}/conda_version.txt
- shell: bash -l {0}
run: which python
- shell: bash -l {0}
run: python -V 2>&1 | tee source_install_linux_artifacts_python_${{ matrix.python-version }}/python_version.txt
- shell: bash -l {0}
run: conda create --name esmvaltool-fromlock --file conda-linux-64.lock
- shell: bash -l {0}
run: conda install pip
- shell: bash -l {0}
run: which python
- shell: bash -l {0}
run: pip --version
- shell: bash -l {0}
run: pip install -e .[develop]
- shell: bash -l {0}
run: esmvaltool --help
- shell: bash -l {0}
run: esmvaltool version 2>&1 | tee source_install_linux_artifacts_python_${{ matrix.python-version }}/version.txt
- shell: bash -l {0}
run: pytest -n 2 -m "not installation and not sequential"
- shell: bash -l {0}
run: pytest -n 0 -m "sequential"
- name: Upload artifacts
if: ${{ always() }} # upload artifacts even if fail
uses: actions/upload-artifact@v2
with:
name: Source_Install_Linux_python_${{ matrix.python-version }}
path: source_install_linux_artifacts_python_${{ matrix.python-version }}

# osx:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is still commented out?

# runs-on: "macos-latest"
# strategy:
# matrix:
# python-version: [3.6, 3.7, 3.8, 3.9]
# fail-fast: false
# name: OSX Python ${{ matrix.python-version }}
# steps:
# - uses: actions/checkout@v2
# - uses: conda-incubator/setup-miniconda@v2
# with:
# activate-environment: esmvaltool
# environment-file: environment.yml
# python-version: ${{ matrix.python-version }}
# miniconda-version: "latest"
# channels: conda-forge
# - shell: bash -l {0}
# run: mkdir -p source_install_osx_artifacts_python_${{ matrix.python-version }}
# - shell: bash -l {0}
# run: conda --version 2>&1 | tee source_install_osx_artifacts_python_${{ matrix.python-version }}/conda_version.txt
# - shell: bash -l {0}
# run: python -V 2>&1 | tee source_install_osx_artifacts_python_${{ matrix.python-version }}/python_version.txt
# - shell: bash -l {0}
# run: pip install -e .[develop] 2>&1 | tee source_install_osx_artifacts_python_${{ matrix.python-version }}/install.txt
# - shell: bash -l {0}
# run: esmvaltool --help
# - shell: bash -l {0}
# run: esmvaltool version 2>&1 | tee source_install_osx_artifacts_python_${{ matrix.python-version }}/version.txt
# - name: Upload artifacts
# if: ${{ always() }} # upload artifacts even if fail
# uses: actions/upload-artifact@v2
# with:
# name: Source_Install_OSX_python_${{ matrix.python-version }}
# path: source_install_osx_artifacts_python_${{ matrix.python-version }}
4 changes: 2 additions & 2 deletions CITATION.cff
Original file line number Diff line number Diff line change
Expand Up @@ -163,11 +163,11 @@ authors:
"orcid": "https://orcid.org/0000-0003-0892-5967"

cff-version: "1.0.3"
date-released: 2021-2-8
date-released: 2021-6-14
doi: "10.5281/zenodo.3387139"
license: "Apache-2.0"
message: "If you use this software, please cite it using these metadata."
repository-code: "https://github.com/ESMValGroup/ESMValCore/"
title: ESMValCore
version: "v2.2.0"
version: "v2.3.0"
...
Loading