Skip to content

Commit 869be5f

Browse files
authored
Merge branch 'main' into rhdh1.4-dynamic-plugins-versions-update
2 parents e2d8c77 + da9c986 commit 869be5f

File tree

57 files changed

+663
-430
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+663
-430
lines changed

.github/actions/docker-build/action.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2023 The Janus IDP Authors
1+
# Copyright Red Hat, Inc.
22
#
33
# Licensed under the Apache License, Version 2.0 (the "License");
44
# you may not use this file except in compliance with the License.

.github/workflows/next-build-image.yaml

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2023 The Janus IDP Authors
1+
# Copyright Red Hat, Inc.
22
#
33
# Licensed under the Apache License, Version 2.0 (the "License");
44
# you may not use this file except in compliance with the License.
@@ -55,9 +55,9 @@ jobs:
5555
uses: ./.github/actions/docker-build
5656
with:
5757
registry: ${{ env.REGISTRY }}
58-
username: ${{ vars.QUAY_USERNAME }}
58+
username: ${{ secrets.QUAY_USERNAME }}
5959
password: ${{ secrets.QUAY_TOKEN }}
60-
imageName: ${{ github.repository }}
60+
imageName: rhdh-community/rhdh
6161
imageTags: |
6262
type=raw,value=next
6363
type=sha,prefix=next-

.github/workflows/pr-build-image.yaml

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2023 The Janus IDP Authors
1+
# Copyright Red Hat, Inc.
22
#
33
# Licensed under the Apache License, Version 2.0 (the "License");
44
# you may not use this file except in compliance with the License.
@@ -45,7 +45,7 @@ jobs:
4545

4646
- name: Get the latest commits from base branch
4747
run: |
48-
git remote add base-origin https://github.com/janus-idp/backstage-showcase || true
48+
git remote add base-origin https://github.com/${{ github.repository }} || true
4949
git config user.name "${{ github.event.pull_request.user.login }}"
5050
git config user.email "${{ github.event.pull_request.user.email }}"
5151
echo "Updating PR with latest commits from ${{ github.event.pull_request.base.ref }} ..."
@@ -67,9 +67,9 @@ jobs:
6767
uses: ./.github/actions/docker-build
6868
with:
6969
registry: ${{ env.REGISTRY }}
70-
username: ${{ vars.QUAY_USERNAME }}
70+
username: ${{ secrets.QUAY_USERNAME }}
7171
password: ${{ secrets.QUAY_TOKEN }}
72-
imageName: ${{ github.repository }}
72+
imageName: rhdh-community/rhdh
7373
imageTags: |
7474
type=ref,prefix=pr-,event=pr
7575
type=ref,prefix=pr-,suffix=-${{ env.SHORT_SHA }},event=pr
@@ -85,5 +85,5 @@ jobs:
8585
issue_number: context.issue.number,
8686
owner: context.repo.owner,
8787
repo: context.repo.repo,
88-
body: 'The image is available at:\n* [`quay.io/${{ github.repository }}:pr-${{ github.event.number }}`](https://quay.io/${{ github.repository }}:pr-${{ github.event.number }}) or\n* [`quay.io/${{ github.repository }}:pr-${{ github.event.number }}-${{ env.SHORT_SHA }}`](https://quay.io/${{ github.repository }}:pr-${{ github.event.number }}-${{ env.SHORT_SHA }})'
88+
body: 'The image is available at:\n* [`quay.io/rhdh-community/rhdh:pr-${{ github.event.number }}`](https://quay.io/rhdh-community/rhdh:pr-${{ github.event.number }}) or\n* [`quay.io/rhdh-community/rhdh:pr-${{ github.event.number }}-${{ env.SHORT_SHA }}`](https://quay.io/rhdh-community/rhdh:pr-${{ github.event.number }}-${{ env.SHORT_SHA }})'
8989
})

