Skip to content

Commit

Permalink
Merge pull request #50 from lsst-dm/tickets/DM-41208
Browse files Browse the repository at this point in the history
DM-41208: Enable building with different pipeline versions.
  • Loading branch information
ktlim authored Oct 24, 2023
2 parents f3c3049 + fa56dfe commit 1e8029f
Show file tree
Hide file tree
Showing 2 changed files with 61 additions and 2 deletions.
56 changes: 56 additions & 0 deletions .github/workflows/build-manually.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: Build Embargo Butler ingest container on demand
on:
workflow_dispatch:
inputs:
rubinenvVersion:
description: 'rubin-env version'
required: true
default: '7.0.1'
obsLsstVersion:
description: 'Science Pipelines release'
required: true
default: 'w_2023_41'


env:
INGEST_NAME: embargo-butler-ingest

jobs:
build:
runs-on: ubuntu-latest
permissions:
packages: write
contents: read
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Build ingest image
run: |
docker build . \
-f Dockerfile.ingest \
--tag $INGEST_NAME \
--label "runnumber=${GITHUB_RUN_ID}" \
--build-arg "RUBINENV_VERSION=${{ inputs.rubinenvVersion }}" \
--build-arg "OBS_LSST_VERSION=${{ inputs.obsLsstVersion }}"
- name: Log in to GitHub Container Registry
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u $ --password-stdin

- name: Push image
run: |
INGEST_ID=ghcr.io/${{ github.repository_owner }}/$INGEST_NAME
if [[ "${{ github.ref }}" == "refs/pull/"* ]]; then
VERSION=$(echo "${{ github.head_ref }}" | sed -e 's|.*/||')
elif [[ "${{ github.ref }}" == "refs/tags/"* ]]; then
VERSION=$(echo "${{ github.ref_name }}" | sed -e 's|^v||')
else
VERSION=latest
fi
INGEST_VERSION="${VERSION}-${{ inputs.obsLsstVersion }}"
echo INGEST_ID=$INGEST_ID
echo VERSION=$VERSION
echo INGEST_VERSION=$INGEST_VERSION
docker tag $INGEST_NAME $INGEST_ID:$INGEST_VERSION
docker push $INGEST_ID:$INGEST_VERSION
7 changes: 5 additions & 2 deletions Dockerfile.ingest
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,13 @@

# Dockerfile for ingest service.

FROM lsstsqre/newinstall:7.0.1
ARG RUBINENV_VERSION=7.0.1
FROM lsstsqre/newinstall:${RUBINENV_VERSION}
ARG OBS_LSST_VERSION
ENV OBS_LSST_VERSION=${OBS_LSST_VERSION:-w_2023_41}
USER lsst
RUN source loadLSST.bash && mamba install redis-py rucio-clients
RUN source loadLSST.bash && eups distrib install -t "w_2023_39" obs_lsst
RUN source loadLSST.bash && eups distrib install -t "${OBS_LSST_VERSION}" obs_lsst
COPY src/ingest.py src/exposure_info.py src/utils.py src/rucio_interface.py ./ingest/
# Environment variables that must be set:
# REDIS_HOST REDIS_PASSWORD BUCKET BUTLER_REPO
Expand Down

0 comments on commit 1e8029f

Please sign in to comment.