Skip to content

Commit

Permalink
Update release documentation to reflect workflow changes
Browse files Browse the repository at this point in the history
  • Loading branch information
markpatton committed Dec 19, 2023
1 parent 55a2903 commit ca8c922
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 239 deletions.
18 changes: 14 additions & 4 deletions docs/dev/release-steps-with-automations.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,31 @@ Actions listed below are to be done by the release manager.

### Java projects

You will need to release these in the order defined here due to dependencies. Between each of these releases, you will need to wait for the Java artifacts to appear on Maven Central. This will give you enough time to do other release activities, such as releasing non-Java artifacts.
You will need to release these in the order defined here due to dependencies. Between each of these releases, you will need to wait for the Java artifacts to appear on Maven Central. This will give you enough time to do other release activities, such as releasing non-Java artifacts. The release workflows should wait for you, but is good to check anyway.

1. [`main`](https://github.com/eclipse-pass/main)
* [Release workflow](https://github.com/eclipse-pass/main/actions/workflows/release.yml)
* [Maven central](https://central.sonatype.com/artifact/org.eclipse.pass/eclipse-pass-parent)
* Package: n/a
2. [`pass-core`](https://github.com/eclipse-pass/pass-core)
* [Release workflow](https://github.com/eclipse-pass/pass-core/actions/workflows/release.yml)
* [Maven Central](https://central.sonatype.com/artifact/org.eclipse.pass/pass-core-main/0.4.0)
* [Package](https://github.com/eclipse-pass/pass-core/pkgs/container/pass-core-main)
3. [`pass-support`](https://github.com/eclipse-pass/pass-support)
* [Release workflow](https://github.com/eclipse-pass/pass-support/actions/workflows/release.yml)
* [Maven Central](https://central.sonatype.com/artifact/org.eclipse.pass/pass-support)
* Package: n/a
* https://github.com/eclipse-pass/pass-support/pkgs/container/pass-notification-service
* https://github.com/orgs/eclipse-pass/packages/container/package/jhu-grant-loader
* https://github.com/orgs/eclipse-pass/packages/container/package/deposit-services-core
* https://github.com/orgs/eclipse-pass/packages/container/package/pass-journal-loader
* https://github.com/orgs/eclipse-pass/packages/container/package/pass-nihms-loader

You can instead use a [combined Java workflow](https://github.com/eclipse-pass/main/actions/workflows/pass-java-release.yml) which combines all the Java projects together and then releases them. This workflow depends on the JAVA_RELEASE_PAT secret having permission to access all the eclipse-pass repositories and write packages. You have have to create a new classic PAT to do the release. If you do so, scope it to only last a few days and make sure it has repo and write package permissions.

How to set the secret using the gh command line tool:
```
gh login
gh secret set JAVA_RELEASE_PAT --body PAT_VALUE --repo eclipse-pass/main
```

### Non-Java projects
These can be released in any order. You should release these between releasing Java components, while waiting for artifacts to become available in Maven Central.
Expand All @@ -30,7 +41,6 @@ These can be released in any order. You should release these between releasing J
* [Package](https://github.com/eclipse-pass/pass-auth/pkgs/container/pass-auth)
* [`pass-acceptance-testing`](https://github.com/eclipse-pass/pass-acceptance-testing)
* [Release workflow](https://github.com/eclipse-pass/pass-acceptance-testing/actions/workflows/release.yml)
* Package: n/a

### Other projects
This must be released last because it relies on some Docker images that will be published during the release process of some of the above projects.
Expand Down
133 changes: 34 additions & 99 deletions docs/dev/release.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,13 @@ Most of the PASS release process is automated new, but if we need to do parts of

## Sonatype

This is setup by the `setup-java` action in automations, so manual setup of this file is only necessary if handling a Java release manually.
Sonatype deployment is handled by the automations. This information is provided for doing a Java release manually.

Developers will need a Sonatype account to release Java projects.
Maven must be configured to use the account by modifying your ~/.m2/settings.xml. Documentation for Sonatype publishing
is available here: https://central.sonatype.org/publish/publish-guide/

Example pom setup:
```
<settings>
<servers>
Expand Down Expand Up @@ -97,71 +98,60 @@ These projects have GitHub workflow automations in place to perform releases tha
## Java release
The release automations will follow these steps. You will only need to follow this process if the automations fail.

The Maven release plugin is used to perform releases. It builds, tests, and pushes release artifacts. In addition it tags the release in the source and increments version numbers. Most of the Maven projects also use Maven to automatically build and push a Docker image. The release process is determined by the decision made to have versions for all Java artifacts be the same for a release. The parent pom in `main` sets the version to be inherited by all its children. This project therefore needs to be released first, as all other projects need to reference it. After this is released, other projects are released in an order which guarantees that all PASS dependencies for them have already been released.
Maven is used to perform many of the release tasks. It sets versions and builds, tests, and pushes release artifacts. Maven may also build Docker images.

The process itself can be described as follows: release `main`, then use the maven release and versions plugins to perform the process. For convenience we set and export environment variables RELEASE for the release version, and NEXT for the next development version (an example might be executing `export RELEASE=0.1.0` and `export NEXT=0.2.0-SNAPSHOT`)
The versions of all the Java artifacts are the same for a release. The parent pom in `main` sets the version to be inherited by all its children. This project therefore needs to be released first, as all other projects need to reference it. After this is released, other projects are released in an order which guarantees that all PASS dependencies for them have already been released. You will need to wait for artifacts to show up in Maven Central before building a module which depends on them.

The process itself can be described as follows: release `main`, . For convenience we set and export environment variables RELEASE for the release version, and NEXT for the next development version (an example might be executing `export RELEASE=0.1.0` and `export NEXT=0.2.0-SNAPSHOT`)
For each of these child projects, we first clone the source from GitHub, and operating on the principal branch (usually `main`).

We would then update the parent version in these projects by:
Update the reference to the parent pom and set the release version.
```
mvn versions:update-parent;
git commit -a -m "update parent version for release";
mvn versions:update-parent -DparentVersion=$RELEASE
mvn versions:set -DnewVersion=$RELEASE
```
After this, we prepare and perform the release:

After this, we do build and push the artifacts to Sonatype, commit the version change, and tag it:
```
mvn release:prepare -DreleaseVersion=$RELEASE -Dtag=$RELEASE -DdevelopmentVersion=$NEXT
mvn release:perform -Dgoals=deploy
mvn -ntp -P release clean deploy
git commit -am "Update version to $RELEASE"
git tag $RELEASE
```

If integration tests need to be skipped, `-DskipITs=true` can be added to the commands above.

Push tags to GitHub:
Push any created images to GHCR after logging in. See [https://docs.github.com/en/packages/working-with-a-github-packages-registry/working-with-the-container-registry] for information.
```
git push [email protected]:eclipse-pass/<PROJECT> --tags
docker push IMAGE_NAME:$RELEASE
```

Finally, the new development code needs to be pushed to GitHub. Since we are using the `main` pom to set versions, we need to have the new development version of `main` deployed to Sonatype before pushing the new development version of its children. once `mvn deploy -P release` has been run on main with the new development version set, it will be available in Sonatype for other projects to consume. The last step for these children is to update the parent version from the new snapshot version of `main` - so for each child, we do:

Push commits and tags to GitHub:
```
mvn versions:update-parent -DallowSnapshots=true
git push [email protected]:eclipse-pass/<PROJECT> main (or master)
mvn deploy -P release
git push origin
git push origin --tags
```

Finally, the new development code needs to be pushed to built and pushed GitHub. Repeat the process above with the dev version, but do not create the tag.

At this point, we should have deployed the release to Sonatype (and eventually to Maven Central), pushed a tag to GitHub, and deployed the new development release to Sonatype.

In addition, the project may be released on GitHub. This provides a way to add release notes for a particular project. A GitHub release is done manually by uploading artifacts through the UI. The release version and tag should be the same used for Maven Central. Release notes can be automatically generated from commit messages and then customized.

----

See an example script that runs through these steps at [/tools/release.sh](/tools/release.sh)

### `main`
See the [/.github/workflows/release.yml] for the details on the exact commands that are run.

* Update POM version to release version
* Push update to GH
* Maven release
* Push release tag and update to new snapshot version to GH
* Maven deploy new snapshot

### `pass-core`

* Update POM version to release
* Push update to GH
* Maven release (include submodules)
* Push generated release Docker image to GHCR
* Push release tag to GH
* Update top level and submodule POMs, allowing SNAPSHOTS
* Push version updates on main to GH
* Maven deploy new snapshot
* Push snapshot Docker image to GHCR

This follows the same general release procedure as `main` with a few extra steps to account for submodules and Docker images
----

### `pass-support`
### `main`, `pass-core`, `pass-support`

See procedure for `pass-core`, but without Docker images
* Update POM to release version
* Commit release version update
* Tag release version
* Build and deploy to Sonatype
* Push any generated Docker images to GHCR
* Update POM to dev version
* Commit dev version update
* Build and deploy to Sonatype
* Push any generated Docker images to GHCR
* Push commits to GitHub
* Wait for artifacts in Maven Central

## JavaScript projects

Expand All @@ -179,15 +169,6 @@ Note, you might want to ensure `node_modules` are removed first to ensure a clea

Push that image to ghcr. For example: `docker push ghcr.io/eclipse-pass/pass-ui:<your-version-tag-here>`

### `pass-ui-public`
In `docker-compose.yml` in the `pass-docker` repo remove the sha from the image line, update the version tag at the end of the line to the version you are releasing.

Build a new docker image from within the root of the `pass-docker` repo by running:
```
docker compose build pass-ui-public
```
Push that image to ghcr. For example: `docker push ghcr.io/eclipse-pass/pass-ui-public:<your-version-tag-here>`

### `pass-auth`
Update the version in `package.json`, and commit that change via a PR to the `pass-auth` repo.

Expand All @@ -204,61 +185,15 @@ After pushing the images to ghcr, update the appropriate image lines in `docker-

Once acceptance-tests successfully run in CI in your `pass-docker` PR, and preferrably once you've done some additional manual spot checking while running `pass-docker` locally, go ahead and tag a new release in the Github UI for each of `pass-ui`, `pass-ui-public`, `pass-auth` and `pass-acceptance-testing`.

# Update pass-docker

Each released image must be updated in the `pass-docker` `docker compose.yml`. Each image is specified with a version and hash identifier. The versions should just be able to be updated to the new release version. The hash can be found using `docker inspect`.

### Building a single image

Updating a single image within [`pass-docker`](https://github.com/eclipse-pass/pass-docker) is largely done manually, for all images.

* Remove the `@sha256:...` from the end of the `image` property for the service. Update the image tag.
* Example: we want to update the current pass-core image to `0.3.0`: `ghcr.io/eclipse-pass/pass-core-main:0.2.0@sha256:56730754843aec0a3d48bfcefd13d72f1bb34708aea9b47d2280d2da61a1eb54` would be changed to `ghcr.io/eclipse-pass/pass-core-main:0.3.0`
* Build the image: `docker compose build <service-name>`
For the fcrepo example above, you'd run `docker compose build pass-core`
* Push the new image: `docker compose push <service-name>`
Example above: `docker compose push pass-core`
This will return the hash that can be appended to the image property in the docker compose file to pin the version, since Docker image tags can be overwritten at any time

---

## docker compose rebuilding / updating
1. Remove the `@sha256` hash from the end of the image reference
2. Update the image tag to new tag
3. `docker compose build <service_name>`
4. `docker compose push <service_name>`: Copy the returned `sha256` hash
5. Append the copied hash to the image reference

## Retag without rebuild
* Grab the `image` reference from the docker compose file, *without the hash*. Ex: `ghcr.io/eclipse-pass/pass-core-main:0.2.0`
* `docker pull <image>:<tag>` - just makes sure you have the tag downloaded locally
* `docker tag <image>:<old_tag> <image>:<new_tag>` - creates the new tag
* `docker push <image>:<new_tag>` - pushes to your Docker repository. This will return a hash for the new tag
* You can now update the docker compose file with the new tag + hash

Example:
``` sh
docker pull ghcr.io/eclipse-pass/pass-core-main:0.2.0
docker tag ghcr.io/eclipse-pass/pass-core-main:0.2.0 ghcr.io/eclipse-pass/pass-core-main:0.3.0
docker push ghcr.io/eclipse-pass/pass-core-main:0.3.0
```

## Per-image customization

Here's what you need to change manually before building a new image version in order to bring in code changes. If the docker compose service is not mentioned here, you do not need to make any manual changes. All images must be built manually using docker compose, following the [docker compose rebuilding / updating](#docker compose-rebuilding--updating) steps except `pass-core` which is built by Maven.

#### `pass-ui`
In `.env`, by default, `EMBER_GIT_BRANCH` should have a value of `main`. If you need to point to a specific branch update the value of `EMBER_GIT_BRANCH`. You can use the name of a tag or a specific commit hash.

#### `pass-ui-public`
In `.env`, by default, `STATIC_HTML_BRANCH` should have a value of `main`. If you need to point to a specific branch update the value of `STATIC_HTML_BRANCH`. You can use the name of a tag or a specific commit hash.

#### `deposit`
TODO

#### `notification`
TODO

# Testing

Manual testing can be done using the newly updated pass-docker to run the release locally. Acceptance testing is run automatically on GitHub against pass-docker/main
Expand Down
12 changes: 0 additions & 12 deletions docs/release/release-actions-template.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,20 +20,8 @@ This is the full detailed release process, including the steps that are performe
Release Workflow Example: [Triggering a GitHub workflow](../dev/release-steps-with-automations.md#triggering-a-gitHub-workflow)

- [ ] Release Main - [Main Release workflow](https://github.com/eclipse-pass/main/actions/workflows/release.yml)
- [ ] Verify Main Artifacts on Maven Central - [Main Artifacts on Maven Central](https://central.sonatype.com/artifact/org.eclipse.pass/eclipse-pass-parent)
- [ ] Main GitHub Release Page - Perform after the Main release is complete - [Main GitHub Release Page](https://github.com/eclipse-pass/main/releases)

---

- [ ] Release Pass-Core - [Pass-Core Release workflow](https://github.com/eclipse-pass/pass-core/actions/workflows/release.yml)
- [ ] Verify Pass-Core Artifacts on Maven Central - [Pass-Core Artifacts on Maven Central](https://central.sonatype.com/artifact/org.eclipse.pass/pass-core)
- [ ] Pass-Core GitHub Release Page - Perform after the Pass Core release is complete - [Pass Core GitHub Release Page](https://github.com/eclipse-pass/pass-core/releases)

---

- [ ] Release Pass Support - [Pass Support Release workflow](https://github.com/eclipse-pass/pass-support/actions/workflows/release.yml)
- [ ] Verify Pass Support Artifacts on Maven Central - [Pass Support Artifacts on Maven Central](https://central.sonatype.com/artifact/org.eclipse.pass/pass-support)
- [ ] Pass Support GitHub Release Page - Perform after the Pass Support release is complete - [Pass Support GitHub Release Page](https://github.com/eclipse-pass/pass-support/releases)

## Release Non-Java Projects

Expand Down
Loading

0 comments on commit ca8c922

Please sign in to comment.