.github/workflows/pr.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2023-2024 The Janus IDP Authors
1+
# Copyright Red Hat, Inc.
22
#
33
# Licensed under the Apache License, Version 2.0 (the "License");
44
# you may not use this file except in compliance with the License.

.github/workflows/techdocs.yaml

-80
This file was deleted.

.github/workflows/update-backstage.yaml

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2024 The Janus IDP Authors
1+
# Copyright Red Hat, Inc.
22
#
33
# Licensed under the Apache License, Version 2.0 (the "License");
44
# you may not use this file except in compliance with the License.
@@ -46,8 +46,8 @@ jobs:
4646
id: generate-token
4747
uses: actions/create-github-app-token@5d869da34e18e7287c1daad50e0b8ea0f506ce69 # v1.11.0
4848
with:
49-
app-id: ${{ vars.JANUS_IDP_GITHUB_APP_ID }}
50-
private-key: ${{ secrets.JANUS_IDP_GITHUB_APP_PRIVATE_KEY }}
49+
app-id: ${{ secrets.RHDH_GITHUB_APP_ID }}
50+
private-key: ${{ secrets.RHDH_GITHUB_APP_PRIVATE_KEY }}
5151

5252
- name: Checkout
5353
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4

.github/workflows/versioned-build-image.yaml

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2023 The Janus IDP Authors
1+
# Copyright Red Hat, Inc.
22
#
33
# Licensed under the Apache License, Version 2.0 (the "License");
44
# you may not use this file except in compliance with the License.
@@ -12,7 +12,7 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
# on push of a tag, trigger a container build for that tag and push to http://quay.io/janus-idp/backstage-showcase
15+
# on push of a tag, trigger a container build for that tag and push to http://quay.io/rhdh-community/rhdh
1616
name: Versioned
1717

1818
on:
@@ -57,9 +57,9 @@ jobs:
5757
uses: ./.github/actions/docker-build
5858
with:
5959
registry: ${{ env.REGISTRY }}
60-
username: ${{ vars.QUAY_USERNAME }}
60+
username: ${{ secrets.QUAY_USERNAME }}
6161
password: ${{ secrets.QUAY_TOKEN }}
62-
imageName: ${{ github.repository }}
62+
imageName: rhdh-community/rhdh
6363
imageTags: |
6464
type=raw,value=latest,enable=${{ env.is_latest }}
6565
type=semver,pattern={{version}}

.ibm/pipelines/README.md

