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

chore: add conda env caching #2207

Merged
merged 1 commit into from
Apr 17, 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
26 changes: 14 additions & 12 deletions templates/conda.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,21 @@ steps:
- bash: echo "##vso[task.prependpath]$CONDA/bin"
displayName: Add conda to PATH
retryCountOnTaskFailure: 1
# - bash: sudo chown -R $(whoami):$(id -ng) $(CONDA_CACHE_DIR)
# displayName: Fix directory permissions
# - task: Cache@2
# displayName: Use cached Anaconda environment
# inputs:
# key: 'conda | "$(Agent.OS)" | environment.yml'
# restoreKeys: |
# python | "$(Agent.OS)"
# python
# path: $(CONDA_CACHE_DIR)
# cacheHitVar: CONDA_CACHE_RESTORED
- bash: sudo chown -R $(whoami):$(id -ng) $(CONDA_CACHE_DIR)
displayName: Fix directory permissions
- task: Cache@2
displayName: Use cached Anaconda environment
inputs:
key: 'conda | "$(Agent.OS)" | environment.yml'
restoreKeys: |
python | "$(Agent.OS)"
python
path: $(CONDA_CACHE_DIR)
cacheHitVar: CONDA_CACHE_RESTORED
timeoutInMinutes: 20
retryCountOnTaskFailure: 1
- bash: |
(timeout 30m conda env create --force -f environment.yml -v) || (timeout 30m conda env create --force -f environment.yml -v)
displayName: Create Anaconda environment
retryCountOnTaskFailure: 1
# condition: eq(variables.CONDA_CACHE_RESTORED, 'false')
condition: eq(variables.CONDA_CACHE_RESTORED, 'false')
Loading