Commit 9d848ae5 authored by Avi Vajpeyi's avatar Avi Vajpeyi 👽
Browse files

Merge branch 'add_nectar_runner' into 'master'

refactor CI workflows

See merge request !107
parents 249ad3e3 329beda0
Pipeline #344488 failed with stages
in 4 minutes and 17 seconds
### parallel bilby ignores
*.version
*.npz
outdir
### Python template
# Byte-compiled / optimized / DLL files
......@@ -7,8 +9,6 @@ __pycache__/
*.py[cod]
*$py.class
# C extensions
*.so
......
# This script is an edited version of the example found at
# https://git.ligo.org/lscsoft/example-ci-project/blob/python/.gitlab-ci.yml
# Each 0th-indendation level is a job that will be run within GitLab CI
# The only exception are a short list of reserved keywords
#
# Main CI file
# https://docs.gitlab.com/ee/ci/yaml/#gitlab-ci-yml
# stages is a reserved keyword that defines job dependencies and
# parallelization. each stage runs in parallel but must complete
# before the next stage begins
stages:
- install
- test
- docs
- deploy
......@@ -20,40 +13,24 @@ cache:
- .pip37
- .pip36
precommits-py3.7:
stage: test
image: bilbydev/bilby_pipe-test-suite-python37
script:
- source activate python37
- mkdir -p .pip37
- pip install --upgrade pip
- pip --cache-dir=.pip37 install --upgrade bilby
- pip --cache-dir=.pip37 install .
- pip --cache-dir=.pip37 install pre-commit
# Run precommits (black, flake8, spellcheck, isort, no merge conflicts, etc)
- pre-commit run --all-files --verbose --show-diff-on-failure
# test install on python 3.6
python-3.6:
stage: test
install-on-python-3.6:
stage: install
tags:
- cit
image: bilbydev/bilby_pipe-test-suite-python36
script:
- conda install -c conda-forge schwimmbad
- python -m pip install .
- mkdir -p .pip36
- pip install --upgrade pip
- pip --cache-dir=.pip36 install --upgrade bilby
- pip --cache-dir=.pip36 install .
# test install on python 3.7
python-3.7:
stage: test
image: bilbydev/bilby_pipe-test-suite-python37
script:
- conda install -c conda-forge schwimmbad
- python -m pip install .
pytest:
stage: test
install-on-python-3.7:
stage: install
tags:
- cit
image: bilbydev/bilby_pipe-test-suite-python37
script:
- conda install -c conda-forge schwimmbad
......@@ -61,63 +38,11 @@ pytest:
- pip install --upgrade pip
- pip --cache-dir=.pip37 install --upgrade bilby
- pip --cache-dir=.pip37 install .
# Run tests and collect coverage data
- pytest --cov parallel_bilby
- coverage html
- coverage-badge -o coverage_badge.svg -f
artifacts:
paths:
- htmlcov/
- coverage_badge.svg
docs:
stage: docs
image: bilbydev/bilby_pipe-test-suite-python37
script:
- source activate python37
- mkdir -p .pip37
- pip --cache-dir=.pip37 install .
# Make the documentation
- apt-get -y install graphviz
- cd docs
- pip install -r requirements.txt
- make clean
- make html
artifacts:
paths:
- docs/_build/html/
pages:
stage: deploy
dependencies:
- docs
- pytest
script:
- ls
- mkdir public/
- mv docs/_build/html/* public/
- mv htmlcov/ public/
- mv coverage_badge.svg public/
artifacts:
paths:
- public
expire_in: 30 days
only:
- master
deploy_release:
stage: deploy
image: bilbydev/bilby_pipe-test-suite-python37
variables:
TWINE_USERNAME: $PYPI_USERNAME
TWINE_PASSWORD: $PYPI_PASSWORD
before_script:
- pip install twine
- python setup.py sdist
script:
- twine upload dist/*
only:
- tags
# Include the additional CI tasks
include:
- local: "/ci_workflows/tests.yml"
- local: "/ci_workflows/make_docs.yml"
- local: "/ci_workflows/pypi_deploy.yml"
- local: "/ci_workflows/end_to_end_analysis.yml"
# run e2e analyses
gw150914_analysis:
stage: install
tags:
- openstack
when: manual
image: bilbydev/bilby_pipe-test-suite-python37
script:
- source activate python37
- mkdir -p .pip37
- pip --cache-dir=.pip37 install .
- cd examples/GW150914_IMRPhenomPv2
- parallel_bilby_generation GW150914.ini
- mpirun -n 16 parallel_bilby_analysis outdir/data/GW150914_data_dump.pickle --label GW150914_0 --outdir outdir/result --sampling-seed 0
fast_injection:
stage: install
tags:
- openstack
when: manual
image: bilbydev/bilby_pipe-test-suite-python37
script:
- source activate python37
- mkdir -p .pip37
- pip --cache-dir=.pip37 install .
- cd examples/fast_injection
- parallel_bilby_generation fast_injection.ini
- mpirun -n 16 parallel_bilby_analysis outdir/data/fast_injection_data_dump.pickle --label fast_injection --outdir outdir/result --sampling-seed 0
# make + upload documentation to https://lscsoft.docs.ligo.org/parallel_bilby/
docs:
stage: docs
tags:
- cit
image: bilbydev/bilby_pipe-test-suite-python37
script:
- source activate python37
- mkdir -p .pip37
- pip --cache-dir=.pip37 install .
# Make the documentation
- apt-get update
- apt-get -y install graphviz
- cd docs
- pip install -r requirements.txt
- make clean
- make html
artifacts:
paths:
- docs/_build/html/
pages:
stage: deploy
tags:
- cit
dependencies:
- docs
- pytest
script:
- ls
- mkdir public/
- mv docs/_build/html/* public/
- mv htmlcov/ public/
- mv coverage_badge.svg public/
artifacts:
paths:
- public
expire_in: 30 days
only:
- master
# on a new tagged commit, deploy to Pypi
deploy_release:
stage: deploy
tags:
- cit
image: bilbydev/bilby_pipe-test-suite-python37
variables:
TWINE_USERNAME: $PYPI_USERNAME
TWINE_PASSWORD: $PYPI_PASSWORD
before_script:
- pip install twine
- python setup.py sdist
script:
- twine upload dist/*
only:
- tags
# run precommit + pytest
precommits:
stage: test
tags:
- cit
image: bilbydev/bilby_pipe-test-suite-python37
script:
- source activate python37
- mkdir -p .pip37
- pip install --upgrade pip
- pip --cache-dir=.pip37 install --upgrade bilby
- pip --cache-dir=.pip37 install .
- pip --cache-dir=.pip37 install pre-commit
# Run precommits (black, flake8, spellcheck, isort, no merge conflicts, etc)
- pre-commit run --all-files --verbose --show-diff-on-failure
pytest:
stage: test
tags:
- cit
image: bilbydev/bilby_pipe-test-suite-python37
script:
- source activate python37
- mkdir -p .pip37
- pip --cache-dir=.pip37 install .
# Run tests and collect coverage data
- pytest --cov parallel_bilby
- coverage html
- coverage-badge -o coverage_badge.svg -f
artifacts:
paths:
- htmlcov/
- coverage_badge.svg
......@@ -95,4 +95,4 @@ The `Multiple Injections`_ folder contains some code to help create submission f
.. _GW170817: https://git.ligo.org/lscsoft/parallel_bilby/-/tree/master/examples/GW170817_IMRPhenomPv2_NRTidal/
.. _Multiple Injections: https://git.ligo.org/lscsoft/parallel_bilby/-/tree/master/examples/multiple_pbilby_injections/
.. _GW150914 tutorial.ipynb: https://git.ligo.org/lscsoft/parallel_bilby/-/tree/master/examples/GW150914_IMRPhenomPv2/tutorial.ipynb
.. _GW170817 tutorial.ipynb: https://git.ligo.org/lscsoft/parallel_bilby/-/tree/master/examples/GW170817_IMRPhenomPv2_NRTidal/tutorial.ipynb
.. _GW170817 tutorial.ipynb: https://git.ligo.org/lscsoft/parallel_bilby/-/tree/master/examples/GW170817_IMRPhenomPv2_NRTidal/tutorial.ipynb
\ No newline at end of file
......@@ -7,3 +7,4 @@ sphinx_rtd_theme
sphinx-argparse
sphinx-tabs
graphviz
parallel_bilby
################################################################################
## Data generation arguments
################################################################################
detectors = [H1]
gaussian-noise = False
zero-noise = True
duration = 4
trigger_time=0
injection-dict={'chirp_mass': 28.0, 'mass_ratio': 1.0, 'a_1': 0.6, 'a_2': 0.6, 'tilt_1': 0.0, 'tilt_2': 0.0, 'phi_12': 0.0, 'phi_jl': 0.0, 'luminosity_distance': 800, 'dec': 0.1, 'ra': 0.1, 'theta_jn': 0.1, 'psi': 0.1, 'phase': 0.1, 'geocent_time': 0.0}
################################################################################
## Job submission arguments
################################################################################
label = fast_injection
outdir = outdir
################################################################################
## Likelihood arguments
################################################################################
distance-marginalization=False
phase-marginalization=False
time-marginalization=True
################################################################################
## Prior arguments
################################################################################
prior-dict = {
mass_ratio = 1,
chirp_mass = Uniform(name='chirp_mass', minimum=25, maximum=31),
mass_1 = Constraint(name='mass_1', minimum=10, maximum=80),
mass_2 = Constraint(name='mass_2', minimum=10, maximum=80),
a_1 = 0.6,
a_2 = 0.6,
tilt_1 = 0.0,
tilt_2 = 0.0,
phi_12 = 0.0,
phi_jl = 0.0,
luminosity_distance = 800,
dec = 0.1,
ra = 0.1,
theta_jn = 0.1,
psi = 0.1,
phase = 0.1
}
################################################################################
## Waveform arguments
################################################################################
waveform_approximant = IMRPhenomPv2
frequency-domain-source-model = lal_binary_black_hole
###############################################################################
## Sampler settings
################################################################################
sampler = dynesty
nlive = 1000
nact = 5
################################################################################
## Slurm Settings
################################################################################
nodes = 10
ntasks-per-node = 16
time = 24:00:00
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment