Skip to content

Commit

Permalink
Merge pull request #61 from masayag/rhdh-operator
Browse files Browse the repository at this point in the history
Use backstage-operator to install backstage
  • Loading branch information
masayag committed Feb 20, 2024
2 parents cc27145 + 6e3f5e0 commit 0771364
Show file tree
Hide file tree
Showing 11 changed files with 4,233 additions and 19,789 deletions.
53 changes: 39 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,21 +49,17 @@ Build helm dependency and create a new project for the installation:
```console
git clone git@github.com:parodos-dev/orchestrator-helm-chart.git
cd orchestrator-helm-chart/charts
helm dep update orchestrator
oc new-project orchestrator
```

Install the chart (expects DB configuration to be provided), set value for $GITHUB_TOKEN:
```console
$ helm install orchestrator orchestrator \
--set "backstage.upstream.backstage.appConfig.integrations.github[0].host"=github.com \
--set "backstage.upstream.backstage.appConfig.integrations.github[0].token"=$GITHUB_TOKEN
$ helm install orchestrator orchestrator --set rhdhOperator.github.token=$GITHUB_TOKEN
```
or install sonataflow services in ephemeral mode for evaluation purpose:
```console
$ helm install orchestrator orchestrator --set orchestrator.devmode=true \
--set "backstage.upstream.backstage.appConfig.integrations.github[0].host"=github.com \
--set "backstage.upstream.backstage.appConfig.integrations.github[0].token"=$GITHUB_TOKEN
--set rhdhOperator.github.token=$GITHUB_TOKEN
```

A sample output:
Expand All @@ -77,8 +73,8 @@ USER-SUPPLIED VALUES:
Components Installed Namespace
====================================================================
Backstage YES orchestrator
Postgres DB - Backstage YES orchestrator
Backstage YES backstage-system
Postgres DB - Backstage NO backstage-system
Red Hat Serverless Operator YES openshift-serverless
KnativeServing YES knative-serving
KnativeEventing YES knative-eventing
Expand All @@ -97,8 +93,9 @@ Run the following commands to wait until the services are ready:
oc wait -n openshift-operators deploy/sonataflow-operator-controller-manager --for=condition=Available --timeout=5m
oc wait -n sonataflow-infra deploy/sonataflow-platform-data-index-service --for=condition=Available --timeout=5m
oc wait -n sonataflow-infra deploy/sonataflow-platform-jobs-service --for=condition=Available --timeout=5m
oc wait -n orchestrator pod/orchestrator-postgresql-0 --for=condition=Ready --timeout=5m
oc wait -n orchestrator deploy/orchestrator-backstage --for=condition=Available --timeout=5m
oc wait -n backstage-system pod/backstage-psql-backstage-0 --for=condition=Ready --timeout=5m
oc wait -n backstage-system backstage backstage --for=condition=Deployed=True
oc wait -n backstage-system deploy/backstage-backstage --for=condition=Available --timeout=5m
oc wait -n knative-eventing knativeeventing/knative-eventing --for=condition=Ready --timeout=5m
oc wait -n knative-serving knativeserving/knative-serving --for=condition=Ready --timeout=5m
oc wait -n sonataflow-infra sonataflow/greeting --for=condition=Running --timeout=5m
Expand All @@ -107,8 +104,9 @@ deployment.apps/knative-openshift condition met
deployment.apps/sonataflow-operator-controller-manager condition met
deployment.apps/sonataflow-platform-data-index-service condition met
deployment.apps/sonataflow-platform-jobs-service condition met
pod/orchestrator-postgresql-0 condition met
deployment.apps/orchestrator-backstage condition met
pod/backstage-psql-backstage-0 condition met
backstage.rhdh.redhat.com/backstage condition met
deployment.apps/backstage-backstage condition met
knativeeventing.operator.knative.dev/knative-eventing condition met
knativeserving.operator.knative.dev/knative-serving condition met
sonataflow.sonataflow.org/greeting condition met
Expand Down Expand Up @@ -164,6 +162,13 @@ $ helm delete orchestrator
release "orchestrator" uninstalled
```
Note that the CRDs created during the installation process will remain in the cluster.
To clean the rest of the resources, run:
```console
oc delete csv sonataflow-operator.v999.0.0-snapshot -n openshift-operators
oc get crd -o name | grep -e 'sonataflow' -e rhdh | xargs oc delete
oc delete pvc --all -n orchestrator
oc delete ns backstage-system
```

## Development
The [Helm Chart Documentation](./charts/orchestrator/README.md) is generated by the [frigate tool](https://github.com/rapidsai/frigate). After the tool is installed, you can run the following command to re-generate the chart documentation.
Expand All @@ -172,7 +177,27 @@ $ cd charts/orchestrator
$ frigate gen --no-deps . > README.md
```

