Skip to content

Commit

Permalink
fix(RHIDP-4076): Migrate framework to RHDH v1.3 (#89)
Browse files Browse the repository at this point in the history
* fix(RHIDP-4076): Update backstage CR to v1alpha2

Signed-off-by: Pavel Macík <[email protected]>

* fix(RHIDP-4076): Fix helm chart for v1.3

Signed-off-by: Pavel Macík <[email protected]>

* fix(RHIDP-4076): update helm and catalog images for 1.3

Signed-off-by: Pavel Macík <[email protected]>

* allow for overriding keycloak repicas

Signed-off-by: Pavel Macík <[email protected]>

---------

Signed-off-by: Pavel Macík <[email protected]>
  • Loading branch information
pmacik authored Sep 25, 2024
1 parent f1b6a18 commit 29d2387
Show file tree
Hide file tree
Showing 7 changed files with 85 additions and 19 deletions.
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,14 @@ export RHDH_IMAGE_TAG ?=

# RHDH Helm chart to deploy
export RHDH_NAMESPACE ?= rhdh-performance
export RHDH_HELM_REPO ?= https://raw.githubusercontent.com/rhdh-bot/openshift-helm-charts/rhdh-1.2-rhel-9/installation
export RHDH_HELM_REPO ?= https://raw.githubusercontent.com/rhdh-bot/openshift-helm-charts/rhdh-1.3-rhel-9/installation
export RHDH_HELM_CHART ?= redhat-developer-hub
export RHDH_HELM_CHART_VERSION ?=
export RHDH_HELM_RELEASE_NAME ?= rhdh

# RHDH OLM subscription to deploy
export RHDH_OLM_INDEX_IMAGE ?= registry.redhat.io/redhat/redhat-operator-index:v$(shell oc version -o json | jq -r '.openshiftVersion' | sed -r -e "s,([0-9]+\.[0-9]+)\..+,\1,")
export RHDH_OLM_CHANNEL ?= fast-1.2
export RHDH_OLM_INDEX_IMAGE ?= quay.io/rhdh/iib:1.3-v$(shell oc version -o json | jq -r '.openshiftVersion' | sed -r -e "s,([0-9]+\.[0-9]+)\..+,\1,")-x86_64
export RHDH_OLM_CHANNEL ?= fast

# RHDH horizontal scaling
export RHDH_DEPLOYMENT_REPLICAS ?= 1
Expand Down
11 changes: 6 additions & 5 deletions ci-scripts/rhdh-setup/deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,13 @@ export RHDH_IMAGE_REGISTRY=${RHDH_IMAGE_REGISTRY:-}
export RHDH_IMAGE_REPO=${RHDH_IMAGE_REPO:-}
export RHDH_IMAGE_TAG=${RHDH_IMAGE_TAG:-}

export RHDH_HELM_REPO=${RHDH_HELM_REPO:-https://raw.githubusercontent.com/rhdh-bot/openshift-helm-charts/rhdh-1.2-rhel-9/installation}
export RHDH_HELM_REPO=${RHDH_HELM_REPO:-https://raw.githubusercontent.com/rhdh-bot/openshift-helm-charts/rhdh-1.3-rhel-9/installation}
export RHDH_HELM_CHART=${RHDH_HELM_CHART:-redhat-developer-hub}
export RHDH_HELM_CHART_VERSION=${RHDH_HELM_CHART_VERSION:-}

OCP_VER="$(oc version -o json | jq -r '.openshiftVersion' | sed -r -e "s#([0-9]+\.[0-9]+)\..+#\1#")"
#OCP_ARCH="$(oc version -o json | jq -r '.serverVersion.platform' | sed -r -e "s#linux/##" | sed -e 's#amd64#x86_64#')"
export RHDH_OLM_INDEX_IMAGE="${RHDH_OLM_INDEX_IMAGE:-registry.redhat.io/redhat/redhat-operator-index:v${OCP_VER}}"
export RHDH_OLM_CHANNEL=${RHDH_OLM_CHANNEL:-fast-1.2}
export RHDH_OLM_INDEX_IMAGE="${RHDH_OLM_INDEX_IMAGE:-quay.io/rhdh/iib:1.3-v${OCP_VER}-x86_64}"
export RHDH_OLM_CHANNEL=${RHDH_OLM_CHANNEL:-fast}
export RHDH_OLM_OPERATOR_PACKAGE=${RHDH_OLM_OPERATOR_PACKAGE:-rhdh}

export PRE_LOAD_DB="${PRE_LOAD_DB:-true}"
Expand Down Expand Up @@ -259,7 +258,9 @@ install_rhdh_with_helm() {
cp "$chart_values" "$TMP_DIR/chart-values.temp.yaml"
if [ "${AUTH_PROVIDER}" == "keycloak" ]; then yq -i '.upstream.backstage |= . + load("template/backstage/helm/oauth2-container-patch.yaml")' "$TMP_DIR/chart-values.temp.yaml"; fi
if ${ENABLE_RBAC}; then
if helm search repo --devel -r rhdh --version 1.2-1 --fail-on-no-result; then
if helm search repo --devel -r rhdh --version 1.3-1 --fail-on-no-result; then
yq -i '.upstream.backstage |= . + load("template/backstage/helm/extravolume-patch-1.3.yaml")' "$TMP_DIR/chart-values.temp.yaml"
elif helm search repo --devel -r rhdh --version 1.2-1 --fail-on-no-result; then
yq -i '.upstream.backstage |= . + load("template/backstage/helm/extravolume-patch-1.2.yaml")' "$TMP_DIR/chart-values.temp.yaml"
else
yq -i '.upstream.backstage |= . + load("template/backstage/helm/extravolume-patch-1.1.yaml")' "$TMP_DIR/chart-values.temp.yaml"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ upstream:
backstage:
appConfig:
app:
baseUrl: 'https://{{- include "janus-idp.hostname" . }}'
baseUrl: "https://${RHDH_HELM_RELEASE_NAME}-${RHDH_HELM_CHART}-${RHDH_NAMESPACE}.${OPENSHIFT_APP_DOMAIN}"
backend:
baseUrl: 'https://{{- include "janus-idp.hostname" . }}'
baseUrl: "https://${RHDH_HELM_RELEASE_NAME}-${RHDH_HELM_CHART}-${RHDH_NAMESPACE}.${OPENSHIFT_APP_DOMAIN}"
cors:
origin: 'https://{{- include "janus-idp.hostname" . }}'
origin: "https://${RHDH_HELM_RELEASE_NAME}-${RHDH_HELM_CHART}-${RHDH_NAMESPACE}.${OPENSHIFT_APP_DOMAIN}"
database:
connection:
password: "${POSTGRESQL_ADMIN_PASSWORD}"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
---
extraVolumeMounts:
- name: dynamic-plugins-root
mountPath: /opt/app-root/src/dynamic-plugins-root
- name: diststatic
mountPath: /opt/app-root/src/packages/app/dist/static
- name: rbac-policy
mountPath: /opt/app-root/src/rbac
extraVolumes:
- name: dynamic-plugins-root
ephemeral:
volumeClaimTemplate:
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
# -- Size of the volume that will contain the dynamic plugins. It should be large enough to contain all the plugins.
storage: 2Gi
- name: dynamic-plugins
configMap:
defaultMode: 420
name: '{{ printf "%s-dynamic-plugins" .Release.Name }}'
optional: true
- name: rbac-policy
configMap:
defaultMode: 420
name: rbac-policy
- name: dynamic-plugins-npmrc
secret:
defaultMode: 420
optional: true
secretName: dynamic-plugins-npmrc
- name: npmcacache
emptyDir: {}
- name: diststatic
emptyDir: {}
initContainers:
- name: install-dynamic-plugins
image: '{{ include "backstage.image" . }}'
command:
- ./install-dynamic-plugins.sh
- /dynamic-plugins-root
env:
- name: NPM_CONFIG_USERCONFIG
value: /opt/app-root/src/.npmrc.dynamic-plugins
imagePullPolicy: Always
volumeMounts:
- mountPath: /dynamic-plugins-root
name: dynamic-plugins-root
- mountPath: /opt/app-root/src/dynamic-plugins.yaml
name: dynamic-plugins
readOnly: true
subPath: dynamic-plugins.yaml
- mountPath: /opt/app-root/src/.npmrc.dynamic-plugins
name: dynamic-plugins-npmrc
readOnly: true
subPath: .npmrc
- mountPath: /opt/app-root/src/.npm/_cacache
name: npmcacache
workingDir: /opt/app-root/src
12 changes: 8 additions & 4 deletions ci-scripts/rhdh-setup/template/backstage/olm/backstage.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
apiVersion: rhdh.redhat.com/v1alpha1
apiVersion: rhdh.redhat.com/v1alpha2
kind: Backstage
metadata:
name: developer-hub
Expand Down Expand Up @@ -34,10 +34,14 @@ spec:
name: keycloak-client-secret-backstage
- key: BACKEND_SECRET
name: rhdh-backend-secret
replicas: ${RHDH_DEPLOYMENT_REPLICAS}
route:
enabled: true
database:
enableLocalDb: true
imagePullSecrets:
- rhdh-pull-secret
deployment:
spec:
replicas: ${RHDH_DEPLOYMENT_REPLICAS}
template:
spec:
imagePullSecrets:
- rhdh-pull-secret
2 changes: 1 addition & 1 deletion ci-scripts/scalability/test-scalability.sh
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ for w in "${workers[@]}"; do
export RHDH_RESOURCES_CPU_LIMITS="$cl"
export RHDH_RESOURCES_MEMORY_REQUESTS="$mr"
export RHDH_RESOURCES_MEMORY_LIMITS="$ml"
export RHDH_KEYCLOAK_REPLICAS=$r
export RHDH_KEYCLOAK_REPLICAS="${RHDH_KEYCLOAK_REPLICAS:-$r}"
export BACKSTAGE_USER_COUNT=$bu
export GROUP_COUNT=$bg
export WORKERS=$w
Expand Down
6 changes: 3 additions & 3 deletions test.env
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
## RHDH installed via Helm
# export RHDH_INSTALL_METHOD=helm
# export RHDH_NAMESPACE=rhdh-performance-helm
# export RHDH_HELM_REPO=https://raw.githubusercontent.com/rhdh-bot/openshift-helm-charts/rhdh-1.2-rhel-9/installation
# export RHDH_HELM_REPO=https://raw.githubusercontent.com/rhdh-bot/openshift-helm-charts/rhdh-1.3-rhel-9/installation
# export RHDH_HELM_CHART=redhat-developer-hub
# export RHDH_HELM_CHART_VERSION=
# export RHDH_HELM_RELEASE_NAME=rhdh
Expand All @@ -38,8 +38,8 @@
# export RHDH_INSTALL_METHOD=olm
# export RHDH_NAMESPACE=rhdh-performance-olm
# export RHDH_OPERATOR_NAMESPACE=rhdh-operator
# export RHDH_OLM_INDEX_IMAGE=registry.redhat.io/redhat/redhat-operator-index:v4.15
# export RHDH_OLM_CHANNEL=fast-1.2
# export RHDH_OLM_INDEX_IMAGE=quay.io/rhdh/iib:1.3-v4.15-x86_64
# export RHDH_OLM_CHANNEL=fast

## RHDH horizontal scaling
# export RHDH_DEPLOYMENT_REPLICAS=1
Expand Down

0 comments on commit 29d2387

Please sign in to comment.