Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some new thoughts on cutting a release, especially scripts/release.sh #309

Merged
merged 37 commits into from
Jun 24, 2024
Merged
Show file tree
Hide file tree
Changes from 33 commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
3dd1c9c
Some new thoughts on cutting a release, especially scripts/release.sh
daw3rd Jun 19, 2024
04fb1dc
Minor updates to release.sh script
daw3rd Jun 20, 2024
98a41b5
Update repo.md for 2 make users and add workflow test of global make …
daw3rd Jun 20, 2024
2d006a5
Update release.sh script for testing
daw3rd Jun 20, 2024
cc6b3aa
more testing or release.sh script
daw3rd Jun 20, 2024
4fc4f9c
More release.sh
daw3rd Jun 20, 2024
8de2c49
Revert to dev versions
daw3rd Jun 20, 2024
e49cbaa
release.sh
daw3rd Jun 20, 2024
db921b9
release.sh
daw3rd Jun 20, 2024
1451277
release.sh
daw3rd Jun 20, 2024
c276b71
release.sh
daw3rd Jun 20, 2024
a026584
release.sh
daw3rd Jun 20, 2024
4b6f41b
release.sh
daw3rd Jun 20, 2024
15317ef
release.sh
daw3rd Jun 20, 2024
7d5ca76
updated repo.md on makefiles
daw3rd Jun 20, 2024
679d637
Merge branch 'dev' into releasing
daw3rd Jun 20, 2024
c85c68a
add publish target to superworkflows Makefile
daw3rd Jun 20, 2024
2a7bcb9
More release work
daw3rd Jun 20, 2024
12f315b
add publish target to kind/Makefile
daw3rd Jun 20, 2024
6c0d4ab
install ../python for spark transforms in .make.defaults
daw3rd Jun 21, 2024
f6bd444
fix kfp set versions, and noop versions
daw3rd Jun 21, 2024
103f559
Fix versioning in .make* and typo in noop/ray/pyproject.tmo
daw3rd Jun 21, 2024
7b3be84
Merge branch 'dev' into releasing
daw3rd Jun 21, 2024
7f7a264
comments and dont created empty pyproject.toml in .make.defaults
daw3rd Jun 21, 2024
52e4eb7
update release.sh to apply final version changes
daw3rd Jun 21, 2024
6211b50
Version updates, version setting fixes, noop spark Dockerfile,
daw3rd Jun 21, 2024
af8ce1c
Merge branch 'dev' into releasing
daw3rd Jun 21, 2024
51fe74c
set-versions inputcode2parquet'
daw3rd Jun 21, 2024
3db00f7
restore INGEST_TO_PARQUET_VERSION removed in recent commit"
daw3rd Jun 21, 2024
caa42b4
updated repo.md to point to include link to transform conventions
daw3rd Jun 21, 2024
b43683f
fix transform link added to repo.md in last commit
daw3rd Jun 21, 2024
fcc6136
Merge branch 'dev' into releasing
daw3rd Jun 23, 2024
67d3357
fixed code2parquet versions from last merge and uninstall libs in bet…
daw3rd Jun 23, 2024
37a24d0
Merge branch 'dev' into releasing
daw3rd Jun 24, 2024
40ccc4c
remove redundant pip uninstall in .make.defaults
daw3rd Jun 24, 2024
0123b7e
Fix transform version settings when python transform code is referenced
daw3rd Jun 24, 2024
87a7549
.make.versions changes - remove redancy and unused macros, and define…
daw3rd Jun 24, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,14 @@ on:
branches:
- "dev"
jobs:
test-make:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Test top-level recursive make targets.
run: |
make -n clean test build publish set-versions
test-python-lib:
runs-on: ubuntu-latest
steps:
Expand Down
43 changes: 22 additions & 21 deletions .make.defaults
Original file line number Diff line number Diff line change
Expand Up @@ -255,8 +255,6 @@ __check_defined = \
# PYTHON_PROJECT_DIR is expected to have src and pyproject.toml
.PHONY: .defaults.install-src-venv
.defaults.install-src-venv::
@# Help: Install Ray and Python data processing library source into existing venv
@echo Installing Ray and Python data processing library source to existing venv
@source venv/bin/activate; \
if [ ! -z "$(EXTRA_INDEX_URL)" ]; then \
extra_url='--extra-index-url $(EXTRA_INDEX_URL)'; \
Expand Down Expand Up @@ -306,8 +304,8 @@ __check_defined = \
@echo Installing Ray and Python data processing library source to existing venv
@source venv/bin/activate; \
pip install pytest; \
$(MAKE) PIP_TARGET=data-prep-toolkit .defaults.pip-uninstall; \
$(MAKE) PIP_TARGET=data-prep-toolkit-ray .defaults.pip-uninstall; \
$(MAKE) PIP_TARGET=data-prep-toolkit .defaults.pip-uninstall; \
$(MAKE) PYTHON_PROJECT_DIR=$(DPK_PYTHON_LIB_DIR) .defaults.install-src-venv; \
$(MAKE) PYTHON_PROJECT_DIR=$(DPK_RAY_LIB_DIR) .defaults.install-src-venv; \
echo Installed source from Ray data processing library for `which $(PYTHON)`; \
Expand All @@ -327,8 +325,8 @@ __check_defined = \
@echo Installing Spark and Python data processing library source to existing venv
@source venv/bin/activate; \
pip install pytest; \
$(MAKE) PIP_TARGET=data-prep-toolkit .defaults.pip-uninstall; \
$(MAKE) PIP_TARGET=data-prep-toolkit-spark .defaults.pip-uninstall; \
$(MAKE) PIP_TARGET=data-prep-toolkit .defaults.pip-uninstall; \
$(MAKE) PYTHON_PROJECT_DIR=$(DPK_PYTHON_LIB_DIR) .defaults.install-src-venv; \
$(MAKE) PYTHON_PROJECT_DIR=$(DPK_SPARK_LIB_DIR) .defaults.install-src-venv; \
if [ -d ../python ]; then \
Expand Down Expand Up @@ -495,30 +493,36 @@ MINIO_ADMIN_PWD= localminiosecretkey
# Expects TOML_VERSION
.PHONY: .defaults.update-toml
.defaults.update-toml:
$(MAKE) TOML_VERSION=$(TOML_VERSION) .defaults.set-toml-version
$(MAKE) .defaults.update-toml-lib-dep-versions
if [ -e pyproject.toml ]; then \
$(MAKE) TOML_VERSION=$(TOML_VERSION) .defaults.__set-toml-version; \
$(MAKE) .defaults.__update-toml-lib-dep-versions; \
fi

