Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Workshop 10 helm mastery with hyku #12

Closed
wants to merge 4 commits into from
Closed
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: 2 additions & 3 deletions .github/workflows/base.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,8 @@ on:

jobs:
build:
uses: scientist-softserv/actions/.github/workflows/[email protected].12
uses: scientist-softserv/actions/.github/workflows/[email protected].14
secrets: inherit
with:
platforms: "linux/amd64" # "linux/amd64,linux/arm64"
target: hyku-base
image_name: samvera/hyku/base
baseTarget: hyku-base
17 changes: 17 additions & 0 deletions .github/workflows/build-solr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: "Build Solr"
on:
workflow_dispatch:
inputs:
debug_enabled:
type: boolean
description: 'Run the build with tmate debugging enabled (https://github.com/marketplace/actions/debugging-with-tmate)'
required: false
default: false

jobs:
build:
uses: scientist-softserv/actions/.github/workflows/[email protected]
secrets: inherit
with:
platforms: "linux/amd64"
solrTarget: hyku-solr
8 changes: 3 additions & 5 deletions .github/workflows/build-test-lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,10 @@ on:

jobs:
build:
uses: scientist-softserv/actions/.github/workflows/[email protected].12
uses: scientist-softserv/actions/.github/workflows/[email protected].14
secrets: inherit
with:
platforms: "linux/amd64" # "linux/amd64,linux/arm64"
target: hyku-web
solr: true
solrTarget:
worker: true
webTarget: hyku-web
solrTarget: hyku-solr
workerTarget: hyku-worker
21 changes: 6 additions & 15 deletions bin/helm_deploy
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/bin/sh


# This script wraps up helm deployment. It is meant as a clear starting point for
# commandline deployment or CI based deployment. It requires the following ENV vars be set
#
Expand All @@ -12,32 +13,22 @@

if [ -z "$1" ] || [ -z "$2" ]
then
echo './bin/deploy RELEASE_NAME NAMESPACE'
echo './bin/helm_deploy RELEASE_NAME NAMESPACE'
exit 1
fi
release_name="${1}"
namespace="${2}"

CHART_VERSION="${CHART_VERSION:-2.0.0}"

DEPLOY_IMAGE="${DEPLOY_IMAGE:-ghcr.io/samvera/hyku}"
WORKER_IMAGE="${WORKER_IMAGE:-ghcr.io/samvera/hyku/worker}"
DEPLOY_TAG="${DEPLOY_TAG:-latest}"
WORKER_TAG="${WORKER_TAG:-$DEPLOY_TAG}"
echo $DEPLOY_TAG
CHART_VERSION="${CHART_VERSION:-3.5.0}"

helm pull --untar oci://ghcr.io/samvera/charts/hyrax --version $CHART_VERSION
helm repo update
HELM_EXPERIMENTAL_OCI=1 helm dependency update hyrax

helm upgrade \
--install \
--atomic \
--timeout 15m0s \
--set image.repository="$DEPLOY_IMAGE" \
--set image.tag="$DEPLOY_TAG" \
--set worker.image.repository="$WORKER_IMAGE" \
--set worker.image.tag="$DEPLOY_TAG" \
$HELM_EXTRA_ARGS \
--timeout 25m0s \
--values ops/test-deploy.yaml \
--namespace="$namespace" \
--create-namespace \
"$release_name" \
Expand Down
20 changes: 12 additions & 8 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,8 @@ x-app: &app
context: .
target: hyku-web
cache_from:
- ghcr.io/samvera/hyku/base:${TAG:-latest}
- ghcr.io/samvera/hyku:${TAG:-latest}
image: ghcr.io/samvera/hyku:${TAG:-latest}
- ghcr.io/scientist-softserv/softserv-training-workshops-2023:${TAG:-latest}
image: ghcr.io/scientist-softserv/softserv-training-workshops-2023:${TAG:-latest}
user: ${CONTAINER_UID}:${CONTAINER_GID}
env_file:
- .env
Expand Down Expand Up @@ -54,9 +53,11 @@ services:
timeout: "8s"

solr:
image: ghcr.io/samvera/hyku/solr:${TAG:-latest}
platform: 'linux/amd64'
image: ghcr.io/scientist-softserv/softserv-training-workshops-2023/solr:${TAG:-latest}
build:
context: solr
target: hyku-solr
dockerfile: Dockerfile
environment:
- OOM=script
Expand Down Expand Up @@ -123,13 +124,15 @@ services:
# Used exclusively for building and caching the base image to reduce build times
base:
<<: *app
image: ghcr.io/samvera/hyku/base:${TAG:-latest}
platform: 'linux/amd64'
image: ghcr.io/scientist-softserv/softserv-training-workshops-2023/base:${TAG:-latest}
build:
context: .
target: hyku-base

web:
<<: *app
platform: 'linux/amd64'
# Uncomment command to access container with out starting Rails. Useful for debugging
# command: sleep infinity
environment:
Expand Down Expand Up @@ -159,13 +162,14 @@ services:

worker:
<<: *app
image: ghcr.io/samvera/hyku/worker:${TAG:-latest}
platform: 'linux/amd64'
image: ghcr.io/scientist-softserv/softserv-training-workshops-2023/worker:${TAG:-latest}
build:
context: .
target: hyku-worker
cache_from:
- ghcr.io/samvera/hyku:${TAG:-latest}
- ghcr.io/samvera/hyku/worker:${TAG:-latest}
- ghcr.io/scientist-softserv/softserv-training-workshops-2023:${TAG:-latest}
- ghcr.io/scientist-softserv/softserv-training-workshops-2023/worker:${TAG:-latest}
command: bundle exec sidekiq
depends_on:
check_volumes:
Expand Down
Loading