11# Warning! Do not use this config in production!
22# This is only for testing and security has been turned off.
33
4- FROM ann-benchmarks
4+ FROM ann-benchmarks AS builder
55
6- WORKDIR /home/app
6+ ARG OPENSEARCH_VERSION=2.6.0
7+
8+ WORKDIR /tmp
79
8- # Install OpenSearch following instructions from https://opensearch.org/docs/opensearch/install/tar/
9- # and https://opensearch.org/docs/opensearch/install/important-settings/
10- RUN apt-get install tmux wget gosu -y
10+ # Download OpenSearch to intermediate builder.
11+ RUN apt-get -y install curl
1112
1213RUN set -eux ; \
1314 ARCH=''; \
@@ -16,12 +17,23 @@ RUN set -eux ; \
1617 x86_64) ARCH='x64' ;; \
1718 *) echo >&2 ; echo >&2 "Unsupported architecture $(arch)" ; echo >&2 ; exit 1 ;; \
1819 esac ; \
19- wget https://artifacts.opensearch.org/releases/bundle/opensearch/1.0.0/opensearch-1.0.0-linux-$ARCH.tar.gz; \
20- tar -zxf opensearch-1.0.0-linux-$ARCH.tar.gz; \
21- rm -r opensearch-1.0.0-linux-$ARCH.tar.gz opensearch-1.0.0/plugins/opensearch-security;
20+ curl -OsS https://artifacts.opensearch.org/releases/bundle/opensearch/${OPENSEARCH_VERSION}/opensearch-${OPENSEARCH_VERSION}-linux-$ARCH.tar.gz; \
21+ tar -zxf opensearch-${OPENSEARCH_VERSION}-linux-$ARCH.tar.gz; \
22+ mv opensearch-${OPENSEARCH_VERSION} opensearch; \
23+ rm -r opensearch-${OPENSEARCH_VERSION}-linux-$ARCH.tar.gz opensearch/plugins/opensearch-security;
24+
25+ # Install OpenSearch in final image:
26+ # - https://opensearch.org/docs/latest/install-and-configure/install-opensearch/tar/
27+ FROM ann-benchmarks
28+
29+ WORKDIR /home/app
30+
31+ RUN apt-get -y install curl tmux gosu
32+
33+ COPY --from=builder /tmp/opensearch /home/app/opensearch
34+ RUN chmod -R 777 opensearch
2235
23- RUN chmod -R 777 opensearch-1.0.0
24- RUN sysctl -w vm.max_map_count=262144
36+ RUN echo "vm.max_map_count=262144" >> /etc/sysctl.conf
2537
2638RUN python3 -m pip install --upgrade elasticsearch==7.13.4 tqdm
2739
@@ -33,7 +45,7 @@ node.roles: [ data, master ]\n\
3345node.processors: 1\n\
3446thread_pool.write.size: 1\n\
3547thread_pool.search.size: 1\n\
36- thread_pool.search.queue_size: 1' > opensearch-1.0.0 /config/opensearch.yml
48+ thread_pool.search.queue_size: 1' > opensearch/config/opensearch.yml
3749
3850RUN echo '\
3951-Xms3G\n\
@@ -42,11 +54,11 @@ RUN echo '\
4254-XX:+HeapDumpOnOutOfMemoryError\n\
4355-XX:HeapDumpPath=data\n\
4456-XX:ErrorFile=logs/hs_err_pid%p.log\n\
45- -Xlog:gc*,gc+age=trace,safepoint:file=logs/gc.log:utctime,pid,tags:filecount=32,filesize=64m' > opensearch-1.0.0 /config/jvm.options
57+ -Xlog:gc*,gc+age=trace,safepoint:file=logs/gc.log:utctime,pid,tags:filecount=32,filesize=64m' > opensearch/config/jvm.options
4658
4759# Custom entrypoint that also starts the OpenSearch server.
4860RUN useradd -m opensearch
49- RUN echo 'tmux new-session -d -s opensearch """exec gosu opensearch "./opensearch-1.0.0 /opensearch-tar-install.sh""""' > entrypoint.sh
61+ RUN echo 'tmux new-session -d -s opensearch """exec gosu opensearch "./opensearch/opensearch-tar-install.sh""""' > entrypoint.sh
5062RUN echo 'python3 -u run_algorithm.py "$@"' >> entrypoint.sh
5163
5264ENTRYPOINT ["/bin/bash", "/home/app/entrypoint.sh"]
0 commit comments