community-plugins/workspaces/mta
Ian Bolton 1af9fb39af
feat(mta-plugins): Adds a suite of MTA Plugins (#1147)
* initial commit for adding MTA Plugins
* add changeset
* prettier fixes
* add api report scripts
* add missing report dependencies
* add reports
* package.json updates for api-report resolution
* yarn dedupe
* update yarn lock file
* fixup! API reports
* move to @backstage-community from @internal
* add Release tags
* add app-config.yaml file
* yarn backstage-cli repo fix --publish
* remove placeholder tests
* ensure clean working dir
* yarn install
* yarn lint fixes
* generate report changes
* yarn dedupe
* fix misformatted .gitignore to correctly ignore files
* update git cache post ignore update
* update changeset
* fixup! remove not published packages from changeset

Signed-off-by: Ian Bolton <ibolton@redhat.com>
2024-10-09 22:29:33 +01:00
..
.changeset feat(mta-plugins): Adds a suite of MTA Plugins (#1147) 2024-10-09 22:29:33 +01:00
examples feat(mta-plugins): Adds a suite of MTA Plugins (#1147) 2024-10-09 22:29:33 +01:00
packages feat(mta-plugins): Adds a suite of MTA Plugins (#1147) 2024-10-09 22:29:33 +01:00
plugins feat(mta-plugins): Adds a suite of MTA Plugins (#1147) 2024-10-09 22:29:33 +01:00
.dockerignore feat(mta-plugins): Adds a suite of MTA Plugins (#1147) 2024-10-09 22:29:33 +01:00
.eslintignore feat(mta-plugins): Adds a suite of MTA Plugins (#1147) 2024-10-09 22:29:33 +01:00
.eslintrc.js feat(mta-plugins): Adds a suite of MTA Plugins (#1147) 2024-10-09 22:29:33 +01:00
.gitignore feat(mta-plugins): Adds a suite of MTA Plugins (#1147) 2024-10-09 22:29:33 +01:00
.prettierignore feat(mta-plugins): Adds a suite of MTA Plugins (#1147) 2024-10-09 22:29:33 +01:00
01-stage-dynamic-plugins.sh feat(mta-plugins): Adds a suite of MTA Plugins (#1147) 2024-10-09 22:29:33 +01:00
02-create-plugin-registry.sh feat(mta-plugins): Adds a suite of MTA Plugins (#1147) 2024-10-09 22:29:33 +01:00
README.md feat(mta-plugins): Adds a suite of MTA Plugins (#1147) 2024-10-09 22:29:33 +01:00
app-config-rhdh.example.yaml feat(mta-plugins): Adds a suite of MTA Plugins (#1147) 2024-10-09 22:29:33 +01:00
app-config.local.example.yaml feat(mta-plugins): Adds a suite of MTA Plugins (#1147) 2024-10-09 22:29:33 +01:00
app-config.yaml feat(mta-plugins): Adds a suite of MTA Plugins (#1147) 2024-10-09 22:29:33 +01:00
backstage-operator-cr.yaml feat(mta-plugins): Adds a suite of MTA Plugins (#1147) 2024-10-09 22:29:33 +01:00
backstage.json feat(mta-plugins): Adds a suite of MTA Plugins (#1147) 2024-10-09 22:29:33 +01:00
catalog-info.yaml feat(mta-plugins): Adds a suite of MTA Plugins (#1147) 2024-10-09 22:29:33 +01:00
create-application-template.yaml feat(mta-plugins): Adds a suite of MTA Plugins (#1147) 2024-10-09 22:29:33 +01:00
internal-backstage-plugin-catalog-backend-module-mta-entity-provider-dynamic-0.1.0.tgz feat(mta-plugins): Adds a suite of MTA Plugins (#1147) 2024-10-09 22:29:33 +01:00
internal-backstage-plugin-mta-backend-dynamic-0.1.0.tgz feat(mta-plugins): Adds a suite of MTA Plugins (#1147) 2024-10-09 22:29:33 +01:00
internal-backstage-plugin-mta-frontend-dynamic-0.1.0.tgz feat(mta-plugins): Adds a suite of MTA Plugins (#1147) 2024-10-09 22:29:33 +01:00
internal-backstage-plugin-scaffolder-backend-module-mta-dynamic-0.1.0.tgz feat(mta-plugins): Adds a suite of MTA Plugins (#1147) 2024-10-09 22:29:33 +01:00
lerna.json feat(mta-plugins): Adds a suite of MTA Plugins (#1147) 2024-10-09 22:29:33 +01:00
log-script.sh feat(mta-plugins): Adds a suite of MTA Plugins (#1147) 2024-10-09 22:29:33 +01:00
mta-create-keycloak-client.sh feat(mta-plugins): Adds a suite of MTA Plugins (#1147) 2024-10-09 22:29:33 +01:00
package.json feat(mta-plugins): Adds a suite of MTA Plugins (#1147) 2024-10-09 22:29:33 +01:00
playwright.config.ts feat(mta-plugins): Adds a suite of MTA Plugins (#1147) 2024-10-09 22:29:33 +01:00
rebuild-script.sh feat(mta-plugins): Adds a suite of MTA Plugins (#1147) 2024-10-09 22:29:33 +01:00
tackle-create-keycloak-client.sh feat(mta-plugins): Adds a suite of MTA Plugins (#1147) 2024-10-09 22:29:33 +01:00
tsconfig.json feat(mta-plugins): Adds a suite of MTA Plugins (#1147) 2024-10-09 22:29:33 +01:00
yarn.lock feat(mta-plugins): Adds a suite of MTA Plugins (#1147) 2024-10-09 22:29:33 +01:00

README.md

backstage-mta-plugins

Welcome to the backstage-mta plugin!

These plugins were created through the Backstage CLI

Getting started

There are four plugins available in this repository:

You can also serve each plugin in isolation by running yarn start in each plugins respective directory. This method of serving the plugin provides quicker iteration speed and a faster startup and hot reloads. It is only meant for local development, and the setup for it can be found inside the /dev directory.

Introduction

These plugins are designed to work in unison to provide a means to create and analyze applications in MTA (Migration toolkit for Applications). Within this readme, you will find instructions on how to develop, test, and deploy these plugins.

MTA / Tackle prerequisites

  • To begin, you will need to have an MTA instance running in your cluster. For upstream MTA (Tackle), you can follow the instructions here.

    • Create a Tackle instance in the cluster. This can be done by running the following command:
    kubectl apply -f https://raw.githubusercontent.com/konveyor/tackle2-operator/main/tackle-k8s.yaml
    
    • Once the tackle instance is running, you can create a Tackle CR to configure the tackle instance. You can apply the CR by running the following command:
    cat << EOF | kubectl apply -f -
    kind: Tackle
    apiVersion: tackle.konveyor.io/v1alpha1
    metadata:
    name: tackle
    namespace: konveyor-tackle
    spec:
    feature_auth_required: false
    EOF
    
    • Obtain the URL for the tackle instance by running the following command:
    oc get routes
    

    You will need the URL for the tackle instance to configure the MTA plugin. This URL needs to be added to the app-config configmap here under the mta key. Be sure to add the http:// or https:// prefix to the URL.

  • Additionally, The MTA plugin requires a keycloak instance to authenticate with the MTA instance. This can be created and configured simply by running the Tackle create keycloak script or the MTA create keycloak script. This will create a keycloak client for the MTA instance and provide the necessary configuration for the MTA plugin. The keycloak configuration also needs to be added to the app-config configmap here under the mta key.

RHDH Operator

  • To begin setting up the RHDH operator for local development, you will need to clone the repository from here and follow the instructions in the README.md file. This will allow you to deploy the RHDH operator to your local cluster. You will need to run make deploy after cloning the repo from the project root. This will ensure all CRDs are installed first. Then you will need to create the backstage rhdh CR. An example of the backstage CR can be found here. Note the referenced configmaps in the CR, as they will be needed for the plugins to function correctly.

Configmaps and Secrets

  • Two primary configmaps are required to get the MTA plugin loaded as a dynamic plugin within RHDH:

    • App config - Rename this file to app-config-rhdh.yaml and update the values as needed. This configmap contains the configuration for the backstage instance. The keys are as follows:

      • mta - Contains the configuration for the MTA resources.

        • url - The URL for the MTA instance running in the cluster.
        • providerAuth - The keycloak authentication configuration for the MTA instance.
          • realm - The realm for the keycloak instance.
          • clientId - The client ID for the keycloak instance.A
          • secret - The client secret for the keycloak instance.
      • dynamicPlugins - Contains the configuration for the front end dynamic plugins. More info here

    • Dynamic plugins

      • package - The package name for the plugin.

      • integrity - The integrity hash for the plugin.

      • disabled - Whether the plugin is enabled or not.

      • A script is available for reference here that will package up the plugins into the deploy directory and generate the integrity hashes for the plugins. When the time comes to deploy the plugins, you will also need to create a plugin-registry using the script here. This will create a plugin registry that the RHDH operator will use to deploy the plugins. A detailed end to end guide can be found here

Compile for Dynamic plugin testing

  • Once you have made necessary modification to the configmap and secrets, you can compile the plugin by running the following commands in the plugin directory.
./rebuild-script.sh

This script will:

  • Delete the existing namespace for the plugin if it exists.
  • Run yarn && yarn run tsc && yarn run build:all to compile the plugin.
  • Export each plugin as a dynamic plugin to their own respective dist-dynamic directory using the janus-cli.
  • Run npm pack to create a tarball of each plugin into the dynamic plugin root directory ( ./deploy ).
  • Create a new namespace for the backstage instance.
  • Generate the integrity hash for each plugin and reference it within the dynamic-plugin configmap defined inline within the script.
  • Create the plugin registry for the dynamic plugins.
  • Apply the app-config and dynamic-plugins configmaps to the cluster.
  • Create the backstage instance using the RHDH operator.