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

Use tardis-refdata from Azure mirror (CI/CD) #1304

Merged
merged 54 commits into from
Sep 25, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
54 commits
Select commit Hold shift + click to select a range
b126781
Use tardis-refdata from Azure mirror
epassaro Sep 16, 2020
c4f9b77
Checkout `self` repo
epassaro Sep 16, 2020
75d7c4c
Debugging pipeline
epassaro Sep 16, 2020
639a595
Debugging pipeline
epassaro Sep 16, 2020
f8e70f9
Debugging pipeline
epassaro Sep 16, 2020
616f593
Fetch just necessary refdata
epassaro Sep 16, 2020
0d855fd
(revert) Fetch just necessary refdata
epassaro Sep 16, 2020
60f998c
Download atom data from Azure
epassaro Sep 16, 2020
5eb9280
Download atom data from GitHub LFS
epassaro Sep 17, 2020
e5f9563
Debugging pipeline
epassaro Sep 17, 2020
aa6ff10
Debugging pipeline
epassaro Sep 17, 2020
e2f927f
Debugging pipeline
epassaro Sep 17, 2020
3d31edd
Debugging pipeline
epassaro Sep 17, 2020
c828c92
Debugging pipeline
epassaro Sep 17, 2020
21de29d
Re-writing CI doc section (1)
epassaro Sep 19, 2020
1471a87
Moving to a template schema
epassaro Sep 21, 2020
41686c8
Moving to a template schema (2)
epassaro Sep 21, 2020
11b0331
Moving to a template schema (3)
epassaro Sep 21, 2020
f4b37b1
Moving to a template schema (4)
epassaro Sep 21, 2020
7ac24f3
Moving to a template schema (5)
epassaro Sep 21, 2020
471df7e
Moving to a template schema (6)
epassaro Sep 21, 2020
79e811a
Moving to a template schema (7)
epassaro Sep 21, 2020
3c2dd8e
Moving to a template schema (8)
epassaro Sep 21, 2020
df8afaa
Moving to a template schema (9)
epassaro Sep 21, 2020
c4885ef
Moving to a template schema (10)
epassaro Sep 21, 2020
6e6265e
Moving to a template schema (11)
epassaro Sep 22, 2020
d37a9d3
Moving to a template schema (12)
epassaro Sep 22, 2020
855ccb4
Moving to a template schema (13)
epassaro Sep 22, 2020
f06c353
Moving to a template schema (15)
epassaro Sep 22, 2020
f89bc2f
Moving to a template schema (16)
epassaro Sep 22, 2020
bee3ffc
Moving to a template schema (16)
epassaro Sep 22, 2020
9455a7c
Moving to a template schema (17)
epassaro Sep 22, 2020
d0d4184
Moving to a template schema (18)
epassaro Sep 22, 2020
dee85dd
Moving to a template schema (19)
epassaro Sep 22, 2020
add2c15
Moving to a template schema (20)
epassaro Sep 22, 2020
fabad85
Moving to a template schema (21)
epassaro Sep 22, 2020
49ca98f
Moving to a template schema (21)
epassaro Sep 22, 2020
d23dec2
Moving to a template schema (22)
epassaro Sep 22, 2020
4974920
Moving to a template schema (23)
epassaro Sep 22, 2020
1f245f4
Moving to a template schema (24)
epassaro Sep 22, 2020
9e06008
Moving to a template schema (25)
epassaro Sep 22, 2020
264b6d4
Moving to a template schema (26)
epassaro Sep 22, 2020
deb8c16
Moving to a template schema (27)
epassaro Sep 22, 2020
24ce8cf
Moving to a template schema (28)
epassaro Sep 22, 2020
1521141
Finished template [skip-ci]
epassaro Sep 22, 2020
dbcb8c1
Minor changes to step names
epassaro Sep 22, 2020
4560075
Minor changes to step names
epassaro Sep 22, 2020
292aa14
Complete documentation
epassaro Sep 22, 2020
78a40f9
Use custom variables for repo paths
epassaro Sep 24, 2020
b1c9acb
Minor changes to documentation
epassaro Sep 24, 2020
e361cc8
Minor changes
epassaro Sep 24, 2020
0271c7b
More documentation on pipelines
epassaro Sep 24, 2020
e46f2e3
Minor changes
epassaro Sep 24, 2020
fcf67e4
Minor changes
epassaro Sep 24, 2020
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
78 changes: 20 additions & 58 deletions azure-pipelines/simple_test_framework.yml
Original file line number Diff line number Diff line change
@@ -1,80 +1,42 @@
# Python package
# Create and test a Python package on multiple Python versions.
# Add steps that analyze code, save the dist with the build record, publish to a PyPI-compatible index, and more:
# https://docs.microsoft.com/azure/devops/pipelines/languages/python
# For more information on how to use this pipeline please refer to:
# http://tardis-sn.github.io/tardis/development/continuous_integration.html

