Skip to content

Commit

Permalink
Added documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
AnnaZivkovic committed Sep 25, 2024
1 parent d10efe3 commit afb6c35
Showing 1 changed file with 46 additions and 31 deletions.
77 changes: 46 additions & 31 deletions docs/ocp-release.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
### Release the operator (for OCP)

1. Choose a snapshot from the list of snapshots and double check post-submits passed for it.
1. Creat a new branch off of `main`. example `v1.0`, `v0.9`
2. Choose a snapshot from the list of snapshots and double check post-submits passed for it.
```shell
oc get snapshots --sort-by .metadata.creationTimestamp -l pac.test.appstudio.openshift.io/event-type=push,appstudio.openshift.io/application=multiarch-tuning-operator
```
2. Look at the results of the tests for the commit reported in the snapshot:
3. Look at the results of the tests for the commit reported in the snapshot:
```yaml
[...]
spec:
Expand All @@ -27,45 +27,58 @@ spec:
url: https://github.com/openshift/multiarch-tuning-operator
[...]
```
3. Ensure that the containerImage of the operator is the one referenced by the bundle in the selected snapshot
4. Ensure that the containerImage of the operator is the one referenced by the bundle in the selected snapshot. If it does not match, update the image argument in `bundle.konflux.Dockerfile` (ex. https://github.com/openshift/multiarch-tuning-operator/pull/262). Wait for new snapshot to be made and restart at step 2.
```shell
podman create quay.io/redhat-user-workloads/multiarch-tuning-ope-tenant/multiarch-tuning-operator/multiarch-tuning-operator-bundle@sha256:...
yq '.spec.install.spec.deployments[0].spec.template.metadata.annotations."multiarch.openshift.io/image"' /tmp/csv.yaml
```
4. Create a new release for the operator in the Konflux cluster:
5. Create a new release for the operator in the Konflux cluster (https://gitlab.cee.redhat.com/releng/konflux-release-data). Create a new directory `tenants-config/cluster/stone-prd-rh01/tenants/multiarch-tuning-ope-tenant/_base/projectl.konflux.dev/projectdevelopmentstreams/multiarch-tuning-operator-<konfluxVersion>`.
For instance, when the version is `v1.0`, replace the period (`.`) with a dash (`-`). Thus, `<konfluxVersion>` would be formatted as `v1-0`.
Add two files to the directory `projectdevelopmentstream.yaml` and `kustomization.yaml`.

```yaml
# oc create -f - <<EOF
apiVersion: appstudio.redhat.com/v1alpha1
kind: Release
# multiarch-tuning-operator-<VERSION>/projectdevelopmentstream.yaml
---
apiVersion: projctl.konflux.dev/v1beta1
kind: ProjectDevelopmentStream
metadata:
generateName: manual-release-
namespace: multiarch-tuning-ope-tenant
name: multiarch-tuning-operator-<konfluxVersion>
spec:
releasePlan: multiarch-tuning-operator-release-as-operator
snapshot: multiarch-tuning-operator-h2rsk
data:
releaseNotes:
type: RHEA
synopsis: |
Red Hat Multiarch Tuning 0.9.0
topic: |
Red Hat Multiarch Tuning 0.9.0
description: |
Red Hat Multiarch Tuning 0.9.0
solution: |
Red Hat Multiarch Tuning 0.9.0
references:
- https://github.com/openshift/multiarch-tuning-operator
# EOF
project: multiarch-tuning-operator
template:
name: multiarch-tuning-operator
values:
- name: version
# The branch name, formatted without the 'v' prefix (e.g., '1.0' for branch 'v1.0')
value: <version>
```
```yaml
# multiarch-tuning-operator-<VERSION>/kustomization.yaml
---
kind: Kustomization
apiVersion: kustomize.config.k8s.io/v1beta1
resources:
- ./projectdevelopmentstream.yaml
```
5. Update the fbc-4.x branches with the SHA of the container image for the bundle and operator, example commit (be aware of the upgrade edges and vertices to implement, TODO: commit example):
6. Update `tenants-config/cluster/stone-prd-rh01/tenants/multiarch-tuning-ope-tenant/_base/kustomization.yaml` file to include the newly added `projectdevelopmentstreams`.
7. Create a new `ReleasePlanAdmission` file in the directory `konflux-release-data/config/stone-prd-rh01.pg1f.p1/product/ReleasePlanAdmission/multiarch-tuning-ope`,
naming it `multiarch-tuning-operator-<versionName>.yaml` where `<versionName>` is the `konfluxVersion` without the "v" (e.g., for `v1-0`, name it `multiarch-tuning-operator-1-0.yaml`).
Duplicate the contents of the existing ReleasePlanAdmission from the `multiarch-tuning-operator.yaml` file, then update the tags and set the appropriate release notes version.
8. Run `build-manifests.sh` to generate auxiliary files. After making the changes, create a new pull request.
9. Update the fbc-4.x branches to use chosen container image for the bundle and operator, example commit (be aware of the upgrade edges and vertices to implement, TODO: commit example):
https://github.com/openshift/multiarch-tuning-operator/commit/60cfede0b323e1c900bed5f58f5fff5e4a8891ef
6. Get the new snapshot triggered by the build of the merge commit at the previous point
(TODO: more explanation here)

```shell
podman run -it --entrypoint /bin/opm -v <path/to/code>:/code:Z registry.redhat.io/openshift4/ose-operator-registry:v4.13 render <konflux-bundle-image> --output=yaml > tmp/rendered.yaml
```
10. Get the new snapshot triggered by the build of the merge commit at the previous point
```shell
oc get snapshots --sort-by .metadata.creationTimestamp -l pac.test.appstudio.openshift.io/event-type=push,appstudio.openshift.io/application=fbc-v4-16
```
7. Watch the `status` of the `Release` Object or look in the Konflux UI to confirm that images and bundle were published as expected.
8. Create a new Release for the fbc snapshot created after the commit in step 4:
11. Watch the `status` of the `Release` Object or look in the Konflux UI to confirm that images and bundle were published as expected.
12. Create a new Release for the fbc snapshot created after the commit in step 4:
```yaml
# oc create -f - <<EOF
apiVersion: appstudio.redhat.com/v1alpha1
Expand All @@ -78,7 +91,9 @@ spec:
snapshot: fbc-v4-16-49tm9
# EOF
```
9. Repeat the previous 3 steps for each OCP release to change the FBC fragment and operator upgrade graph of.
13. Duplicate the prow config to target the new branch. Add `ci-operator/config/openshift/multiarch-tuning-operator/openshift-multiarch-tuning-operator-<branchVersion>.yaml` by copping `openshift-multiarch-tuning-operator-main.yaml` and updating references from `main` to the new branch name.
(ex. https://github.com/openshift/release/pull/56835)
14. Repeat the previous 3 steps for each OCP release to change the FBC fragment and operator upgrade graph of.

### Create a new FBC fragment for a new OCP release

Expand Down

0 comments on commit afb6c35

Please sign in to comment.