Skip to content
This repository has been archived by the owner on Oct 20, 2022. It is now read-only.

Commit

Permalink
Make JMX port remotely available (#151)
Browse files Browse the repository at this point in the history
- Make JMX port remotely available
- Update dgoss tests
- Use newer bootstrap image
- JMX is also accessible locally
  • Loading branch information
cscetbon authored and Sébastien Allamand committed Nov 29, 2019
1 parent 966df4e commit d3ff7df
Show file tree
Hide file tree
Showing 10 changed files with 18 additions and 30 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ DOCKER_REPO_BASE_TEST ?= orangeopensource
IMAGE_NAME := $(SERVICE_NAME)
BUILD_IMAGE ?= orangeopensource/casskop-build

BOOTSTRAP_IMAGE ?= orangeopensource/cassandra-bootstrap:0.1.0
BOOTSTRAP_IMAGE ?= orangeopensource/cassandra-bootstrap:0.1.3
TELEPRESENCE_REGISTRY ?= datawire
KUBESQUASH_REGISTRY:=

Expand Down
15 changes: 5 additions & 10 deletions docker/bootstrap/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ else
PROJECT:=$(CI_REGISTRY_IMAGE)
endif

VERSION:=0.1.2
VERSION:=0.1.3
TAG?=${VERSION}
ifeq ($(CIRCLE_BRANCH),master)
BRANCH:=latest
Expand All @@ -33,16 +33,11 @@ endif

all: build

params:
@echo ${PROJECT} ${BRANCH}
@echo $(VERSION) $(JAVA_VERSION) $(CASSANDRA_VERSION)
@echo $(TAG)

build: params
build:
docker build --pull \
--build-arg https_proxy=$(https_proxy) --build-arg http_proxy=$(http_proxy) \
-t ${PROJECT}:${TAG} .
--build-arg https_proxy=$(https_proxy) --build-arg http_proxy=$(http_proxy) \
-t ${PROJECT}:${TAG} .

push: params
push:
docker push ${PROJECT}:${TAG}

2 changes: 1 addition & 1 deletion docker/bootstrap/bootstrap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ if [ -f ${CONFIGMAP}/pre_run.sh ]; then
fi

# Bootstrap Cassandra configuration
echo " == We execute bootstrap srcipt run.sh"
echo " == We execute bootstrap script run.sh"
/${BOOTSTRAP_CONF}/run.sh

if [ -f ${CONFIGMAP}/post_run.sh ]; then
Expand Down
3 changes: 2 additions & 1 deletion docker/bootstrap/dgoss/checks/goss.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ addr:
tcp://localhost:7199:
reachable: true
tcp://{{.Env.HOSTNAME}}:7199:
reachable: false
reachable: true
timeout: 5000
# jolokia rest service
tcp://{{.Env.HOSTNAME}}:8778:
Expand Down Expand Up @@ -58,6 +58,7 @@ file:
/etc/cassandra/cassandra-env.sh:
exists: true
contains:
- "LOCAL_JMX=no"
- "/extra-lib/jolokia-agent.jar"
- "-javaagent:/extra-lib/cassandra-exporter-agent.jar=@/etc/cassandra/exporter.conf"

Expand Down
1 change: 0 additions & 1 deletion docker/bootstrap/dgoss/test-with-configmap/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ createDgossVolumes
createSimpleConfigMapFile
createInitConfigContainer
createCassandraBootstrapContainer
#createAndCheckCassandraContainer # already tested

# check using test specific `goss.yaml`
GOSS_SLEEP=0 dgoss run \
Expand Down
1 change: 0 additions & 1 deletion docker/bootstrap/dgoss/test-with-pre-run/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ createDgossVolumes
createInitConfigContainer
createPreRunConfigMapFile
createCassandraBootstrapContainer
#createAndCheckCassandraContainer #comment to go quicker

# check using test specific `goss.yaml`
GOSS_SLEEP=0 dgoss run \
Expand Down
2 changes: 1 addition & 1 deletion docker/bootstrap/dgoss/test-without-volumes/goss.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ addr:
tcp://localhost:7199:
reachable: true
tcp://{{.Env.HOSTNAME}}:7199:
reachable: false
reachable: true
timeout: 5000
# jolokia rest service
tcp://{{.Env.HOSTNAME}}:8778:
Expand Down
3 changes: 0 additions & 3 deletions docker/bootstrap/dgoss/test-without-volumes/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,6 @@ createDgossVolumes
# Add test file to user config map
createInitConfigContainer
createCassandraBootstrapContainerNoExtraLib
#createAndCheckCassandraContainer # already tested

#createCassandraContainer

# check using test specific `goss.yaml`
GOSS_WAIT_OPTS='-r 90s -s 1s > /dev/null' dgoss run \
Expand Down
11 changes: 5 additions & 6 deletions docker/bootstrap/dgoss/util.sh
Original file line number Diff line number Diff line change
Expand Up @@ -129,17 +129,16 @@ function createPreRunConfigMapFile {
docker container create --name dummy -v ${CONFIGMAP_VOLUME}:/configmap hello-world
docker cp ${testScriptDir}/pre_run.sh dummy:/configmap/pre_run.sh
docker rm dummy
# docker run --rm -v ${CONFIGMAP_VOLUME}:/configmap -v ${testScriptDir}:/tmp --entrypoint=bash ${CASSANDRA_IMAGE} -c "cp -v /tmp/pre_run.sh /configmap"
}

function createCassandraContainer {
echo "== createCassandraContainer"
docker run \
-v ${BOOTSTRAP_VOLUME}:/etc/cassandra \
-v ${EXTRA_LIB_VOLUME}:/extra-lib \
-p 9500:9500 \
-p 8778:8778 \
${CASSANDRA_IMAGE}
-v ${BOOTSTRAP_VOLUME}:/etc/cassandra \
-v ${EXTRA_LIB_VOLUME}:/extra-lib \
-p 9500:9500 \
-p 8778:8778 \
${CASSANDRA_IMAGE}

}

Expand Down
8 changes: 3 additions & 5 deletions docker/bootstrap/files/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@ set -e

CASSANDRA_CFG=$CASSANDRA_CONF/cassandra.yaml



default_value()
{
echo $(grep -v '#' ${CASSANDRA_CFG}|grep -i \\b$1|awk '{print $2}')
Expand Down Expand Up @@ -198,9 +196,9 @@ echo "-Dcassandra.ring_delay_ms=${CASSANDRA_RING_DELAY}" >> $CASSANDRA_CONF/jvm.

[[ $CASSANDRA_ENABLE_JOLOKIA == 'true' ]] && CASSANDRA_ENABLE_JMX=true

if [[ $CASSANDRA_ENABLE_JMX == 'true' ]]; then
export LOCAL_JMX=no

if [[ $CASSANDRA_ENABLE_JMX == 'true' ]]
then
sed -ri '/^JMX_PORT=/a LOCAL_JMX=no' $CASSANDRA_CONF/cassandra-env.sh
sed -ri 's@ -Dcom\.sun\.management\.jmxremote\.authenticate=true@ -Dcom\.sun\.management\.jmxremote\.authenticate=false@' $CASSANDRA_CONF/cassandra-env.sh
sed -ri 's@ -Dcom\.sun\.management\.jmxremote\.password\.file=/etc/cassandra/jmxremote\.password/@@' $CASSANDRA_CONF/cassandra-env.sh

Expand Down

0 comments on commit d3ff7df

Please sign in to comment.