trigger:
- master

variables:
system.debug: "true"
ref.data.home: "$(Agent.BuildDirectory)/tardis-refdata"
ref.data.github.url: "https://github.com/tardis-sn/tardis-refdata.git"
tardis.build.dir: $(Build.Repository.LocalPath)
codecov.token: "a876d307-9ed5-4f5d-a6c4-e58291ac4111"
codecov.token: 'a876d307-9ed5-4f5d-a6c4-e58291ac4111'
system.debug: false

jobs:
- job: "Test"
- job: test
displayName: 'TARDIS test'

pool:
vmImage: $[variables.vm_Image]

strategy:
matrix:
linux:
vm_Image: "Ubuntu-16.04"
vm_Image: 'ubuntu-latest'

mac:
vm_Image: "macOS-10.14"
vm_Image: 'macOS-latest'

maxParallel: 2

steps:
- bash: echo "##vso[task.setvariable variable=shellopts]errexit"
displayName: "Force exit on error (bash) "

- bash: echo "##vso[task.prependpath]$CONDA/bin"
displayName: "Add conda to PATH"

- bash: sudo chown -R $USER $CONDA
condition: eq( variables['Agent.OS'], 'Darwin' )
displayName: "Take ownership of conda installation (macOS)"

- bash: conda install mamba=0.4.0 -c conda-forge -y
displayName: "Install mamba"

- bash: mamba env create -f tardis_env3.yml
displayName: "Install TARDIS environment"

- bash: |
GIT_LFS_SKIP_SMUDGE=1 git clone $(ref.data.github.url) $(ref.data.home)
cd $(ref.data.home)
git fetch origin
git checkout origin/master
git lfs pull --include="atom_data/kurucz_cd23_chianti_H_He.h5" origin
git lfs pull --include="atom_data/chianti_He.h5" origin
git lfs pull --include="unit_test_data.h5" origin
git lfs pull --include="packet_unittest.h5" origin
echo MD5: `md5sum unit_test_data.h5`
displayName: "Fetch reference data"
condition: false

- bash: |
source activate tardis
pip install gdown
gdown https://drive.google.com/uc\?id\=1LwfZ6MXuV2j9a23uu9HTcoDDFI9gIuf1 -O tardis-refdata.tar.gz
tar zxf tardis-refdata.tar.gz
mv tardis-refdata $(ref.data.home)
displayName: "Fetch reference data (GDrive backup)"
condition: true
- bash: |
source activate tardis
python setup.py build_ext --inplace
displayName: "TARDIS build"
- template: templates/default.yml
parameters:
fetchRefdata: true
useMamba: true

- bash: |
cd $(tardis.dir)
source activate tardis
pip install pytest-azurepipelines
pytest tardis --tardis-refdata=$(ref.data.home) --cov=tardis --cov-report=xml --cov-report=html
displayName: "TARDIS test"
pytest tardis --tardis-refdata=$(refdata.dir) --cov=tardis --cov-report=xml --cov-report=html
displayName: 'TARDIS test'

