Release Status
The release status of the policy framework is stored in the policy/parent repository in the pf_release_data.csv file. Look at that file under each branch to find details of the current release artifacts for each branch. The table below is a shortcut to that file for each release.
Release | Release Data |
---|---|
master | pf_release_data.csv |
kohn | not branched yet |
jakarta | pf_release_data.csv |
istanbul (security updates only) | pf_release_data.csv |
honolulu (security updates only) | pf_release_data.csv |
previous releases (unsupported) | Policy Framework Project: Old Releases |
Repository Dependencies and Docker Images
The diagram below shows the repositories and Docker images produced by the Policy Framework. The repositories (released as maven artifacts) are shown as rectangles, and the Docker images are shown as ovals. The dependencies between the repositories are shown as are the Docker images produced by each repository.
The Policy Framework Release Process
The Policy Framework release process is complex, time-consuming, and tedious. In the release process, the maven repositories and docker images must be released in the order shown in the diagram above: Blue-->Green-->Pink-->Yellow→Purple. In addition, the references for the repository layering and the parent Docker image file references must be set to release references before staging and back to snapshot references after staging.
A set of scripts have been developed to make the release process somewhat less tedious. The scripts are located in the policy/parent repo here.
The scripts guide one through the release process. The scripts:
- Run each step in the release process as a sequence of release phases
- Act on pom.xml, Docker, version.properties, and pf_release_data.csv files, changing the references in those files as is required for each phase in a release
- Generate the commits in Gerrit for each phase of the release
- Work on all branches from Honolulu on
- Execute a normal release, where there are no special cases like repositories or docker images being added or removed
The scripts do not:
- Provide a fully automatic release, manual checking and submitting of commits is still required
- Deal with all possible permutations and combinations of releases
- Guarantee that there are not bugs in the scripts, manual oversight is required
The scripts make the following assumptions:
- All 13 Policy Framework repositories are freshly cloned into a directory called policy
policy/parent
policy/common
......... - There are no updates or pending commits on any of the cloned repositories
- All references between Policy Framework Maven modules are in the root POM in each repository
- All references between Policy Framework Maven modules are controlled by the following properties in root pom.xml files
policy.common.version or version.policy.common: policy/common
policy.models.version or version.policy.models: policy/models
policy-drools-pdp.version or version.policy.drools-pdp: policy/drools-pdp
- policy-apex-pdp.version or version.policy.apex-pdp: policy/apex-pdp
- All files that match the regular expression '*Docker*' and have their base image matching the regular expression 'FROM onap\/policy-j[d|r][k|e]-alpine:)[0-9]*.[0-9]*.[0-9].*$' will have their base image changed to the appropriate policy-jre-alpine or policy-jdk-apline version for the phase in question
During a normal release, the most important scripts are the getReleaseData.sh script and the releasePhase.sh script.
getReleaseData.sh creates the file pf_release_data.csv for a specified branch. This file is used by the release process to keep track of where it is. It has the following 5 columns:
- Repo: The repository to which this row of the file refers
- Last Tag Version: The last hard release version of this repository on this branch
- Snapshot Version: The current snapshot version of this repository on this branch
- Changed Files: The number of files that are changed between the Last Tag Version and the Snapshot Version
- Docker Images: A list of the Docker images generated on this repository, which can be none
getReleaseData.sh recreates the pf_release_data.sh each time it is executed so as the release proceeds through its phases, the content of the file changes. The script has a list of the 13 Policy Framework repositories, and for each repository it:
- Checks out the specified branch, pulls the latest changes, and rebases the repository
- Runs a "mvn clean" command on the repository to determine its current snapshot
- Reads the tags on the repository and determines what the latest tag on this branch of the repository is
- Runs a "git diff" command to detemine the number of changed files between the latest tag and the current snapshot
- Reads the releases/x.x.x-container.yaml file to find the docker images generated by the repository
Performing an Interim Release
An Interim Release is where the all the Maven artifacts and Docker images are released on the current branch and and the snapshot version of the repositories is stepped.
Branching a Release
An Interim Release is where the all the Maven artifacts and Docker images are released on the current branch and and the snapshot version of the repositories is stepped.
Appendix I: Release Script Usage
Script | Description |
---|---|
bumpSnapshots.sh | bumpSnapshots.sh - generate commits to bump the snapshot version and update references to snapshot references |
generateCommit.sh | generateCommit.sh - generates a new commit or a patch on an existing commit for PF releases |
getReleaseData.sh | getReleaseData.sh - gets information from the checked out Policy Framework repos for the release process |
mkart.sh | mkart.sh - create the release yaml file to release the current snapshot on the current repo |
mkdock.sh | mkdock.sh - create the release container yaml file to release the docker images on the current repo |
releasePhase.sh | releasePhase.sh - execute a certain policy framework release phase |
releaseRepo.sh | releaseRepo.sh - release the specified repository by generating the release yaml file and the release commit |
releaseRepoImages.sh | releaseRepoImages.sh - release the docker images for the specified repository by generating the release yaml file and |
updateOomImages.sh | updateOomImages.sh - generate an OOM commit to update the versions of Policy Framework images in values.yaml files |
updateParentRef.sh | updateParentRef.sh - update the parent reference in a POM file usage: updateParentRef.sh [-options] options |
updateRefs.sh | updateRefs.sh - updates the inter-repo references in Policy Framework POM files |
The scripts:
- Operate on a cloned copy of all 13 Policy Framework repositories
- Break the release process into a set of phases, which are executed one after another to perform a release
- Can release on the Master branch or any other branch
- Act on the POM files, Docker files, the maven and docker release files, the version.properties files, and the pf_release_data.csv file in the repos, updating the references in those files as required for each phase
The scripts do NOT:
- Fully automate the release process, manual checking and submission of commits is still required
- Capture every possible permutation and corner case of releasing, manual intervention in the process is often required