github.com/kubeflow/training-operator@v1.7.0/docs/release/releasing.md (about) 1 # Releasing the training operator 2 3 ## Prerequisite 4 5 1. Permissions 6 - You need to be a member of release-team@kubeflow.org. 7 - You need write permissions on the repository to create a release tag/branch. 8 9 2. Prepare your Github Token 10 11 3. Install Github python dependencies to generate changlog 12 ``` 13 pip install PyGithub 14 ``` 15 16 ### Release Process 17 18 1. Make sure the last commit you want to release past `kubeflow-training-operator-postsubmit` testing. 19 20 1. Check out that commit (in this example, we'll use `6214e560`). 21 22 1. Depends on what version you want to release, 23 - Major or Minor version - Use the GitHub UI to cut a release branch and name the release branch `v{MAJOR}.${MINOR}-branch` 24 - Patch version - You don't need to cut release branch. 25 26 1. Create a new PR against the release branch to change container image in manifest to point to that commit hash. 27 28 ``` 29 images: 30 - name: kubeflow/training-operator 31 newName: kubeflow/training-operator 32 newTag: ${commit_hash} 33 ``` 34 35 > note: post submit job will always build a new image using the `PULL_BASE_HASH` as image tag. 36 37 1. Create a tag and push tag to upstream. 38 39 ``` 40 git tag v1.2.0 41 git push upstream v1.2.0 42 ``` 43 44 1. Run following code and fetch online git commits from last release (v1.1.0) to current release (v1.2.0). 45 46 ``` 47 git log v1.1.0..v1.2.0 --oneline 48 ``` 49 50 1. Copy above commit history to `release.py` and replace `<your_github_token>` with your Github token. 51 Run this python scripts to generate changelogs. 52 53 ``` 54 from github import Github 55 import re 56 57 58 class ChangelogGenerator: 59 def __init__(self, github_repo): 60 # Replace <your_github_token> with your Github Token 61 self._github = Github('<your_github_token>') 62 self._github_repo = self._github.get_repo(github_repo) 63 64 def generate(self, pr_id): 65 pr = self._github_repo.get_pull(pr_id) 66 67 return "{title} ([#{pr_id}]({pr_link}), @{user})".format( 68 title=pr.title, 69 pr_id=pr_id, 70 pr_link=pr.html_url, 71 user=pr.user.login 72 ) 73 74 75 # generated by `git log <oldTag>..<newTag> --oneline` 76 payload = ''' 77 6f1e96c4 Update container image for v1.2.0 (#1328) 78 47a74b73 add a specific version of tensorflow_datasets (#1305) 79 e3061132 Remove vendor folder (#1288) 80 eb362bd8 Fix invalid pointer when tfjob is deleted (#1285) 81 0c41b273 fix get_logs pod_names type and iteration blocking (#1280) 82 af5bdd58 Add job namespace to `tf_operator_jobs_*` counters (#1283) 83 6fd9489e fix custom_api.delete_namespaced_custom_object args (#1281) 84 c095f7a9 feat: upgrade kubeflow common and volcano version (#1276) 85 13b17b0e Use remote Kustomize build option in standalone installation instructions (#1266) 86 faf34868 fix: Remove the dup comment tag (#1274) 87 9a297876 add podgroups rule in cluster-role.yaml (#1272) 88 58c9bc4a Fix: the "follow" of TFJobClient.get_logs (#1254) 89 3d9e7c8a Add task type annotation for pods when EnableGangScheduling is true. (#1268) 90 8d179f70 Fix: Remove Github CD workflow (#1263) 91 ''' 92 93 g = ChangelogGenerator("kubeflow/training-operator") 94 for pr_match in re.finditer(r"#(\d+)", payload): 95 pr_id = int(pr_match.group(1)) 96 print("* {}".format(g.generate(pr_id))) 97 ``` 98 99 1. Cut release from tags and copy results from last step. You can group commits into `Features`, `Bugs` etc. 100 See example [v1.2.0 release](https://github.com/kubeflow/training-operator/releases/tag/v1.2.0) 101 102 1. Send a PR to update [CHANGELOG.md](../../CHANGELOG.md) 103