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

Environment pinning #985

Merged
merged 66 commits into from
Dec 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
66 commits
Select commit Hold shift + click to select a range
2cd8233
Add conda environment definitions
guyer Dec 9, 2023
509fb9b
Add multi-platform lockfiles produced by `conda-lock lock`
guyer Dec 9, 2023
84e40b2
Add single-platform explicit lockfiles from `conda-lock render`
guyer Dec 9, 2023
0eb2507
Convert azure pipeline to use conda-lock lockfiles
guyer Dec 9, 2023
2f5b5f8
Fix comparison syntax
guyer Dec 9, 2023
0001a0b
Close bash if clause
guyer Dec 9, 2023
5c0b6fb
Disable libmamba solve
guyer Dec 9, 2023
f261dc5
Actually disable libmamba
guyer Dec 9, 2023
37990e6
Try really really hard to turn off libmamba
guyer Dec 9, 2023
98c660c
Install pip to make wheels
guyer Dec 9, 2023
33a9a2c
Move lockfiles into subdirectory
guyer Dec 9, 2023
eb4216f
Pin PETSc on macOS
guyer Dec 10, 2023
33f7ffb
Change constraint to actual problematical package
guyer Dec 10, 2023
8de8dd1
Restore libmamba and explain why classic solver is needed
guyer Dec 10, 2023
94568f5
Update locks for midnight build
guyer Dec 10, 2023
616f437
Fix name
guyer Dec 10, 2023
30e986d
Document different triggers
guyer Dec 10, 2023
2d6e823
Pass locks to downstream stages
guyer Dec 10, 2023
ce59438
Fix indentation
guyer Dec 10, 2023
95fc95a
Copy locks into place
guyer Dec 10, 2023
514a040
Fix indentation and hope downloading artifacts works "right"
guyer Dec 10, 2023
9a0c97d
Rename lock artifact and explicitly move lockfiles
guyer Dec 10, 2023
b85e81b
Skip slow step
guyer Dec 10, 2023
7a88272
Move from and to explicit directories
guyer Dec 10, 2023
a73b1fe
Test midnight build
guyer Dec 10, 2023
5f9f3a4
Fix bash syntax
guyer Dec 10, 2023
5ff422f
Don't create locks over existing locks
guyer Dec 10, 2023
435cc87
Add environment for scipy for symmetry
guyer Dec 10, 2023
7b11a91
Install from environment.yml when not using lockfiles
guyer Dec 10, 2023
6cea356
Fix variable syntax
guyer Dec 10, 2023
2493087
Debug which "not"
guyer Dec 10, 2023
292b2b7
By all means, lets have >= 3 incompatible variable syntaxen
guyer Dec 10, 2023
7e20829
Microsoft should by their coders higher quality crack
guyer Dec 10, 2023
d060fe0
I hate these people
guyer Dec 10, 2023
7295350
If at first you don't succeeed...
guyer Dec 10, 2023
e9dde88
Pass `use_lockfile` as template parameter
guyer Dec 10, 2023
861cf55
Pass runtime value?
guyer Dec 10, 2023
6ea5e12
Stop trying to use a runtime variable as a condition
guyer Dec 10, 2023
334459d
Pass solver as template variable
guyer Dec 10, 2023
79d387b
Toggle conda environment mode
guyer Dec 10, 2023
77c359c
Revert "Toggle conda environment mode"
guyer Dec 10, 2023
0dc6f52
Revert "Revert "Toggle conda environment mode""
guyer Dec 11, 2023
fdb1a15
Clarify purpose of environment file
guyer Dec 11, 2023
0dd1306
Fix `conda env create` syntax
guyer Dec 11, 2023
3bcfe1c
Document use of lockfiles
guyer Dec 11, 2023
03596fe
Fix references
guyer Dec 11, 2023
39bd76f
Revert "Revert "Revert "Toggle conda environment mode"""
guyer Dec 11, 2023
5e07621
Pass solver to non-lockfile installations
guyer Dec 11, 2023
6eebefa
Pass only solvers to install
guyer Dec 11, 2023
4095a61
Revert "Revert "Revert "Revert "Toggle conda environment mode""""
guyer Dec 11, 2023
edf8826
Incorporate pip in install.yml template
guyer Dec 11, 2023
26a712d
Document different modes of creating conda environment
guyer Dec 11, 2023
099eb9b
Remove gratuitous conda packages
guyer Dec 11, 2023
b4c0229
Fix phrasing
guyer Dec 11, 2023
969c0a4
Fix reference and tweaks
guyer Dec 11, 2023
8476631
Fix references
guyer Dec 11, 2023
a905eea
Fix pip
guyer Dec 11, 2023
048f33c
Install pip without libmamba
guyer Dec 11, 2023
4f75df0
Ensure CI environment has pip
guyer Dec 11, 2023
35a1746
Document that installing more than one solver isn't necessary
guyer Dec 12, 2023
a480a84
Update locks to get new petsc
guyer Dec 12, 2023
4c201df
Downgrade petsc
guyer Dec 12, 2023
1c1afa5
Merge base-environment.yml into solver environments
guyer Dec 12, 2023
a22d494
Bump the locks
guyer Dec 12, 2023
49cf812
Fix reST and spelling
guyer Dec 12, 2023
277e713
Point to blog posting about conda-lock
guyer Dec 12, 2023
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
64 changes: 12 additions & 52 deletions .azure/pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,14 @@
# Add steps that analyze code, save the dist with the build record, publish to a PyPI-compatible index, and more:
# https://docs.microsoft.com/en-us/azure/devops/pipelines/ecosystems/anaconda

# test every commit (implicit branches and explicit tags) for breaking
# changes in commit
trigger:
tags:
include:
- '*'

# test master nightly for breaking changes in dependencies
schedules:
- cron: "0 0 * * *"
displayName: Daily midnight build
Expand All @@ -34,13 +37,8 @@ stages:
steps:
- template: templates/install.yml
parameters:
python_version: 3
conda_packages: 'hunspell'

- bash: |
source activate myEnvironment
pip install pyspelling
displayName: Install pip packages
pip_packages: pyspelling

- bash: |
wget -O en_US.aff https://cgit.freedesktop.org/libreoffice/dictionaries/plain/en/en_US.aff?id=a4473e06b56bfe35187e302754f6baaa8d75e54f
Expand All @@ -62,13 +60,8 @@ stages:
steps:
- template: templates/install.yml
parameters:
python_version: 3
conda_packages: 'numpy'

- bash: |
source activate myEnvironment
pip install pylint
displayName: Install pip packages
pip_packages: pylint

- bash: |
source activate myEnvironment
Expand All @@ -85,13 +78,8 @@ stages:
steps:
- template: templates/install.yml
parameters:
python_version: 3
conda_packages: 'numpy'

- bash: |
source activate myEnvironment
pip install flake8
displayName: Install pip packages
pip_packages: flake8

- bash: |
source activate myEnvironment
Expand All @@ -106,74 +94,50 @@ stages:
matrix:
linux-py3k-petsc:
image: ubuntu-latest
python_version: 3
conda_packages: 'numpy scipy matplotlib-base future packaging mpich mpi4py petsc4py mayavi "gmsh <4.0|>=4.5.2"'
FIPY_SOLVERS: petsc
MPIRUN:
linux-py3k-petsc-parallel:
image: ubuntu-latest
python_version: 3
conda_packages: 'numpy scipy matplotlib-base future packaging mpich mpi4py petsc4py mayavi "gmsh <4.0|>=4.5.2"'
FIPY_SOLVERS: petsc
MPIRUN: 'mpirun -np 2'
linux-py3k-scipy:
image: ubuntu-latest
python_version: 3
conda_packages: 'numpy scipy matplotlib-base future packaging mayavi "gmsh <4.0|>=4.5.2"'
FIPY_SOLVERS: scipy
MPIRUN:
linux-py3k-trilinos:
image: ubuntu-latest
python_version: 3
conda_packages: 'numpy scipy matplotlib-base future packaging mpich mpi4py pytrilinos mayavi "gmsh <4.0|>=4.5.2"'
FIPY_SOLVERS: trilinos
MPIRUN:
linux-py3k-trilinos-parallel:
image: ubuntu-latest
python_version: 3
conda_packages: 'numpy scipy matplotlib-base future packaging mpich mpi4py pytrilinos mayavi "gmsh <4.0|>=4.5.2"'
FIPY_SOLVERS: trilinos
MPIRUN: 'mpirun -np 2'
macos-py27-pysparse:
image: macos-latest
python_version: 2.7
conda_packages: 'numpy scipy matplotlib-base future packaging pysparse mayavi "traitsui<7.0.0" "gmsh<4.0"'
FIPY_SOLVERS: pysparse
MPIRUN:
macos-py3k-petsc:
image: macos-latest
python_version: 3
conda_packages: 'numpy scipy matplotlib-base future packaging mpich mpi4py petsc4py mayavi "gmsh <4.0|>=4.5.2"'
FIPY_SOLVERS: petsc
MPIRUN:
macos-py3k-petsc-parallel:
image: macos-latest
python_version: 3
conda_packages: 'numpy scipy matplotlib-base future packaging mpich mpi4py petsc4py mayavi "gmsh <4.0|>=4.5.2"'
FIPY_SOLVERS: petsc
MPIRUN: 'mpirun -np 2'
macos-py3k-scipy:
image: macos-latest
python_version: 3
conda_packages: 'numpy scipy matplotlib-base future packaging mayavi "gmsh <4.0|>=4.5.2"'
FIPY_SOLVERS: scipy
MPIRUN:
macos-py3k-trilinos:
image: macos-latest
python_version: 3
conda_packages: 'numpy scipy matplotlib-base future packaging mpich mpi4py pytrilinos mayavi "gmsh <4.0|>=4.5.2"'
FIPY_SOLVERS: trilinos
MPIRUN:
macos-py3k-trilinos-parallel:
image: macos-latest
python_version: 3
conda_packages: 'numpy scipy matplotlib-base future packaging mpich mpi4py pytrilinos mayavi "gmsh <4.0|>=4.5.2"'
FIPY_SOLVERS: trilinos
MPIRUN: 'mpirun -np 2'
windows-py3k-scipy:
image: windows-latest
python_version: 3
conda_packages: 'numpy scipy matplotlib-base future packaging mayavi "gmsh <4.0|>=4.5.2"'
FIPY_SOLVERS: scipy
MPIRUN:

Expand All @@ -183,12 +147,13 @@ stages:
steps:
- template: templates/install.yml
parameters:
python_version: $(python_version)
conda_packages: $(conda_packages)
solver: $(FIPY_SOLVERS)

- bash: |
conda env export --name myEnvironment
displayName: Environment
source activate myEnvironment
# OK if this fails
pip install scikit-fmm || true
displayName: Install pip packages

- bash: |
source activate myEnvironment
Expand All @@ -209,14 +174,10 @@ stages:
matrix:
unix:
image: ubuntu-latest
python_version: 3.10
conda_packages: 'numpy scipy matplotlib-base future packaging mpich mpi4py petsc4py mayavi "gmsh <4.0|>=4.5.2"'
FIPY_SOLVERS: petsc
MPIRUN:
windows:
image: windows-latest
python_version: 3.10
conda_packages: 'numpy scipy matplotlib-base future packaging mayavi "gmsh <4.0|>=4.5.2"'
FIPY_SOLVERS: scipy
MPIRUN:

Expand All @@ -226,8 +187,7 @@ stages:
steps:
- template: templates/install.yml
parameters:
python_version: $(python_version)
conda_packages: $(conda_packages)
solver: $(FIPY_SOLVERS)

- bash: git fetch origin --tags --force
displayName: Fetch tags
Expand Down
47 changes: 38 additions & 9 deletions .azure/templates/install.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
parameters:
- name: python_version
type: string
default: 3.9
- name: conda_packages
type: string
default: ''
- name: pip_packages
type: string
default: ''
- name: solver
type: string
default: scipy

steps:
- bash: echo "##vso[task.prependpath]$CONDA/bin"
Expand Down Expand Up @@ -32,16 +35,42 @@ steps:
conda config --set always_yes yes --set changeps1 no
conda config --remove channels defaults
conda config --set solver libmamba
displayName: Create Anaconda environment
displayName: Configure Anaconda

# Most triggered builds use lockfile to ensure failures are
# due to commit and not due to dependencies
- bash: |
conda install --channel=conda-forge --name=base conda-lock
conda-lock install --name myEnvironment \
environments/locks/conda-${{ parameters.solver }}-lock.yml
displayName: Create Anaconda environment from lockfile
condition: not(eq(variables['Build.CronSchedule.DisplayName'], 'Daily midnight build'))

# Daily midnight build uses environment.yml files to catch regressions
# due to updates in dependencies
- bash: |
conda create --yes --quiet --name myEnvironment --channel conda-forge python=${{ parameters.python_version }} ${{ parameters.conda_packages }}
conda env create --name myEnvironment \
--file environments/${{ parameters.solver }}-environment.yml
displayName: Create Anaconda environment from environments
condition: eq(variables['Build.CronSchedule.DisplayName'], 'Daily midnight build')

- bash: |
if [[ "${{ parameters.conda_packages }}" != "" ]]; then
source activate myEnvironment
# "Libmamba only supports a subset of the MatchSpec interface for
# now. You can only use ('name', 'version', 'build', 'channel',
# 'subdir'), but you tried to use ('md5',)."
conda install --solver classic --channel conda-forge ${{ parameters.conda_packages }}
fi
displayName: Install Anaconda packages

- bash: |
if [[ ${{ parameters.python_version }} != "2.7" ]]; then
if [[ "${{ parameters.pip_packages }}" != "" ]]; then
source activate myEnvironment
pip install scikit-fmm
pip install packaging
python -m pip install ${{ parameters.pip_packages }}
fi
displayName: Install pip packages
displayName: Install Pip packages

- bash: |
conda env export --name myEnvironment
displayName: Environment
1 change: 1 addition & 0 deletions .en-custom.txt
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,7 @@ linearize
linearizing
liquidus
Lobkovsky
lockfiles
LSMLIB
MacBook
Malalasekera
Expand Down
Loading
Loading