Skip to content

Commit 91524e2

Browse files
committed
LOG-1281: Add linting and Dockerfile generation from midstream Dockerfile.in
1 parent 840fe74 commit 91524e2

18 files changed

+741
-151
lines changed

Makefile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,3 +56,9 @@ deploy-all-images: deploy-fluentd-image deploy-kibana-image deploy-elasticsearch
5656
lint:
5757
@hack/run-linter
5858
.PHONY: lint
59+
60+
gen-dockerfiles:
61+
@for d in "curator" "elasticsearch" "fluentd" "kibana"; do \
62+
./hack/generate-dockerfile-from-midstream "$$d/Dockerfile.in" > "$$d/Dockerfile" ; \
63+
done
64+
.PHONY: gen-dockerfiles

curator/Dockerfile

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,29 @@
1+
### This is a generated file from Dockerfile.in ###
2+
3+
#@follow_tag(openshift-ose-base:ubi8.python.36)
14
FROM registry.ci.openshift.org/ocp/builder:ubi8.python.36
25

6+
ENV BUILD_VERSION=${CI_CONTAINER_VERSION:-}
7+
ENV OS_GIT_MAJOR=${CI_X_VERSION:-}
8+
ENV OS_GIT_MINOR=${CI_Y_VERSION:-}
9+
ENV OS_GIT_PATCH=${CI_Z_VERSION:-}
10+
ENV SOURCE_GIT_COMMIT=${CI_ORIGIN_AGGREGATED_LOGGING_UPSTREAM_COMMIT:-}
11+
ENV SOURCE_GIT_URL=${CI_ORIGIN_AGGREGATED_LOGGING_UPSTREAM_URL:-}
12+
13+
LABEL \
14+
License="GPLv2+" \
15+
io.k8s.description="Curator elasticsearch container for elasticsearch deletion/archival" \
16+
io.k8s.display-name="Curator 5" \
17+
io.openshift.tags="logging,elk,elasticsearch,curator" \
18+
vendor="Red Hat" \
19+
name="openshift/ose-logging-curator5" \
20+
com.redhat.component="logging-curator5-container" \
21+
io.openshift.maintainer.product="OpenShift Container Platform" \
22+
io.openshift.build.commit.id=${CI_ORIGIN_AGGREGATED_LOGGING_UPSTREAM_COMMIT} \
23+
io.openshift.build.source-location=${CI_ORIGIN_AGGREGATED_LOGGING_UPSTREAM_URL} \
24+
io.openshift.build.commit.url=${CI_ORIGIN_AGGREGATED_LOGGING_UPSTREAM_URL}/commit/${CI_ORIGIN_AGGREGATED_LOGGING_UPSTREAM_URL} \
25+
version=${CI_CONTAINER_VERSION}
26+
327
MAINTAINER OpenShift Development <[email protected]>
428

529
ENV HOME=/opt/app-root/src \
@@ -17,9 +41,10 @@ ENV HOME=/opt/app-root/src \
1741
CURATOR_VER=5.8.1 \
1842
container=oci \
1943
LC_ALL=en_US.UTF-8
44+
ENV upstream_code=${upstream_code:-"."}
2045

2146
USER 0
22-
COPY . ${HOME}
47+
COPY ${upstream_code}/ ${HOME}
2348

2449
RUN mkdir -p $(dirname "$CURATOR_CONF_LOCATION") && \
2550
touch ${CURATOR_CONF_LOCATION} && \

