Skip to content

Commit

Permalink
Rebase 1.9 to master (kubeflow#2712)
Browse files Browse the repository at this point in the history
* Fix kserve upgrade script and update kserve diagram (kubeflow#2702)

* Fix kserve upgrade script and update kserve diagram

Signed-off-by: Sivanantham Chinnaiyan <sivanantham.chinnaiyan@ideas2it.com>

* Update Readme

Signed-off-by: Sivanantham Chinnaiyan <sivanantham.chinnaiyan@ideas2it.com>

---------

Signed-off-by: Sivanantham Chinnaiyan <sivanantham.chinnaiyan@ideas2it.com>

* update cert-manager to 1.14.5 (kubeflow#2703)

Signed-off-by: juliusvonkohout <45896133+juliusvonkohout@users.noreply.github.com>

* Upgrade bentoml to 1.2.28 and 1.1.21 (kubeflow#2704)

* Upgrade bentoml to 1.2.28 and 1.1.21

Signed-off-by: Andrea Lamparelli <a.lamparelli95@gmail.com>

* Bentoml skip broken curl in kind test

Signed-off-by: Andrea Lamparelli <a.lamparelli95@gmail.com>

---------

Signed-off-by: Andrea Lamparelli <a.lamparelli95@gmail.com>

* Refactor test workflows  (kubeflow#2693)

* Renamed workflow files
* Fixed dependency files
* Upgrade actions/checkout to v4

Signed-off-by: Andrea Lamparelli <a.lamparelli95@gmail.com>

* update readme (kubeflow#2707)

Signed-off-by: juliusvonkohout <45896133+juliusvonkohout@users.noreply.github.com>

* Upgrade dex to 2.39.1 (kubeflow#2710)

Signed-off-by: Andrea Lamparelli <a.lamparelli95@gmail.com>

* Upgrade knative to v1.12.4 (kubeflow#2709)

* Add common/knative sync script

Signed-off-by: Andrea Lamparelli <a.lamparelli95@gmail.com>

* Update common/knative manifests from v1.12.4/v1.12.6

Signed-off-by: Andrea Lamparelli <a.lamparelli95@gmail.com>

---------

Signed-off-by: Andrea Lamparelli <a.lamparelli95@gmail.com>

* Fixes for dco changes (kubeflow#2713)

* Fix kserve upgrade script and update kserve diagram (kubeflow#2702)

* Fix kserve upgrade script and update kserve diagram

Signed-off-by: Sivanantham Chinnaiyan <sivanantham.chinnaiyan@ideas2it.com>

* Update Readme

Signed-off-by: Sivanantham Chinnaiyan <sivanantham.chinnaiyan@ideas2it.com>

---------

Signed-off-by: Sivanantham Chinnaiyan <sivanantham.chinnaiyan@ideas2it.com>
Signed-off-by: juliusvonkohout <45896133+juliusvonkohout@users.noreply.github.com>

* update cert-manager to 1.14.5 (kubeflow#2703)

Signed-off-by: juliusvonkohout <45896133+juliusvonkohout@users.noreply.github.com>

* Upgrade bentoml to 1.2.28 and 1.1.21 (kubeflow#2704)

* Upgrade bentoml to 1.2.28 and 1.1.21

Signed-off-by: Andrea Lamparelli <a.lamparelli95@gmail.com>

* Bentoml skip broken curl in kind test

Signed-off-by: Andrea Lamparelli <a.lamparelli95@gmail.com>

---------

Signed-off-by: Andrea Lamparelli <a.lamparelli95@gmail.com>
Signed-off-by: juliusvonkohout <45896133+juliusvonkohout@users.noreply.github.com>

* Refactor test workflows  (kubeflow#2693)

* Renamed workflow files
* Fixed dependency files
* Upgrade actions/checkout to v4

Signed-off-by: Andrea Lamparelli <a.lamparelli95@gmail.com>
Signed-off-by: juliusvonkohout <45896133+juliusvonkohout@users.noreply.github.com>

* update readme (kubeflow#2707)

Signed-off-by: juliusvonkohout <45896133+juliusvonkohout@users.noreply.github.com>

* Upgrade dex to 2.39.1 (kubeflow#2710)

Signed-off-by: Andrea Lamparelli <a.lamparelli95@gmail.com>
Signed-off-by: juliusvonkohout <45896133+juliusvonkohout@users.noreply.github.com>

* Upgrade knative to v1.12.4 (kubeflow#2709)

* Add common/knative sync script

Signed-off-by: Andrea Lamparelli <a.lamparelli95@gmail.com>

* Update common/knative manifests from v1.12.4/v1.12.6

Signed-off-by: Andrea Lamparelli <a.lamparelli95@gmail.com>

---------

Signed-off-by: Andrea Lamparelli <a.lamparelli95@gmail.com>
Signed-off-by: juliusvonkohout <45896133+juliusvonkohout@users.noreply.github.com>

---------

Signed-off-by: Sivanantham Chinnaiyan <sivanantham.chinnaiyan@ideas2it.com>
Signed-off-by: juliusvonkohout <45896133+juliusvonkohout@users.noreply.github.com>
Signed-off-by: Andrea Lamparelli <a.lamparelli95@gmail.com>
Co-authored-by: Sivanantham <90966311+sivanantha321@users.noreply.github.com>
Co-authored-by: Andrea Lamparelli <a.lamparelli95@gmail.com>

---------

Signed-off-by: Sivanantham Chinnaiyan <sivanantham.chinnaiyan@ideas2it.com>
Signed-off-by: juliusvonkohout <45896133+juliusvonkohout@users.noreply.github.com>
Signed-off-by: Andrea Lamparelli <a.lamparelli95@gmail.com>
Co-authored-by: Sivanantham <90966311+sivanantha321@users.noreply.github.com>
Co-authored-by: Andrea Lamparelli <a.lamparelli95@gmail.com>
  • Loading branch information
3 people authored and rimolive committed Jul 2, 2024
1 parent 38a8183 commit f02b04b
Showing 1 changed file with 145 additions and 0 deletions.
145 changes: 145 additions & 0 deletions hack/sync-knative-manifests.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,145 @@
#!/usr/bin/env bash

# This script aims at helping create a PR to update the manifests of the
# knative.
# This script:
# 1. Checks out a new branch
# 2. Download files into the correct places
# 3. Commits the changes
#
# Afterwards the developers can submit the PR to the kubeflow/manifests
# repo, based on that local branch
# It must be executed directly from its directory

# strict mode http://redsymbol.net/articles/unofficial-bash-strict-mode/
set -euxo pipefail
IFS=$'\n\t'

KN_SERVING_RELEASE="v1.12.4" # Must be a release
KN_EXTENSION_RELEASE="v1.12.3" # Must be a release
KN_EVENTING_RELEASE="v1.12.6" # Must be a release
BRANCH=${BRANCH:=sync-knative-manifests-${KN_SERVING_RELEASE?}}

SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
MANIFESTS_DIR=$(dirname $SCRIPT_DIR)

# replace source regex ($1) with target regex ($2)
# in file ($3)
replace_in_file() {
SRC_TXT=$1
DST_TXT=$2
sed -i "s|$SRC_TXT|$DST_TXT|g" $3
}

echo "Creating branch: ${BRANCH}"

if [ -n "$(git status --porcelain)" ]; then
echo "WARNING: You have uncommitted changes"
fi
if [ `git branch --list $BRANCH` ]
then
echo "WARNING: Branch $BRANCH already exists."
fi

# Create the branch in the manifests repository
if ! git show-ref --verify --quiet refs/heads/$BRANCH; then
git checkout -b $BRANCH
else
echo "Branch $BRANCH already exists."
fi

if [ -n "$(git status --porcelain)" ]; then
echo "WARNING: You have uncommitted changes"
fi

DST_DIR=$MANIFESTS_DIR/common/knative
if [ -d "$DST_DIR" ]; then
# keep README and OWNERS file
rm -r "$DST_DIR/knative-serving/base/upstream"
rm "$DST_DIR/knative-serving-post-install-jobs/base/serving-post-install-jobs.yaml"
rm -r "$DST_DIR/knative-eventing/base/upstream"
rm "$DST_DIR/knative-eventing-post-install-jobs/base/eventing-post-install.yaml"
fi

mkdir -p "$DST_DIR/knative-serving/base/upstream"
mkdir -p "$DST_DIR/knative-serving-post-install-jobs/base"
mkdir -p "$DST_DIR/knative-eventing/base/upstream"
mkdir -p "$DST_DIR/knative-eventing-post-install-jobs/base"

echo "Downloading knative-serving manifests..."
# No need to install serving-crds.
# See: https://github.com/knative/serving/issues/9945
wget -O $DST_DIR/knative-serving/base/upstream/serving-core.yaml "https://github.com/knative/serving/releases/download/knative-$KN_SERVING_RELEASE/serving-core.yaml"
wget -O $DST_DIR/knative-serving/base/upstream/net-istio.yaml "https://github.com/knative-extensions/net-istio/releases/download/knative-$KN_EXTENSION_RELEASE/net-istio.yaml"
wget -O $DST_DIR/knative-serving-post-install-jobs/base/serving-post-install-jobs.yaml "https://github.com/knative/serving/releases/download/knative-$KN_SERVING_RELEASE/serving-post-install-jobs.yaml"

yq eval -i '... comments=""' $DST_DIR/knative-serving/base/upstream/serving-core.yaml
yq eval -i '... comments=""' $DST_DIR/knative-serving/base/upstream/net-istio.yaml
yq eval -i '... comments=""' $DST_DIR/knative-serving-post-install-jobs/base/serving-post-install-jobs.yaml

yq eval -i 'explode(.)' $DST_DIR/knative-serving/base/upstream/serving-core.yaml
yq eval -i 'explode(.)' $DST_DIR/knative-serving/base/upstream/net-istio.yaml
yq eval -i 'explode(.)' $DST_DIR/knative-serving-post-install-jobs/base/serving-post-install-jobs.yaml

# We are not using the '|=' operator because it generates an empty object
# ({}) which crashes kustomize.
yq eval -i 'select(.kind == "Job" and .metadata.generateName == "storage-version-migration-serving-") | .metadata.name = "storage-version-migration-serving"' $DST_DIR/knative-serving-post-install-jobs/base/serving-post-install-jobs.yaml

echo "Downloading knative-eventing manifests..."

wget -O $DST_DIR/knative-eventing/base/upstream/eventing-core.yaml "https://github.com/knative/eventing/releases/download/knative-$KN_EVENTING_RELEASE/eventing-core.yaml"
wget -O $DST_DIR/knative-eventing/base/upstream/in-memory-channel.yaml "https://github.com/knative/eventing/releases/download/knative-$KN_EVENTING_RELEASE/in-memory-channel.yaml"
wget -O $DST_DIR/knative-eventing/base/upstream/mt-channel-broker.yaml "https://github.com/knative/eventing/releases/download/knative-$KN_EVENTING_RELEASE/mt-channel-broker.yaml"
wget -O $DST_DIR/knative-eventing-post-install-jobs/base/eventing-post-install.yaml "https://github.com/knative/eventing/releases/download/knative-$KN_EVENTING_RELEASE/eventing-post-install.yaml"

yq eval -i '... comments=""' $DST_DIR/knative-eventing/base/upstream/eventing-core.yaml
yq eval -i '... comments=""' $DST_DIR/knative-eventing/base/upstream/in-memory-channel.yaml
yq eval -i '... comments=""' $DST_DIR/knative-eventing/base/upstream/mt-channel-broker.yaml
yq eval -i '... comments=""' $DST_DIR/knative-eventing-post-install-jobs/base/eventing-post-install.yaml

yq eval -i 'explode(.)' $DST_DIR/knative-eventing/base/upstream/eventing-core.yaml
yq eval -i 'explode(.)' $DST_DIR/knative-eventing/base/upstream/in-memory-channel.yaml
yq eval -i 'explode(.)' $DST_DIR/knative-eventing/base/upstream/mt-channel-broker.yaml
yq eval -i 'explode(.)' $DST_DIR/knative-eventing-post-install-jobs/base/eventing-post-install.yaml

# We are not using the '|=' operator because it generates an empty object
# ({}) which crashes kustomize.
yq eval -i 'select(.kind == "Job" and .metadata.generateName == "storage-version-migration-eventing-") | .metadata.name = "storage-version-migration-eventing"' $DST_DIR/knative-eventing-post-install-jobs/base/eventing-post-install.yaml

yq eval -i 'select((.kind == "ConfigMap" and .metadata.name == "config-observability") | not)' $DST_DIR/knative-eventing/base/upstream/in-memory-channel.yaml
yq eval -i 'select((.kind == "ConfigMap" and .metadata.name == "config-tracing") | not)' $DST_DIR/knative-eventing/base/upstream/in-memory-channel.yaml

echo "Successfully copied all manifests."

echo "Updating README..."

replace_in_file \
"\[.*\](https://github.com/knative/serving/releases/tag/knative-.*) <" \
"\[$KN_SERVING_RELEASE\](https://github.com/knative/serving/releases/tag/knative-$KN_SERVING_RELEASE) <" \
${MANIFESTS_DIR}/README.md

replace_in_file \
"> \[.*\](https://github.com/knative/eventing/releases/tag/knative-.*)" \
"> \[$KN_EVENTING_RELEASE\](https://github.com/knative/eventing/releases/tag/knative-$KN_EVENTING_RELEASE)" \
${MANIFESTS_DIR}/README.md

replace_in_file \
"\[Knative serving (v.*)\](https://github.com/knative/serving/releases/tag/knative-v.*)" \
"\[Knative serving ($KN_SERVING_RELEASE)\](https://github.com/knative/serving/releases/tag/knative-$KN_SERVING_RELEASE)" \
$DST_DIR/README.md

replace_in_file \
"\[Knative ingress controller for Istio (v.*)\](https://github.com/knative-extensions/net-istio/releases/tag/knative-v.*)" \
"\[Knative ingress controller for Istio ($KN_EXTENSION_RELEASE)\](https://github.com/knative-extensions/net-istio/releases/tag/knative-$KN_EXTENSION_RELEASE)" \
$DST_DIR/README.md

replace_in_file \
"The manifests for Knative Eventing are based off the \[v.* release\](https://github.com/knative/eventing/releases/tag/knative-v.*)" \
"The manifests for Knative Eventing are based off the \[$KN_EVENTING_RELEASE release\](https://github.com/knative/eventing/releases/tag/knative-$KN_EVENTING_RELEASE)" \
$DST_DIR/README.md

echo "Committing the changes..."
cd $MANIFESTS_DIR
git add $DST_DIR
git add README.md
git commit -s -m "Update common/knative manifests from ${KN_SERVING_RELEASE}/${KN_EVENTING_RELEASE}"

0 comments on commit f02b04b

Please sign in to comment.