Skip to content
Merged
Show file tree
Hide file tree
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
5 changes: 5 additions & 0 deletions .codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
coverage:
status:
project:
default:
threshold: 0.1%
2 changes: 1 addition & 1 deletion .github/workflows/basic-install.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
matrix:
# disable windows build test as bilby_cython is currently broken there
os: [ubuntu-latest, macos-latest]
python-version: ["3.10", "3.11", "3.12"]
python-version: ["3.10", "3.11", "3.12", "3.13"]
steps:
- uses: actions/checkout@v4
with:
Expand Down
64 changes: 34 additions & 30 deletions .github/workflows/build-containers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,56 +5,60 @@ on:
- cron: "15 0 * * *"
workflow_dispatch:

env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}

jobs:
build-container:
permissions:
contents: read
packages: write
attestations: write
contents: read
id-token: write
packages: write
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["310", "311", "312"]
python-version: ["11", "12", "13"]
env:
LABEL: ghcr.io/${{ github.repository }}-python3${{ matrix.python-version }}
steps:
- uses: actions/checkout@v4
- name: Setup dockerfile

- name: Remove unnecessary files
run: |
cp containers/v3-dockerfile-test-suite-python${{ matrix.python-version }} Dockerfile
cp containers/env-template.yml .
df . -h
sudo rm -rf /usr/share/dotnet
sudo rm -rf "$AGENT_TOOLSDIRECTORY"
df . -h

- name: Login to the Container registry
uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7
with:
tags: type=raw,value=latest
images: ghcr.io/${{ env.IMAGE_NAME }}-python${{ matrix.python-version }}
- name: Set up QEMU
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Build and push Docker image
id: push
uses: docker/build-push-action@f2a1d5e99d037542a71f64918e516c093c6f3fc4
uses: docker/build-push-action@v6
with:
context: .
tags: ${{ steps.meta.outputs.tags }}
build-args: |
python_minor_version=${{ matrix.python-version }}
ENV_FILE=containers/environment.yml
push: true
labels: ${{ steps.meta.outputs.labels }}

# FIXME: disabled as it is not working well but should probably be added in later
# https://docs.github.com/en/actions/security-for-github-actions/using-artifact-attestations/using-artifact-attestations-to-establish-provenance-for-builds
# - name: Generate artifact attestation
# uses: actions/attest-build-provenance@v1
# with:
# subject-name: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME}}
# subject-digest: ${{ steps.push.outputs.digest }}
# push-to-registry: true
file: containers/Dockerfile
tags: ${{ env.LABEL }}:latest
cache-from: type=registry,ref=${{ env.LABEL }}:buildcache
cache-to: type=registry,ref=${{ env.LABEL }}:buildcache,mode=max

- name: Generate artifact attestation
uses: actions/attest-build-provenance@v3
with:
subject-name: ${{ env.LABEL }}
subject-digest: ${{ steps.push.outputs.digest }}
push-to-registry: true
2 changes: 1 addition & 1 deletion .github/workflows/pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ concurrency:
jobs:
build:
runs-on: ubuntu-latest
container: ghcr.io/bilby-dev/bilby-python311:latest
container: ghcr.io/bilby-dev/bilby-python312:latest
steps:
- name: Checkout
uses: actions/checkout@v4
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@ jobs:
- name: Python 3.12
version: 3.12
short-version: 312
- name: Python 3.13
version: 3.13
short-version: 313

steps:
- uses: actions/checkout@v4
Expand Down
52 changes: 52 additions & 0 deletions containers/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
#############################
######## Setup base #########
#############################

FROM containers.ligo.org/docker/base:conda AS os-deps
LABEL name="bilby CI testing" \
maintainer="Gregory Ashton <gregory.ashton@ligo.org>, Colm Talbot <colm.talbot@ligo.org>"

#############################
##### Download ROQ data #####
#############################

FROM debian:bookworm-slim AS data
WORKDIR /roq_basis
RUN apt-get update && apt-get install -y --no-install-recommends ca-certificates wget \
&& rm -rf /var/lib/apt/lists/*
# Add the ROQ data to the image
RUN wget https://git.ligo.org/lscsoft/ROQ_data/raw/master/IMRPhenomPv2/4s/B_linear.npy \
&& wget https://git.ligo.org/lscsoft/ROQ_data/raw/master/IMRPhenomPv2/4s/B_quadratic.npy \
&& wget https://git.ligo.org/lscsoft/ROQ_data/raw/master/IMRPhenomPv2/4s/fnodes_linear.npy \
&& wget https://git.ligo.org/lscsoft/ROQ_data/raw/master/IMRPhenomPv2/4s/fnodes_quadratic.npy \
&& wget https://git.ligo.org/lscsoft/ROQ_data/raw/master/IMRPhenomPv2/4s/params.dat \
&& wget https://git.ligo.org/soichiro.morisaki/roq_basis/raw/main/IMRPhenomD/16s_nospins/basis_addcal.hdf5 \
&& wget https://git.ligo.org/soichiro.morisaki/roq_basis/raw/main/IMRPhenomD/16s_nospins/basis_multiband_addcal.hdf5

#############################
##### Build environment #####
#############################

FROM os-deps AS build-env
ARG ENV_FILE=environment.yml
COPY ${ENV_FILE} env.yml
ARG python_major_version=3
ARG python_minor_version=12

RUN echo " - python=${python_major_version}.${python_minor_version}" >> env.yml
ENV conda_env=python${python_major_version}${python_minor_version}

RUN mamba env create -f env.yml -n ${conda_env}
RUN echo "source activate ${conda_env}" > ~/.bashrc
ENV PATH=/opt/conda/envs/${conda_env}/bin:$PATH
RUN /bin/bash -c "source activate ${conda_env}"
RUN mamba clean --all

#############################
### Finalize environment ####
#############################

FROM build-env AS final
COPY --from=data /roq_basis /roq_basis
RUN mamba info
RUN python --version
25 changes: 0 additions & 25 deletions containers/dockerfile-template

This file was deleted.

8 changes: 3 additions & 5 deletions containers/env-template.yml → containers/environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,17 @@
# The python version should be added before creating the env
channels:
- conda-forge
- defaults
- pytorch
dependencies:
- pip
- setuptools
- setuptools_scm
- matplotlib
- numpy<2.2 # dynesty<2.2 requires numpy<2.2
- numpy<2.4
- scipy
- pandas
- astropy
- flake8
- anaconda
- coverage
- configargparse
- future
Expand All @@ -23,7 +21,7 @@ dependencies:
- pytest-cov
- pytest-requires
- pytest-rerunfailures
- conda-forge::arviz
- arviz
- parameterized
- scikit-image
- celerite
Expand All @@ -37,7 +35,7 @@ dependencies:
- bilby.cython
- pyseobnr
- ligo-gracedb
- gwpy
- gwpy>=4.0.0
- ligo.skymap
- sphinx<9 # needed for sphinx_rtd_theme<3.1
- numpydoc
Expand Down
27 changes: 0 additions & 27 deletions containers/v3-dockerfile-test-suite-python310

This file was deleted.

27 changes: 0 additions & 27 deletions containers/v3-dockerfile-test-suite-python311

This file was deleted.

27 changes: 0 additions & 27 deletions containers/v3-dockerfile-test-suite-python312

This file was deleted.

23 changes: 0 additions & 23 deletions containers/write_dockerfiles.py

This file was deleted.

Loading