curator/Dockerfile.in

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
## EXCLUDE BEGIN ##
2+
#@follow_tag(ubi8:8-released)
3+
FROM ubi8:8.2-347 AS builder
4+
5+
ARG upstream_code
6+
ENV upstream_code=upstream_code
7+
ARG upstream_tarball=${upstream_code}.tar.gz
8+
9+
COPY ${CI_ARCHIVE_ORIGIN_AGGREGATED_LOGGING} ${upstream_tarball}
10+
RUN mkdir -p ${upstream_code} \
11+
&& tar -xzf ${upstream_tarball} \
12+
--strip-components 1 \
13+
-C ${upstream_code}
14+
## EXCLUDE END ##
15+
16+
#@follow_tag(openshift-ose-base:ubi8.python.36)
17+
FROM openshift-ose-base:v4.0-202009120102.31989
18+
19+
ENV BUILD_VERSION=${CI_CONTAINER_VERSION:-}
20+
ENV OS_GIT_MAJOR=${CI_X_VERSION:-}
21+
ENV OS_GIT_MINOR=${CI_Y_VERSION:-}
22+
ENV OS_GIT_PATCH=${CI_Z_VERSION:-}
23+
ENV SOURCE_GIT_COMMIT=${CI_ORIGIN_AGGREGATED_LOGGING_UPSTREAM_COMMIT:-}
24+
ENV SOURCE_GIT_URL=${CI_ORIGIN_AGGREGATED_LOGGING_UPSTREAM_URL:-}
25+
26+
LABEL \
27+
License="GPLv2+" \
28+
io.k8s.description="Curator elasticsearch container for elasticsearch deletion/archival" \
29+
io.k8s.display-name="Curator 5" \
30+
io.openshift.tags="logging,elk,elasticsearch,curator" \
31+
vendor="Red Hat" \
32+
name="openshift/ose-logging-curator5" \
33+
com.redhat.component="logging-curator5-container" \
34+
io.openshift.maintainer.product="OpenShift Container Platform" \
35+
io.openshift.build.commit.id=${CI_ORIGIN_AGGREGATED_LOGGING_UPSTREAM_COMMIT} \
36+
io.openshift.build.source-location=${CI_ORIGIN_AGGREGATED_LOGGING_UPSTREAM_URL} \
37+
io.openshift.build.commit.url=${CI_ORIGIN_AGGREGATED_LOGGING_UPSTREAM_URL}/commit/${CI_ORIGIN_AGGREGATED_LOGGING_UPSTREAM_URL} \
38+
version=${CI_CONTAINER_VERSION}
39+
40+
MAINTAINER OpenShift Development <[email protected]>
41+
42+
ENV HOME=/opt/app-root/src \
43+
ES_HOST=localhost \
44+
ES_PORT=9200 \
45+
ES_CA=/etc/curator/keys/ca \
46+
ES_CLIENT_CERT=/etc/curator/keys/cert \
47+
ES_CLIENT_KEY=/etc/curator/keys/key \
48+
CURATOR_CONF_LOCATION=/etc/curator/settings/config.yaml \
49+
CURATOR_CONF_FILE=/etc/curator/settings/curator5.yaml \
50+
CURATOR_ACTIONS_FILE=/etc/curator/settings/actions.yaml \
51+
CURATOR_LOG_LEVEL=ERROR \
52+
CURATOR_SCRIPT_LOG_LEVEL=INFO \
53+
CURATOR_TIMEOUT=300 \
54+
CURATOR_VER=5.8.1 \
55+
container=oci \
56+
LC_ALL=en_US.UTF-8
57+
ENV upstream_code=${upstream_code:-"."}
58+
59+
USER 0
60+
COPY --from=builder ${upstream_code}/ ${HOME}
61+
62+
RUN mkdir -p $(dirname "$CURATOR_CONF_LOCATION") && \
63+
touch ${CURATOR_CONF_LOCATION} && \
64+
chmod -R u+x ${HOME} && \
65+
chgrp -R 0 ${HOME} && \
66+
chmod -R g=u ${HOME}
67+
68+
WORKDIR ${HOME}/vendor
69+
RUN pip install $(ls . | grep -v curator) -q --no-index --find-links . && \
70+
pip install elasticsearch-curator* --no-index -q && \
71+
rm -rf $HOME/vendor
72+
73+
WORKDIR ${HOME}
74+
USER 1001
75+
CMD ["sh", "run.sh"]

curator/origin-meta.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
from:
2+
- source: openshift-ose-base\:v(?:[\.0-9\-]*)
3+
target: registry.ci.openshift.org/ocp/builder:ubi8.python.36

elasticsearch/Dockerfile

Lines changed: 0 additions & 1 deletion
This file was deleted.

