camunda / camunda-bpm-platform

Flexible framework for workflow and decision automation with BPMN and DMN. Integration with Quarkus, Spring, Spring Boot, CDI.
https://camunda.com/
Apache License 2.0
4.13k stars 1.56k forks source link

Support PostgreSQL 17 #4165

Open toco-cam opened 8 months ago

toco-cam commented 8 months ago

Acceptance Criteria (Required on creation)

Hints

Links

Breakdown

### Code | jenkins-shared-library
- [ ] https://github.com/camunda/cambpm-jenkins-shared-library/pull/149
### 7.23
- [ ] https://github.com/camunda/camunda-bpm-platform/pull/4552
- [ ] https://github.com/camunda/camunda-bpm-platform-ee/pull/989
- [ ] https://github.com/camunda/camunda-docs-manual/pull/1695
- [ ] https://github.com/camunda/camunda-docs-static/pull/512
- [ ] https://github.com/camunda/camunda-bpm-platform/pull/4801
### 7.22 | Backport
- [ ] https://github.com/camunda/camunda-bpm-platform-maintenance/pull/1292
- [ ] https://github.com/camunda/camunda-bpm-platform-ee-maintenance/pull/504
- [ ] https://github.com/camunda/camunda-docs-manual/pull/1696
- [ ] https://github.com/camunda/camunda-docs-static/pull/511
- [ ] https://github.com/camunda/camunda-bpm-platform-maintenance/pull/1310
- [ ] https://github.com/camunda/camunda-bpm-platform-maintenance/pull/1312
### Optional / Follow-up
- [ ] https://github.com/camunda/camunda-bpm-platform/issues/4768
- [ ] https://github.com/camunda/camunda-bpm-platform/issues/4789

Dev2QA handover

QA Testing

The feature needs testing for the two supported versions: master (7.23) and the 7.22 backport.

Two supported environments can be used for each supported version with a slight variance to achieve a pluralistic testing result.

Please find below the breakdown of the testing scenarios:

Scenarios

yanavasileva commented 4 weeks ago

Note:

tasso94 commented 3 weeks ago

EE pipeline also have stages for postgresql

They are using PostgreSQL 14 right now which is still supported for versions <= 7.23. No urgent need to bump them to PostgreSQL 17 right now. I see it as a bonus.

psavidis commented 2 weeks ago

Kickoff

1. Context

Our CI is already capable of utilizing the declarative podspecs approach to do basic parameterisation of the docker images used (see respective feature)

The above already works and is capable of specifying the image for spinning one pod using one docker image.

The context of this feature is to extend the existing solution further to i) work with multiple containers per pod and ii) use the underlying new functionality to introduce Postgres 17

Why are combopods needed

In most stages, the jenkins files describe stages that execute specific testing logic (e.g spring boot tests, unit tests during assembly stage, e2e tests etc.).

This is done by invoking maven and and the respective profile as in the following screenshots:

2. Business Value

2.1 Users

Users are going to benefit from the latest supported version of Postgres, a database that has been supported for all the lifetime of the product so far.

2.2 Developers

Developers will be able to utilize the declarative podspecs to configure multiple containers (typically dbs) in a single pod. With the first iteration, only postgres 17 will be supported

3. Customer Requirements

4. Documentation

The new Postgres 17 version needs to be mentioned in 

  1. announcements and 
  2. supported environments 

sections of the docs.

5. Technical Proposal

The following high level changes are needed :

  1. Add multi-image support to Podspec Execution of Jenkins-shared-library Code

    • Introduction

      • All stages (calculated, non-calculated) end up calling the cambpmConditionalRetry script to execute a stage.

      • The script currently considers two modes with priority:

      • Podspec mode

        • If a podspec is configured in the incoming parameters, the script is going to consider that first.
      • AgentLabel mode

        • If no podspec is configured, the script will try to execute the given agentLabel using the legacy behavior
    • What needs to Change

      • Change cambpmConditionalRetry | podspec mode to support two pod executions

      • Single-image pod execution

        • Will be used for node execution (alpine, maven images)
      • Multi-image pod execution

        • Will be used for executing maven and database containers into a single pod
        • Important: The underlying script should facilitate the addition of new database and node execution containers in an easy way
      • Change cambpmConditionalRetry | podspec mode to consider agentLabels

      • Why: The calculated stages pass the db information in agentLabel as discriminator value for that stage

    • Algorithm

      • If podspec is configured
        • Search in the podSpec images to find an image to execute the agentLabel
        • If found, execute the pod using the first image found (db)
        • If no image is found, execute the agentNode using nodeExecution (legacy behavior)
      • If no podSpec is configured
        • execute the agentLabel using nodeExecution (legacy behavior) 
  2. Incorporate the new Podspec Execution in the CI of camunda-bpm-platform

    • Ensure all existing cambpmConditionalRetry invocations in the Jenkinsfiles (main, daily, sidetrack) work with the new changes
    • Configure Postgres 17 in matrices.yml
    • Configure the stage-types.yml to execute the  Postgres 17 stages with multipod-execution
  3. Incorporate the new Podspec Execution in the CI of camunda-bpm-platform-ee

    • Similar to point section above
  4. Update Documentation with Postgres 17

    • Update the manual
    • Add Internal dev documentation:
      • Mention explicitly in the code of jenkins-shared-library the isolation level of postgres and add an informative comment to check isolation level for new db entries
  5. Add Portainer support for Postgres 17


6. Breakdown



psavidis commented 1 week ago

Status: The code, repositories and doc pull requests all pass through the respective CI tests.

Next Steps: Assigning the ticket for Review to @mboskamp. In the meantime, @psavidis will do the the manual testing.

Review Tips:

psavidis commented 1 week ago

Testing Status

psavidis commented 1 week ago

✅ The minimum viable feature is merged to master and 7.22.1-SNAPSHOT respectively.

Note: The following optional tasks can be taken into consideration and are not mandatory for the completion of this ticket:

➡️ What's Next

psavidis commented 4 days ago

Jenkins Build Failures Issue Investigation

Problem: After merging the code changes to jenkins-shared-library and the successful 7.23, 7.22 PR builds, there are builds failing on master.

Failing Builds

When: Both builds failed at 2014-11-16

Observations:

Side effect: The execution of instance-migration stage with Postgres 17 is not executed with Podspec and the build freezes. Root-cause: The legacy behaviour tries to execute the stage with an image searching in the infra-team images. The image is not found and the build waits for ever.

Solution: Execute instance-migration with podspec.

PR:

psavidis commented 3 days ago

Backport Update

The 7.22 backport still uses maven:3.8.5 in the stage-types.

PR to sync with latest maven:3.9.7 according to latest decision: