From 91524e20ec3c5ed3cf4f4fa29949cd66e56a19f7 Mon Sep 17 00:00:00 2001 From: Jeff Cantrill Date: Mon, 19 Apr 2021 16:22:41 -0400 Subject: [PATCH] LOG-1281: Add linting and Dockerfile generation from midstream Dockerfile.in --- Makefile | 6 ++ curator/Dockerfile | 27 ++++- curator/Dockerfile.in | 75 ++++++++++++++ curator/origin-meta.yaml | 3 + elasticsearch/Dockerfile | 100 ++++++++++++++++++- elasticsearch/Dockerfile.in | 114 +++++++++++++++++++++ elasticsearch/Dockerfile.origin | 2 +- elasticsearch/Dockerfile.rhel8 | 80 +-------------- elasticsearch/origin-meta.yaml | 3 + fluentd/Dockerfile | 121 ++++++++++++++++------- fluentd/Dockerfile.in | 125 ++++++++++++++++++++++++ fluentd/origin-meta.yaml | 3 + hack/generate-dockerfile-from-midstream | 47 +++++++++ hack/run-linter | 10 ++ kibana/Dockerfile | 61 +++++++++++- kibana/Dockerfile.in | 76 ++++++++++++++ kibana/Dockerfile.rhel8 | 36 +------ kibana/origin-meta.yaml | 3 + 18 files changed, 741 insertions(+), 151 deletions(-) create mode 100644 curator/Dockerfile.in create mode 100644 curator/origin-meta.yaml mode change 120000 => 100644 elasticsearch/Dockerfile create mode 100644 elasticsearch/Dockerfile.in mode change 100644 => 120000 elasticsearch/Dockerfile.rhel8 create mode 100644 elasticsearch/origin-meta.yaml create mode 100644 fluentd/Dockerfile.in create mode 100644 fluentd/origin-meta.yaml create mode 100755 hack/generate-dockerfile-from-midstream mode change 120000 => 100644 kibana/Dockerfile create mode 100644 kibana/Dockerfile.in mode change 100644 => 120000 kibana/Dockerfile.rhel8 create mode 100644 kibana/origin-meta.yaml diff --git a/Makefile b/Makefile index 9f39286fc..f1a6cb04f 100644 --- a/Makefile +++ b/Makefile @@ -56,3 +56,9 @@ deploy-all-images: deploy-fluentd-image deploy-kibana-image deploy-elasticsearch lint: @hack/run-linter .PHONY: lint + +gen-dockerfiles: + @for d in "curator" "elasticsearch" "fluentd" "kibana"; do \ + ./hack/generate-dockerfile-from-midstream "$$d/Dockerfile.in" > "$$d/Dockerfile" ; \ + done +.PHONY: gen-dockerfiles diff --git a/curator/Dockerfile b/curator/Dockerfile index 7bae01332..2d691ee25 100644 --- a/curator/Dockerfile +++ b/curator/Dockerfile @@ -1,5 +1,29 @@ +### This is a generated file from Dockerfile.in ### + +#@follow_tag(openshift-ose-base:ubi8.python.36) FROM registry.ci.openshift.org/ocp/builder:ubi8.python.36 +ENV BUILD_VERSION=${CI_CONTAINER_VERSION:-} +ENV OS_GIT_MAJOR=${CI_X_VERSION:-} +ENV OS_GIT_MINOR=${CI_Y_VERSION:-} +ENV OS_GIT_PATCH=${CI_Z_VERSION:-} +ENV SOURCE_GIT_COMMIT=${CI_ORIGIN_AGGREGATED_LOGGING_UPSTREAM_COMMIT:-} +ENV SOURCE_GIT_URL=${CI_ORIGIN_AGGREGATED_LOGGING_UPSTREAM_URL:-} + +LABEL \ + License="GPLv2+" \ + io.k8s.description="Curator elasticsearch container for elasticsearch deletion/archival" \ + io.k8s.display-name="Curator 5" \ + io.openshift.tags="logging,elk,elasticsearch,curator" \ + vendor="Red Hat" \ + name="openshift/ose-logging-curator5" \ + com.redhat.component="logging-curator5-container" \ + io.openshift.maintainer.product="OpenShift Container Platform" \ + io.openshift.build.commit.id=${CI_ORIGIN_AGGREGATED_LOGGING_UPSTREAM_COMMIT} \ + io.openshift.build.source-location=${CI_ORIGIN_AGGREGATED_LOGGING_UPSTREAM_URL} \ + io.openshift.build.commit.url=${CI_ORIGIN_AGGREGATED_LOGGING_UPSTREAM_URL}/commit/${CI_ORIGIN_AGGREGATED_LOGGING_UPSTREAM_URL} \ + version=${CI_CONTAINER_VERSION} + MAINTAINER OpenShift Development ENV HOME=/opt/app-root/src \ @@ -17,9 +41,10 @@ ENV HOME=/opt/app-root/src \ CURATOR_VER=5.8.1 \ container=oci \ LC_ALL=en_US.UTF-8 +ENV upstream_code=${upstream_code:-"."} USER 0 -COPY . ${HOME} +COPY ${upstream_code}/ ${HOME} RUN mkdir -p $(dirname "$CURATOR_CONF_LOCATION") && \ touch ${CURATOR_CONF_LOCATION} && \ diff --git a/curator/Dockerfile.in b/curator/Dockerfile.in new file mode 100644 index 000000000..4a46c1db7 --- /dev/null +++ b/curator/Dockerfile.in @@ -0,0 +1,75 @@ +## EXCLUDE BEGIN ## +#@follow_tag(ubi8:8-released) +FROM ubi8:8.2-347 AS builder + +ARG upstream_code +ENV upstream_code=upstream_code +ARG upstream_tarball=${upstream_code}.tar.gz + +COPY ${CI_ARCHIVE_ORIGIN_AGGREGATED_LOGGING} ${upstream_tarball} +RUN mkdir -p ${upstream_code} \ + && tar -xzf ${upstream_tarball} \ + --strip-components 1 \ + -C ${upstream_code} +## EXCLUDE END ## + +#@follow_tag(openshift-ose-base:ubi8.python.36) +FROM openshift-ose-base:v4.0-202009120102.31989 + +ENV BUILD_VERSION=${CI_CONTAINER_VERSION:-} +ENV OS_GIT_MAJOR=${CI_X_VERSION:-} +ENV OS_GIT_MINOR=${CI_Y_VERSION:-} +ENV OS_GIT_PATCH=${CI_Z_VERSION:-} +ENV SOURCE_GIT_COMMIT=${CI_ORIGIN_AGGREGATED_LOGGING_UPSTREAM_COMMIT:-} +ENV SOURCE_GIT_URL=${CI_ORIGIN_AGGREGATED_LOGGING_UPSTREAM_URL:-} + +LABEL \ + License="GPLv2+" \ + io.k8s.description="Curator elasticsearch container for elasticsearch deletion/archival" \ + io.k8s.display-name="Curator 5" \ + io.openshift.tags="logging,elk,elasticsearch,curator" \ + vendor="Red Hat" \ + name="openshift/ose-logging-curator5" \ + com.redhat.component="logging-curator5-container" \ + io.openshift.maintainer.product="OpenShift Container Platform" \ + io.openshift.build.commit.id=${CI_ORIGIN_AGGREGATED_LOGGING_UPSTREAM_COMMIT} \ + io.openshift.build.source-location=${CI_ORIGIN_AGGREGATED_LOGGING_UPSTREAM_URL} \ + io.openshift.build.commit.url=${CI_ORIGIN_AGGREGATED_LOGGING_UPSTREAM_URL}/commit/${CI_ORIGIN_AGGREGATED_LOGGING_UPSTREAM_URL} \ + version=${CI_CONTAINER_VERSION} + +MAINTAINER OpenShift Development + +ENV HOME=/opt/app-root/src \ + ES_HOST=localhost \ + ES_PORT=9200 \ + ES_CA=/etc/curator/keys/ca \ + ES_CLIENT_CERT=/etc/curator/keys/cert \ + ES_CLIENT_KEY=/etc/curator/keys/key \ + CURATOR_CONF_LOCATION=/etc/curator/settings/config.yaml \ + CURATOR_CONF_FILE=/etc/curator/settings/curator5.yaml \ + CURATOR_ACTIONS_FILE=/etc/curator/settings/actions.yaml \ + CURATOR_LOG_LEVEL=ERROR \ + CURATOR_SCRIPT_LOG_LEVEL=INFO \ + CURATOR_TIMEOUT=300 \ + CURATOR_VER=5.8.1 \ + container=oci \ + LC_ALL=en_US.UTF-8 +ENV upstream_code=${upstream_code:-"."} + +USER 0 +COPY --from=builder ${upstream_code}/ ${HOME} + +RUN mkdir -p $(dirname "$CURATOR_CONF_LOCATION") && \ + touch ${CURATOR_CONF_LOCATION} && \ + chmod -R u+x ${HOME} && \ + chgrp -R 0 ${HOME} && \ + chmod -R g=u ${HOME} + +WORKDIR ${HOME}/vendor +RUN pip install $(ls . | grep -v curator) -q --no-index --find-links . && \ + pip install elasticsearch-curator* --no-index -q && \ + rm -rf $HOME/vendor + +WORKDIR ${HOME} +USER 1001 +CMD ["sh", "run.sh"] \ No newline at end of file diff --git a/curator/origin-meta.yaml b/curator/origin-meta.yaml new file mode 100644 index 000000000..38c14521a --- /dev/null +++ b/curator/origin-meta.yaml @@ -0,0 +1,3 @@ +from: +- source: openshift-ose-base\:v(?:[\.0-9\-]*) + target: registry.ci.openshift.org/ocp/builder:ubi8.python.36 diff --git a/elasticsearch/Dockerfile b/elasticsearch/Dockerfile deleted file mode 120000 index 9186ee0ce..000000000 --- a/elasticsearch/Dockerfile +++ /dev/null @@ -1 +0,0 @@ -Dockerfile.rhel8 \ No newline at end of file diff --git a/elasticsearch/Dockerfile b/elasticsearch/Dockerfile new file mode 100644 index 000000000..3cec6573d --- /dev/null +++ b/elasticsearch/Dockerfile @@ -0,0 +1,99 @@ +### This is a generated file from Dockerfile.in ### + +#@follow_tag(openshift-ose-base:ubi8) +FROM registry.ci.openshift.org/ocp/builder:rhel-8-base-openshift-4.7 + +ENV BUILD_VERSION=${CI_CONTAINER_VERSION:-} +ENV OS_GIT_MAJOR=${CI_X_VERSION:-} +ENV OS_GIT_MINOR=${CI_Y_VERSION:-} +ENV SOURCE_GIT_COMMIT=${CI_ORIGIN_AGGREGATED_LOGGING_UPSTREAM_COMMIT:-} +ENV SOURCE_GIT_URL=${CI_ORIGIN_AGGREGATED_LOGGING_UPSTREAM_URL:-} + +LABEL \ + License="GPLv2+" \ + io.k8s.description="Elasticsearch container for EFK aggregated logging storage" \ + io.k8s.display-name="Elasticsearch 6" \ + io.openshift.tags="logging,elk,elasticsearch" \ + vendor="Red Hat" \ + name="openshift-logging/elasticsearch6-rhel8" \ + com.redhat.component="logging-elasticsearch6-container" \ + io.openshift.maintainer.product="OpenShift Container Platform" \ + io.openshift.build.commit.id=${CI_ORIGIN_AGGREGATED_LOGGING_UPSTREAM_COMMIT} \ + io.openshift.build.source-location=${CI_ORIGIN_AGGREGATED_LOGGING_UPSTREAM_URL} \ + io.openshift.build.commit.url=${CI_ORIGIN_AGGREGATED_LOGGING_UPSTREAM_URL}/commit/${CI_ORIGIN_AGGREGATED_LOGGING_UPSTREAM_COMMIT} \ + version=${CI_CONTAINER_VERSION} + +MAINTAINER OpenShift Development + +EXPOSE 9200 +EXPOSE 9300 +USER 0 + +ARG ES_ARCHIVE_URL +ARG PROMETHEUS_EXPORTER_URL +ARG OPENDISTRO_URL +ARG OPENSHIFT_CI + + +ENV ES_PATH_CONF=/etc/elasticsearch/ \ + ES_HOME=/usr/share/elasticsearch \ + ES_VER=6.8.1.redhat-00006 \ + HOME=/opt/app-root/src \ + INSTANCE_RAM=512G \ + JAVA_VER=11 \ + JAVA_HOME=/usr/lib/jvm/jre \ + NODE_QUORUM=1 \ + PROMETHEUS_EXPORTER_VER=6.8.1.0-redhat-00001 \ + OPENDISTRO_VER=0.10.0.4-redhat-00001 \ + PLUGIN_LOGLEVEL=INFO \ + RECOVER_AFTER_NODES=1 \ + RECOVER_EXPECTED_NODES=1 \ + RECOVER_AFTER_TIME=5m \ + DHE_TMP_KEY_SIZE=2048 \ + RELEASE_STREAM=prod \ + OPENSHIFT_CI=${OPENSHIFT_CI:-false} + + +# COPY $REMOTE_SOURCE $REMOTE_SOURCE_DIR +# WORKDIR $REMOTE_SOURCE_DIR/app/elasticsearch + +RUN packages="java-${JAVA_VER}-openjdk-headless \ + python36 \ + python3-pyyaml \ + hostname \ + openssl \ + zip \ + unzip" && \ + yum install -y ${packages} && \ + rpm -V ${packages} && \ + alternatives --set python /usr/bin/python3 && \ + yum clean all + +ARG MAVEN_REPO_URL=${MAVEN_REPO_URL:-file:///artifacts/} +ENV upstream_code=${upstream_code:-"."} + +COPY ${upstream_code}/extra-jvm.options /var/tmp +COPY ${upstream_code}/ci-env.sh /var/tmp +COPY ${upstream_code}/install-es.sh /var/tmp +COPY artifacts /artifacts +RUN /var/tmp/install-es.sh + +COPY ${upstream_code}/sgconfig/ ${HOME}/sgconfig/ +COPY ${upstream_code}/index_templates/ ${ES_HOME}/index_templates/ +COPY ${upstream_code}/index_patterns/ ${ES_HOME}/index_patterns/ +COPY ${upstream_code}/init/ ${ES_HOME}/init/ +COPY ${upstream_code}/probe/ ${ES_HOME}/probe/ +COPY ${upstream_code}/init.sh ${HOME}/ +COPY ${upstream_code}/run.sh ${HOME}/ +COPY ${upstream_code}/ci-env.sh ${HOME}/ +COPY ${upstream_code}/install.sh ${HOME}/ +COPY ${upstream_code}/utils/** /usr/local/bin/ + +RUN ${HOME}/install.sh && rm -rf /artifacts && \ + mv ${ES_HOME}/lib/elasticsearch-${ES_VER}.jar ${ES_HOME}/lib/elasticsearch-$(echo $ES_VER | cut -d'.' -f1-3).jar + +WORKDIR ${HOME} +USER 1000 +CMD ["sh", "/opt/app-root/src/run.sh"] + + diff --git a/elasticsearch/Dockerfile.in b/elasticsearch/Dockerfile.in new file mode 100644 index 000000000..999bb266c --- /dev/null +++ b/elasticsearch/Dockerfile.in @@ -0,0 +1,114 @@ +## EXCLUDE BEGIN ## +#@follow_tag(openshift-ose-base:ubi8) +FROM openshift-ose-base:v4.0-202104100031.20055 AS builder + +ARG upstream_code +ENV upstream_code=upstream_code +ARG upstream_tarball=${upstream_code}.tar.gz + +COPY ${CI_ARCHIVE_ORIGIN_AGGREGATED_LOGGING} ${upstream_tarball} +RUN mkdir -p ${upstream_code} \ + && tar -xzf ${upstream_tarball} \ + --strip-components 1 \ + -C ${upstream_code} +## EXCLUDE END ## + +#@follow_tag(openshift-ose-base:ubi8) +FROM openshift-ose-base:v4.0-202104100031.20055 + +ENV BUILD_VERSION=${CI_CONTAINER_VERSION:-} +ENV OS_GIT_MAJOR=${CI_X_VERSION:-} +ENV OS_GIT_MINOR=${CI_Y_VERSION:-} +ENV SOURCE_GIT_COMMIT=${CI_ORIGIN_AGGREGATED_LOGGING_UPSTREAM_COMMIT:-} +ENV SOURCE_GIT_URL=${CI_ORIGIN_AGGREGATED_LOGGING_UPSTREAM_URL:-} + +LABEL \ + License="GPLv2+" \ + io.k8s.description="Elasticsearch container for EFK aggregated logging storage" \ + io.k8s.display-name="Elasticsearch 6" \ + io.openshift.tags="logging,elk,elasticsearch" \ + vendor="Red Hat" \ + name="openshift-logging/elasticsearch6-rhel8" \ + com.redhat.component="logging-elasticsearch6-container" \ + io.openshift.maintainer.product="OpenShift Container Platform" \ + io.openshift.build.commit.id=${CI_ORIGIN_AGGREGATED_LOGGING_UPSTREAM_COMMIT} \ + io.openshift.build.source-location=${CI_ORIGIN_AGGREGATED_LOGGING_UPSTREAM_URL} \ + io.openshift.build.commit.url=${CI_ORIGIN_AGGREGATED_LOGGING_UPSTREAM_URL}/commit/${CI_ORIGIN_AGGREGATED_LOGGING_UPSTREAM_COMMIT} \ + version=${CI_CONTAINER_VERSION} + +MAINTAINER OpenShift Development + +EXPOSE 9200 +EXPOSE 9300 +USER 0 + +ARG ES_ARCHIVE_URL +ARG PROMETHEUS_EXPORTER_URL +ARG OPENDISTRO_URL +ARG OPENSHIFT_CI + + +ENV ES_PATH_CONF=/etc/elasticsearch/ \ + ES_HOME=/usr/share/elasticsearch \ + ES_VER=6.8.1.redhat-00006 \ + HOME=/opt/app-root/src \ + INSTANCE_RAM=512G \ + JAVA_VER=11 \ + JAVA_HOME=/usr/lib/jvm/jre \ + NODE_QUORUM=1 \ + PROMETHEUS_EXPORTER_VER=6.8.1.0-redhat-00001 \ + OPENDISTRO_VER=0.10.0.4-redhat-00001 \ + PLUGIN_LOGLEVEL=INFO \ + RECOVER_AFTER_NODES=1 \ + RECOVER_EXPECTED_NODES=1 \ + RECOVER_AFTER_TIME=5m \ + DHE_TMP_KEY_SIZE=2048 \ + RELEASE_STREAM=prod \ + OPENSHIFT_CI=${OPENSHIFT_CI:-false} + + +# COPY $REMOTE_SOURCE $REMOTE_SOURCE_DIR +# WORKDIR $REMOTE_SOURCE_DIR/app/elasticsearch + +RUN packages="java-${JAVA_VER}-openjdk-headless \ + python36 \ + python3-pyyaml \ + hostname \ + openssl \ + zip \ + unzip" && \ + yum install -y ${packages} && \ + rpm -V ${packages} && \ + alternatives --set python /usr/bin/python3 && \ + yum clean all + +ARG MAVEN_REPO_URL=${MAVEN_REPO_URL:-file:///artifacts/} +## EXCLUDE BEGIN ## +ENV upstream_code=upstream_code/elasticsearch +## EXCLUDE END ## +ENV upstream_code=${upstream_code:-"."} + +COPY --from=builder ${upstream_code}/extra-jvm.options /var/tmp +COPY --from=builder ${upstream_code}/ci-env.sh /var/tmp +COPY --from=builder ${upstream_code}/install-es.sh /var/tmp +COPY artifacts /artifacts +RUN /var/tmp/install-es.sh + +COPY --from=builder ${upstream_code}/sgconfig/ ${HOME}/sgconfig/ +COPY --from=builder ${upstream_code}/index_templates/ ${ES_HOME}/index_templates/ +COPY --from=builder ${upstream_code}/index_patterns/ ${ES_HOME}/index_patterns/ +COPY --from=builder ${upstream_code}/init/ ${ES_HOME}/init/ +COPY --from=builder ${upstream_code}/probe/ ${ES_HOME}/probe/ +COPY --from=builder ${upstream_code}/init.sh ${HOME}/ +COPY --from=builder ${upstream_code}/run.sh ${HOME}/ +COPY --from=builder ${upstream_code}/ci-env.sh ${HOME}/ +COPY --from=builder ${upstream_code}/install.sh ${HOME}/ +COPY --from=builder ${upstream_code}/utils/** /usr/local/bin/ + +RUN ${HOME}/install.sh && rm -rf /artifacts && \ + mv ${ES_HOME}/lib/elasticsearch-${ES_VER}.jar ${ES_HOME}/lib/elasticsearch-$(echo $ES_VER | cut -d'.' -f1-3).jar + +WORKDIR ${HOME} +USER 1000 +CMD ["sh", "/opt/app-root/src/run.sh"] + diff --git a/elasticsearch/Dockerfile.origin b/elasticsearch/Dockerfile.origin index 9186ee0ce..1d1fe94df 120000 --- a/elasticsearch/Dockerfile.origin +++ b/elasticsearch/Dockerfile.origin @@ -1 +1 @@ -Dockerfile.rhel8 \ No newline at end of file +Dockerfile \ No newline at end of file diff --git a/elasticsearch/Dockerfile.rhel8 b/elasticsearch/Dockerfile.rhel8 deleted file mode 100644 index 5a8acd7f5..000000000 --- a/elasticsearch/Dockerfile.rhel8 +++ /dev/null @@ -1,79 +0,0 @@ -FROM registry.ci.openshift.org/ocp/builder:rhel-8-base-openshift-4.7 - -MAINTAINER OpenShift Development - -LABEL \ - License="GPLv2+" \ - io.k8s.description="Elasticsearch container for EFK aggregated logging storage" \ - io.k8s.display-name="Elasticsearch 6" \ - io.openshift.tags="logging,elk,elasticsearch" \ - vendor="Red Hat" \ - name="openshift/ose-logging-elasticsearch6" \ - com.redhat.component="logging-elasticsearch6-container" \ - io.openshift.maintainer.product="OpenShift Container Platform" \ - io.openshift.maintainer.component="Logging" - -EXPOSE 9200 -EXPOSE 9300 -USER 0 - -ARG ES_ARCHIVE_URL -ARG PROMETHEUS_EXPORTER_URL -ARG OPENDISTRO_URL -ARG OPENSHIFT_CI - -ENV ES_PATH_CONF=/etc/elasticsearch/ \ - ES_HOME=/usr/share/elasticsearch \ - ES_VER=6.8.1.redhat-00006 \ - HOME=/opt/app-root/src \ - INSTANCE_RAM=512G \ - JAVA_VER=11 \ - JAVA_HOME=/usr/lib/jvm/jre \ - NODE_QUORUM=1 \ - PROMETHEUS_EXPORTER_VER=6.8.1.0-redhat-00001 \ - OPENDISTRO_VER=0.10.0.4-redhat-00001 \ - PLUGIN_LOGLEVEL=INFO \ - RECOVER_AFTER_NODES=1 \ - RECOVER_EXPECTED_NODES=1 \ - RECOVER_AFTER_TIME=5m \ - DHE_TMP_KEY_SIZE=2048 \ - RELEASE_STREAM=prod \ - OPENSHIFT_CI=${OPENSHIFT_CI:-false} - -ARG MAVEN_REPO_URL=${MAVEN_REPO_URL:-file:///artifacts/} - -RUN packages="java-${JAVA_VER}-openjdk-headless \ - python36 python3-pyyaml \ - hostname \ - openssl \ - zip \ - unzip" && \ - yum install -y ${packages} && \ - rpm -V ${packages} && \ - alternatives --set python /usr/bin/python3 && \ - yum clean all - -ADD extra-jvm.options install-es.sh ci-env.sh /var/tmp - -# Since artifacts does not exist during CI build, include README.MD -# which will prevent the copy from raising an error. -RUN mkdir /artifacts -# In an OSBS build, this will COPY artifacts from fetch-artifacts-koji.yaml. In a CI build, it will just -# copy the README.MD. -COPY artifacts/* /artifacts -COPY *.zip / -RUN /var/tmp/install-es.sh - -ADD sgconfig/ ${HOME}/sgconfig/ -ADD index_templates/ ${ES_HOME}/index_templates/ -ADD index_patterns/ ${ES_HOME}/index_patterns/ -ADD init/ ${ES_HOME}/init/ -ADD probe/ ${ES_HOME}/probe/ -ADD init.sh run.sh ci-env.sh install.sh ${HOME}/ -COPY utils/** /usr/local/bin/ - -RUN ${HOME}/install.sh && rm -rf /artifacts - -WORKDIR ${HOME} -USER 1000 -CMD ["sh", "/opt/app-root/src/run.sh"] diff --git a/elasticsearch/Dockerfile.rhel8 b/elasticsearch/Dockerfile.rhel8 new file mode 120000 index 000000000..1d1fe94df --- /dev/null +++ b/elasticsearch/Dockerfile.rhel8 @@ -0,0 +1 @@ +Dockerfile \ No newline at end of file diff --git a/elasticsearch/origin-meta.yaml b/elasticsearch/origin-meta.yaml new file mode 100644 index 000000000..db94fe1b1 --- /dev/null +++ b/elasticsearch/origin-meta.yaml @@ -0,0 +1,3 @@ +from: +- source: openshift-ose-base\:v(?:[\.0-9\-]*) + target: registry.ci.openshift.org/ocp/builder:rhel-8-base-openshift-4.7 diff --git a/fluentd/Dockerfile b/fluentd/Dockerfile index ceca2d859..ad61e905e 100644 --- a/fluentd/Dockerfile +++ b/fluentd/Dockerfile @@ -1,55 +1,110 @@ +### This is a generated file from Dockerfile.in ### + +#@follow_tag(openshift-ose-base:ubi8.ruby.25) FROM registry.ci.openshift.org/ocp/builder:ubi8.ruby.25 +ENV BUILD_VERSION=${CI_CONTAINER_VERSION:-} +ENV OS_GIT_MAJOR=${CI_X_VERSION:-} +ENV OS_GIT_MINOR=${CI_Y_VERSION:-} +ENV OS_GIT_PATCH=${CI_Z_VERSION:-} +ENV SOURCE_GIT_COMMIT=${CI_ORIGIN_AGGREGATED_LOGGING_UPSTREAM_COMMIT:-} +ENV SOURCE_GIT_URL=${CI_ORIGIN_AGGREGATED_LOGGING_UPSTREAM_URL:-} + +LABEL \ + License="GPLv2+" \ + io.k8s.description="Fluentd container for collecting of container logs" \ + io.k8s.display-name="Fluentd" \ + io.openshift.tags="logging,elk,fluentd" \ + vendor="Red Hat" \ + name="openshift/ose-logging-fluentd" \ + com.redhat.component="logging-fluentd-container" \ + io.openshift.maintainer.product="OpenShift Container Platform" \ + io.openshift.build.commit.id=${CI_ORIGIN_AGGREGATED_LOGGING_UPSTREAM_COMMIT} \ + io.openshift.build.source-location=${CI_ORIGIN_AGGREGATED_LOGGING_UPSTREAM_URL} \ + io.openshift.build.commit.url=${CI_ORIGIN_AGGREGATED_LOGGING_UPSTREAM_URL}/commit/${CI_ORIGIN_AGGREGATED_LOGGING_UPSTREAM_URL} \ + version=${CI_CONTAINER_VERSION} + MAINTAINER OpenShift Development -ENV DATA_VERSION=1.6.0 \ - FLUENTD_VERSION=1.7.4 \ - HOME=/opt/app-root/src \ - PATH=/opt/app-root/src/bin:/opt/app-root/bin:$PATH \ - LOGGING_FILE_PATH=/var/lib/fluentd/fluentd.log \ - LOGGING_FILE_AGE=10 \ - LOGGING_FILE_SIZE=1024000 \ - container=oci +ARG DATA_VERSION_VALUE=1.6.0 +ARG FLUENTD_VERSION_VALUE=1.7.4 +ARG HOME_VALUE=/opt/app-root/src +ARG PATH_VALUE=/opt/app-root/src/bin:/opt/app-root/bin +ARG LOGGING_FILE_PATH_VALUE=/var/log/fluentd/fluentd.log +ARG LOGGING_FILE_AGE_VALUE=10 +ARG LOGGING_FILE_SIZE_VALUE=1024000 +ARG CONTAINER_VALUE=oci -ARG BUILD_PKGS="make gcc-c++ libffi-devel autoconf automake libtool m4 redhat-rpm-config" -ARG RUNTIME_PKGS="hostname bc iproute" +ENV DATA_VERSION=$DATA_VERSION_VALUE \ + FLUENTD_VERSION=$FLUENTD_VERSION_VALUE \ + HOME=$HOME_VALUE \ + PATH=$PATH_VALUE:$PATH \ + LOGGING_FILE_PATH=$LOGGING_FILE_PATH_VALUE \ + LOGGING_FILE_AGE=$LOGGING_FILE_AGE_VALUE \ + LOGGING_FILE_SIZE=$LOGGING_FILE_SIZE_VALUE \ + container=$CONTAINER_VALUE -USER 0 -RUN yum install -y $BUILD_PKGS $RUNTIME_PKGS && \ - rpm -V $BUILD_PKGS $RUNTIME_PKGS && \ - yum clean all +ARG TEST_REPO +#ADD test.repo /etc/yum.repos.d + +USER 0 +RUN : 'removed yum-config-manager' \ + && BUILD_PKGS="make gcc-c++ libffi-devel autoconf automake libtool m4 redhat-rpm-config" \ + && RUNTIME_PKGS="hostname bc iproute" \ + && yum install -y --setopt=tsflags=nodocs $BUILD_PKGS $RUNTIME_PKGS \ + && rpm -V $BUILD_PKGS \ + && rpm -V $RUNTIME_PKGS \ + && yum clean all -ADD jemalloc/ ${HOME}/jemalloc/ +# uncomment if you want to try out test rpm builds +#ADD *.rpm /tmp/ +#RUN yum -y install /tmp/*.rpm +ENV upstream_code=${upstream_code:-"."} +COPY ${upstream_code}/jemalloc/ ${HOME}/jemalloc/ RUN cd ${HOME}/jemalloc && EXTRA_CFLAGS="$( rpm --eval '%{optflags}' )" ./autogen.sh && \ make install_lib_shared install_bin && cp COPYING ${HOME}/COPYING.jemalloc && \ cd .. && rm -rf jemalloc -ADD source.jemalloc /source.jemalloc +COPY ${upstream_code}/source.jemalloc /source.jemalloc RUN bash -c '. /source.jemalloc; echo jemalloc $JEMALLOC_VER >> /contents' -ADD vendored_gem_src/ ${HOME}/vendored_gem_src/ -ADD lib/fluent-plugin-remote_syslog/ ${HOME}/vendored_gem_src/fluent-plugin-remote_syslog/ -ADD lib/remote_syslog_sender/ ${HOME}/vendored_gem_src/remote_syslog_sender/ -ADD lib/syslog_protocol/ ${HOME}/vendored_gem_src/syslog_protocol/ -ADD install-gems.sh *.patch.sh *.patch ${HOME}/vendored_gem_src/ +COPY ${upstream_code}/vendored_gem_src/ ${HOME}/vendored_gem_src/ +COPY ${upstream_code}/lib/fluent-plugin-remote_syslog/ ${HOME}/vendored_gem_src/fluent-plugin-remote_syslog/ +COPY ${upstream_code}/lib/remote_syslog_sender/ ${HOME}/vendored_gem_src/remote_syslog_sender/ +COPY ${upstream_code}/lib/syslog_protocol/ ${HOME}/vendored_gem_src/syslog_protocol/ +COPY ${upstream_code}/install-gems.sh ${HOME}/vendored_gem_src/ +COPY ${upstream_code}/*.patch.sh ${HOME}/vendored_gem_src/ +COPY ${upstream_code}/*.patch ${HOME}/vendored_gem_src/ RUN cd ${HOME}/vendored_gem_src/ && ./install-gems.sh && cd / && rm -rf ${HOME}/vendored_gem_src/ -RUN yum remove -y $BUILD_PKGS +RUN BUILD_PKGS="make gcc-c++ libffi-devel \ + autoconf automake libtool m4 \ + redhat-rpm-config" && \ + yum remove -y $BUILD_PKGS RUN mkdir -p /etc/fluent/plugin -ADD out_syslog_buffered.rb out_syslog.rb out_rawtcp.rb /etc/fluent/plugin/ -ADD run.sh wait_for_es_version.rb wait_for_es_version.sh ${HOME}/ -ADD lib/filter_parse_json_field/lib/*.rb /etc/fluent/plugin/ -ADD lib/filter_elasticsearch_genid_ext/lib/filter_elasticsearch_genid_ext.rb /etc/fluent/plugin/ -ADD lib/parser_viaq_host_audit/lib/*.rb /etc/fluent/plugin/ -ADD lib/fluent-plugin-viaq_data_model/lib/fluent/plugin/*.rb /etc/fluent/plugin/ -COPY utils/ /usr/local/bin/ - -RUN mkdir -p /etc/fluent/configs.d/user && \ - chmod 777 /etc/fluent/configs.d/user && \ - ln -s /etc/fluent/configs.d/user/fluent.conf /etc/fluent/fluent.conf + +COPY ${upstream_code}/out_syslog_buffered.rb /etc/fluent/plugin/ +COPY ${upstream_code}/out_syslog.rb /etc/fluent/plugin/ +COPY ${upstream_code}/out_rawtcp.rb /etc/fluent/plugin/ + +COPY ${upstream_code}/run.sh ${HOME}/ +COPY ${upstream_code}/generate_syslog_config.rb ${HOME}/ +COPY ${upstream_code}/wait_for_es_version.rb ${HOME}/ +COPY ${upstream_code}/wait_for_es_version.sh ${HOME}/ + +COPY ${upstream_code}/lib/filter_parse_json_field/lib/*.rb /etc/fluent/plugin/ +COPY ${upstream_code}/lib/filter_elasticsearch_genid_ext/lib/filter_elasticsearch_genid_ext.rb /etc/fluent/plugin/ +COPY ${upstream_code}/lib/parser_viaq_host_audit/lib/*.rb /etc/fluent/plugin/ +COPY ${upstream_code}/lib/fluent-plugin-viaq_data_model/lib/fluent/plugin/*.rb /etc/fluent/plugin/ +COPY ${upstream_code}/utils/ /usr/local/bin/ + +RUN mkdir -p /etc/fluent/configs.d/user && \ + chmod 777 /etc/fluent/configs.d/user && \ + ln -s /etc/fluent/configs.d/user/fluent.conf /etc/fluent/fluent.conf WORKDIR ${HOME} CMD ["sh", "run.sh"] + diff --git a/fluentd/Dockerfile.in b/fluentd/Dockerfile.in new file mode 100644 index 000000000..0fc3082f6 --- /dev/null +++ b/fluentd/Dockerfile.in @@ -0,0 +1,125 @@ +## EXCLUDE BEGIN ## +#@follow_tag(ubi8:8-released) +FROM ubi8:8.2-347 AS builder + +ARG upstream_code +ENV upstream_code=upstream_code +ARG upstream_tarball=${upstream_code}.tar.gz + +COPY ${CI_ARCHIVE_ORIGIN_AGGREGATED_LOGGING} ${upstream_tarball} +RUN mkdir -p ${upstream_code} \ + && tar -xzf ${upstream_tarball} \ + --strip-components 1 \ + -C ${upstream_code} +## EXCLUDE END ## + +#@follow_tag(openshift-ose-base:ubi8.ruby.25) +FROM openshift-ose-base:v4.0-202009120105.6452 + +ENV BUILD_VERSION=${CI_CONTAINER_VERSION:-} +ENV OS_GIT_MAJOR=${CI_X_VERSION:-} +ENV OS_GIT_MINOR=${CI_Y_VERSION:-} +ENV OS_GIT_PATCH=${CI_Z_VERSION:-} +ENV SOURCE_GIT_COMMIT=${CI_ORIGIN_AGGREGATED_LOGGING_UPSTREAM_COMMIT:-} +ENV SOURCE_GIT_URL=${CI_ORIGIN_AGGREGATED_LOGGING_UPSTREAM_URL:-} + +LABEL \ + License="GPLv2+" \ + io.k8s.description="Fluentd container for collecting of container logs" \ + io.k8s.display-name="Fluentd" \ + io.openshift.tags="logging,elk,fluentd" \ + vendor="Red Hat" \ + name="openshift/ose-logging-fluentd" \ + com.redhat.component="logging-fluentd-container" \ + io.openshift.maintainer.product="OpenShift Container Platform" \ + io.openshift.build.commit.id=${CI_ORIGIN_AGGREGATED_LOGGING_UPSTREAM_COMMIT} \ + io.openshift.build.source-location=${CI_ORIGIN_AGGREGATED_LOGGING_UPSTREAM_URL} \ + io.openshift.build.commit.url=${CI_ORIGIN_AGGREGATED_LOGGING_UPSTREAM_URL}/commit/${CI_ORIGIN_AGGREGATED_LOGGING_UPSTREAM_URL} \ + version=${CI_CONTAINER_VERSION} + +MAINTAINER OpenShift Development + +ARG DATA_VERSION_VALUE=1.6.0 +ARG FLUENTD_VERSION_VALUE=1.7.4 +ARG HOME_VALUE=/opt/app-root/src +ARG PATH_VALUE=/opt/app-root/src/bin:/opt/app-root/bin +ARG LOGGING_FILE_PATH_VALUE=/var/log/fluentd/fluentd.log +ARG LOGGING_FILE_AGE_VALUE=10 +ARG LOGGING_FILE_SIZE_VALUE=1024000 +ARG CONTAINER_VALUE=oci + +ENV DATA_VERSION=$DATA_VERSION_VALUE \ + FLUENTD_VERSION=$FLUENTD_VERSION_VALUE \ + HOME=$HOME_VALUE \ + PATH=$PATH_VALUE:$PATH \ + LOGGING_FILE_PATH=$LOGGING_FILE_PATH_VALUE \ + LOGGING_FILE_AGE=$LOGGING_FILE_AGE_VALUE \ + LOGGING_FILE_SIZE=$LOGGING_FILE_SIZE_VALUE \ + container=$CONTAINER_VALUE + + +ARG TEST_REPO +#ADD test.repo /etc/yum.repos.d + +USER 0 +RUN : 'removed yum-config-manager' \ + && BUILD_PKGS="make gcc-c++ libffi-devel autoconf automake libtool m4 redhat-rpm-config" \ + && RUNTIME_PKGS="hostname bc iproute" \ + && yum install -y --setopt=tsflags=nodocs $BUILD_PKGS $RUNTIME_PKGS \ + && rpm -V $BUILD_PKGS \ + && rpm -V $RUNTIME_PKGS \ + && yum clean all + +# uncomment if you want to try out test rpm builds +#ADD *.rpm /tmp/ +#RUN yum -y install /tmp/*.rpm +## EXCLUDE BEGIN ## +ENV upstream_code=upstream_code/fluentd +## EXCLUDE END ## +ENV upstream_code=${upstream_code:-"."} +COPY --from=builder ${upstream_code}/jemalloc/ ${HOME}/jemalloc/ +RUN cd ${HOME}/jemalloc && EXTRA_CFLAGS="$( rpm --eval '%{optflags}' )" ./autogen.sh && \ + make install_lib_shared install_bin && cp COPYING ${HOME}/COPYING.jemalloc && \ + cd .. && rm -rf jemalloc + +COPY --from=builder ${upstream_code}/source.jemalloc /source.jemalloc +RUN bash -c '. /source.jemalloc; echo jemalloc $JEMALLOC_VER >> /contents' + +COPY --from=builder ${upstream_code}/vendored_gem_src/ ${HOME}/vendored_gem_src/ +COPY --from=builder ${upstream_code}/lib/fluent-plugin-remote_syslog/ ${HOME}/vendored_gem_src/fluent-plugin-remote_syslog/ +COPY --from=builder ${upstream_code}/lib/remote_syslog_sender/ ${HOME}/vendored_gem_src/remote_syslog_sender/ +COPY --from=builder ${upstream_code}/lib/syslog_protocol/ ${HOME}/vendored_gem_src/syslog_protocol/ +COPY --from=builder ${upstream_code}/install-gems.sh ${HOME}/vendored_gem_src/ +COPY --from=builder ${upstream_code}/*.patch.sh ${HOME}/vendored_gem_src/ +COPY --from=builder ${upstream_code}/*.patch ${HOME}/vendored_gem_src/ + +RUN cd ${HOME}/vendored_gem_src/ && ./install-gems.sh && cd / && rm -rf ${HOME}/vendored_gem_src/ + +RUN BUILD_PKGS="make gcc-c++ libffi-devel \ + autoconf automake libtool m4 \ + redhat-rpm-config" && \ + yum remove -y $BUILD_PKGS + +RUN mkdir -p /etc/fluent/plugin + +COPY --from=builder ${upstream_code}/out_syslog_buffered.rb /etc/fluent/plugin/ +COPY --from=builder ${upstream_code}/out_syslog.rb /etc/fluent/plugin/ +COPY --from=builder ${upstream_code}/out_rawtcp.rb /etc/fluent/plugin/ + +COPY --from=builder ${upstream_code}/run.sh ${HOME}/ +COPY --from=builder ${upstream_code}/generate_syslog_config.rb ${HOME}/ +COPY --from=builder ${upstream_code}/wait_for_es_version.rb ${HOME}/ +COPY --from=builder ${upstream_code}/wait_for_es_version.sh ${HOME}/ + +COPY --from=builder ${upstream_code}/lib/filter_parse_json_field/lib/*.rb /etc/fluent/plugin/ +COPY --from=builder ${upstream_code}/lib/filter_elasticsearch_genid_ext/lib/filter_elasticsearch_genid_ext.rb /etc/fluent/plugin/ +COPY --from=builder ${upstream_code}/lib/parser_viaq_host_audit/lib/*.rb /etc/fluent/plugin/ +COPY --from=builder ${upstream_code}/lib/fluent-plugin-viaq_data_model/lib/fluent/plugin/*.rb /etc/fluent/plugin/ +COPY --from=builder ${upstream_code}/utils/ /usr/local/bin/ + +RUN mkdir -p /etc/fluent/configs.d/user && \ + chmod 777 /etc/fluent/configs.d/user && \ + ln -s /etc/fluent/configs.d/user/fluent.conf /etc/fluent/fluent.conf + +WORKDIR ${HOME} +CMD ["sh", "run.sh"] diff --git a/fluentd/origin-meta.yaml b/fluentd/origin-meta.yaml new file mode 100644 index 000000000..67c792e8b --- /dev/null +++ b/fluentd/origin-meta.yaml @@ -0,0 +1,3 @@ +from: +- source: openshift-ose-base\:v(?:[\.0-9\-]*) + target: registry.ci.openshift.org/ocp/builder:ubi8.ruby.25 diff --git a/hack/generate-dockerfile-from-midstream b/hack/generate-dockerfile-from-midstream new file mode 100755 index 000000000..0cf229946 --- /dev/null +++ b/hack/generate-dockerfile-from-midstream @@ -0,0 +1,47 @@ +#!/usr/bin/env python + +import re,sys,yaml +import os.path + +dockerfileInFile = "Dockerfile.in" +dockerfileOut = "Dockerfile" +metaFile = "origin-meta.yaml" + +if len(sys.argv) > 1: + dockerfileInFile = sys.argv[1] +if len(sys.argv) > 2: + dockerfileOut = sys.argv[2] + +with open(dockerfileInFile, 'r') as f: + dockerfileIn = f.read() + +metaFile = os.path.join(os.path.dirname(dockerfileInFile), metaFile) +with open(metaFile, 'r') as f: + metaYaml = yaml.safe_load(f) + +froms = metaYaml['from'] +if froms and len(froms) > 0: + for base in froms: + dockerfileIn = re.sub("FROM " + base['source'],"FROM " + base['target'],dockerfileIn) + +#Remove aliases if only one is defined otherwise it will fail +aliases = [] +for l in dockerfileIn.split("\n"): + if l.startswith("FROM"): + index = l.rfind("AS") + if index > -1: + aliases.append(l[index + 3:]) +if len(aliases) == 1: + dockerfileIn = re.sub("--from=" + aliases[0],"",dockerfileIn) + +exclude = False +print("### This is a generated file from Dockerfile.in ###") +for l in dockerfileIn.split('\n'): + if l == "## EXCLUDE BEGIN ##": + exclude = True + continue + if l == "## EXCLUDE END ##": + exclude = False + continue + if not exclude: + print(l) diff --git a/hack/run-linter b/hack/run-linter index d488d7759..a1e70fc28 100755 --- a/hack/run-linter +++ b/hack/run-linter @@ -1,3 +1,13 @@ #!/usr/bin/sh set -euo pipefail + +# check dockerfile changes +for d in "curator" "elasticsearch" "fluentd" "kibana" ; do + change=$(./hack/generate-dockerfile-from-midstream $d/Dockerfile.in | md5sum | cut -d ' ' -f1) + if [ "$change" != "$(md5sum $d/Dockerfile | cut -d ' ' -f1)" ] ; then + echo "A change was found in CI file $d/Dockerfile that was not sourced from the midstream file $d/Dockerfile.in (or vice versa)." + echo "Please reset the CI file (e.g. Dockerfile), update Dockerfile.in, run make gen-dockerfiles and commit the results" + exit 1 + fi +done diff --git a/kibana/Dockerfile b/kibana/Dockerfile deleted file mode 120000 index 9186ee0ce..000000000 --- a/kibana/Dockerfile +++ /dev/null @@ -1 +0,0 @@ -Dockerfile.rhel8 \ No newline at end of file diff --git a/kibana/Dockerfile b/kibana/Dockerfile new file mode 100644 index 000000000..7d09f30e4 --- /dev/null +++ b/kibana/Dockerfile @@ -0,0 +1,60 @@ +### This is a generated file from Dockerfile.in ### + +#@follow_tag(openshift-ose-base:ubi8.nodejs.10) +FROM registry.ci.openshift.org/ocp/builder:ubi8.nodejs.10 + +ENV BUILD_VERSION=${CI_CONTAINER_VERSION:-} +ENV OS_GIT_MAJOR=${CI_X_VERSION:-} +ENV OS_GIT_MINOR=${CI_Y_VERSION:-} +ENV OS_GIT_PATCH=${CI_Z_VERSION:-} +ENV SOURCE_GIT_COMMIT=${CI_ORIGIN_AGGREGATED_LOGGING_UPSTREAM_COMMIT:-} +ENV SOURCE_GIT_URL=${CI_ORIGIN_AGGREGATED_LOGGING_UPSTREAM_URL:-} + +MAINTAINER OpenShift Development + +EXPOSE 5601 + +ENV ELASTICSEARCH_URL=https://elasticsearch.openshift-logging.svc.cluster.local:9200 \ + HOME=/opt/app-root/src \ + KIBANA_CONF_DIR=${HOME}/config \ + KIBANA_VERSION=6.8.1 \ + NODE_ENV=production \ + RELEASE_STREAM=prod \ + container=oci \ + NODE_ENV=production \ + NODE_PATH=/usr/bin + +LABEL \ + License="GPLv2+" \ + io.k8s.description="Kibana container for querying Elasticsearch for aggregated logs" \ + io.k8s.display-name="Kibana" \ + io.openshift.tags="logging,elk,kibana" \ + vendor="Red Hat" \ + name="openshift/ose-logging-kibana6" \ + com.redhat.component="logging-kibana6-container" \ + io.openshift.maintainer.product="OpenShift Container Platform" \ + io.openshift.build.commit.id=${CI_ORIGIN_AGGREGATED_LOGGING_UPSTREAM_COMMIT} \ + io.openshift.build.source-location=${CI_ORIGIN_AGGREGATED_LOGGING_UPSTREAM_URL} \ + io.openshift.build.commit.url=${CI_ORIGIN_AGGREGATED_LOGGING_UPSTREAM_URL}/commit/${CI_ORIGIN_AGGREGATED_LOGGING_UPSTREAM_COMMIT} \ + version=${CI_CONTAINER_VERSION} +ARG LOCAL_REPO + +USER 0 + +ENV upstream_code=${upstream_code:-"."} +COPY ${upstream_code}/vendored_tar_src/kibana-oss-6.8.1 ${HOME}/ +COPY ${upstream_code}/vendored_tar_src/opendistro_security_kibana_plugin-0.10.0.4/ ${HOME}/plugins/opendistro_security_kibana_plugin-0.10.0.4/ + +RUN chmod -R og+w ${HOME}/ +COPY ${upstream_code}/probe/ /usr/share/kibana/probe/ +COPY ${upstream_code}/kibana.yml ${KIBANA_CONF_DIR}/ +COPY ${upstream_code}/run.sh ${HOME}/ +COPY ${upstream_code}/utils ${HOME}/ +RUN sed -i -e 's/"node":.*/"node": "'$(${NODE_PATH}/node --version | sed 's/v//')'"/' package.json && \ + mkdir -p node && \ + ln -s ${NODE_PATH} node/bin +RUN bin/kibana --optimize + +WORKDIR ${HOME} +CMD ["./run.sh"] + diff --git a/kibana/Dockerfile.in b/kibana/Dockerfile.in new file mode 100644 index 000000000..6f304406e --- /dev/null +++ b/kibana/Dockerfile.in @@ -0,0 +1,76 @@ +## EXCLUDE BEGIN ## +## extract the tarball +#@follow_tag(ubi8:8-released) +FROM ubi8:8.2-347 AS builder + +ARG upstream_code +ENV upstream_code=upstream_code +ARG upstream_tarball=${upstream_code}.tar.gz + +COPY ${CI_ARCHIVE_ORIGIN_AGGREGATED_LOGGING} ${upstream_tarball} +RUN mkdir -p ${upstream_code} \ + && tar -xzf ${upstream_tarball} \ + --strip-components 1 \ + -C ${upstream_code} +## EXCLUDE END ## + +#@follow_tag(openshift-ose-base:ubi8.nodejs.10) +FROM openshift-ose-base:v4.0-202009120056.16421 + +ENV BUILD_VERSION=${CI_CONTAINER_VERSION:-} +ENV OS_GIT_MAJOR=${CI_X_VERSION:-} +ENV OS_GIT_MINOR=${CI_Y_VERSION:-} +ENV OS_GIT_PATCH=${CI_Z_VERSION:-} +ENV SOURCE_GIT_COMMIT=${CI_ORIGIN_AGGREGATED_LOGGING_UPSTREAM_COMMIT:-} +ENV SOURCE_GIT_URL=${CI_ORIGIN_AGGREGATED_LOGGING_UPSTREAM_URL:-} + +MAINTAINER OpenShift Development + +EXPOSE 5601 + +ENV ELASTICSEARCH_URL=https://elasticsearch.openshift-logging.svc.cluster.local:9200 \ + HOME=/opt/app-root/src \ + KIBANA_CONF_DIR=${HOME}/config \ + KIBANA_VERSION=6.8.1 \ + NODE_ENV=production \ + RELEASE_STREAM=prod \ + container=oci \ + NODE_ENV=production \ + NODE_PATH=/usr/bin + +LABEL \ + License="GPLv2+" \ + io.k8s.description="Kibana container for querying Elasticsearch for aggregated logs" \ + io.k8s.display-name="Kibana" \ + io.openshift.tags="logging,elk,kibana" \ + vendor="Red Hat" \ + name="openshift/ose-logging-kibana6" \ + com.redhat.component="logging-kibana6-container" \ + io.openshift.maintainer.product="OpenShift Container Platform" \ + io.openshift.build.commit.id=${CI_ORIGIN_AGGREGATED_LOGGING_UPSTREAM_COMMIT} \ + io.openshift.build.source-location=${CI_ORIGIN_AGGREGATED_LOGGING_UPSTREAM_URL} \ + io.openshift.build.commit.url=${CI_ORIGIN_AGGREGATED_LOGGING_UPSTREAM_URL}/commit/${CI_ORIGIN_AGGREGATED_LOGGING_UPSTREAM_COMMIT} \ + version=${CI_CONTAINER_VERSION} +ARG LOCAL_REPO + +USER 0 + +## EXCLUDE BEGIN ## +ENV upstream_code=upstream_code/kibana +## EXCLUDE END ## +ENV upstream_code=${upstream_code:-"."} +COPY --from=builder ${upstream_code}/vendored_tar_src/kibana-oss-6.8.1 ${HOME}/ +COPY --from=builder ${upstream_code}/vendored_tar_src/opendistro_security_kibana_plugin-0.10.0.4/ ${HOME}/plugins/opendistro_security_kibana_plugin-0.10.0.4/ + +RUN chmod -R og+w ${HOME}/ +COPY --from=builder ${upstream_code}/probe/ /usr/share/kibana/probe/ +COPY --from=builder ${upstream_code}/kibana.yml ${KIBANA_CONF_DIR}/ +COPY --from=builder ${upstream_code}/run.sh ${HOME}/ +COPY --from=builder ${upstream_code}/utils ${HOME}/ +RUN sed -i -e 's/"node":.*/"node": "'$(${NODE_PATH}/node --version | sed 's/v//')'"/' package.json && \ + mkdir -p node && \ + ln -s ${NODE_PATH} node/bin +RUN bin/kibana --optimize + +WORKDIR ${HOME} +CMD ["./run.sh"] diff --git a/kibana/Dockerfile.rhel8 b/kibana/Dockerfile.rhel8 deleted file mode 100644 index ad6cfbc94..000000000 --- a/kibana/Dockerfile.rhel8 +++ /dev/null @@ -1,35 +0,0 @@ -FROM registry.ci.openshift.org/ocp/builder:ubi8.nodejs.10 AS build - -MAINTAINER OpenShift Development - -EXPOSE 5601 - -ENV ELASTICSEARCH_URL=https://elasticsearch.openshift-logging.svc.cluster.local:9200 \ - HOME=/opt/app-root/src \ - KIBANA_CONF_DIR=${HOME}/config \ - KIBANA_VERSION=6.8.1 \ - NODE_ENV=production \ - RELEASE_STREAM=prod \ - container=oci \ - NODE_ENV=production \ - NODE_PATH=/usr/bin - -ARG LOCAL_REPO - -USER 0 - -COPY vendored_tar_src/kibana-oss-6.8.1 ${HOME}/ -COPY vendored_tar_src/opendistro_security_kibana_plugin-0.10.0.4/ ${HOME}/plugins/opendistro_security_kibana_plugin-0.10.0.4/ -COPY lib/openshift_logging_plugin/ ${HOME}/plugins/openshift_logging_plugin/ - -RUN chmod -R og+w ${HOME}/ -ADD probe/ /usr/share/kibana/probe/ -ADD kibana.yml ${KIBANA_CONF_DIR}/ -ADD run.sh module_list.sh utils ${HOME}/ -RUN sed -i -e 's/"node":.*/"node": "'$(${NODE_PATH}/node --version | sed 's/v//')'"/' package.json && \ - mkdir -p node && \ - ln -s ${NODE_PATH} node/bin -RUN bin/kibana --optimize - -WORKDIR ${HOME} -CMD ["./run.sh"] diff --git a/kibana/Dockerfile.rhel8 b/kibana/Dockerfile.rhel8 new file mode 120000 index 000000000..1d1fe94df --- /dev/null +++ b/kibana/Dockerfile.rhel8 @@ -0,0 +1 @@ +Dockerfile \ No newline at end of file diff --git a/kibana/origin-meta.yaml b/kibana/origin-meta.yaml new file mode 100644 index 000000000..fc7c991e8 --- /dev/null +++ b/kibana/origin-meta.yaml @@ -0,0 +1,3 @@ +from: +- source: openshift-ose-base\:v(?:[\.0-9\-]*) + target: registry.ci.openshift.org/ocp/builder:ubi8.nodejs.10