Skip to content

Commit

Permalink
chore(third_party): Add a script to update MLMD. (#6454)
Browse files Browse the repository at this point in the history
* chore(third_party): Add a script to update MLMD

* address comments
  • Loading branch information
zijianjoy authored Aug 27, 2021
1 parent c127996 commit 36ac7de
Show file tree
Hide file tree
Showing 3 changed files with 60 additions and 0 deletions.
23 changes: 23 additions & 0 deletions third_party/ml-metadata/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,35 @@

Upstream repo location: <https://github.com/google/ml-metadata>.

## Upgrade MLMD versions

First change the MLMD version in VERSION file in current folder, for example: $VERSION=1.2.0.

```
echo -n "\$VERSION" > VERSION
```

Run the `update_version.sh` script in current folder to update related image references:

```
./update_version.sh
```

Run update_dependencies.sh in the following way:

```
../../hack/update-all-requirements.sh
```

Make sure the generated files are as expected. Update clients as described below:

## Build golang gRPC client from proto

* [MLMD proto definitions](https://github.com/google/ml-metadata/tree/master/ml_metadata/proto)
* [grpc go quickstart](https://grpc.io/docs/languages/go/quickstart/)
* [client example code](https://github.com/grpc/grpc-go/blob/master/examples/helloworld/greeter_client/main.go)


## Build JS client from proto

Refer to [frontend/README.md](frontend/README.md) for `npm run build:replace` command.
1 change: 1 addition & 0 deletions third_party/ml-metadata/VERSION
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
1.2.0
36 changes: 36 additions & 0 deletions third_party/ml-metadata/update_version.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
#!/bin/bash

set -e

echo "Usage: update kubeflow/pipelines/third_party/ml-metadata/VERSION to new MLMD version tag by"
echo '`echo -n "\$VERSION" > VERSION` first, then run this script.'
echo "Please use the above command to make sure the file doesn't have extra"
echo "line endings."
echo "MLMD version page: https://github.com/google/ml-metadata/releases"

DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" > /dev/null && pwd)"
TAG_NAME="$(cat $DIR/VERSION)"
REPO_ROOT="$DIR/../.."

cd $REPO_ROOT
echo $PWD
echo $TAG_NAME

image_files=( "$REPO_ROOT/.cloudbuild.yaml" \
"$REPO_ROOT/.release.cloudbuild.yaml" \
"$REPO_ROOT/manifests/kustomize/base/metadata/base/metadata-grpc-deployment.yaml" \
"$REPO_ROOT/test/tag_for_hosted.sh" \
"$REPO_ROOT/v2/Makefile" \
)
for i in "${image_files[@]}"
do
echo "Replacing $i"
sed -i.bak -r "s/gcr.io\/tfx-oss-public\/ml_metadata_store_server\:[0-9.-a-z]+/gcr.io\/tfx-oss-public\/ml_metadata_store_server\:$TAG_NAME/g" "$i"
done

requirement_files=( "$REPO_ROOT/backend/metadata_writer/requirements.in" )
for i in "${requirement_files[@]}"
do
echo "Replacing $i"
sed -i.bak -r "s/ml-metadata==[0-9.-a-z]+/ml-metadata==$TAG_NAME/g" "$i"
done

0 comments on commit 36ac7de

Please sign in to comment.