# Changes the version field of the pyproject.toml file to the given version
# Expects TOML_VERSION
.PHONY: .defaults.set-toml-version
.defaults.set-toml-version:
.PHONY: .defaults.__set-toml-version
.defaults.__set-toml-version:
@# Help: Set the version= field of pyproject.toml
cat pyproject.toml | sed -e \
's/^version[ ]*=.*/version = "'${TOML_VERSION}'"/' \
> tt.toml
mv tt.toml pyproject.toml
if [ -e pyproject.toml ]; then \
cat pyproject.toml | sed -e \
's/^version[ ]*=.*/version = "'${TOML_VERSION}'"/' \
> tt.toml; \
mv tt.toml pyproject.toml; \
fi

# Updates the versions references to our repo source as defined in .make.versions
.PHONY: .defaults.update-toml-lib-dep-versions
.defaults.update-toml-lib-dep-versions:
.PHONY: .defaults.__update-toml-lib-dep-versions
.defaults.__update-toml-lib-dep-versions:
@# Help: Update pyproject.toml to depend on lib versions defined in .make.versions
cat pyproject.toml | sed \
if [ -e pyproject.toml ]; then \
cat pyproject.toml | sed \
-e 's/"data-prep-toolkit-ray\(..\).*",/"data-prep-toolkit-ray\1$(DPK_LIB_VERSION)",/' \
-e 's/"data-prep-toolkit-spark\(..\).*",/"data-prep-toolkit-spark\1$(DPK_LIB_VERSION)",/' \
-e 's/"data-prep-toolkit-kfp\(..\).*",/"data-prep-toolkit-spark\1$(DPK_LIB_KFP_VERSION)",/' \
-e 's/"data-prep-toolkit-kfp\(..\).*",/"data-prep-toolkit-kfp\1$(DPK_LIB_KFP_VERSION)",/' \
-e 's/"data-prep-toolkit\([=><][=><]\).*",/"data-prep-toolkit\1$(DPK_LIB_VERSION)",/' \
> tt.toml
mv tt.toml pyproject.toml
> tt.toml; \
mv tt.toml pyproject.toml; \
fi

