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
61 changes: 61 additions & 0 deletions .github/workflows/build-base.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
---
name: "Build base"
on:
push:
paths:
- '.github/workflows/build-base.yml'
- 'python/base/**'
branches:
- main
pull_request:
paths:
- '.github/workflows/build-base.yml'
- 'python/base/**'
workflow_dispatch:

permissions:
packages: write

jobs:
update-base-image:
name: Update base image
runs-on: ubuntu-latest
env:
IMAGE_NAME: prompt-proto-base
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Build image
run: docker build python/base --tag $IMAGE_NAME --label "runnumber=${GITHUB_RUN_ID}"
- name: Login to GitHub Container Registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Push image to GitHub Container Registry
run: |
IMAGE_ID=ghcr.io/${{ github.repository_owner }}/$IMAGE_NAME
VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,')
[ "$VERSION" == "merge" ] && VERSION=$(echo "${{ github.head_ref }}" | sed -e 's,.*/\(.*\),\1,')
[ "$VERSION" == "main" ] && VERSION=latest
echo IMAGE_ID=$IMAGE_ID
echo VERSION=$VERSION
docker tag $IMAGE_NAME $IMAGE_ID:$VERSION
docker push $IMAGE_ID:$VERSION
- name: Login to Google Artifact Registry
uses: docker/login-action@v1
with:
registry: us-central1-docker.pkg.dev
username: _json_key_base64
password: ${{ secrets.GAR_JSON_B64 }}
- name: Push image to Google Artifact Registry
run: |
IMAGE_ID=us-central1-docker.pkg.dev/prompt-proto/prompt/$IMAGE_NAME
VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,')
[ "$VERSION" == "merge" ] && VERSION=$(echo "${{ github.head_ref }}" | sed -e 's,.*/\(.*\),\1,')
[ "$VERSION" == "main" ] && VERSION=latest
echo IMAGE_ID=$IMAGE_ID
echo VERSION=$VERSION
docker tag $IMAGE_NAME $IMAGE_ID:$VERSION
docker push $IMAGE_ID:$VERSION
87 changes: 87 additions & 0 deletions .github/workflows/build-service.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
---
name: "Build and test service"
on:
push:
branches:
- main
paths:
- '.github/workflows/build-service.yml'
- 'python/activator/**'
pull_request:
paths:
- '.github/workflows/build-service.yml'
- 'python/activator/**'
workflow_dispatch:

permissions:
packages: write

jobs:
test-service:
name: Test service
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Fix permissions
run: chmod -R a+rwX $GITHUB_WORKSPACE
- name: Login to GitHub Container Registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Run tests
run: |
docker run \
-v $GITHUB_WORKSPACE:/home/lsst/prompt_prototype \
ghcr.io/${{ github.repository_owner }}/prompt-proto-base:latest \
bash -c '
cd /home/lsst/prompt_prototype
source /opt/lsst/software/stack/loadLSST.bash
setup -r .
scons'

update-service-image:
name: Update service image
needs: test-service
runs-on: ubuntu-latest
env:
IMAGE_NAME: prompt-proto-service
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Login to GitHub Container Registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build image
run: docker build python/activator --tag $IMAGE_NAME --label "runnumber=${GITHUB_RUN_ID}"
- name: Push image to GitHub Container Registry
run: |
IMAGE_ID=ghcr.io/${{ github.repository_owner }}/$IMAGE_NAME
VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,')
[ "$VERSION" == "merge" ] && VERSION=$(echo "${{ github.head_ref }}" | sed -e 's,.*/\(.*\),\1,')
[ "$VERSION" == "main" ] && VERSION=latest
echo IMAGE_ID=$IMAGE_ID
echo VERSION=$VERSION
docker tag $IMAGE_NAME $IMAGE_ID:$VERSION
docker push $IMAGE_ID:$VERSION
- name: Login to Google Artifact Registry
uses: docker/login-action@v1
with:
registry: us-central1-docker.pkg.dev
username: _json_key_base64
password: ${{ secrets.GAR_JSON_B64 }}
- name: Push image to Google Artifact Registry
run: |
IMAGE_ID=us-central1-docker.pkg.dev/prompt-proto/prompt/$IMAGE_NAME
VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,')
[ "$VERSION" == "merge" ] && VERSION=$(echo "${{ github.head_ref }}" | sed -e 's,.*/\(.*\),\1,')
[ "$VERSION" == "main" ] && VERSION=latest
echo IMAGE_ID=$IMAGE_ID
echo VERSION=$VERSION
docker tag $IMAGE_NAME $IMAGE_ID:$VERSION
docker push $IMAGE_ID:$VERSION
13 changes: 0 additions & 13 deletions .github/workflows/null.yml

This file was deleted.

2 changes: 1 addition & 1 deletion python/activator/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM us-central1-docker.pkg.dev/prompt-proto/prompt/prompt-proto-base:latest
FROM ghcr.io/lsst-dm/prompt-proto-base:latest
ENV PYTHONUNBUFFERED True
ENV APP_HOME /app
ARG RUBIN_INSTRUMENT
Expand Down