KAFKA-6247; Install Kibosh on Vagrant and fix release downloads in Docker

Fix an omission where Kibosh was not getting installed on Vagrant
instances running in AWS.

Fix an issue where the Dockerfile was unable to download old Apache
Kafka releases.  See the discussion on KAFKA-6233.

Author: Colin P. Mccabe <cmccabe@confluent.io>

Reviewers: Ismael Juma <ismael@juma.me.uk>

Closes #4240 from cmccabe/KAFKA-6247
This commit is contained in:
Colin P. Mccabe 2017-11-21 14:39:11 +00:00 committed by Ismael Juma
parent f0276f5ca2
commit a133e69b45
3 changed files with 30 additions and 9 deletions

View File

@ -17,7 +17,6 @@ FROM openjdk:8
MAINTAINER Apache Kafka dev@kafka.apache.org MAINTAINER Apache Kafka dev@kafka.apache.org
VOLUME ["/opt/kafka-dev"] VOLUME ["/opt/kafka-dev"]
ENV MIRROR="http://mirror.olnevhost.net/pub/apache/"
# Set the timezone. # Set the timezone.
ENV TZ="/usr/share/zoneinfo/America/Los_Angeles" ENV TZ="/usr/share/zoneinfo/America/Los_Angeles"
@ -40,17 +39,21 @@ COPY ./ssh-config /root/.ssh/config
RUN ssh-keygen -q -t rsa -N '' -f /root/.ssh/id_rsa && cp -f /root/.ssh/id_rsa.pub /root/.ssh/authorized_keys RUN ssh-keygen -q -t rsa -N '' -f /root/.ssh/id_rsa && cp -f /root/.ssh/id_rsa.pub /root/.ssh/authorized_keys
# Install binary test dependencies. # Install binary test dependencies.
ENV MIRROR="http://mirrors.ocf.berkeley.edu/apache/" ARG KAFKA_MIRROR="https://s3-us-west-2.amazonaws.com/kafka-packages"
RUN mkdir -p "/opt/kafka-0.8.2.2" && curl -s "${MIRROR}kafka/0.8.2.2/kafka_2.10-0.8.2.2.tgz" | tar xz --strip-components=1 -C "/opt/kafka-0.8.2.2" RUN mkdir -p "/opt/kafka-0.8.2.2" && curl -s "$KAFKA_MIRROR/kafka_2.10-0.8.2.2.tgz" | tar xz --strip-components=1 -C "/opt/kafka-0.8.2.2"
RUN mkdir -p "/opt/kafka-0.9.0.1" && curl -s "${MIRROR}kafka/0.9.0.1/kafka_2.11-0.9.0.1.tgz" | tar xz --strip-components=1 -C "/opt/kafka-0.9.0.1" RUN mkdir -p "/opt/kafka-0.9.0.1" && curl -s "$KAFKA_MIRROR/kafka_2.11-0.9.0.1.tgz" | tar xz --strip-components=1 -C "/opt/kafka-0.9.0.1"
RUN mkdir -p "/opt/kafka-0.10.0.1" && curl -s "${MIRROR}kafka/0.10.0.1/kafka_2.11-0.10.0.1.tgz" | tar xz --strip-components=1 -C "/opt/kafka-0.10.0.1" RUN mkdir -p "/opt/kafka-0.10.0.1" && curl -s "$KAFKA_MIRROR/kafka_2.11-0.10.0.1.tgz" | tar xz --strip-components=1 -C "/opt/kafka-0.10.0.1"
RUN mkdir -p "/opt/kafka-0.10.1.1" && curl -s "${MIRROR}kafka/0.10.1.1/kafka_2.11-0.10.1.1.tgz" | tar xz --strip-components=1 -C "/opt/kafka-0.10.1.1" RUN mkdir -p "/opt/kafka-0.10.1.1" && curl -s "$KAFKA_MIRROR/kafka_2.11-0.10.1.1.tgz" | tar xz --strip-components=1 -C "/opt/kafka-0.10.1.1"
RUN mkdir -p "/opt/kafka-0.10.2.1" && curl -s "${MIRROR}kafka/0.10.2.1/kafka_2.11-0.10.2.1.tgz" | tar xz --strip-components=1 -C "/opt/kafka-0.10.2.1" RUN mkdir -p "/opt/kafka-0.10.2.1" && curl -s "$KAFKA_MIRROR/kafka_2.11-0.10.2.1.tgz" | tar xz --strip-components=1 -C "/opt/kafka-0.10.2.1"
RUN mkdir -p "/opt/kafka-0.11.0.0" && curl -s "${MIRROR}kafka/0.11.0.0/kafka_2.11-0.11.0.0.tgz" | tar xz --strip-components=1 -C "/opt/kafka-0.11.0.0" RUN mkdir -p "/opt/kafka-0.11.0.0" && curl -s "$KAFKA_MIRROR/kafka_2.11-0.11.0.0.tgz" | tar xz --strip-components=1 -C "/opt/kafka-0.11.0.0"
# The version of Kibosh to use for testing.
# If you update this, also update vagrant/base.sy
ARG KIBOSH_VERSION="d85ac3ec44be0700efe605c16289fd901cfdaa13"
# Install Kibosh # Install Kibosh
RUN apt-get install fuse RUN apt-get install fuse
RUN cd /opt && git clone -q https://github.com/confluentinc/kibosh.git && cd "/opt/kibosh" && git reset --hard 399de967c5520e8fe6e32d4e5c1c55d71cd7f46c && mkdir "/opt/kibosh/build" && cd "/opt/kibosh/build" && ../configure && make -j 2 RUN cd /opt && git clone -q https://github.com/confluentinc/kibosh.git && cd "/opt/kibosh" && git reset --hard $KIBOSH_VERSION && mkdir "/opt/kibosh/build" && cd "/opt/kibosh/build" && ../configure && make -j 2
# Set up the ducker user. # Set up the ducker user.
RUN useradd -ms /bin/bash ducker && mkdir -p /home/ducker/ && rsync -aiq /root/.ssh/ /home/ducker/.ssh && chown -R ducker /home/ducker/ /mnt/ && echo 'ducker ALL=(ALL) NOPASSWD: ALL' >> /etc/sudoers RUN useradd -ms /bin/bash ducker && mkdir -p /home/ducker/ && rsync -aiq /root/.ssh/ /home/ducker/.ssh && chown -R ducker /home/ducker/ /mnt/ && echo 'ducker ALL=(ALL) NOPASSWD: ALL' >> /etc/sudoers

