-
Notifications
You must be signed in to change notification settings - Fork 1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Prow jobs to automate the release of Docker images and Python SDK (…
…#369) * Add CI script for push to master and release tag. - Publish Python SDK to pypi - Publish Docker images - Publish Helm chart Also update Prow config for test-infra with image tag: v20191211 https://github.com/kubernetes/test-infra/tree/821a860177455dab60160c7624950c2da5c092ed/prow/cluster * Install Python SDK with editable mode during testing So that setuptools_scm does not complain about missing version * Use editable mode for Python SDK installation during testing * Use consistent separator, dash instead of underscore, in script names and options * Remove duplicate README.md in sdk/python folder Reuse the same README in repository root * Push docker images with commit SHA as the tag as well, upon push to master branch
- Loading branch information
1 parent
c1e4c57
commit 68fc3b7
Showing
11 changed files
with
297 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -e | ||
set -o pipefail | ||
|
||
usage() | ||
{ | ||
echo "usage: publish-docker-image.sh | ||
--repository the target repository to upload the Docker image, example: | ||
gcr.io/kf-feast/feast-core | ||
--tag the tag for the Docker image, example: 1.0.4 | ||
--file path to the Dockerfile | ||
[--google-service-account-file | ||
path to Google Cloud service account JSON key file] | ||
" | ||
} | ||
|
||
while [ "$1" != "" ]; do | ||
case "$1" in | ||
--repository ) REPOSITORY="$2"; shift;; | ||
--tag ) TAG="$2"; shift;; | ||
--file ) FILE="$2"; shift;; | ||
--google-service-account-file ) GOOGLE_SERVICE_ACCOUNT_FILE="$2"; shift;; | ||
-h | --help ) usage; exit;; | ||
* ) usage; exit 1 | ||
esac | ||
shift | ||
done | ||
|
||
if [ -z $REPOSITORY ]; then usage; exit 1; fi | ||
if [ -z $TAG ]; then usage; exit 1; fi | ||
if [ -z $FILE ]; then usage; exit 1; fi | ||
|
||
if [ $GOOGLE_SERVICE_ACCOUNT_FILE ]; then | ||
gcloud -q auth activate-service-account --key-file $GOOGLE_SERVICE_ACCOUNT_FILE | ||
gcloud -q auth configure-docker | ||
fi | ||
|
||
echo "============================================================" | ||
echo "Building Docker image $REPOSITORY:$TAG" | ||
echo "============================================================" | ||
docker build -t $REPOSITORY:$TAG --build-arg REVISION=$TAG -f $FILE . | ||
|
||
echo "============================================================" | ||
echo "Pushing Docker image $REPOSITORY:$TAG" | ||
echo "============================================================" | ||
docker push $REPOSITORY:$TAG |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -e | ||
set -o pipefail | ||
|
||
usage() | ||
{ | ||
echo "usage: publish-python-sdk.sh | ||
--directory-path absolute path to the python package, this directory | ||
should contain 'setup.py' file | ||
--repository the repository name where the package will be uploaded, | ||
check your .pypirc configuration file for the list of | ||
valid repositories, usually it's 'pypi' or 'testpypi' | ||
" | ||
} | ||
|
||
while [ "$1" != "" ]; do | ||
case "$1" in | ||
--directory-path ) DIRECTORY_PATH="$2"; shift;; | ||
--repository ) REPOSITORY="$2"; shift;; | ||
-h | --help ) usage; exit;; | ||
* ) usage; exit 1 | ||
esac | ||
shift | ||
done | ||
|
||
if [ -z $DIRECTORY_PATH ]; then usage; exit 1; fi | ||
if [ -z $REPOSITORY ]; then usage; exit 1; fi | ||
|
||
ORIGINAL_DIR=$PWD | ||
cd $DIRECTORY_PATH | ||
|
||
echo "============================================================" | ||
echo "Generating distribution archives" | ||
echo "============================================================" | ||
python3 -m pip install --user --upgrade setuptools wheel | ||
python3 setup.py sdist bdist_wheel | ||
|
||
echo "============================================================" | ||
echo "Uploading distribution archives" | ||
echo "============================================================" | ||
python3 -m pip install --user --upgrade twine | ||
python3 -m twine upload --repository $REPOSITORY dist/* | ||
|
||
cd $ORIGINAL_DIR |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.