# Build the distribution, usually in preparation for publishing using ith the .defaults.publish-dist target
.PHONY: .defaults.build-dist
Expand All @@ -543,6 +547,3 @@ MINIO_ADMIN_PWD= localminiosecretkey
fi
${PYTHON} -m twine check dist/*
${PYTHON} -m twine upload --verbose --non-interactive dist/*
#@echo "create a git tag to reference published version"
#@git tag ${TAG}
#@git push origin ${TAG}
86 changes: 49 additions & 37 deletions .make.versions
Original file line number Diff line number Diff line change
Expand Up @@ -2,60 +2,72 @@
# Here we attempt to capture/define all the version numbers used across the
# repository in Makefile format. These are generally considered the version
# numbers TO BE published on the NEXT release/publishing of artifacts.
#
# NOTE: If you modify any of the version numbers, you MUST run "make set-versions"
# from the top of the repo to have the new versions applied throughout the repo.
#
################################################################################

# do
# % make RELEASE_VERSION_SUFFIX= set-version
# % git push, tag, etc.
# % make build, publish, etc.
RELEASE_VERSION_SUFFIX=.dev6

# This major versions is generally changed manually when a breaking change to apis is made in the libraries, for example.
DPK_MAJOR_VERSION=0
# The minor version is incremented manually when significant features have been added that are backward compatible with the previous major.minor release.
DPK_MINOR_VERSION=2
# The minor version is incremented AUTOMATICALLY by the release.sh script when a new release is set.
DPK_MICRO_VERSION=0
# The suffix is generally always set in the main/development branch and only nulled out when creating release branches.
# It can be manually incremented, for example, to allow publishing a new intermediate version wheel to pypi.
DPK_VERSION_SUFFIX=.dev6

DPK_VERSION=$(DPK_MAJOR_VERSION).$(DPK_MINOR_VERSION).$(DPK_MICRO_VERSION)$(DPK_VERSION_SUFFIX)

# Data prep lab wheel version
DPK_LIB_VERSION=0.2.0$(RELEASE_VERSION_SUFFIX)
DPK_LIB_KFP_VERSION=0.2.0$(RELEASE_VERSION_SUFFIX)
DPK_LIB_KFP_VERSION_v2=0.2.0$(RELEASE_VERSION_SUFFIX)
DPK_LIB_KFP_SHARED=0.2.0$(RELEASE_VERSION_SUFFIX)
DPK_LIB_VERSION=$(DPK_VERSION)
DPK_LIB_KFP_VERSION=$(DPK_VERSION)
DPK_LIB_KFP_VERSION_v2=$(DPK_VERSION)
DPK_LIB_KFP_SHARED=$(DPK_VERSION)

# Begin transform versions/tags
BLOCKLIST_VERSION=0.4.2$(RELEASE_VERSION_SUFFIX)

DOC_ID_RAY_VERSION=0.4.0$(RELEASE_VERSION_SUFFIX)
DOC_ID_SPARK_VERSION=0.4.0$(RELEASE_VERSION_SUFFIX)
BLOCKLIST_VERSION=$(DPK_VERSION)

EDEDUP_RAY_VERSION=0.4.0$(RELEASE_VERSION_SUFFIX)
DOC_ID_RAY_VERSION=$(DPK_VERSION)
DOC_ID_SPARK_VERSION=$(DPK_VERSION)

FDEDUP_RAY_VERSION=0.4.0$(RELEASE_VERSION_SUFFIX)
EDEDUP_RAY_VERSION=$(DPK_VERSION)

FILTER_PYTHON_VERSION=0.4.0$(RELEASE_VERSION_SUFFIX)
FILTER_RAY_VERSION=0.4.0$(RELEASE_VERSION_SUFFIX)
FILTER_SPARK_VERSION=0.2.0$(RELEASE_VERSION_SUFFIX)
FDEDUP_RAY_VERSION=$(DPK_VERSION)

NOOP_PYTHON_VERSION=0.9.0$(RELEASE_VERSION_SUFFIX)
NOOP_RAY_VERSION=0.9.0$(RELEASE_VERSION_SUFFIX)
NOOP_SPARK_VERSION=0.2.0$(RELEASE_VERSION_SUFFIX)
PROFILER_RAY_VERSION=0.2.0$(RELEASE_VERSION_SUFFIX)
FILTER_PYTHON_VERSION=$(DPK_VERSION)
FILTER_RAY_VERSION=$(DPK_VERSION)
FILTER_SPARK_VERSION=$(DPK_VERSION)

RESIZE_VERSION=0.4.0$(RELEASE_VERSION_SUFFIX)
NOOP_PYTHON_VERSION=$(DPK_VERSION)
NOOP_RAY_VERSION=$(DPK_VERSION)
NOOP_SPARK_VERSION=$(DPK_VERSION)
PROFILER_VERSION=$(DPK_VERSION)
PROFILER_RAY_VERSION=$(DPK_VERSION)

LANG_ID_PYTHON_VERSION=0.4.0$(RELEASE_VERSION_SUFFIX)
LANG_ID_RAY_VERSION=0.4.0$(RELEASE_VERSION_SUFFIX)
RESIZE_VERSION=$(DPK_VERSION)

TOKENIZATION_RAY_VERSION=0.4.0$(RELEASE_VERSION_SUFFIX)
TOKENIZATION_PYTHON_VERSION=0.4.0$(RELEASE_VERSION_SUFFIX)
LANG_ID_PYTHON_VERSION=$(DPK_VERSION)
LANG_ID_RAY_VERSION=$(DPK_VERSION)

MALWARE_PYTHON_VERSION=0.5.0$(RELEASE_VERSION_SUFFIX)
MALWARE_RAY_VERSION=0.5.0$(RELEASE_VERSION_SUFFIX)
TOKENIZATION_RAY_VERSION=$(DPK_VERSION)
TOKENIZATION_PYTHON_VERSION=$(DPK_VERSION)

PROGLANG_SELECT_RAY_VERSION=0.4.0$(RELEASE_VERSION_SUFFIX)
MALWARE_RAY_VERSION=$(DPK_VERSION)
MALWARE_PYTHON_VERSION=$(DPK_VERSION)

CODE_QUALITY_PYTHON_VERSION=0.4.0$(RELEASE_VERSION_SUFFIX)
CODE_QUALITY_RAY_VERSION=0.4.0$(RELEASE_VERSION_SUFFIX)
PROGLANG_SELECT_RAY_VERSION=$(DPK_VERSION)

CODE2PARQUET_PYTHON_VERSION=0.4.0$(RELEASE_VERSION_SUFFIX)
CODE2PARQUET_RAY_VERSION=0.4.0$(RELEASE_VERSION_SUFFIX)
CODE_QUALITY_RAY_VERSION=$(DPK_VERSION)
CODE_QUALITY_PYTHON_VERSION=$(DPK_VERSION)
CODE_QUALITY_RAY_VERSION=$(DPK_VERSION)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It appears twice.


INGEST_TO_PARQUET_VERSION=0.4.0$(RELEASE_VERSION_SUFFIX)
CODE2PARQUET_PYTHON_VERSION=$(DPK_VERSION)
CODE2PARQUET_RAY_VERSION=$(DPK_VERSION)
INGEST_TO_PARQUET_VERSION=$(DPK_VERSION)

KFP_DOCKER_VERSION=$(DPK_VERSION)
KFP_DOCKER_VERSION_v2=$(DPK_VERSION)

KFP_DOCKER_VERSION=0.2.0$(RELEASE_VERSION_SUFFIX)
KFP_DOCKER_VERSION_v2=0.2.0$(RELEASE_VERSION_SUFFIX)
1 change: 1 addition & 0 deletions .secrets.baseline
Original file line number Diff line number Diff line change
Expand Up @@ -132,3 +132,4 @@
"hash": null
}
}

30 changes: 21 additions & 9 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -51,15 +51,27 @@ set-versions:
@# Help: Recursively $@ in all subdirs
@$(MAKE) RULE=$@ .recurse

lib-release:
@# Help: Publish data-prep-kit $(DPK_LIB_VERSION) and data-prep-kit-kfp $(DPK_LIB_KFP_VERSION) libraries to pypi
@$(MAKE) -C $(DPK_PYTHON_LIB_DIR) build publish
@$(MAKE) -C $(DPK_RAY_LIB_DIR) build publish
@$(MAKE) -C $(DPK_SPARK_LIB_DIR) build publish
@$(MAKE) -C kfp/kfp_support_lib build publish
@echo ""
@echo "This modified files in the repo. Please be sure to commit/push back to the repository."
@echo ""
#set-release-verions:
# @# Help: Update all internally used versions to not include the release suffix.
# @$(MAKE) DPK_VERSION_SUFFIX= set-versions

#lib-release:
# @# Help: Set versions to be unsuffixed and publish libraries
# @$(MAKE) set-release-versions
# @$(MAKE) publish-lib

show-version:
@echo $(DPK_VERSION)

#publish-lib:
# @# Help: Publish data-prep-kit $(DPK_LIB_VERSION) and data-prep-kit-kfp $(DPK_LIB_KFP_VERSION) libraries to pypi
# @$(MAKE) -C $(DPK_PYTHON_LIB_DIR) build publish
# @$(MAKE) -C $(DPK_RAY_LIB_DIR) build publish
# @$(MAKE) -C $(DPK_SPARK_LIB_DIR) build publish
# @$(MAKE) -C kfp/kfp_support_lib build publish
# @echo ""
# @echo "This modified files in the repo. Please be sure to commit/push back to the repository."
# @echo ""



57 changes: 57 additions & 0 deletions RELEASE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# Release Management

Release are created from the main repository branch using the version
numbers, including an intermediate version suffix,
defined in `.make.versions`.
The following points are important:

1. `.make.versions` contains the version to be used when publishing the **next** release.
1. The main branch always has the version suffix set to .dev<N>, which
allows intermediate publishing from the dev branch using version X.Y.Z.dev<N>.
2. In general, common version number is used for all published pypi wheels and docker images.
3. The `scripts/release.sh` script automates the following:
1. Creating a `release/vX.Y.Z` branch and `vX.Y.Z` tag
2. Nulling out the version suffix in the new branch's `.make.version` file.
3. Applying the unsuffixed versions to the artifacts published from the repo.
4. Building and publishing the wheels to pypi and images to a docker registry.
5. Incrementing the minor version and resetting the suffix in the main branch.

# Cutting the release
Creating the release requires running the `release.sh` script and optionally
generating a release on github. The latter can be performed manually
once the `release.sh` script has done its work.

## release.sh
Running `release.sh` requires credentials to publish to the various cloud locations.

For docker registry publishing, the following environment variables/credentials are needed:

* DPK_DOCKER_REGISTRY_USER - user used with the registry defined in DOCKER_HOST in `.make.defaults`
* DPK_DOCKER_REGISTRY_KEY - key/password for docker registry user.

To publish to pypi, the credentials in `~/.pypirc` file (let us know if there is a way to do
this with environment variables).
See [pypi](https://packaging.python.org/en/latest/specifications/pypirc/) for details.

To see the version that will be published,
```
make DPK_VERSION_SUFFIX= show-version
```
This will print for example, 1.2.3.

To generate the release :
```shell
bash scripts/release.sh
```

## Github release
After running the `release.sh` script, to create tag `vX.Y.Z` and branch `releases/vX.Y.Z`
1. Go to the [releases page](https://github.com/IBM/data-prep-kit/releases).
2. Select `Draft a new release`
3. Select `Choose a tag -> vX.Y.Z`
4. Press `Generate release notes`
5. Add a title (e.g., Release X.Y.Z)
6. Add any additional relese notes.
7. Press `Publish release`


Loading