Upgrading from 4.0.x to 4.0.5

How to upgrade

Compared to previous versions, IBM Industry Solutions Workbench provides now a schema registry integration for managing event payloads. After upgrading from 4.0.x to 4.1.1, you have the chance to migrate your existing projects, to use schemas in event payloads as well.

System requirements and third-party components

IBM Industry Solutions Workbench 4.0.5 supports OpenShift 4.12. We strongly recommend to upgrade your OpenShift cluster to that version before upgrading IBM Industry Solutions Workbench.

Additionally, a running instance of Red Hat Integration - Service Registry is required now. You can check the updated system requirements here. We also provide an installation manual. After installing the Service Registry, you need to configure the k5-schema-registry-binding to connect it to IBM Industry Solutions Workbench. All information for configuring can be found here. Additionally the Schema Registry must be configured for you k5projects here.

Adjust your existing deployment targets

Note:

You only have to adjust your deployment targets if you use events based on schemas from schema registry.

In order to setup the schema registry integration properly for your deployment targets, make sure the secrets k5-schema-registry-binding and k5-schema-registry-oauth-secret are defined as described in k5-project configuration

Java pro-code

Dependency update

Java pro-code uses several functionalities provided by the dependency "cp-framework-sdk", which has been updated to include new fixes, and versions of underlying used dependencies.

All existing Java pro-code projects have to download this new version and migrate to this new version.

Migration steps
  1. Open the Solution Envoy dashboard (you can find the link in Solution Designer on the CI/CD page after you have set up at least one deploy pipeline or inside Solution Hub after selecting a k5-project and opening the tab "Service Deployments")

  2. Navigate to the Infrastructure page and download all the dependencies listed under Maven Dependencies (Java)

  3. Install dependencies in the local maven repository. Below is an example how the dependencies can be installed via maven

    mvn install:install-file -Dfile=cp-framework-sdk-autoconfiguration-4.0.219.jar -DpomFile=cp-framework-sdk-autoconfiguration-4.0.219.pom
    mvn install:install-file -Dfile=cp-framework-sdk-parent-4.0.219.pom -DpomFile=cp-framework-sdk-parent-4.0.219.pom
  4. Clone / Open your pro-code service project

  5. Navigate to pom.xml file

  6. Search for the parent attribute and change it to match the new "cp-framework-sdk" version, see the following snippet example:

    <parent>
        <groupId>de.knowis.cp.sdk</groupId>
        <artifactId>cp-framework-sdk-parent</artifactId>
        <version>4.0.219</version>
        <relativePath>
            ./.framework/repo/de/knowis/cp/sdk/cp-framework-sdk-parent/4.0.219/cp-framework-sdk-parent-4.0.219.pom
        </relativePath>
    </parent>

    NOTE Current latest version of "cp-framework-sdk" that is shipped with the IBM Industry Solutions Workbench 4.1 is 4.0.219.

  7. Push your adjustment and run your pipeline(s) to make sure your projects deploy successfully

Adjust your Java low-code projects created with previous versions

Dependency Update

Java low-code uses several functionalities provided by the dependency "cp-framework-sdk", which has been updated to include new fixes, and versions of underlying used dependencies.

All existing Java low-code are required to migrate to this new version.

Migration steps
  1. Clone (k5 clone) or update (k5 pull) your low-code service project

  2. Open your low-code service project

  3. Navigate to pom.xml file

  4. Search for the parent attribute and change it to match the new "cp-framework-sdk" version, see the following snippet example:

    <parent>
        <groupId>de.knowis.cp.sdk</groupId>
        <artifactId>cp-framework-managed-sdk-parent</artifactId>
        <version>4.0.219</version>
        <relativePath>
            ./.framework/repo/de/knowis/cp/sdk/cp-framework-managed-sdk-parent/4.0.219/cp-framework-managed-sdk-parent-4.0.219.pom
        </relativePath>
    </parent>

    NOTE Current latest version of "cp-framework-sdk" that is shipped with the IBM Industry Solutions Workbench 4.1 is 4.0.219.

  5. Push your adjustment and run your pipeline(s) to make sure your projects deploy successfully

Adding necessary dependencies and configurations

Note:

