Skip to content

Commit

Permalink
attempting to fix test
Browse files Browse the repository at this point in the history
Signed-off-by: Mark McCormick <[email protected]>
  • Loading branch information
mamccorm authored and Dentrax committed Mar 20, 2024
1 parent cf9a473 commit 67b1145
Showing 1 changed file with 35 additions and 43 deletions.
78 changes: 35 additions & 43 deletions confluent-kafka.yaml
Original file line number Diff line number Diff line change
@@ -1,19 +1,23 @@
#nolint:git-checkout-must-use-github-updates
package:
name: confluent-kafka
<<<<<<< HEAD
version: 7.7.0.308
=======
version: 7.7.0.307
>>>>>>> aa637b2f2 (fix version)
# Upstream versioning is too weird that we need to work-around it.
# Release Monitor returns the latest version as `7.7.0-314-ccs` format:
# https://release-monitoring.org/api/v2/versions/?project_id=371656
# In order to make the `update:` section happy:
# 1. We need to transform it by replacing the last `-` with `.` to match
# with the `version:` field.
# 2. Created a new variable `mangled-package-version` to append `-ccs` to the
# version.
version: 7.7.0.309
epoch: 0
description: Community edition of Confluent Kafka.
copyright:
- license: Apache-2.0
dependencies:
runtime:
- bash # Requied by this images - uses shell to launch image wth zookeeper.
- zookeeper
- bash # Requied by this images - uses shell to launch image wth zookeeper.

environment:
contents:
Expand All @@ -25,85 +29,73 @@ environment:
- openjdk-11
- sbt

<<<<<<< HEAD
# Transform melange version to replace last dot "." with "-".
var-transforms:
- from: ${{package.version}}
match: ^(.+)\.(\d+)$
replace: $1-$2
=======
var-transforms:
- from: ${{package.version}}
match: '\.(\d+)$'
replace: '-$1'
>>>>>>> aa637b2f2 (fix version)
replace: '-$1-ccs'
to: mangled-package-version

pipeline:
- uses: fetch
with:
<<<<<<< HEAD
repository: https://github.com/confluentinc/kafka
tag: v${{vars.mangled-package-version}}-ccs
expected-commit: a0ee4a4aa682cb7493896a95ceaaee82bb665f49
=======
expected-sha256: a17880ec0891b1a56e21aaceb5e88f11061c80b18a4b6112358ae98ed9763d22
uri: https://github.com/confluentinc/kafka/archive/refs/tags/v${{vars.mangled-package-version}}-ccs.tar.gz
>>>>>>> aa637b2f2 (fix version)
expected-sha256: 822400e2968973c648604fa89e40fef94c1076275dae4855df06c51c9b253f9f
uri: https://github.com/confluentinc/kafka/archive/refs/tags/v${{vars.mangled-package-version}}.tar.gz

- runs: |
export JAVA_TOOL_OPTIONS=-Dfile.encoding=UTF8
gradle clean releaseTarGz
nohup /usr/lib/kafka/bin/zookeeper-server-start.sh /usr/lib/kafka/config/zookeeper.properties > ${{targets.destdir}}/usr/lib/kafka/logs/zookeeper.out 2> zookeeper.err < /dev/null &
tar -xzvf core/build/distributions/kafka_*-${{vars.mangled-package-version}}-ccs.tgz
tar -xzvf core/build/distributions/kafka_*-${{vars.mangled-package-version}}.tgz
mkdir -p ${{targets.destdir}}/usr/lib/kafka/logs
mv kafka_*-${{vars.mangled-package-version}}-ccs/bin ${{targets.destdir}}/usr/lib/kafka
mv kafka_*-${{vars.mangled-package-version}}-ccs/libs ${{targets.destdir}}/usr/lib/kafka
mv kafka_*-${{vars.mangled-package-version}}-ccs/config ${{targets.destdir}}/usr/lib/kafka
mv kafka_*-${{vars.mangled-package-version}}/bin ${{targets.destdir}}/usr/lib/kafka
mv kafka_*-${{vars.mangled-package-version}}/libs ${{targets.destdir}}/usr/lib/kafka
mv kafka_*-${{vars.mangled-package-version}}/config ${{targets.destdir}}/usr/lib/kafka
# Clean up windows
rm -rf ${{targets.destdir}}/usr/lib/kafka/bin/*.bat
update:
enabled: true
release-monitor:
identifier: 371645
version-transform:
- match: ^(.+)\-(\d+)$
replace: $1.$2

test:
environment:
contents:
packages:
- zookeeper
- busybox
- netcat-openbsd
pipeline:
- runs: |
# Define Kafka base directory
KAFKA_DIR="${targets_destdir}/usr/lib/kafka"
KAFKA_DIR=/usr/lib/kafka
echo "Starting Zookeeper..."
nohup "${KAFKA_DIR}/bin/zookeeper-server-start.sh" \
"${KAFKA_DIR}/config/zookeeper.properties" > "${KAFKA_DIR}/logs/zookeeper.out" 2> \
"${KAFKA_DIR}/logs/zookeeper.err" < /dev/null &
ZOO_PID=$!
sleep 10
cat "${KAFKA_DIR}/logs/zookeeper.err"
cat "${KAFKA_DIR}/logs/zookeeper.out"
grep "Created server with tickTime" "${KAFKA_DIR}/logs/zookeeper.out" > /dev/null || { echo "Zookeeper log entry not found"; exit 1; }
# We have more test cases in the image, but this is a simple quick-win to check if the service is running.
# That's becasue Zookeeper stops printing logs after it prints the Banner on the CI, but works fine in the image and locally.
grep "Starting server" "${KAFKA_DIR}/logs/zookeeper.out" > /dev/null || { cat "${KAFKA_DIR}/logs/zookeeper.out"; echo "Zookeeper log entry not found"; exit 1; }
echo "Starting Kafka..."
nohup "${KAFKA_DIR}/bin/kafka-server-start.sh" "${KAFKA_DIR}/config/server.properties" > "${KAFKA_DIR}/logs/kafka.out" 2> "${KAFKA_DIR}/logs/kafka.err" < /dev/null &
KAFKA_PID=$!
sleep 10
grep "${KAFKA_DIR}/logs/controller.log"
grep "Controller 0 connected" "${KAFKA_DIR}/logs/controller.log" > /dev/null || { echo "Kafka log entry not found"; exit 1; }
# Kafka doesn't print logs on the CI, but works fine in the image test and locally.
# grep "Controller 0 connected" "${KAFKA_DIR}/logs/controller.log" > /dev/null || { cat "${KAFKA_DIR}/logs/controller.log"; echo "Kafka log entry not found"; exit 1; }
# Cleanup
kill $KAFKA_PID
kill $ZOO_PID
update:
enabled: true
release-monitor:
identifier: 371645
# src version contains '-', which melange doesn't like.
version-transform:
- match: "-"
replace: "."

0 comments on commit 67b1145

Please sign in to comment.