Repository: cassandra-builds
Updated Branches:
  refs/heads/master 4f49929aa -> 82dbe9d4f


Add docker image for running dtests

Closes #7


Project: http://git-wip-us.apache.org/repos/asf/cassandra-builds/repo
Commit: http://git-wip-us.apache.org/repos/asf/cassandra-builds/commit/82dbe9d4
Tree: http://git-wip-us.apache.org/repos/asf/cassandra-builds/tree/82dbe9d4
Diff: http://git-wip-us.apache.org/repos/asf/cassandra-builds/diff/82dbe9d4

Branch: refs/heads/master
Commit: 82dbe9d4f22f3ba649d0eaee8f048f667d8bfa3d
Parents: 4f49929
Author: Stefan Podkowinski <stefan.podkowin...@1und1.de>
Authored: Tue Oct 9 13:17:46 2018 +0200
Committer: Stefan Podkowinski <stefan.podkowin...@1und1.de>
Committed: Tue Oct 9 13:17:46 2018 +0200

----------------------------------------------------------------------
 docker/testing/ubuntu18_j11.docker | 107 ++++++++++++++++++++++++++++++++
 1 file changed, 107 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra-builds/blob/82dbe9d4/docker/testing/ubuntu18_j11.docker
----------------------------------------------------------------------
diff --git a/docker/testing/ubuntu18_j11.docker 
b/docker/testing/ubuntu18_j11.docker
new file mode 100644
index 0000000..30ecdf1
--- /dev/null
+++ b/docker/testing/ubuntu18_j11.docker
@@ -0,0 +1,107 @@
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+# base things off the latest LTS Ubuntu Release (18.04)
+FROM ubuntu:18.04
+MAINTAINER Stefan Podkowinski <s.podkowin...@gmail.com>
+
+# install our python dependencies and some other stuff we need
+# libev4 libev-dev are for the python driver
+
+RUN export DEBIAN_FRONTEND=noninteractive && \
+    apt-get update && \
+    apt-get install -y --no-install-recommends software-properties-common 
apt-utils
+
+RUN export DEBIAN_FRONTEND=noninteractive && \
+    apt-get update && \
+    apt-get install -y git-core python2.7 python3.6 python3.6-venv 
python3.6-dev python3-pip net-tools libev4 libev-dev wget gcc
+
+# solves warning: "jemalloc shared library could not be preloaded to speed up 
memory allocations"
+RUN export DEBIAN_FRONTEND=noninteractive && \
+    apt-get update && \
+    apt-get install -y --no-install-recommends libjemalloc1
+
+# install dumb-init as minimal init system
+RUN export DEBIAN_FRONTEND=noninteractive && \
+    apt-get update && \
+    apt-get install -y dumb-init
+
+# generate locales for the standard en_US.UTF8 value we use for testing
+RUN export DEBIAN_FRONTEND=noninteractive && \
+    apt-get update && \
+    apt-get install -y locales && \
+    locale-gen en_US.UTF-8
+
+# as we only need the requirements.txt file from the dtest repo, let's just 
get it from GitHub as a raw asset
+# so we can avoid needing to clone the entire repo just to get this file
+ADD 
https://raw.githubusercontent.com/apache/cassandra-dtest/master/requirements.txt
 /opt
+RUN chmod 0644 /opt/requirements.txt
+
+# now setup python via virtualenv with all of the python dependencies we need 
according to requirements.txt
+RUN pip3 install virtualenv
+RUN pip3 install --upgrade wheel
+
+# openjdk + ant
+RUN export DEBIAN_FRONTEND=noninteractive && \
+    apt-get update && \
+    apt-get install -y --no-install-recommends openjdk-8-jdk openjdk-11-jdk 
ant ant-optional
+
+# make Java 8 the default executable (we use to run all tests against Java 8)
+RUN update-java-alternatives -s java-1.8.0-openjdk-amd64
+
+# setup our user -- if we don't do this docker will default to root and 
Cassandra will fail to start
+# as we appear to have a check that the user isn't starting Cassandra as root
+RUN export DEBIAN_FRONTEND=noninteractive && \
+    apt-get install sudo && \
+    adduser --disabled-password --gecos "" cassandra && \
+    echo "cassandra ALL=(root) NOPASSWD:ALL" > /etc/sudoers.d/cassandra && \
+    chmod 0440 /etc/sudoers.d/cassandra
+
+# fix up permissions on the cassandra home dir
+RUN chown -R cassandra:cassandra /home/cassandra
+
+# switch to the cassandra user... we are all done running things as root
+USER cassandra
+ENV HOME /home/cassandra
+WORKDIR /home/cassandra
+
+# Add environment variables for Ant and Java and add them to the PATH
+RUN echo 'export ANT_HOME=/usr/share/ant' >> /home/cassandra/.bashrc && \
+    echo 'export JAVA8_HOME=/usr/lib/jvm/java-8-openjdk-amd64' >> 
/home/cassandra/.bashrc && \
+    echo 'export JAVA11_HOME=/usr/lib/jvm/java-11-openjdk-amd64' >> 
/home/cassandra/.bashrc && \
+    echo 'export JAVA_HOME=$JAVA8_HOME' >> /home/cassandra/.bashrc
+
+# run pip commands and setup virtualenv (note we do this after we switch to 
cassandra user so we
+# setup the virtualenv for the cassandrauser and not the root user by acident)
+RUN virtualenv --python=python3.6 --no-site-packages env
+RUN chmod +x env/bin/activate
+RUN /bin/bash -c "source ~/env/bin/activate && pip3 install Cython && pip3 
install -r /opt/requirements.txt && pip3 freeze --user"
+
+# we need to make SSH less strict to prevent various dtests from failing when 
they attempt to
+# git clone a given commit/tag/etc
+# upgrading node1 to github:apache/18cdd391ec27d16daf775f928902f5a421c415e3
+# g...@github.com:apache/cassandra.git 
github:apache/18cdd391ec27d16daf775f928902f5a421c415e3
+# 23:47:08,993 ccm INFO Cloning Cassandra...
+# The authenticity of host 'github.com (192.30.253.112)' can't be established.
+# RSA key fingerprint is SHA256:nThbg6kXUpJWGl7E1IGOCspRomTxdCARLviKw6E5SY8.
+# Are you sure you want to continue connecting (yes/no)?
+RUN mkdir ~/.ssh
+RUN echo 'Host *\n UserKnownHostsFile /dev/null\n StrictHostKeyChecking no' > 
~/.ssh/config
+RUN chown cassandra:cassandra ~/.ssh
+RUN chown cassandra:cassandra ~/.ssh/config
+RUN chmod 600 ~/.ssh/config
+
+# mark "/tmp" as a volume so it will get mounted as an ext4 mount and not
+# the stupid aufs/CoW stuff that the actual docker container mounts will have.
+# we've been seeing 3+ minute hangs when calling sync on an aufs backed mount
+# so it greatly makes tests flaky as things can hang basically anywhere
+VOLUME ["/tmp"]


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org
For additional commands, e-mail: commits-h...@cassandra.apache.org

Reply via email to