elasticsearch/Dockerfile

Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
### This is a generated file from Dockerfile.in ###
2+
3+
#@follow_tag(openshift-ose-base:ubi8)
4+
FROM registry.ci.openshift.org/ocp/builder:rhel-8-base-openshift-4.7
5+
6+
ENV BUILD_VERSION=${CI_CONTAINER_VERSION:-}
7+
ENV OS_GIT_MAJOR=${CI_X_VERSION:-}
8+
ENV OS_GIT_MINOR=${CI_Y_VERSION:-}
9+
ENV SOURCE_GIT_COMMIT=${CI_ORIGIN_AGGREGATED_LOGGING_UPSTREAM_COMMIT:-}
10+
ENV SOURCE_GIT_URL=${CI_ORIGIN_AGGREGATED_LOGGING_UPSTREAM_URL:-}
11+
12+
LABEL \
13+
License="GPLv2+" \
14+
io.k8s.description="Elasticsearch container for EFK aggregated logging storage" \
15+
io.k8s.display-name="Elasticsearch 6" \
16+
io.openshift.tags="logging,elk,elasticsearch" \
17+
vendor="Red Hat" \
18+
name="openshift-logging/elasticsearch6-rhel8" \
19+
com.redhat.component="logging-elasticsearch6-container" \
20+
io.openshift.maintainer.product="OpenShift Container Platform" \
21+
io.openshift.build.commit.id=${CI_ORIGIN_AGGREGATED_LOGGING_UPSTREAM_COMMIT} \
22+
io.openshift.build.source-location=${CI_ORIGIN_AGGREGATED_LOGGING_UPSTREAM_URL} \
23+
io.openshift.build.commit.url=${CI_ORIGIN_AGGREGATED_LOGGING_UPSTREAM_URL}/commit/${CI_ORIGIN_AGGREGATED_LOGGING_UPSTREAM_COMMIT} \
24+
version=${CI_CONTAINER_VERSION}
25+
26+
MAINTAINER OpenShift Development <[email protected]>
27+
28+
EXPOSE 9200
29+
EXPOSE 9300
30+
USER 0
31+
32+
ARG ES_ARCHIVE_URL
33+
ARG PROMETHEUS_EXPORTER_URL
34+
ARG OPENDISTRO_URL
35+
ARG OPENSHIFT_CI
36+
37+
38+
ENV ES_PATH_CONF=/etc/elasticsearch/ \
39+
ES_HOME=/usr/share/elasticsearch \
40+
ES_VER=6.8.1.redhat-00006 \
41+
HOME=/opt/app-root/src \
42+
INSTANCE_RAM=512G \
43+
JAVA_VER=11 \
44+
JAVA_HOME=/usr/lib/jvm/jre \
45+
NODE_QUORUM=1 \
46+
PROMETHEUS_EXPORTER_VER=6.8.1.0-redhat-00001 \
47+
OPENDISTRO_VER=0.10.0.4-redhat-00001 \
48+
PLUGIN_LOGLEVEL=INFO \
49+
RECOVER_AFTER_NODES=1 \
50+
RECOVER_EXPECTED_NODES=1 \
51+
RECOVER_AFTER_TIME=5m \
52+
DHE_TMP_KEY_SIZE=2048 \
53+
RELEASE_STREAM=prod \
54+
OPENSHIFT_CI=${OPENSHIFT_CI:-false}
55+
56+
57+
# COPY $REMOTE_SOURCE $REMOTE_SOURCE_DIR
58+
# WORKDIR $REMOTE_SOURCE_DIR/app/elasticsearch
59+
60+
RUN packages="java-${JAVA_VER}-openjdk-headless \
61+
python36 \
62+
python3-pyyaml \
63+
hostname \
64+
openssl \
65+
zip \
66+
unzip" && \
67+
yum install -y ${packages} && \
68+
rpm -V ${packages} && \
69+
alternatives --set python /usr/bin/python3 && \
70+
yum clean all
71+
72+
ARG MAVEN_REPO_URL=${MAVEN_REPO_URL:-file:///artifacts/}
73+
ENV upstream_code=${upstream_code:-"."}
74+
75+
COPY ${upstream_code}/extra-jvm.options /var/tmp
76+
COPY ${upstream_code}/ci-env.sh /var/tmp
77+
COPY ${upstream_code}/install-es.sh /var/tmp
78+
COPY artifacts /artifacts
79+
RUN /var/tmp/install-es.sh
80+
81+
COPY ${upstream_code}/sgconfig/ ${HOME}/sgconfig/
82+
COPY ${upstream_code}/index_templates/ ${ES_HOME}/index_templates/
83+
COPY ${upstream_code}/index_patterns/ ${ES_HOME}/index_patterns/
84+
COPY ${upstream_code}/init/ ${ES_HOME}/init/
85+
COPY ${upstream_code}/probe/ ${ES_HOME}/probe/
86+
COPY ${upstream_code}/init.sh ${HOME}/
87+
COPY ${upstream_code}/run.sh ${HOME}/
88+
COPY ${upstream_code}/ci-env.sh ${HOME}/
89+
COPY ${upstream_code}/install.sh ${HOME}/
90+
COPY ${upstream_code}/utils/** /usr/local/bin/
91+
92+
RUN ${HOME}/install.sh && rm -rf /artifacts && \
93+
mv ${ES_HOME}/lib/elasticsearch-${ES_VER}.jar ${ES_HOME}/lib/elasticsearch-$(echo $ES_VER | cut -d'.' -f1-3).jar
94+
95+
WORKDIR ${HOME}
96+
USER 1000
97+
CMD ["sh", "/opt/app-root/src/run.sh"]
98+
99+

elasticsearch/Dockerfile.in

Lines changed: 114 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,114 @@
1+
## EXCLUDE BEGIN ##
2+
#@follow_tag(openshift-ose-base:ubi8)
3+
FROM openshift-ose-base:v4.0-202104100031.20055 AS builder
4+
5+
ARG upstream_code
6+
ENV upstream_code=upstream_code
7+
ARG upstream_tarball=${upstream_code}.tar.gz
8+
9+
COPY ${CI_ARCHIVE_ORIGIN_AGGREGATED_LOGGING} ${upstream_tarball}
10+
RUN mkdir -p ${upstream_code} \
11+
&& tar -xzf ${upstream_tarball} \
12+
--strip-components 1 \
13+
-C ${upstream_code}
14+
## EXCLUDE END ##
15+
16+
#@follow_tag(openshift-ose-base:ubi8)
17+
FROM openshift-ose-base:v4.0-202104100031.20055
18+
19+
ENV BUILD_VERSION=${CI_CONTAINER_VERSION:-}
20+
ENV OS_GIT_MAJOR=${CI_X_VERSION:-}
21+
ENV OS_GIT_MINOR=${CI_Y_VERSION:-}
22+
ENV SOURCE_GIT_COMMIT=${CI_ORIGIN_AGGREGATED_LOGGING_UPSTREAM_COMMIT:-}
23+
ENV SOURCE_GIT_URL=${CI_ORIGIN_AGGREGATED_LOGGING_UPSTREAM_URL:-}
24+
25+
LABEL \
26+
License="GPLv2+" \
27+
io.k8s.description="Elasticsearch container for EFK aggregated logging storage" \
28+
io.k8s.display-name="Elasticsearch 6" \
29+
io.openshift.tags="logging,elk,elasticsearch" \
30+
vendor="Red Hat" \
31+
name="openshift-logging/elasticsearch6-rhel8" \
32+
com.redhat.component="logging-elasticsearch6-container" \
33+
io.openshift.maintainer.product="OpenShift Container Platform" \
34+
io.openshift.build.commit.id=${CI_ORIGIN_AGGREGATED_LOGGING_UPSTREAM_COMMIT} \
35+
io.openshift.build.source-location=${CI_ORIGIN_AGGREGATED_LOGGING_UPSTREAM_URL} \
36+
io.openshift.build.commit.url=${CI_ORIGIN_AGGREGATED_LOGGING_UPSTREAM_URL}/commit/${CI_ORIGIN_AGGREGATED_LOGGING_UPSTREAM_COMMIT} \
37+
version=${CI_CONTAINER_VERSION}
38+
39+
MAINTAINER OpenShift Development <[email protected]>
40+
41+
EXPOSE 9200
42+
EXPOSE 9300
43+
USER 0
44+
45+
ARG ES_ARCHIVE_URL
46+
ARG PROMETHEUS_EXPORTER_URL
47+
ARG OPENDISTRO_URL
48+
ARG OPENSHIFT_CI
49+
50+
51+
ENV ES_PATH_CONF=/etc/elasticsearch/ \
52+
ES_HOME=/usr/share/elasticsearch \
53+
ES_VER=6.8.1.redhat-00006 \
54+
HOME=/opt/app-root/src \
55+
INSTANCE_RAM=512G \
56+
JAVA_VER=11 \
57+
JAVA_HOME=/usr/lib/jvm/jre \
58+
NODE_QUORUM=1 \
59+
PROMETHEUS_EXPORTER_VER=6.8.1.0-redhat-00001 \
60+
OPENDISTRO_VER=0.10.0.4-redhat-00001 \
61+
PLUGIN_LOGLEVEL=INFO \
62+
RECOVER_AFTER_NODES=1 \
63+
RECOVER_EXPECTED_NODES=1 \
64+
RECOVER_AFTER_TIME=5m \
65+
DHE_TMP_KEY_SIZE=2048 \
66+
RELEASE_STREAM=prod \
67+
OPENSHIFT_CI=${OPENSHIFT_CI:-false}
68+
69+
70+
# COPY $REMOTE_SOURCE $REMOTE_SOURCE_DIR
71+
# WORKDIR $REMOTE_SOURCE_DIR/app/elasticsearch
72+
73+
RUN packages="java-${JAVA_VER}-openjdk-headless \
74+
python36 \
75+
python3-pyyaml \
76+
hostname \
77+
openssl \
78+
zip \
79+
unzip" && \
80+
yum install -y ${packages} && \
81+
rpm -V ${packages} && \
82+
alternatives --set python /usr/bin/python3 && \
83+
yum clean all
84+
85+
ARG MAVEN_REPO_URL=${MAVEN_REPO_URL:-file:///artifacts/}
86+
## EXCLUDE BEGIN ##
87+
ENV upstream_code=upstream_code/elasticsearch
88+
## EXCLUDE END ##
89+
ENV upstream_code=${upstream_code:-"."}
90+
91+
COPY --from=builder ${upstream_code}/extra-jvm.options /var/tmp
92+
COPY --from=builder ${upstream_code}/ci-env.sh /var/tmp
93+
COPY --from=builder ${upstream_code}/install-es.sh /var/tmp
94+
COPY artifacts /artifacts
95+
RUN /var/tmp/install-es.sh
96+
97+
COPY --from=builder ${upstream_code}/sgconfig/ ${HOME}/sgconfig/
98+
COPY --from=builder ${upstream_code}/index_templates/ ${ES_HOME}/index_templates/
99+
COPY --from=builder ${upstream_code}/index_patterns/ ${ES_HOME}/index_patterns/
100+
COPY --from=builder ${upstream_code}/init/ ${ES_HOME}/init/
101+
COPY --from=builder ${upstream_code}/probe/ ${ES_HOME}/probe/
102+
COPY --from=builder ${upstream_code}/init.sh ${HOME}/
103+
COPY --from=builder ${upstream_code}/run.sh ${HOME}/
104+
COPY --from=builder ${upstream_code}/ci-env.sh ${HOME}/
105+
COPY --from=builder ${upstream_code}/install.sh ${HOME}/
106+
COPY --from=builder ${upstream_code}/utils/** /usr/local/bin/
107+
108+
RUN ${HOME}/install.sh && rm -rf /artifacts && \
109+
mv ${ES_HOME}/lib/elasticsearch-${ES_VER}.jar ${ES_HOME}/lib/elasticsearch-$(echo $ES_VER | cut -d'.' -f1-3).jar
110+
111+
WORKDIR ${HOME}
112+
USER 1000
113+
CMD ["sh", "/opt/app-root/src/run.sh"]
114+

elasticsearch/Dockerfile.origin

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
Dockerfile.rhel8
1+
Dockerfile

0 commit comments

Comments
 (0)