Skip to content

Commit

Permalink
Fix #382 and #423: better release process incl docker (#424)
Browse files Browse the repository at this point in the history
  • Loading branch information
trentmc authored Nov 30, 2023
1 parent bcaf4f3 commit 98f17a7
Show file tree
Hide file tree
Showing 3 changed files with 69 additions and 12 deletions.
Binary file added READMEs/images/dockerbranch.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added READMEs/images/dockerbuild.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
81 changes: 69 additions & 12 deletions READMEs/release-process.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,79 @@ Copyright 2023 Ocean Protocol Foundation
SPDX-License-Identifier: Apache-2.0
-->

# Release Process
**Contents**

## 1. Set Version Number
- [Release Process (main)](#release-process-including-docker)
- [About PyPi](#about-pypi)
- [About Docker](#about-docker)

In the pdr-backend repository, the version and tag name convention follows the format "vx.x.x":
- The version number consists of three parts separated by dots, The first part represents the major version, the second part represents the minor version, and the third part represents the patch version.
- When a new release is created, the version number should be incremented according to the significance of the changes made in the release.
# Release Process, including Docker

## 2. Create a New Release
## Step 1: Update documentation

Update [docs repo](https://github.com/oceanprotocol/docs) if your changes affect docs.oceanprotocol.com content.

## Step 2. Publish new "Github Release" & Docker image

To create a new release for pdr-backend, follow these steps:

1. Visit the [Github Releases](https://github.com/oceanprotocol/pdr-backend/releases) page.
2. Click on "Draft a new release."
3. Choose an appropriate version tag (e.g., v1.0.0) and provide a release title.
4. Add release notes and any relevant information about the new release.
5. Once everything is ready, click "Publish release."
1. Visit [pdr-backend Github Releases](https://github.com/oceanprotocol/pdr-backend/releases). Note the current version number, eg `v0.1.4`. It follows [semantic versioning](https://semver.org/).
1. Decide a new version number, by incrementing patch (eg `v0.1.5`), minor (eg `v0.2.0`), or major (eg `v1.0.0`). Major is rare.
1. Click "Draft a new release".
1. For tag version, put something like `v0.1.5`.
1. For release title, put the same value (like `v0.1.5`).
1. For the target, select the `main` branch, or the most recent commit in main.
1. Describe the main changes. You can auto-generate a first cut following [these instructions](https://docs.github.com/en/repositories/releasing-projects-on-github/automatically-generated-release-notes), step 8.
1. Click "Publish release."

What happens then:
- The pdr-backend Github Releases Page will now include this release
- CI/CD will automatically build and publish a **new Docker image** with the release tag, making it available for installation and use.

# About PyPi

The release process does not include publishing to pypi.
- This is because we have explicitly _not_ put pdr-backend into pypi yet. It's not meant to be used as a library yet. In time, it likely will. Just not yet.

# About Docker

### Docker releases from main

> CI/CD will automatically build and publish a **new Docker image**
To elaborate: we have an automated docker build for pdr-backend `main` branch and for all releases. Github is already connected to dockerhub.

![](./images/dockerbuild.png)

### Adding Docker branches

If you want to add Docker branches, go to https://hub.docker.com/repository/docker/oceanprotocol/pdr-backend/builds/edit

Then: on "Build rules", add your branch. Below is an example, where Alex is buildint "pdr-backend: alex" from branch "feature/alex".

![](./images/dockerbranch.png)

In the last line: you should be able to log in with your username (eg trentmc).

### Testing Docker images

We recommend local testing (versus adding more to dockerhub). Here's how.

First, build your image locally (in pdr-backend folder):

```console
docker build -t 'oceanprotocol/pdr-backend:trent_custom' .
export PDR_BACKEND_VERSION=trent_custom
```

Then, start barge, **with your own docker image**:
```console
./start_ocean.sh ......
```

Pros of local testing:

The CI/CD will automatically build and publish a new Docker image with the release tag, making it available for installation and use.
- don't pollute dockerhub with one time images
- no need of cleanups. If a PR is merged, we don't need to delete that branch from dockerhub autobuild.
- no need of access to dockerhub
- dockerhub should be used for production ready images only

0 comments on commit 98f17a7

Please sign in to comment.