44 строки
1.5 KiB
YAML
44 строки
1.5 KiB
YAML
steps:
|
|
- template: checkout.yml
|
|
|
|
- template: store_settings.yml
|
|
|
|
- template: prepare_conda.yml
|
|
|
|
- bash: echo "##vso[task.setvariable variable=conda_env_dir]/usr/share/miniconda/envs"
|
|
displayName: "Set the Conda environment folder (Linux)"
|
|
condition: eq(variables['Agent.OS'], 'Linux')
|
|
|
|
- bash: echo "##vso[task.setvariable variable=conda_env_dir]C:/Miniconda/envs"
|
|
displayName: "Set the Conda environment folder(Windows)"
|
|
condition: eq(variables['Agent.OS'], 'Windows_NT')
|
|
|
|
- bash: echo $(conda_env_dir)
|
|
displayName: 'Printing Conda environment folder'
|
|
|
|
# https://docs.microsoft.com/en-us/azure/devops/pipelines/release/caching?view=azure-devops#pythonanaconda
|
|
- task: Cache@2
|
|
displayName: Use cached Conda environment
|
|
inputs:
|
|
# Beware of changing the cache key or path independently, safest to change in sync
|
|
key: 'conda_env | "$(Agent.OS)" | environment.yml'
|
|
cacheHitVar: CONDA_CACHE_RESTORED
|
|
path: $(conda_env_dir)
|
|
|
|
- bash: conda env create --file environment.yml
|
|
displayName: Create Anaconda environment
|
|
failOnStderr: false # Conda env create does not have an option to suppress warnings generated in wheel.py
|
|
condition: eq(variables.CONDA_CACHE_RESTORED, 'false')
|
|
|
|
- bash: |
|
|
source activate InnerEye
|
|
which python
|
|
conda info
|
|
pip freeze
|
|
failOnStderr: false
|
|
displayName: Print package list and Conda info
|
|
condition: succeededOrFailed()
|
|
|
|
- bash: source activate InnerEye
|
|
displayName: Check if InnerEye environment is present
|