Skip to content

Commit

Permalink
workshop-manager-v0.7.1
Browse files Browse the repository at this point in the history
  • Loading branch information
jkupferer committed Jul 30, 2024
1 parent d17c2f5 commit 3f241cc
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 37 deletions.
42 changes: 17 additions & 25 deletions .github/workflows/workshop-manager-publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout source
uses: actions/checkout@v2
uses: actions/checkout@master

- name: Get image tags
id: image_tags
Expand All @@ -24,40 +24,32 @@ jobs:
RELEASE=${GITHUB_REF#refs/tags/workshop-manager-}
# To determine VERSION, strip off any release number suffix
VERSION=${RELEASE/-*/}
echo "::set-output name=RELEASE::${RELEASE}"
echo "::set-output name=VERSION::${VERSION}"
# Only build image if version tag without release number
# Releases indicate a change in the repository that should not trigger a new build.
if [[ "${VERSION}" == "${RELEASE}" ]]; then
# Publish to latest, minor, and patch tags
# Ex: latest,v0.1.2,v0.1
IMAGE_TAGS=(
'${{ secrets.REGISTRY_URI }}/${{ secrets.GPTE_REGISTRY_REPOSITORY }}/${{ env.IMAGE_NAME }}:latest'
"${{ secrets.REGISTRY_URI }}/${{ secrets.GPTE_REGISTRY_REPOSITORY }}/${{ env.IMAGE_NAME }}:${VERSION%.*}"
"${{ secrets.REGISTRY_URI }}/${{ secrets.GPTE_REGISTRY_REPOSITORY }}/${{ env.IMAGE_NAME }}:${VERSION}"
)
# Set IMAGE_TAGS output for use in next step
( IFS=$','; echo "::set-output name=IMAGE_TAGS::${IMAGE_TAGS[*]}" )
echo "IMAGE_TAGS=latest ${VERSION%.*} ${VERSION}" >> $GITHUB_OUTPUT
fi
- name: Set up buildx
uses: docker/setup-buildx-action@v1
if: steps.image_tags.outputs.IMAGE_TAGS

- name: Login to image registry
uses: docker/login-action@v1
- name: Buildah Action
id: buildah-build
if: steps.image_tags.outputs.IMAGE_TAGS
uses: redhat-actions/buildah-build@v2
with:
registry: ${{ secrets.REGISTRY_URI }}
username: ${{ secrets.GPTE_REGISTRY_USERNAME }}
password: ${{ secrets.GPTE_REGISTRY_PASSWORD }}
image: ${{ env.IMAGE_NAME }}
tags: ${{ steps.image_tags.outputs.IMAGE_TAGS }}
context: workshop-manager
containerfiles: workshop-manager/Containerfile

- name: Build and publish image
uses: docker/build-push-action@v2
- name: Push image to registry
id: push-to-registry
if: steps.image_tags.outputs.IMAGE_TAGS
uses: redhat-actions/push-to-registry@v2
with:
context: workshop-manager
file: workshop-manager/Dockerfile
push: true
tags: ${{ steps.image_tags.outputs.IMAGE_TAGS }}
image: ${{ steps.buildah-build.outputs.image }}
tags: ${{ steps.buildah-build.outputs.tags }}
registry: ${{ vars.BABYLON_IMAGE_REGISTRY }}/${{ vars.BABYLON_IMAGE_REPOSITORY }}
username: ${{ secrets.BABYLON_IMAGE_REGISTRY_USERNAME }}
password: ${{ secrets.BABYLON_IMAGE_REGISTRY_PASSWORD }}
4 changes: 2 additions & 2 deletions helm/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -206,9 +206,9 @@ workshopManager:
version: v1
deploy: true
image:
repository: quay.io/redhat-gpte/babylon-workshop-manager
repository: quay.io/rhpds/babylon-workshop-manager
pullPolicy: IfNotPresent
tag: v0.7.0
tag: v0.7.1
namespace:
create: true
name: babylon-workshop-manager
Expand Down
File renamed without changes.
9 changes: 3 additions & 6 deletions workshop-manager/build-template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ parameters:
value: https://github.com/redhat-cop/babylon.git
- name: GIT_REF
value: main
- name: KOPF_S2I_IMAGE
value: quay.io/redhat-cop/python-kopf-s2i:v1.37

objects:
- apiVersion: image.openshift.io/v1
Expand Down Expand Up @@ -44,8 +42,7 @@ objects:
ref: ${GIT_REF}
strategy:
type: Source
sourceStrategy:
from:
kind: DockerImage
name: ${KOPF_S2I_IMAGE}
dockerStrategy:
dockerfilePath: Containerfile
forcePull: true
triggers: []
4 changes: 0 additions & 4 deletions workshop-manager/operator/operator.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,6 @@ async def workshop_daemon(logger, stopped, **kwargs):
workshop = Workshop.load(**kwargs)
try:
while not stopped:
if workshop.ignore:
return
if workshop.lifespan_end and workshop.lifespan_end < datetime.now(timezone.utc):
logger.info(f"Deleting {workshop} for lifespan end")
await workshop.delete()
Expand Down Expand Up @@ -155,8 +153,6 @@ async def workshop_provision_daemon(logger, stopped, **kwargs):
workshop_provision = WorkshopProvision.load(**kwargs)
try:
while not stopped:
if workshop_provision.ignore:
return
if workshop_provision.lifespan_end \
and workshop_provision.lifespan_end < datetime.now(timezone.utc):
logger.info(f"deleting {workshop_provision} for lifespan end")
Expand Down

0 comments on commit 3f241cc

Please sign in to comment.