Skip to content

PiPY Wheel Release Instructions

Will edited this page Sep 3, 2024 · 62 revisions

Table of Contents

Goals

Every 2 weeks we can create a fms-hf-tuning pypi release:

Ability to test changes before push to main and before release

  • pre-release candidate is created off the main branch, which allows us to test
  • When we're ready to consider the release done, We sync the release branch with the release candidate tag Then we create a release without the rc# convention.

Release branch that is stable and tested that RH pulls from

  • ensure that this is using the release wheel with semver tag --> all using same commit

Creating a new wheel pre-release:

Pre-reqs:

0.1 Need to be an admin in https://github.com/foundation-model-stack/fms-hf-tuning

0.2 Need to know what the next release will be... can check https://pypi.org/project/fms-hf-tuning/#history

Step 1. Create a pre-release candidate from main

1.1 Go to https://github.com/foundation-model-stack/fms-hf-tuning and on the lower right under "Releases" Click on "Draft a new release"

1.2 Click on "Choose a tag" and type in the new tag name. For example, v0.1.0-rc.1 and press "create tag on publish"

1.3 For the other items:

For release title, I'm using: v0.2.0-rc.1
For Target - Leave it at main
Click on "Generate Release notes"
Don't Click on "Set as the latest release"
Click on "Set as pre-release" button.

1.4 Click on Publish release

Step 2. Check the github actions to make sure it runs to completion

https://github.com/foundation-model-stack/fms-hf-tuning/actions

It should show up as available as a release on pypi here once complete: https://pypi.org/project/fms-hf-tuning/#history

Step 3. Initial verifying of the release:

3.1. See that you can clone the new tag:

git clone --branch <tag or release name> https://github.com/foundation-model-stack/fms-hf-tuning.git

for example:

git clone --branch v0.2.0-rc.1 https://github.com/foundation-model-stack/fms-hf-tuning.git

3.2. See if you can install the new pypi file: Note: If you previously had fms-hf-tuning installed, you'll need to uninstall it: pip uninstall -y fms-hf-tuning

python -m venv .env
source .env/bin/activate
pip install --upgrade pip
pip install --pre fms-hf-tuning

and it should return the right version. For example:

pip list |grep fms
fms-hf-tuning            0.2.0rc1

3.3 Test the release Candidate!

Stop Here and do the testing of the release candidate, which means making a rc-1 sft-trainer image and testing it. See https://github.ibm.com/ai-foundation/fmaas-tuning-docs/wiki/SFT%E2%80%90Trainer%E2%80%90Image-Test-process for Testing instructions.

For quality testing, follow along with and update Release Quality Records.

To run quality tests, run .yaml files in /fmaas-tuning-docs/test/release-quality-test (currently in PR state).

Step 4. Create the Ready for Red Hat release when the IBM release candidate testing is complete and we're ready to go:

4.1 Merge the release candidate into the release branch. I did this on my laptop with the following steps:

mkdir RELEASE ; cd RELEASE
git clone https://github.com/foundation-model-stack/fms-hf-tuning.git -b release
cd fms-hf-tuning
git checkout -b v0.2.0-rc1
git branch
git remote -v
git fetch --tags origin
git tag -l
git merge <tag_name> --signoff for example:
git merge v0.2.0-rc.1 --signoff
git push --set-upstream origin v0.2.0-rc1

Since release is a protected branch, make a pull request from your newly created branch into the release branch. Make sure someone approves your PR before you merge.
When you open your PR, a name example would be: release: merge set of changes for v0.2.0
NOTE: For release branch, do a regular merge commit, do not do a squash and merge into the release branch.

NOTE, in the unlikely event you have merge conflicts, this merge command would override any release changes with what you had tested from main:

git merge -X theirs <tag_name>   for example:
git merge -X theirs v0.2.0-rc.1

Step 5. Create a new real release:

5.1 Go to https://github.com/foundation-model-stack/fms-hf-tuning and on the lower right under "Releases" Click on "Draft a new release"

5.2 Click on "Choose a tag" and type in the new tag name. For example, v0.2.0 and press "create tag on publish"

5.3 For the other items:

For release title, I'm using: v0.2.0
For Target - Change it from main to release  
Click on "Generate Release notes"
Click on "Set as the latest release"  (If that option is there...)

5.4 Click on Publish release

Step 6. Check the github actions to make sure it runs to completion

https://github.com/foundation-model-stack/fms-hf-tuning/actions

It should show up as available as a release on pypi here once complete: https://pypi.org/project/fms-hf-tuning/#history

Step 7. Make an artificatory release image:

7.1 Clone or pull the latest copy of sft-trainer-image

git clone  https://github.ibm.com/ai-foundation/sft-trainer-image.git
cd sft-trainer-image

7.2 make a new branch

git checkout -b release-v0.2.0

7.3 Clone the new tag into the sft-trainer repo:

git clone --branch v0.2.0 https://github.com/foundation-model-stack/fms-hf-tuning.git

7.4 git add the new folder with the right tag version of fms-hf-tuning

git add fms-hf-tuning

7.5 Commit it and push

git commit -sm "0.2.0 release for sft-trainer"
git push --set-upstream origin release-v0.2.0

7.6 Create a PR:

Make sure to merge into ai-foundations

for example:

ai-foundations/sft-trainer-image: main <- ai-foundations/sft-trainer-image: release-v0.2.0

https://github.ibm.com/ai-foundation/sft-trainer-image/compare/main...ai-foundation:sft-trainer-image:release-v0.2.0?expand=1

Results in: https://github.ibm.com/ai-foundation/sft-trainer-image/pull/14

7.7 The interim image is created.

You can see it here: https://v3.travis.ibm.com/github/ai-foundation/sft-trainer-image/builds/20049215

It shows:

docker-na-private.artifactory.swg-devops.com/wcp-ai-foundation-team-docker-virtual/sft-trainer:release-v0.2.0_ubi9_py311

which should compute to:

docker-na-public.artifactory.swg-devops.com/wcp-ai-foundation-team-docker-virtual/sft-trainer:release-v0.2.0_ubi9_py311

7.8 Once the PR is merged, it'll result in an "official" release image. Can see that here:

https://v3.travis.ibm.com/github/ai-foundation/sft-trainer-image/builds/20051870

Which ended up with an image of:

docker-na-private.artifactory.swg-devops.com/wcp-ai-foundation-team-docker-virtual/sft-trainer:4304af0_ubi9_py311

which on the public side would be:

docker-na-public.artifactory.swg-devops.com/wcp-ai-foundation-team-docker-virtual/sft-trainer:4304af0_ubi9_py311

Step 8. Verifying the new real release:

8.1. See that you can clone the new tag:

git clone --branch <tag or release name> https://github.com/foundation-model-stack/fms-hf-tuning.git

for example:

git clone --branch v0.2.0 https://github.com/foundation-model-stack/fms-hf-tuning.git

8.2. See if you can install the new pypi file:

python -m venv .env
source .env/bin/activate
pip install --upgrade pip
pip install fms-hf-tuning

and it should return the right version

pip list |grep fms
fms-hf-tuning            0.2.0

Step 9. Let people know on the slack channel that the release is ready. For example:

0.1.0: https://ibm-research.slack.com/archives/C0698T0FW3S/p1716242505819769 and 0.2.0 https://ibm-research.slack.com/archives/C0698T0FW3S/p1717112087215109