View File

@ -84,6 +84,7 @@ class KiboshService(Service):
cmd += " --target %s" % self.target cmd += " --target %s" % self.target
cmd += " --pidfile %s" % self.pidfile_path cmd += " --pidfile %s" % self.pidfile_path
cmd += " --log %s" % self.log_path cmd += " --log %s" % self.log_path
cmd += " --control-mode 666"
cmd += " --verbose" cmd += " --verbose"
cmd += " %s" % self.mirror cmd += " %s" % self.mirror
cmd += " &> %s" % self.stdout_stderr_path cmd += " &> %s" % self.stdout_stderr_path

View File

@ -16,6 +16,10 @@
set -ex set -ex
# The version of Kibosh to use for testing.
# If you update this, also update tests/docker/Dockerfile
export KIBOSH_VERSION=d85ac3ec44be0700efe605c16289fd901cfdaa13
if [ -z `which javac` ]; then if [ -z `which javac` ]; then
apt-get -y update apt-get -y update
apt-get install -y software-properties-common python-software-properties apt-get install -y software-properties-common python-software-properties
@ -82,6 +86,19 @@ get_kafka() {
fi fi
} }
# Install Kibosh
apt-get update -y && apt-get install -y git cmake pkg-config libfuse-dev
pushd /opt
git clone -q https://github.com/confluentinc/kibosh.git
pushd "/opt/kibosh"
git reset --hard $KIBOSH_VERSION
mkdir "/opt/kibosh/build"
pushd "/opt/kibosh/build"
../configure && make -j 2
popd
popd
popd
# Test multiple Scala versions # Test multiple Scala versions
get_kafka 0.8.2.2 2.10 get_kafka 0.8.2.2 2.10
chmod a+rw /opt/kafka-0.8.2.2 chmod a+rw /opt/kafka-0.8.2.2