-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[DPE-3721] - chore: add cruise-control to snap #38
Conversation
369eed5
to
dd2c937
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like how clean the diff is, especially in the installation hook and the snapcraft file.
Do we need to add CC's license in the directory with the same name?
Out of scope question, should we remove kafka-export license since it is not part of the snap?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changes look sane. I only have a couple of points I'd like to follow before approving
snap/local/opt/cruise-control/bin/kafka-cruise-control-start.sh
Outdated
Show resolved
Hide resolved
a50620a
to
7c70507
Compare
Have re-requested review as it was a bit stale.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have still few comments I'd like to get addressed. Also, thanks for investigating the main
for variable handling, I'm a bit disappointed that it does not work :(, but that's all right! Thanks for investingating this! 🤷♂️
But before merging, I also believe it would be very important to
-
Starting cruise control in CI and doing the curl (that you mention in the PR description) to make sure the service is up and running. The defaults in the CC properties file - e.g. zookeeper and kafka endpoint - should be such that the plain "deployment" works out-of-the box (like what we have in CI for Kafka and ZooKeeper)
-
Just add the same steps in the
README.md
, to keep the documentation up to date.
|
||
# Loggers | ||
logger.cruisecontrol.name=com.linkedin.kafka.cruisecontrol | ||
logger.cruisecontrol.level=${main:cruisecontrol.log.level} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
todo update with sys
if main
was not working
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why was this resolved? can you clarify where/why sometimes we use sys
, and sometime we use main
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very nice! I hope the script to start cc wasn't a pain to get working 😬
appender.kafkaCruiseControlAppender.policies.time.type=TimeBasedTriggeringPolicy | ||
appender.kafkaCruiseControlAppender.policies.time.interval=1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suggest to keep the same approach as we recently did with Kafka:
appender.kafkaCruiseControlAppender.policies.time.type=TimeBasedTriggeringPolicy | |
appender.kafkaCruiseControlAppender.policies.time.interval=1 | |
appender.kafkaCruiseControlAppender.policies.size.type = SizeBasedTriggeringPolicy | |
appender.kafkaCruiseControlAppender.policies.size.size=100MB | |
appender.kafkaCruiseControlAppender.strategy.type = DefaultRolloverStrategy | |
appender.kafkaCruiseControlAppender.strategy.max = 10 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After checking, there are up to 6 files between kafka and cc. A fully running cluster log output might be too much if each unit is going to have up to 3Gb (uncompressed) of logs.
appender.operationAppender.policies.time.type=TimeBasedTriggeringPolicy | ||
appender.operationAppender.policies.time.interval=1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
appender.operationAppender.policies.time.type=TimeBasedTriggeringPolicy | |
appender.operationAppender.policies.time.interval=1 | |
appender.operationAppender.policies.size.type = SizeBasedTriggeringPolicy | |
appender.operationAppender.policies.size.size=100MB | |
appender.operationAppender.strategy.type = DefaultRolloverStrategy | |
appender.operationAppender.strategy.max = 10 |
appender.requestAppender.policies.time.type=TimeBasedTriggeringPolicy | ||
appender.requestAppender.policies.time.interval=1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
appender.requestAppender.policies.time.type=TimeBasedTriggeringPolicy | |
appender.requestAppender.policies.time.interval=1 | |
appender.requestAppender.policies.size.type = SizeBasedTriggeringPolicy | |
appender.requestAppender.policies.size.size=100MB | |
appender.requestAppender.strategy.type = DefaultRolloverStrategy | |
appender.requestAppender.strategy.max = 10 |
interface: content | ||
source: | ||
read: | ||
- $SNAP_COMMON/var/log/cruise-control | ||
|
||
apps: | ||
daemon: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: I would change this to be kafka
. Makes things explicit once we start having multiple apps on the snap.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's leave it for now and update it to something useful when we have KRaft and need to also update it everywhere in the charms and docs, but I see your point.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Thanks!
Review Notes
MVP CruiseControl addition to Snap
The final layout will be similar to Kafka, as follows:
$SNAP/opt/cruise-control/bin
- Modified start script from upstream, and Snap wrapper for setting default env-vars$SNAP/opt/cruise-control/libs
- Allbuild/libs
andbuild/dependant-libs
for running cruisecontrol. Also includes libs for cruise-control-metrics-reporter, not sure if these are needed or not yet$SNAP_DATA/etc/cruise-control
- Config files. May include:log4j.properties
- Bundled with snapcruisecontrol.properties
- Added by charmcruisecontrol.jaas
- Added by charmcapacity.json
- Added by charm$SNAP_COMMON/var/log/cruise-control
- Dir for logs from Log4j2$SNAP_COMMON/var/lib/cruise-control
- Data dir, but will likely not be usedMinor changes to existing Kafka snap
We
unset KAFKA_LOG4J_OPTS
now inkafka/bin/bin-wrapper.bash
. This avoids very distracting and mostly unnecessary logging when running bin-scripts locally.We also now take the STAGE'd CruiseControl libs and add the metrics-reporter JARs to Kafka's
libs
.Heavily modified
kafka-cruise-control-start.sh
CruiseControl's default 'start-the-daemon' bash script expects that it's running directly from within the CruiseControl repo after being built from source. As a result, it hard-codes a bunch of paths that we have modified to get it to fit in the Snap layout.
tl;dr - We change
base_dir
and set$CLASSPATH
to include files in a single/opt/cruise-control/libs
dir. If we compare the diff to upstream:SASL Auth with JAAS
In order to pick up auth for Kafka + ZooKeeper, similar to Kafka we need to set
-Djava.security.auth.login.config
in$KAFKA_OPTS
, pointing to a path for somecruisecontrol.jaas
. For Charmed Kafka, this will be in/etc/environment
most likely.An example file would look like:
Hard-coded logging path override
We provide a default Log4j2 config packaged with the snap that takes
-Dcruisecontrol.logs.dir
as a Java config, as the default config file provided by upstream is hard-coded to a path we don't want to use.This gets set in
$KAFKA_LOG4J_OPTS
in thestart-wrapper.bash
, using the snap daemon environment variable$LOG_DIR
.We also pass
-Dlog4j.configurationFile
here too, pointing to the file in$SNAP_DATA/etc/cruise-control
Minimal properties that need to be set over defaults
Proof it works (probably)