Skip to content

Commit 23e0819

Browse files
committed
opensearch: move to yum/apt repos
systemd-tmpfiles is needed otherwise opensearch postinst on Debian/Ubuntu fails Change-Id: I5aeb5796f8de7697a1c4a7404fe292ef9eb522ee (cherry picked from commit 6bd7898) (cherry picked from commit aab455c)
1 parent d49cca5 commit 23e0819

File tree

5 files changed

+124
-55
lines changed

5 files changed

+124
-55
lines changed

docker/base/Dockerfile.j2

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ Repo files not available for CentOS Stream 9:
6464
'grafana.repo',
6565
'influxdb.repo',
6666
'mariadb.repo',
67+
'opensearch.repo',
6768
'proxysql.repo',
6869
'rabbitmq_rabbitmq-server.repo',
6970
'td.repo',
@@ -192,6 +193,8 @@ RUN rm -f /etc/rpm/macros.image-language-conf \
192193
'centos-opstools',
193194
'centos-rabbitmq-38',
194195
'epel',
196+
'opensearch-2.x',
197+
'opensearch-dashboards-2.x',
195198
'influxdb',
196199
] %}
197200

@@ -240,6 +243,7 @@ RUN {{ macros.install_packages(base_centos_yum_repo_packages | customizable("cen
240243
{# NOTE(hrw): CentOS Stream 9 has curl-minimal, Rocky Linux 9 has curl so we do not install any #}
241244
{% set base_centos_packages = [
242245
'ca-certificates',
246+
'crypto-policies-scripts',
243247
'dumb-init',
244248
'findutils',
245249
'hostname',
@@ -355,6 +359,7 @@ COPY apt_preferences /etc/apt/preferences.d/kolla-custom
355359
{'name': 'grafana', 'url': 'https://packages.grafana.com/gpg.key'},
356360
{'name': 'influxdb', 'url': 'https://repos.influxdata.com/influxdata-archive_compat.key'},
357361
{'name': 'mariadb', 'url': 'https://downloads.mariadb.com/MariaDB/mariadb-keyring-2019.gpg', 'type': 'gpg'},
362+
{'name': 'opensearch', 'url': 'https://artifacts.opensearch.org/publickeys/opensearch.pgp'},
358363
{'name': 'proxysql', 'url': 'https://repo.proxysql.com/ProxySQL/repo_pub_key'},
359364
{'name': 'treasuredata', 'url': 'https://packages.treasuredata.com/GPG-KEY-td-agent'},
360365
] %}

docker/base/opensearch.repo

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
[opensearch-2.x]
2+
name=OpenSearch 2.x
3+
baseurl=https://artifacts.opensearch.org/releases/bundle/opensearch/2.x/yum
4+
enabled=0
5+
repo_gpgcheck=1
6+
gpgcheck=1
7+
gpgkey=https://artifacts.opensearch.org/publickeys/opensearch.pgp
8+
autorefresh=1
9+
type=rpm-md
10+
11+
[opensearch-dashboards-2.x]
12+
name=OpenSearch Dashboards 2.x
13+
baseurl=https://artifacts.opensearch.org/releases/bundle/opensearch-dashboards/2.x/yum
14+
enabled=0
15+
repo_gpgcheck=1
16+
gpgcheck=1
17+
gpgkey=https://artifacts.opensearch.org/publickeys/opensearch.pgp
18+
autorefresh=1
19+
type=rpm-md

docker/opensearch/opensearch-dashboards/Dockerfile.j2

Lines changed: 12 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -8,25 +8,21 @@ LABEL maintainer="{{ maintainer }}" name="{{ image_name }}" build-date="{{ build
88
{% import "macros.j2" as macros with context %}
99

1010
{{ macros.configure_user(name='opensearch', shell='/bin/bash', homedir='/usr/share/opensearch') }}
11+
{{ macros.enable_extra_repos(['opensearch-dashboards']) }}
1112

12-
{% block opensearch_version %}
13+
{% set opensearch_dashboards_packages = ['opensearch-dashboards'] %}
1314

14-
{% if base_arch == 'x86_64' %}
15-
{% set arch_os='x64' %}
16-
{% elif base_arch == 'aarch64' %}
17-
{% set arch_os='arm64' %}
18-
{% endif %}
15+
{% if base_distro_tag.startswith('stream9') or base_distro == 'rocky' %}
16+
{# TODO: OpenSearch will move from SHA1 in 2.8 release, remove this once 2.8 is out #}
17+
RUN update-crypto-policies --set DEFAULT:SHA1
18+
{% endif %}
1919

20-
ARG opensearch_version=2.3.0
21-
ARG opensearch_dashboards_url=https://artifacts.opensearch.org/releases/bundle/opensearch-dashboards/${opensearch_version}/opensearch-dashboards-${opensearch_version}-linux-{{ arch_os }}.tar.gz
22-
{% endblock %}
23-
24-
ARG OPENSEARCH_DASHBOARDS_HOME=/usr/share/opensearch-dashboards
25-
26-
RUN mkdir -p $OPENSEARCH_DASHBOARDS_HOME && \
27-
curl -o /tmp/opensearch-dashboards.tgz ${opensearch_dashboards_url} && \
28-
tar -xzpf /tmp/opensearch-dashboards.tgz -C $OPENSEARCH_DASHBOARDS_HOME --strip-components=1 && \
29-
rm /tmp/opensearch-dashboards.tgz
20+
{# TODO: ugly hack to get past opensearch postinst, remove once #}
21+
{# https://github.com/opensearch-project/opensearch-build/pull/3435 gets merged #}
22+
{# and packages get rebuilt #}
23+
RUN touch /usr/bin/systemd-tmpfiles && chmod a+rx /usr/bin/systemd-tmpfiles \
24+
&& {{ macros.install_packages(opensearch_dashboards_packages | customizable("packages"), chain=True) }} \
25+
&& rm -f /usr/bin/systemd-tmpfiles
3026

3127
COPY extend_start.sh /usr/local/bin/kolla_extend_start
3228
RUN chmod 755 /usr/local/bin/kolla_extend_start

docker/opensearch/opensearch/Dockerfile.j2

Lines changed: 16 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -8,25 +8,22 @@ LABEL maintainer="{{ maintainer }}" name="{{ image_name }}" build-date="{{ build
88
{% import "macros.j2" as macros with context %}
99

1010
{{ macros.configure_user(name='opensearch', shell='/bin/bash', homedir='/usr/share/opensearch') }}
11-
12-
{% block opensearch_version %}
13-
14-
{% if base_arch == 'x86_64' %}
15-
{% set arch_os='x64' %}
16-
{% elif base_arch == 'aarch64' %}
17-
{% set arch_os='arm64' %}
18-
{% endif %}
19-
20-
ARG opensearch_version=2.3.0
21-
ARG opensearch_url=https://artifacts.opensearch.org/releases/bundle/opensearch/${opensearch_version}/opensearch-${opensearch_version}-linux-{{ arch_os }}.tar.gz
22-
{% endblock %}
23-
24-
ARG OPENSEARCH_HOME=/usr/share/opensearch
25-
26-
RUN curl -o /tmp/opensearch.tgz ${opensearch_url} && \
27-
tar -xzpf /tmp/opensearch.tgz -C $OPENSEARCH_HOME --strip-components=1 && \
28-
rm /tmp/opensearch.tgz && \
29-
mkdir -p $OPENSEARCH_HOME/data && chown -R opensearch:opensearch $OPENSEARCH_HOME/data
11+
{{ macros.enable_extra_repos(['opensearch']) }}
12+
13+
{% set opensearch_packages = [
14+
'opensearch'
15+
] %}
16+
17+
{% if base_distro_tag.startswith('stream9') or base_distro == 'rocky' %}
18+
{# TODO: OpenSearch will move from SHA1 in 2.8 release, remove this when 2.8 is out #}
19+
RUN update-crypto-policies --set DEFAULT:SHA1
20+
{% endif %}
21+
22+
{# TODO: ugly hack to get past opensearch postinst, remove once #}
23+
{# https://github.com/opensearch-project/opensearch-build/pull/3435 gets merged #}
24+
{# and packages get rebuilt #}
25+
RUN touch /usr/bin/systemd-tmpfiles && chmod a+rx /usr/bin/systemd-tmpfiles \
26+
&& {{ macros.install_packages(opensearch_packages | customizable("packages"), chain=True) }}
3027

3128
COPY extend_start.sh /usr/local/bin/kolla_extend_start
3229
RUN chmod 755 /usr/local/bin/kolla_extend_start

kolla/template/repos.yaml

Lines changed: 72 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ centos:
1313
kibana: "elasticsearch-kibana-logstash-7.x"
1414
logstash: "elasticsearch-kibana-logstash-7.x"
1515
mariadb: "mariadb"
16+
opensearch: "opensearch-2.x"
17+
opensearch-dashboards: "opensearch-dashboards-2.x"
1618
openvswitch: "centos-nfv-openvswitch"
1719
opstools: "centos-opstools"
1820
powertools: "powertools"
@@ -33,6 +35,8 @@ centos-aarch64:
3335
kibana: "elasticsearch-kibana-logstash-7.x"
3436
logstash: "elasticsearch-kibana-logstash-7.x"
3537
mariadb: "mariadb"
38+
opensearch: "opensearch-2.x"
39+
opensearch-dashboards: "opensearch-dashboards-2.x"
3640
openvswitch: "centos-nfv-openvswitch"
3741
opstools: "centos-opstools"
3842
powertools: "powertools"
@@ -50,6 +54,8 @@ centos9:
5054
hacluster: "highavailability"
5155
influxdb: "influxdb"
5256
mariadb: "mariadb"
57+
opensearch: "opensearch-2.x"
58+
opensearch-dashboards: "opensearch-dashboards-2.x"
5359
openvswitch: "centos-nfv-openvswitch"
5460
opstools: "centos-opstools"
5561
proxysql: "proxysql"
@@ -66,6 +72,8 @@ centos9-aarch64:
6672
hacluster: "highavailability"
6773
influxdb: "influxdb"
6874
mariadb: "mariadb"
75+
opensearch: "opensearch-2.x"
76+
opensearch-dashboards: "opensearch-dashboards-2.x"
6977
openvswitch: "centos-nfv-openvswitch"
7078
opstools: "centos-opstools"
7179
proxysql: "proxysql"
@@ -108,6 +116,21 @@ debian:
108116
suite: "bullseye"
109117
component: "main"
110118
gpg_key: "mariadb.gpg"
119+
opensearch:
120+
url: "https://artifacts.opensearch.org/releases/bundle/opensearch/2.x/apt/"
121+
suite: "stable"
122+
component: "main"
123+
gpg_key: "opensearch.asc"
124+
opensearch-dashboards:
125+
url: "https://artifacts.opensearch.org/releases/bundle/opensearch-dashboards/2.x/apt/"
126+
suite: "stable"
127+
component: "main"
128+
gpg_key: "opensearch.asc"
129+
proxysql:
130+
url: "https://repo.proxysql.com/ProxySQL/proxysql-2.3.x/bullseye/"
131+
suite: "./"
132+
component: ""
133+
gpg_key: "proxysql.asc"
111134
rabbitmq:
112135
url: "https://dl.cloudsmith.io/public/rabbitmq/rabbitmq-server/deb/debian"
113136
suite: "bullseye"
@@ -118,11 +141,6 @@ debian:
118141
suite: "bullseye"
119142
component: "contrib"
120143
gpg_key: "treasuredata.asc"
121-
proxysql:
122-
url: "https://repo.proxysql.com/ProxySQL/proxysql-2.3.x/bullseye/"
123-
suite: "./"
124-
component: ""
125-
gpg_key: "proxysql.asc"
126144

127145
debian-aarch64:
128146
elasticsearch:
@@ -160,6 +178,21 @@ debian-aarch64:
160178
suite: "bullseye"
161179
component: "main"
162180
gpg_key: "mariadb.gpg"
181+
opensearch:
182+
url: "https://artifacts.opensearch.org/releases/bundle/opensearch/2.x/apt/"
183+
suite: "stable"
184+
component: "main"
185+
gpg_key: "opensearch.asc"
186+
opensearch-dashboards:
187+
url: "https://artifacts.opensearch.org/releases/bundle/opensearch-dashboards/2.x/apt/"
188+
suite: "stable"
189+
component: "main"
190+
gpg_key: "opensearch.asc"
191+
proxysql:
192+
url: "https://repo.proxysql.com/ProxySQL/proxysql-2.3.x/bullseye/"
193+
suite: "./"
194+
component: ""
195+
gpg_key: "proxysql.asc"
163196
rabbitmq:
164197
url: "https://dl.cloudsmith.io/public/rabbitmq/rabbitmq-server/deb/debian"
165198
suite: "bullseye"
@@ -170,11 +203,6 @@ debian-aarch64:
170203
suite: "bullseye"
171204
component: "contrib"
172205
gpg_key: "treasuredata.asc"
173-
proxysql:
174-
url: "https://repo.proxysql.com/ProxySQL/proxysql-2.3.x/bullseye/"
175-
suite: "./"
176-
component: ""
177-
gpg_key: "proxysql.asc"
178206

179207
rocky:
180208
ceph: "centos-ceph-pacific"
@@ -189,6 +217,8 @@ rocky:
189217
kibana: "elasticsearch-kibana-logstash-7.x"
190218
logstash: "elasticsearch-kibana-logstash-7.x"
191219
mariadb: "mariadb"
220+
opensearch: "opensearch-2.x"
221+
opensearch-dashboards: "opensearch-dashboards-2.x"
192222
openvswitch: "centos-nfv-openvswitch"
193223
opstools: "centos-opstools"
194224
proxysql: "proxysql"
@@ -208,6 +238,8 @@ rocky-aarch64:
208238
kibana: "elasticsearch-kibana-logstash-7.x"
209239
logstash: "elasticsearch-kibana-logstash-7.x"
210240
mariadb: "mariadb"
241+
opensearch: "opensearch-2.x"
242+
opensearch-dashboards: "opensearch-dashboards-2.x"
211243
openvswitch: "centos-nfv-openvswitch"
212244
opstools: "centos-opstools"
213245
proxysql: "proxysql"
@@ -255,6 +287,21 @@ ubuntu:
255287
suite: "focal"
256288
component: "main"
257289
gpg_key: "mariadb.gpg"
290+
opensearch:
291+
url: "https://artifacts.opensearch.org/releases/bundle/opensearch/2.x/apt/"
292+
suite: "stable"
293+
component: "main"
294+
gpg_key: "opensearch.asc"
295+
opensearch-dashboards:
296+
url: "https://artifacts.opensearch.org/releases/bundle/opensearch-dashboards/2.x/apt/"
297+
suite: "stable"
298+
component: "main"
299+
gpg_key: "opensearch.asc"
300+
proxysql:
301+
url: "https://repo.proxysql.com/ProxySQL/proxysql-2.3.x/focal/"
302+
suite: "./"
303+
component: ""
304+
gpg_key: "proxysql.asc"
258305
rabbitmq:
259306
url: "https://dl.cloudsmith.io/public/rabbitmq/rabbitmq-server/deb/ubuntu"
260307
suite: "focal"
@@ -265,11 +312,6 @@ ubuntu:
265312
suite: "focal"
266313
component: "contrib"
267314
gpg_key: "treasuredata.asc"
268-
proxysql:
269-
url: "https://repo.proxysql.com/ProxySQL/proxysql-2.3.x/focal/"
270-
suite: "./"
271-
component: ""
272-
gpg_key: "proxysql.asc"
273315

274316
ubuntu-aarch64:
275317
elasticsearch:
@@ -307,6 +349,21 @@ ubuntu-aarch64:
307349
suite: "focal"
308350
component: "main"
309351
gpg_key: "mariadb.gpg"
352+
opensearch:
353+
url: "https://artifacts.opensearch.org/releases/bundle/opensearch/2.x/apt/"
354+
suite: "stable"
355+
component: "main"
356+
gpg_key: "opensearch.asc"
357+
opensearch-dashboards:
358+
url: "https://artifacts.opensearch.org/releases/bundle/opensearch-dashboards/2.x/apt/"
359+
suite: "stable"
360+
component: "main"
361+
gpg_key: "opensearch.asc"
362+
proxysql:
363+
url: "https://repo.proxysql.com/ProxySQL/proxysql-2.3.x/focal/"
364+
suite: "./"
365+
component: ""
366+
gpg_key: "proxysql.asc"
310367
rabbitmq:
311368
url: "https://dl.cloudsmith.io/public/rabbitmq/rabbitmq-server/deb/ubuntu"
312369
suite: "focal"
@@ -317,8 +374,3 @@ ubuntu-aarch64:
317374
suite: "focal"
318375
component: "contrib"
319376
gpg_key: "treasuredata.asc"
320-
proxysql:
321-
url: "https://repo.proxysql.com/ProxySQL/proxysql-2.3.x/focal/"
322-
suite: "./"
323-
component: ""
324-
gpg_key: "proxysql.asc"

0 commit comments

Comments
 (0)