Skip to content

Commit

Permalink
Automate updating the self-hosted artifact tracker's vizier, operator…
Browse files Browse the repository at this point in the history
… and cli version (#2076)

Summary: Automate updating the self-hosted artifact tracker's vizier,
operator and cli version

This was previously done manually and from talking with end users in
Slack people are often running very old Vizier versions as a result.
Let's include updating this file in the same automation that updates the
README on releases.

Relevant Issues: Closes #1907

Type of change: /kind cleanup

Test Plan: Tested the script with the various release types
```
$ ./ci/update_files_with_release_versions.sh vizier 0.14.15 '<!--vizier-latest-release'
$ git diff k8s
diff --git a/k8s/cloud/public/base/artifact_tracker_versions.yaml b/k8s/cloud/public/base/artifact_tracker_versions.yaml
index 69fbcaf46..1aa87c7e5 100644
--- a/k8s/cloud/public/base/artifact_tracker_versions.yaml
+++ b/k8s/cloud/public/base/artifact_tracker_versions.yaml
@@ -12,7 +12,7 @@ spec:
         - name: artifact-tracker-server
           env:
             - name: PL_VIZIER_VERSION
-              value: "0.14.14"
+              value: "0.14.15"
             - name: PL_CLI_VERSION
               value: "0.8.5"
             - name: PL_OPERATOR_VERSION
# Remove changes
$ git checkout -- k8s
$ ./ci/update_files_with_release_versions.sh cli 0.14.15 '<!--cli-latest-release'
ddelnano@dev-vm:~/code/pixie-extra (ddelnano/update-artifact-versions-on-release) $ git diff k8s/
diff --git a/k8s/cloud/public/base/artifact_tracker_versions.yaml b/k8s/cloud/public/base/artifact_tracker_versions.yaml
index 69fbcaf46..e0b50ee83 100644
--- a/k8s/cloud/public/base/artifact_tracker_versions.yaml
+++ b/k8s/cloud/public/base/artifact_tracker_versions.yaml
@@ -14,6 +14,6 @@ spec:
             - name: PL_VIZIER_VERSION
               value: "0.14.14"
             - name: PL_CLI_VERSION
-              value: "0.8.5"
+              value: "0.14.15"
             - name: PL_OPERATOR_VERSION
               value: "0.1.7"

# Remove changes
$ git checkout -- k8s
$ ./ci/update_files_with_release_versions.sh operator 0.14.15 '<!--operator-latest-release'
$ git diff k8s
diff --git a/k8s/cloud/public/base/artifact_tracker_versions.yaml b/k8s/cloud/public/base/artifact_tracker_versions.yaml
index 69fbcaf46..6466f8a4b 100644
--- a/k8s/cloud/public/base/artifact_tracker_versions.yaml
+++ b/k8s/cloud/public/base/artifact_tracker_versions.yaml
@@ -16,4 +16,4 @@ spec:
             - name: PL_CLI_VERSION
               value: "0.8.5"
             - name: PL_OPERATOR_VERSION
-              value: "0.1.7"
+              value: "0.14.15"

# Remove changes and verify cloud release results in no changes
$ git checkout -- k8s/
$ ./ci/update_files_with_release_versions.sh cloud 0.14.15 '<!--cloud-latest-release'
$ git diff k8s/
```

Changelog Message: Add automation to ensure self-hosted Cloud
deployments receive updated vizier, operator and cli version manifests

---------

Signed-off-by: Dom Del Nano <[email protected]>
  • Loading branch information
ddelnano authored Jan 16, 2025
1 parent a63b134 commit 1634b86
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 9 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/release_update_readme.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ jobs:
run: |
export COMPONENT="$(echo "${TAG_NAME}" | cut -d'/' -f2)"
export VERSION="$(echo "${TAG_NAME}" | cut -d'/' -f3)"
./ci/update_readme_with_latest_release.sh "${COMPONENT}" "${VERSION}" "${URL}"
./ci/update_files_with_release_versions.sh "${COMPONENT}" "${VERSION}" "${URL}"
- name: Create PR
shell: bash
env:
Expand All @@ -56,6 +56,7 @@ jobs:
export BRANCH="${VERSION}-update-readme"
git checkout -b "${BRANCH}"
git add README.md
git add k8s/cloud/public/base/artifact_tracker_versions.yaml
git commit -s -m "$(cat pr_title)"
git push -f fork "${BRANCH}"
gh pr create --repo pixie-io/pixie \
Expand Down
2 changes: 2 additions & 0 deletions .yamllint
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,5 @@ rules:
max: 120
truthy:
check-keys: false
comments:
min-spaces-from-content: 1
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ version="$2"
url="$3"

readme_path="README.md"
at_versions_path="k8s/cloud/public/base/artifact_tracker_versions.yaml"

latest_release_comment="<!--${artifact_type}-latest-release-->"

Expand All @@ -45,6 +46,11 @@ latest_release_line() {
echo "- [$(pretty_artifact_name) ${version}](${url})${latest_release_comment}"
}

# environment variable is uppercased
artifact_tracker_env_name="PL_${artifact_type^^}_VERSION"

yq -i ".spec.template.spec.containers[] |= select(.name == \"artifact-tracker-server\").env[] |= select(.name == \"${artifact_tracker_env_name}\").value = \"${version}\"" "${at_versions_path}"

sed -i 's|.*'"${latest_release_comment}"'.*|'"$(latest_release_line)"'|' "${readme_path}"

echo "[bot][releases] Update readme with link to latest ${artifact_type} release." > pr_title
Expand Down
17 changes: 9 additions & 8 deletions k8s/cloud/public/base/artifact_tracker_versions.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# autogenerated do not edit manually
---
apiVersion: apps/v1
kind: Deployment
Expand All @@ -7,11 +8,11 @@ spec:
template:
spec:
containers:
- name: artifact-tracker-server
env:
- name: PL_VIZIER_VERSION
value: "0.14.14"
- name: PL_CLI_VERSION
value: "0.8.5"
- name: PL_OPERATOR_VERSION
value: "0.1.7"
- name: artifact-tracker-server # yamllint disable rule:indentation
env:
- name: PL_VIZIER_VERSION
value: "0.14.14"
- name: PL_CLI_VERSION
value: "0.8.5"
- name: PL_OPERATOR_VERSION
value: "0.1.7"

0 comments on commit 1634b86

Please sign in to comment.