- bash: |
bash <(curl -s https://codecov.io/bash)
displayName: "Upload to codecov.io"
- bash: bash <(curl -s https://codecov.io/bash)
displayName: 'Upload to codecov.io'
64 changes: 64 additions & 0 deletions azure-pipelines/templates/default.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
# For more information on how to use this template please refer to:
# http://tardis-sn.github.io/tardis/development/continuous_integration.html

parameters:
- name: fetchRefdata
type: boolean
default: false

- name: useMamba
type: boolean
default: false

- name: skipInstall
type: boolean
default: false

steps:
- bash: echo "##vso[task.setvariable variable=shellopts]errexit"
displayName: 'Force BASH exit if a command exits with non-zero status'
condition: eq(variables['Agent.OS'], 'Linux')

- bash: |
echo "##vso[task.setvariable variable=sources.dir]$(Build.SourcesDirectory)"
echo "##vso[task.setvariable variable=tardis.dir]$(Build.SourcesDirectory)/tardis"
echo "##vso[task.setvariable variable=refdata.dir]$(Build.SourcesDirectory)/tardis-refdata"
displayName: 'Set custom variables'

- checkout: self
displayName: 'Fetch TARDIS repository (GitHub)'

- ${{ if eq(parameters.fetchRefdata, true) }}:
- checkout: git://TARDIS/tardis-refdata
lfs: true
displayName: 'Fetch reference data repository (Azure Repos)'

- bash: echo "##vso[task.prependpath]$CONDA/bin"
displayName: 'Add conda to PATH'

- bash: sudo chown -R $USER $CONDA
displayName: 'Take ownership of conda installation (macOS)'
condition: eq(variables['Agent.OS'], 'Darwin')

- ${{ if eq(parameters.useMamba, true) }}:
- bash: conda install mamba -c conda-forge -y
displayName: 'Install Mamba package manager'

- ${{ if and( eq(parameters.skipInstall, false), eq(parameters.useMamba, false)) }}:
- bash: |
cd $(tardis.dir)
conda env create -f tardis_env3.yml
displayName: 'TARDIS environment install (conda)'

- ${{ if and( eq(parameters.skipInstall, false), eq(parameters.useMamba, true)) }}:
- bash: |
cd $(tardis.dir)
mamba env create -f tardis_env3.yml
displayName: 'TARDIS environment install (mamba)'

- ${{ if eq(parameters.skipInstall, false) }}:
- bash: |
cd $(tardis.dir)
source activate tardis
python setup.py build_ext --inplace
displayName: 'TARDIS build & install'
23 changes: 7 additions & 16 deletions docs/development/azure_links.inc
Original file line number Diff line number Diff line change
@@ -1,22 +1,13 @@

.. azure stuff
.. _azure devops: http://azure.microsoft.com/en-us/services/devops/?nav=mi
.. _azure ssh-task: http://docs.microsoft.com/en-us/azure/devops/pipelines/tasks/utility/install-ssh-key?view=azure-devops#example-setup-using-github
.. _azure secure files: http://docs.microsoft.com/en-us/azure/devops/pipelines/library/secure-files?view=azure-devops#how-do-i-authorize-a-secure-file-for-use-in-all-pipelines
.. _azure variables: http://docs.microsoft.com/en-us/azure/devops/pipelines/process/variables?view=azure-devops&tabs=yaml%2Cbatch#secret-variables
.. _azure secure files: http://docs.microsoft.com/en-us/azure/devops/pipelines/library/secure-files?view=azure-devops#how-do-i-authorize-a-secure-file-for-use-in-all-pipelines
.. _azure task: http://github.com/microsoft/azure-pipelines-tasks
.. _azure pipelines agent releases: https://github.com/Microsoft/azure-pipelines-agent/releases
.. _azure self hosted agents: https://docs.microsoft.com/en-us/azure/devops/pipelines/agents/agents?view=azure-devops#install
.. _azure tutorial: https://docs.microsoft.com/en-us/azure/devops/pipelines/create-first-pipeline?view=azure-devops&tabs=tfs-2018-2
.. _azure condition statements: https://docs.microsoft.com/en-us/azure/devops/pipelines/process/conditions?view=azure-devops&tabs=yaml
.. _personal access token PAT: https://docs.microsoft.com/en-us/azure/devops/organizations/accounts/use-personal-access-tokens-to-authenticate?view=azure-devops
.. _self agent services: https://docs.microsoft.com/en-us/azure/devops/pipelines/agents/v2-linux?view=azure-devops#run-as-a-systemd-service
.. _agent pool security roles: https://docs.microsoft.com/en-us/azure/devops/organizations/security/about-security-roles?view=azure-devops#agent-pool-security-roles-project-level
.. _service file: https://docs.microsoft.com/en-us/azure/devops/pipelines/agents/v2-linux?view=azure-devops#service-files

.. _azure DevOps: http://azure.microsoft.com/en-us/services/devops/?nav=mi
.. _azure documentation section on triggers: https://docs.microsoft.com/en-us/azure/devops/pipelines/repos/github?view=azure-devops&tabs=yaml#ci-triggers
.. _azure documentation section on variables: https://docs.microsoft.com/en-us/azure/devops/pipelines/process/variables?view=azure-devops&tabs=yaml%2Cbatch
.. _azure documentation section on jobs: https://docs.microsoft.com/en-us/azure/devops/pipelines/process/phases?view=azure-devops&tabs=yaml
.. _azure documentation section on templates: https://docs.microsoft.com/en-us/azure/devops/pipelines/process/templates?view=azure-devops
.. _checking out multiple repositories: https://docs.microsoft.com/en-us/azure/devops/pipelines/repos/multi-repo-checkout?view=azure-devops
.. general stuff
.. _Continuous Integration: https://en.wikipedia.org/wiki/Continuous_integration
.. _continuous integration: https://en.wikipedia.org/wiki/Continuous_integration

.. |emdash| unicode:: U+02014

Expand Down
Loading