<commit_before>FROM ubuntu
RUN echo 'Building new SuperDuper Docker image...'
COPY test/testdata/ca-cert.pem /tmp/
RUN apt-get update && \
    apt-get install -y software-properties-common && \
    apt-add-repository -y ppa:jbboehr/coreos && \
    apt-get update && \
    apt-get install -qqy \
        ca-certificates \
        etcdctl \
        libevent-2.0.5 \
        libevent-core-2.0.5 \
        libevent-extra-2.0.5 \
        libevent-openssl-2.0.5 \
        libevent-pthreads-2.0.5 \
        libgflags2 \
        libgoogle-glog0 \
        libjson-c2 \
        libleveldb1 \
        libsnappy1 \
        libgoogle-perftools4 \
        libldns1 \
        libprotobuf8
RUN update-ca-certificates && \
    cat /etc/ssl/certs/* /tmp/ca-cert.pem > /usr/local/etc/ctlog_ca_roots.pem
RUN groupadd -r ctlog && useradd -r -g ctlog ctlog
RUN mkdir /mnt/ctlog
COPY cpp/server/ct-server /usr/local/bin/
COPY test/testdata/ct-server-key.pem /usr/local/etc/
COPY cpp/tools/ct-clustertool /usr/local/bin/
VOLUME /mnt/ctlog
CMD cd /mnt/ctlog/ && \
    if [ ! -d logs ]; then mkdir logs; fi && \
    MY_IP=$(awk "/${HOSTNAME}/ {print \$1}" < /etc/hosts) && \
    export V_LEVEL=${V_LEVEL:-0} && \
    export NUM_HTTP_SERVER_THREADS=${NUM_HTTP_SERVER_THREADS:-32} && \
    echo "My IP: ${MY_IP}" && \
    echo "Container: ${CONTAINER_HOST}" && \
    echo "Etcd: ${ETCD_HOST}:${ETCD_PORT}" && \
    echo "Project: ${PROJECT}" && \
    echo "Monitoring: ${MONITORING}" && \
    ulimit -c unlimited && \
    /usr/local/bin/ct-server \
        --port=80 \
        --server=${CONTAINER_HOST} \
        --key=/usr/local/etc/ct-server-key.pem \
        --trusted_cert_file=/usr/local/etc/ctlog_ca_roots.pem \
        --log_dir=/mnt/ctlog/logs \
        --tree_signing_frequency_seconds=30 \
        --guard_window_seconds=10 \
        --sqlite_db=/mnt/ctlog/sqlite.db \
        --etcd_host=${ETCD_HOST} \
        --etcd_port=${ETCD_PORT} \
        --etcd_delete_concurrency=100 \
        --num_http_server_threads=${NUM_HTTP_SERVER_THREADS} \
        --monitoring=${MONITORING} \
        --google_compute_monitoring_base_url="https://www.googleapis.com/cloudmonitoring/v2beta2/projects/${PROJECT}" \
        --v=${V_LEVEL}; \
    if [ -e core ]; then \
      CORE_DIR="/mnt/ctlog/cores/$(date +%s)"; \
      mkdir -p ${CORE_DIR}; \
      cp -v core ${CORE_DIR}; \
      cp -v /usr/local/bin/ct-server ${CORE_DIR}; \
      echo "Core saved to ${CORE_DIR}"; \
    fi

EXPOSE 80<commit_msg>Use LevelDB for log too.<commit_after>FROM ubuntu
RUN echo 'Building new SuperDuper Docker image...'
COPY test/testdata/ca-cert.pem /tmp/
RUN apt-get update && \
    apt-get install -y software-properties-common && \
    apt-add-repository -y ppa:jbboehr/coreos && \
    apt-get update && \
    apt-get install -qqy \
        ca-certificates \
        etcdctl \
        libevent-2.0.5 \
        libevent-core-2.0.5 \
        libevent-extra-2.0.5 \
        libevent-openssl-2.0.5 \
        libevent-pthreads-2.0.5 \
        libgflags2 \
        libgoogle-glog0 \
        libjson-c2 \
        libleveldb1 \
        libsnappy1 \
        libgoogle-perftools4 \
        libldns1 \
        libprotobuf8
RUN update-ca-certificates && \
    cat /etc/ssl/certs/* /tmp/ca-cert.pem > /usr/local/etc/ctlog_ca_roots.pem
RUN groupadd -r ctlog && useradd -r -g ctlog ctlog
RUN mkdir /mnt/ctlog
COPY cpp/server/ct-server /usr/local/bin/
COPY test/testdata/ct-server-key.pem /usr/local/etc/
COPY cpp/tools/ct-clustertool /usr/local/bin/
VOLUME /mnt/ctlog
CMD cd /mnt/ctlog/ && \
    if [ ! -d logs ]; then mkdir logs; fi && \
    MY_IP=$(awk "/${HOSTNAME}/ {print \$1}" < /etc/hosts) && \
    export V_LEVEL=${V_LEVEL:-0} && \
    export NUM_HTTP_SERVER_THREADS=${NUM_HTTP_SERVER_THREADS:-32} && \
    echo "My IP: ${MY_IP}" && \
    echo "Container: ${CONTAINER_HOST}" && \
    echo "Etcd: ${ETCD_HOST}:${ETCD_PORT}" && \
    echo "Project: ${PROJECT}" && \
    echo "Monitoring: ${MONITORING}" && \
    ulimit -c unlimited && \
    /usr/local/bin/ct-server \
        --port=80 \
        --server=${CONTAINER_HOST} \
        --key=/usr/local/etc/ct-server-key.pem \
        --trusted_cert_file=/usr/local/etc/ctlog_ca_roots.pem \
        --log_dir=/mnt/ctlog/logs \
        --tree_signing_frequency_seconds=30 \
        --guard_window_seconds=10 \
        --leveldb_db=/mnt/ctlog/log.ldb \
        --etcd_host=${ETCD_HOST} \
        --etcd_port=${ETCD_PORT} \
        --etcd_delete_concurrency=100 \
        --num_http_server_threads=${NUM_HTTP_SERVER_THREADS} \
        --monitoring=${MONITORING} \
        --google_compute_monitoring_base_url="https://www.googleapis.com/cloudmonitoring/v2beta2/projects/${PROJECT}" \
        --v=${V_LEVEL}; \
    if [ -e core ]; then \
      CORE_DIR="/mnt/ctlog/cores/$(date +%s)"; \
      mkdir -p ${CORE_DIR}; \
      cp -v core ${CORE_DIR}; \
      cp -v /usr/local/bin/ct-server ${CORE_DIR}; \
      echo "Core saved to ${CORE_DIR}"; \
    fi

EXPOSE 80
{'fraction_non_alphanumeric': 0.16309620048504447, 'fraction_numerical': 0.016168148746968473, 'mean_word_length': 2.089263420724095, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 2, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '698881', 'n_tokens_mistral': 1912, 'n_tokens_neox': 1845, 'n_words': 303}