You only have to adjust the low-code projects where you use events based on schemas from schema registry.

  1. Open your project in your IDE

  2. Navigate to the pom.xml

  3. Add the dependencies apicurio-registry-serdes-jsonschema-serde which handles the integration with the schema registry, and json-schema-validator which does the json schema validation

    <dependency>
      <groupId>io.apicurio</groupId>
      <artifactId>apicurio-registry-serdes-jsonschema-serde</artifactId>
      <version>2.4.1.Final</version>
      <exclusions>
        <exclusion>
          <artifactId>slf4j-jboss-logmanager</artifactId>
          <groupId>org.jboss.slf4j</groupId>
        </exclusion>
      </exclusions>
    </dependency>
    
    <dependency>
      <groupId>com.networknt</groupId>
      <artifactId>json-schema-validator</artifactId>
      <version>1.0.77</version>
    </dependency>
  4. Add generated-resources to build in your pom.xml so resources inside build should look like:

     <resources>
      <resource>
        <directory>src/main/filtered</directory>
        <filtering>true</filtering>
      </resource>
      <resource>
        <directory>src/main/resources</directory>
        <filtering>false</filtering>
      </resource>
      <resource>
        <directory>src/main/generated-resources</directory>
        <filtering>false</filtering>
      </resource>
     </resources>
  5. Add the jsonschema2pojo plugin to your pom.xml. Please replace yourPackageName and yourProjectAcronym according to your project meta data:

      <plugin>
        <groupId>org.jsonschema2pojo</groupId>
        <artifactId>jsonschema2pojo-maven-plugin</artifactId>
        <version>1.1.2</version>
        <configuration>
          <sourceDirectory>${basedir}/src/main/generated-resources/schemas</sourceDirectory>
          <targetPackage>yourPackageName.yourProjectAcronym.sdk.domain.schemas</targetPackage>
          <outputDirectory>${basedir}/src/main/generated</outputDirectory>
        </configuration>
        <executions>
          <execution>
            <goals>
              <goal>generate</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
    Note:

After adding the plugin to your pom.xml you have to trigger the code generation using the new plugin. Please execute k5 pull for this or push your changes and clone the project again.

  1. For local development using schema registry, please refer to Setup Java local profile
  2. Push the changes and run the pipeline to ensure that the project deploys successfully

Migrate existing low-code projects to use schemas in event payloads

If you have used events in your services, it is possible to migrate your existing events to the new events using schemas.The migration of the events can be processed one by one and you are not forced to do it directly after the installation of 4.0.5. However, it is recommended to do it rather soon as the old event way is deprecated. Please checkout our other documentation articles to learn more about Schemas, Events and Event support 1.0 vs 2.0.

To migrate events in your low-code projects to use schemas instead of entities, please follow the below described procedure.

Note:

If your projects are using Java as implementation language, please ensure that you've executed the steps describe in Adjust your Java low-code projects created with previous versions

Create new schema

  1. Open the Schema page in the Solution Designer
  2. Create a new schema containing all the properties needed for the event

Adjust event in producing service

  1. Create a new event for your the use case you want to migrate
  2. Choose a new topic for it (one topic per event is suggested and recommended)
  3. Add your schema as payload of the event
  4. Keep the old event to still support the old behavior
  5. Commit and push changes in Solution Designer
  6. Clone/Pull your project
  7. Implement new publishing logic
  8. Deploy/Release your service by triggering a pipeline

After these steps, your service will now publish the old and the new event.

Adjust agent in the consuming service

Adjust existing event:

  1. Remove the entity payload from the event
  2. Adjust topic binding of the event to use the same one as in the consuming service
  3. Select the new schema as payload for the event
  4. Commit and push changes in Solution Designer
  5. Clone/Pull your project
  6. Adjust agent implementation to deal with the new event payload
  7. Deploy/Release your service by triggering a pipeline

Create a new event:

  1. Create a new event using the same topic binding as in the consuming service
  2. Select the new schema as payload for the event
  3. Create a new agent using the event as trigger event
  4. Delete old event
  5. Commit and push changes in Solution Designer
  6. Clone/Pull your project
  7. Implement agent implementation of the new agent
  8. Cleanup agent implementation of the old agent
  9. Deploy/Release your service by triggering a pipeline

After these steps, your service will now use the new event and no longer the old event.

Cleanup producing service

After you ensured, that all consuming services use the new event, you can delete the old event and deploy your service again.

Note:

If you migrated all events of a project, it is safe to switch to event support 2.0

Keycloak roles

New Keycloak roles sr-admin, sr-developer and sr-readonly were added for managing access to the schema registry. Users should be granted one of these roles, otherwise schema registry can not be accessed if role-based-authorization is enabled. See the Configure Users page for a full description of the roles.