Skip to content

Commit

Permalink
chore: improve workflow to get latest tag
Browse files Browse the repository at this point in the history
  • Loading branch information
ialejandro committed Aug 15, 2024
1 parent 8fbac47 commit 23bebf7
Show file tree
Hide file tree
Showing 7 changed files with 46 additions and 27 deletions.
15 changes: 15 additions & 0 deletions .github/updatecli/helm-appversion.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
sources:
cruise-control:
kind: dockerimage
spec:
image: devopsiaci/cruise-control
architecture: linux/amd64
tagfilter: "jdk17-cc*"
conditions: {}
targets:
chartVersion:
name: bump appversion
kind: yaml
spec:
file: charts/cruise-control/Chart.yaml
key: $.appVersion
38 changes: 22 additions & 16 deletions .github/workflows/check-changes.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,36 +14,45 @@ jobs:
with:
fetch-depth: 0

- name: Get latest release
id: latest_release
run: |
latest_release=$(curl -s https://api.github.com/repos/linkedin/cruise-control/tags | jq -r '.[0].name')
echo "latest_release=$latest_release" >> $GITHUB_OUTPUT
- name: Get current release
id: current_release
run: |
current_release=$(grep appVersion charts/cruise-control/Chart.yaml | awk '{ print $2 }')
echo "current_release=$current_release" >> $GITHUB_OUTPUT
- name: Install updatecli
uses: updatecli/updatecli-action@v2

- name: Update dependencies
run: |
updatecli apply --config .github/updatecli/helm-appversion.yaml --commit=false
- name: Get latest release
id: latest_release
run: |
latest_release=$(grep appVersion charts/cruise-control/Chart.yaml | awk '{ print $2 }')
echo "latest_release=$latest_release" >> $GITHUB_OUTPUT
- name: Check if release changed
id: check_changes
run: |
if [ ${{ steps.latest_release.outputs.latest_release }} != ${{ steps.current_release.outputs.current_release }} ]; then
echo "release_changed=true" >> $GITHUB_OUTPUT
fi
- name: Set new Chat.yaml appVersion
if: steps.check_changes.outputs.release_changed == 'true'
run: |
sed -i "s/appVersion: .*/appVersion: jdk17-cc${{ steps.latest_release.outputs.latest_release }}/g" charts/cruise-control/Chart.yaml
- name: Update README.md Helm Chart
if: steps.check_changes.outputs.release_changed == 'true'
uses: losisin/helm-docs-github-action@v1
with:
chart-search-root: charts/cruise-control

- name: Clean tag release for Cruise Control
id: clean_tag_release
if: steps.check_changes.outputs.release_changed == 'true'
run: |
cc_clean_version_tag=$(echo ${{ steps.latest_release.outputs.latest_release }} | grep -oP '(?<=cc)\d+\.\d+\.\d+')
echo "cc_clean_version_tag=$cc_clean_version_tag" >> $GITHUB_OUTPUT
- name: Create PR with changes
if: steps.check_changes.outputs.release_changed == 'true'
uses: peter-evans/create-pull-request@v6
Expand All @@ -57,11 +66,8 @@ jobs:
body: |
Cruise Control version:
- :information_source: Current: `${{ steps.current_release.outputs.current_release }}`
- :up: Upgrade: `jdk17-cc${{ steps.latest_release.outputs.latest_release }}`
Changelog: https://github.com/linkedin/cruise-control/releases/tag/${{ steps.latest_release.outputs.latest_release }}
- :up: Upgrade: `${{ steps.latest_release.outputs.latest_release }}`
:warning: **BEFORE UPGRADE** :warning:
Check the release is pushed on <https://github.com/devops-ia/kafka-cruise-control/pkgs/container/kafka-cruise-control>
Changelog: https://github.com/linkedin/cruise-control/releases/tag/${{ steps.clean_tag_release.outputs.cc_clean_version_tag }}
labels: |
auto-pr-bump-version
3 changes: 1 addition & 2 deletions .github/workflows/lint-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,9 @@ jobs:
with:
fetch-depth: 0

# default install latest (stable)
- name: Set up Helm
uses: azure/setup-helm@v4
with:
version: v3.13.0

- uses: actions/setup-python@v5
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Release charts
name: Release Cruise Control chart

on:
workflow_dispatch:
Expand Down
2 changes: 1 addition & 1 deletion charts/cruise-control/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ maintainers:
url: https://ialejandro.rocks
sources:
- https://github.com/linkedin/cruise-control
version: 0.0.1
version: 1.0.0
appVersion: jdk17-cc2.5.138
home: https://github.com/devops-ia/helm-cruise-control
keywords:
Expand Down
11 changes: 5 additions & 6 deletions charts/cruise-control/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -216,8 +216,8 @@ config:
disk.balance.threshold: 1.1
disk.capacity.threshold: 0.8
disk.low.utilization.threshold: 0.0
#goal.balancedness.priority.weight:
#goal.balancedness.strictness.weight:
# goal.balancedness.priority.weight:
# goal.balancedness.strictness.weight:
goals:
- com.linkedin.kafka.cruisecontrol.analyzer.goals.RackAwareGoal
- com.linkedin.kafka.cruisecontrol.analyzer.goals.RackAwareDistributionGoal
Expand Down Expand Up @@ -268,7 +268,7 @@ config:
topics.excluded.from.partition.movement: __consumer_offsets.*|__amazon_msk_canary.*|__amazon_msk_connect.*|__KafkaCruiseControl.*

# EXECUTOR
#default.replication.throttle:
# default.replication.throttle:
execution.progress.check.interval.ms: 10000
max.num.cluster.partition.movements: 1250
num.concurrent.intra.broker.partition.movements: 2
Expand Down Expand Up @@ -303,7 +303,7 @@ config:
completed.kafka.monitor.user.task.retention.time.ms: 86400000
completed.user.task.retention.time.ms: 86400000
demotion.history.retention.time.ms: 1209600000
#goal.violation.distribution.threshold.multiplier: 2.50
# goal.violation.distribution.threshold.multiplier: 2.50
max.active.user.tasks: 5
max.cached.completed.cruise.control.admin.user.tasks: 30
max.cached.completed.cruise.control.monitor.user.tasks: 20
Expand All @@ -322,7 +322,7 @@ config:
metric.anomaly.detection.interval.ms: 120000
metric.anomaly.finder.class: com.linkedin.kafka.cruisecontrol.detector.KafkaMetricAnomalyFinder
removal.history.retention.time.ms: 1209600000
#self.healing.broker.failure.enabled: true
# self.healing.broker.failure.enabled: true
self.healing.enabled: false
self.healing.exclude.recently.demoted.brokers: true
self.healing.exclude.recently.removed.brokers: true
Expand Down Expand Up @@ -414,4 +414,3 @@ log4j:
rootLogger.appenderRefs: console, kafkaCruiseControlAppender
rootLogger.appenderRef.console.ref: STDOUT
rootLogger.appenderRef.kafkaCruiseControlAppender.ref: kafkaCruiseControlFile

2 changes: 1 addition & 1 deletion ct.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# See https://github.com/helm/chart-testing#configuration
chart-dirs: charts
check-version-increment: true
check-version-increment: false
debug: false
remote: origin
target-branch: main
Expand Down

0 comments on commit 23bebf7

Please sign in to comment.