### Updating plugins version
The Orchestrator includes the orchestrator and the notification plugins.
Overall, there are 4 plugins:
* [notifications](https://github.com/janus-idp/backstage-plugins/tree/main/plugins/notifications) - [@janus-idp/plugin-notifications in npmjs](https://www.npmjs.com/package/@janus-idp/plugin-notifications)
* [notifications-backend](https://github.com/janus-idp/backstage-plugins/tree/main/plugins/notifications-backend) - [@janus-idp/plugin-notifications-backend-dynamic in npmjs](https://www.npmjs.com/package/@janus-idp/plugin-notifications-backend-dynamic)
* [orchestrator](https://github.com/janus-idp/backstage-plugins/tree/main/plugins/orchestrator) - [@janus-idp/backstage-plugin-orchestrator in npmjs](https://www.npmjs.com/package/@janus-idp/backstage-plugin-orchestrator)
* [orchestrator-backend](https://github.com/janus-idp/backstage-plugins/tree/main/plugins/orchestrator-backend) - [@janus-idp/backstage-plugin-orchestrator-backend-dynamic in npmjs](https://www.npmjs.com/package/@janus-idp/backstage-plugin-orchestrator-backend-dynamic)

The plugins are configured by the `dynamic-plugins-rhdh` configmap in [RHDH operator configuraiton](./charts/orchestrator/templates/rhdh-operator.yaml).
To update plugins versions, use the npmjs package name and run the following command:
```console
PLUGIN_NAME=@janus-idp/backstage-plugin-orchestrator-backend-dynamic
curl -s -q https://registry.npmjs.com/${PLUGIN_NAME} | jq -r '.versions | keys_unsorted[-1] as $latest_version | .[$latest_version] | " package: \"\(.name)@\(.version)\"\n integrity: >-\n \(.dist.integrity)"'
```
The expected output should look like:
```console
package: "@janus-idp/backstage-plugin-orchestrator-backend-dynamic@1.3.1"
integrity: >-
sha512-kDbhP8Cq3PJFLJ6bwTRJwllxU71bnH7SkC3I3HqX6K9TVIqSKwyI8MNGYMRHoTlxwHH+4fASmFBPfEtIpMVLTA==
```
It can be pasted directly in the configmap, to override the existing values, in the correct plugins configuration.

## Documentation
See [Helm Chart Documentation](./charts/orchestrator/README.md) for information about the values used by the helm chart.

This helm chart uses the [Janus-IDP backstage helm chart](https://github.com/janus-idp/helm-backstage) as a dependency subchart. See the [chart documentation](https://github.com/janus-idp/helm-backstage/blob/main/charts/backstage/README.md) on how to override its values.
5 changes: 0 additions & 5 deletions charts/orchestrator/Chart.lock
Original file line number Diff line number Diff line change
@@ -1,6 +1 @@
dependencies:
- name: backstage
repository: https://redhat-developer.github.io/rhdh-chart
version: 2.13.3
digest: sha256:6f54e7bba87514fea3c18011c6fe39370af22170e351b5df0787883e9a65efbc
generated: "2024-02-14T10:44:30.976345587+02:00"
7 changes: 1 addition & 6 deletions charts/orchestrator/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ type: application
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 0.1.24
version: 0.1.25

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
Expand All @@ -26,8 +26,3 @@ appVersion: "0.0.1"
# This is an icon to Parodos project. In the future we might design a dedicated logo for the Orchestrator.
# However, since the entire development is done under the Parodos organization, we'll use it.
icon: https://raw.githubusercontent.com/parodos-dev/parodos-dev.github.io/main/assets/images/WO_black.svg

dependencies:
- name: backstage
repository: https://redhat-developer.github.io/rhdh-chart
version: "2.13.3"
28 changes: 12 additions & 16 deletions charts/orchestrator/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ The following table lists the configurable parameters of the Orchestrator chart
| `sonataFlowOperator.subscription.channel` | channel of an operator package to subscribe to | `"alpha"` |
| `sonataFlowOperator.subscription.installPlanApproval` | whether the update should be installed automatically | `"Automatic"` |
| `sonataFlowOperator.subscription.pkgName` | name of the operator package | `"sonataflow-operator"` |
| `sonataFlowOperator.subscription.sourceImage` | catalog image of the development build. Unset it for the release build. | `"quay.io/masayag/kogito-serverless-operator-catalog:v2.0.0-snapshot"` |
| `sonataFlowOperator.subscription.sourceImage` | catalog image of the development build. Unset it for the release build. | `"quay.io/masayag/kogito-serverless-operator-catalog:v999.0.0-snapshot"` |
| `sonataFlowOperator.subscription.sourceNamespace` | namespace of the catalog source | `"openshift-marketplace"` |
| `sonataFlowOperator.subscription.source` | name of the catalog source for the operator | `"sonataflow-operator"` |
| `serverlessOperator.enabled` | whether the operator should be deployed by the chart | `true` |
Expand All @@ -26,27 +26,23 @@ The following table lists the configurable parameters of the Orchestrator chart
| `serverlessOperator.subscription.installPlanApproval` | whether the update should be installed automatically | `"Automatic"` |
| `serverlessOperator.subscription.pkgName` | name of the operator package | `"serverless-operator"` |
| `serverlessOperator.subscription.sourceNamespace` | namespace of the catalog source | `"openshift-marketplace"` |
| `rhdhOperator.enabled` | whether the operator should be deployed by the chart | `true` |
| `rhdhOperator.github.token` | | `""` |
| `rhdhOperator.github.clientId` | | `""` |
| `rhdhOperator.github.clientSecret` | | `""` |
| `rhdhOperator.subscription.namespace` | namespace where the operator should be deployed | `"backstage-system"` |
| `rhdhOperator.subscription.channel` | channel of an operator package to subscribe to | `"alpha"` |
| `rhdhOperator.subscription.installPlanApproval` | whether the update should be installed automatically | `"Automatic"` |
| `rhdhOperator.subscription.pkgName` | name of the operator package | `"backstage-operator"` |
| `rhdhOperator.subscription.sourceImage` | | `"quay.io/janus-idp/operator-catalog:0.1.0"` |
| `rhdhOperator.subscription.sourceNamespace` | namespace of the catalog source | `"openshift-marketplace"` |
| `rhdhOperator.subscription.source` | name of the catalog source for the operator | `"rhdh-operator"` |
| `postgres.serviceName` | The name of the Postgres DB service to be used by dataindex and job service. Cannot be empty. | `"sonataflow-psql-postgresql"` |
| `postgres.serviceNamespace` | The namespace of the Postgres DB service to be used by dataindex and job service. | `"sonataflow-infra"` |
| `postgres.authSecret.name` | name of existing secret to use for PostgreSQL credentials. | `"sonataflow-psql-postgresql"` |
| `postgres.authSecret.userKey` | name of key in existing secret to use for PostgreSQL credentials. | `"postgres-username"` |
| `postgres.authSecret.passwordKey` | name of key in existing secret to use for PostgreSQL credentials. | `"postgres-password"` |
| `postgres.database` | existing database instance used by data index and job service | `"sonataflow"` |
| `backstage.global.dynamic.includes` | | `["dynamic-plugins.default.yaml"]` |
| `backstage.global.dynamic.plugins` | | `[{"disabled": false, "integrity": "sha512-iVywjs0wOSgTFRV0n9k70+vkl92JF6jJaemqkIrooZAix1v8MiklsQe83bRrcASOh6SnQDbTIils+FHAWjV+qQ==", "package": "@janus-idp/backstage-plugin-orchestrator-backend-dynamic@1.0.2", "pluginConfig": {"orchestrator": {"dataIndexService": {"url": "http://sonataflow-platform-data-index-service.sonataflow-infra"}, "editor": {"path": "https://sandbox.kie.org/swf-chrome-extension/0.32.0"}}}}, {"disabled": false, "integrity": "sha512-Lmma6or08EnlM5va95VSz/P9sVbXZTA95kHs9JHjaZfdbcEj7J2oTjYXdKG+fd4yfVdl0tD7/QP9cfYCY98UIg==", "package": "@janus-idp/backstage-plugin-orchestrator@1.1.1", "pluginConfig": {"dynamicPlugins": {"frontend": {"janus-idp.backstage-plugin-orchestrator": {"appIcons": [{"importName": "OrchestratorIcon", "module": "OrchestratorPlugin", "name": "orchestratorIcon"}], "dynamicRoutes": [{"importName": "OrchestratorPage", "menuItem": {"icon": "orchestratorIcon", "text": "Orchestrator"}, "module": "OrchestratorPlugin", "path": "/orchestrator"}]}}}}}]` |
| `backstage.upstream.backstage.image.tag` | | `"next"` |
| `backstage.upstream.backstage.appConfig.integrations.github` | | `[{"host": "github.com", "token": "INSERT VALID TOKEN HERE"}]` |
| `backstage.upstream.backstage.appConfig.auth.environment` | | `"development"` |
| `backstage.upstream.backstage.appConfig.auth.providers.github.development.clientId` | | `"INSERT VALID CLIENT ID HERE"` |
| `backstage.upstream.backstage.appConfig.auth.providers.github.development.clientSecret` | | `"INSERT VALID CLIENT SECRET HERE"` |
| `backstage.upstream.backstage.appConfig.catalog.rules` | | `[{"allow": ["Component", "System", "Group", "Resource", "Location", "Template", "API", "User", "Domain"]}]` |
| `backstage.upstream.backstage.appConfig.catalog.locations` | | `[{"type": "url", "target": "https://github.com/janus-idp/backstage-plugins/blob/main/plugins/notifications-backend/users.yaml"}, {"type": "url", "target": "https://github.com/parodos-dev/workflow-software-templates/blob/main/entities/workflow-resources.yaml"}, {"type": "url", "target": "https://github.com/parodos-dev/workflow-software-templates/blob/main/template/template.yaml"}, {"type": "url", "target": "https://github.com/janus-idp/software-templates/blob/main/showcase-templates.yaml"}]` |
| `backstage.upstream.backstage.appConfig.backend.csp.frame-src` | | `["https://sandbox.kie.org"]` |
| `backstage.upstream.backstage.appConfig.backend.database.client` | | `"pg"` |
| `backstage.upstream.backstage.appConfig.backend.database.connection.password` | | `"${POSTGRESQL_ADMIN_PASSWORD}"` |
| `backstage.upstream.backstage.appConfig.backend.database.connection.user` | | `"postgres"` |
| `backstage.upstream.backstage.appConfig.backend.database.connection.host` | | `"orchestrator-postgresql-hl.orchestrator.svc.cluster.local"` |
| `backstage.upstream.backstage.appConfig.backend.database.connection.port` | | `5432` |
| `orchestrator.devmode` | devmode runs sonataflow services in ephemeral mode (for a non-production use) | `false` |
| `orchestrator.namespace` | namespace where the data index, job service and workflows are deployed | `"sonataflow-infra"` |
| `orchestrator.sonataPlatform.resources.requests.memory` | | `"64Mi"` |
Expand Down
Loading

0 comments on commit 0771364

Please sign in to comment.