+109
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,112 @@
1+
# OCP Ephemeral Environment
2+
3+
## Overview
4+
5+
The RHDH deployment for end-to-end (e2e) tests in CI has been updated to use **ephemeral clusters** on OpenShift Container Platform (OCP) instead of persistent clusters.
6+
7+
### Key Updates
8+
- Starting from version **1.5**, ephemeral clusters are used for:
9+
- OCP nightly jobs (v4.17, v4.16, and v4.14).
10+
- PR checks on the main branch.
11+
- Previously, RHDH PR checks utilized persistent clusters created on IBM Cloud.
12+
- Now, ephemeral clusters are provisioned using the **OpenShift CI cluster claim** on AWS via the RHDH-QE account in the `us-east-2` region.
13+
14+
---
15+
16+
## Access Requirements
17+
18+
To access ephemeral clusters, you must:
19+
1. Be a **Cluster Pool Admin**.
20+
2. Join the **Rover Group**: [rhdh-pool-admins](https://rover.redhat.com/groups/group/rhdh-pool-admins).
21+
22+
---
23+
24+
## Cluster Pools
25+
26+
The following cluster pools are available for different OCP versions:
27+
28+
- **RHDH-4-17-US-EAST-2**
29+
- Usage: PR checks on the main branch and OCP v4.17 nightly jobs.
30+
- [Cluster Pool Configuration](https://github.com/openshift/release/blob/master/clusters/hosted-mgmt/hive/pools/rhdh/rhdh-ocp-4-17-0-amd64-aws-us-east-2_clusterpool.yaml).
31+
32+
- **RHDH-4-16-US-EAST-2**
33+
- Usage: OCP v4.16 nightly jobs.
34+
- [Cluster Pool Configuration](https://github.com/openshift/release/blob/master/clusters/hosted-mgmt/hive/pools/rhdh/rhdh-ocp-4-16-0-amd64-aws-us-east-2_clusterpool.yaml).
35+
36+
- **RHDH-4-15-US-EAST-2**
37+
- Usage: OCP v4.15 nightly jobs.
38+
- [Cluster Pool Configuration](https://github.com/openshift/release/blob/master/clusters/hosted-mgmt/hive/pools/rhdh/rhdh-ocp-4-15-0-amd64-aws-us-east-2_clusterpool.yaml).
39+
40+
---
41+
42+
## Using Cluster Claims in OpenShift CI Jobs
43+
44+
Ephemeral clusters can be utilized in CI jobs by defining a `cluster_claim` stanza with values matching the labels on the pool.
45+
Additionally, include the workflow: `generic-claim` for setup and cleanup.
46+
47+
### Example Configuration
48+
49+
```yaml
50+
- as: e2e-tests-nightly
51+
cluster_claim:
52+
architecture: amd64
53+
cloud: aws
54+
labels:
55+
region: us-east-2
56+
owner: rhdh
57+
product: ocp
58+
timeout: 1h0m0s
59+
version: "4.17"
60+
cron: 0 7 * * *
61+
steps:
62+
test:
63+
- ref: janus-idp-backstage-showcase-nightly
64+
workflow: generic-claim
65+
```
66+
67+
68+
69+
## Debugging
70+
71+
If you are a member of the ```rhdh-pool-admins``` group, you can use the [.ibm/pipelines/ocp-cluster-claim-login.sh](ocp-cluster-claim-login.sh) script to log in and retrieve ephemeral environment credentials.
72+
73+
### Steps:
74+
75+
1. Run the script:
76+
```bash
77+
.ibm/pipelines/ocp-cluster-claim-login.sh
78+
```
79+
2. Provide the Prow log URL when prompted, for example: ```https://prow.ci.openshift.org/view/gs/test-platform-results/pr-logs/pull/janus-idp_backstage-showcase/2089/pull-ci-janus-idp-backstage-showcase-main-e2e-tests/1866766753132974080 ```
80+
3. The script will:
81+
- Log in to the hosted-mgmt cluster, which manages ephemeral cluster creation.
82+
- Retrieve admin credentials and log in to the ephemeral cluster.
83+
- Prompt to open the OCP web console directly in the browser.
84+
4. Note:
85+
- The ephemeral cluster is deleted as soon as the CI job terminates.
86+
- To retain the cluster for a longer duration, add a sleep command in the [openshift-ci-tests.sh](openshift-ci-tests.sh) script, e.g.:
87+
```bash
88+
...
89+
echo "Main script completed with result: ${OVERALL_RESULT}"
90+
sleep 60*60
91+
exit "${OVERALL_RESULT}"
92+
...
93+
```
94+
95+
### For detailed documentation, refer to: [Openshift-ci cluster claim docs](https://docs.ci.openshift.org/docs/how-tos/cluster-claim/)
96+
97+
98+
## Keycloak Authentication for Tests
99+
- All tests on the main branch use Keycloak as the default authentication provider.
100+
- Keycloak is deployed on the pr-os cluster.
101+
### Keycloak Instance Details:
102+
- URL: [Keycloak Admin Console](https://keycloak-rhsso.rhdh-pr-os-a9805650830b22c3aee243e51d79565d-0000.us-east.containers.appdomain.cloud/auth/admin/master/console/#/realms/rhdh-login-test)
103+
- Credentials: These can be found in the RHDH-QE Vault under the following keys:
104+
- ```KEYCLOAK_AUTH_BASE_URL```
105+
- ```KEYCLOAK_AUTH_CLIENTID```
106+
- ```KEYCLOAK_AUTH_CLIENT_SECRET```
107+
- ```KEYCLOAK_AUTH_LOGIN_REALM```
108+
- ```KEYCLOAK_AUTH_REALM```
109+
1110
# Installation Instructions for Tests
2111

3112
For tests dependent on `backstage-community-plugin-ocm-backend-dynamic` and `backstage-community-plugin-ocm`, it's necessary to install **Advanced Cluster Management for Kubernetes "MultiClusterHub"**.

.ibm/pipelines/jobs/aks.sh

+18-15
Original file line numberDiff line numberDiff line change
@@ -4,25 +4,30 @@ handle_aks() {
44
echo "Starting AKS deployment"
55
for file in ${DIR}/cluster/aks/*.sh; do source $file; done
66

7-
export K8S_CLUSTER_TOKEN=$(cat /tmp/secrets/AKS_CLUSTER_TOKEN)
8-
export K8S_CLUSTER_TOKEN_ENCODED=$(printf "%s" $K8S_CLUSTER_TOKEN | base64 | tr -d '\n')
9-
export K8S_SERVICE_ACCOUNT_TOKEN=$K8S_CLUSTER_TOKEN_ENCODED
10-
export OCM_CLUSTER_TOKEN=$K8S_CLUSTER_TOKEN_ENCODED
11-
127
export K8S_CLUSTER_ROUTER_BASE=$AKS_INSTANCE_DOMAIN_NAME
138
export NAME_SPACE_K8S="showcase-k8s-ci-nightly"
149
export NAME_SPACE_RBAC_K8S="showcase-rbac-k8s-ci-nightly"
1510

1611
url="https://${K8S_CLUSTER_ROUTER_BASE}"
1712

18-
az_login
19-
az_aks_start "${AKS_NIGHTLY_CLUSTER_NAME}" "${AKS_NIGHTLY_CLUSTER_RESOURCEGROUP}"
20-
az_aks_approuting_enable "${AKS_NIGHTLY_CLUSTER_NAME}" "${AKS_NIGHTLY_CLUSTER_RESOURCEGROUP}"
21-
az_aks_get_credentials "${AKS_NIGHTLY_CLUSTER_NAME}" "${AKS_NIGHTLY_CLUSTER_RESOURCEGROUP}"
22-
23-
export K8S_CLUSTER_URL=$(oc whoami --show-server)
24-
export K8S_CLUSTER_API_SERVER_URL=$(printf "%s" "$K8S_CLUSTER_URL" | base64 | tr -d '\n')
25-
export OCM_CLUSTER_URL=$(printf "%s" "$K8S_CLUSTER_URL" | base64 | tr -d '\n')
13+
if kubectl auth whoami > /dev/null 2>&1; then
14+
echo "Using an ephemeral AKS cluster."
15+
else
16+
echo "Falling back to a long-running AKS cluster."
17+
export K8S_CLUSTER_TOKEN=$(cat /tmp/secrets/AKS_CLUSTER_TOKEN)
18+
export K8S_CLUSTER_TOKEN_ENCODED=$(printf "%s" $K8S_CLUSTER_TOKEN | base64 | tr -d '\n')
19+
export K8S_SERVICE_ACCOUNT_TOKEN=$K8S_CLUSTER_TOKEN_ENCODED
20+
export OCM_CLUSTER_TOKEN=$K8S_CLUSTER_TOKEN_ENCODED
21+
22+
az_login
23+
az_aks_start "${AKS_NIGHTLY_CLUSTER_NAME}" "${AKS_NIGHTLY_CLUSTER_RESOURCEGROUP}"
24+
az_aks_approuting_enable "${AKS_NIGHTLY_CLUSTER_NAME}" "${AKS_NIGHTLY_CLUSTER_RESOURCEGROUP}"
25+
az_aks_get_credentials "${AKS_NIGHTLY_CLUSTER_NAME}" "${AKS_NIGHTLY_CLUSTER_RESOURCEGROUP}"
26+
27+
export K8S_CLUSTER_URL=$(oc whoami --show-server)
28+
export K8S_CLUSTER_API_SERVER_URL=$(printf "%s" "$K8S_CLUSTER_URL" | base64 | tr -d '\n')
29+
export OCM_CLUSTER_URL=$(printf "%s" "$K8S_CLUSTER_URL" | base64 | tr -d '\n')
30+
fi
2631

2732
initiate_aks_deployment
2833
check_and_test "${RELEASE_NAME}" "${NAME_SPACE_K8S}" "${url}"
@@ -32,5 +37,3 @@ handle_aks() {
3237
check_and_test "${RELEASE_NAME_RBAC}" "${NAME_SPACE_RBAC_K8S}" "${rbac_rhdh_base_url}"
3338
delete_namespace "${NAME_SPACE_RBAC_K8S}"
3439
}
35-
36-

.ibm/pipelines/jobs/operator.sh

+1-5
Original file line numberDiff line numberDiff line change
@@ -56,15 +56,11 @@ initiate_operator_deployments() {
5656
handle_operator() {
5757
oc_login
5858

59-
API_SERVER_URL=$(oc whoami --show-server)
60-
ENCODED_API_SERVER_URL=$(echo "${API_SERVER_URL}" | base64)
61-
ENCODED_CLUSTER_NAME=$(echo "my-cluster" | base64)
62-
6359
export K8S_CLUSTER_ROUTER_BASE=$(oc get route console -n openshift-console -o=jsonpath='{.spec.host}' | sed 's/^[^.]*\.//')
6460
local url="https://backstage-${RELEASE_NAME}-${NAME_SPACE}.${K8S_CLUSTER_ROUTER_BASE}"
6561
local rbac_url="https://backstage-${RELEASE_NAME_RBAC}-${NAME_SPACE_RBAC}.${K8S_CLUSTER_ROUTER_BASE}"
6662

67-
cluster_setup
63+
cluster_setup_operator
6864
initiate_operator_deployments
6965
check_and_test "${RELEASE_NAME}" "${NAME_SPACE}" "${url}"
7066
check_and_test "${RELEASE_NAME_RBAC}" "${NAME_SPACE_RBAC}" "${rbac_url}"

.ibm/pipelines/resources/cluster_role_binding/cluster-role-binding-ocm.yaml

-3
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,3 @@ subjects:
1616
- kind: ServiceAccount
1717
name: rhdh-k8s-plugin
1818
namespace: showcase-operator-nightly
19-
- kind: ServiceAccount
20-
name: rhdh-k8s-plugin
21-
namespace: showcase-op-rbac-nightly

.ibm/pipelines/resources/config_map/app-config-rhdh-rbac.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ catalog:
7676
- allow: [API, Component, Group, Location, Resource, System, Template]
7777
locations:
7878
- type: url
79-
target: https://github.com/janus-idp/backstage-showcase/blob/main/catalog-entities/all.yaml
79+
target: https://github.com/redhat-developer/rhdh/blob/main/catalog-entities/all.yaml
8080
- type: url
8181
target: https://github.com/redhat-developer/red-hat-developer-hub-software-templates/blob/main/templates.yaml
8282
- type: url

.ibm/pipelines/resources/config_map/app-config-rhdh.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ catalog:
107107
- allow: [API, Component, Group, Location, Resource, System, Template]
108108
locations:
109109
- type: url
110-
target: https://github.com/janus-idp/backstage-showcase/blob/main/catalog-entities/all.yaml
110+
target: https://github.com/redhat-developer/rhdh/blob/main/catalog-entities/all.yaml
111111
- type: url
112112
target: https://github.com/redhat-developer/red-hat-developer-hub-software-templates/blob/main/templates.yaml
113113
- type: url

0 commit comments

Comments
 (0)