Skip to content

Commit

Permalink
Merge 960d46e into 1c5f2e9
Browse files Browse the repository at this point in the history
  • Loading branch information
dmnlk committed Jan 11, 2019
2 parents 1c5f2e9 + 960d46e commit cea1cc5
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 3 deletions.
19 changes: 17 additions & 2 deletions bin/Dockerfile.base
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ RUN { \
&& chmod +x /usr/local/bin/docker-java-home
ENV JAVA_HOME /usr/lib/jvm/java-1.8-openjdk
ENV PATH $PATH:/usr/lib/jvm/java-1.8-openjdk/jre/bin:/usr/lib/jvm/java-1.8-openjdk/bin
ENV JAVA_VERSION 8u171
ENV JAVA_ALPINE_VERSION 8.181.13-r0
ENV JAVA_VERSION 8u191
ENV JAVA_ALPINE_VERSION 8.191.12-r0
RUN set -x && apk add --no-cache openjdk8="$JAVA_ALPINE_VERSION" \
&& [ "$JAVA_HOME" = "$(docker-java-home)" ]

Expand All @@ -51,6 +51,10 @@ ADD https://raw.githubusercontent.com/carlossg/docker-maven/master/jdk-8/setting
RUN mkdir -p /opt/code/localstack
WORKDIR /opt/code/localstack/

# https://github.com/pires/docker-elasticsearch/issues/56
ENV ES_TMPDIR /tmp
# require --batch option that ingest-attachment plugin require additional permissions

# init environment and cache some dependencies
RUN mkdir -p /opt/code/localstack/localstack/infra && \
wget -O /tmp/localstack.es.zip \
Expand All @@ -59,6 +63,17 @@ RUN mkdir -p /opt/code/localstack/localstack/infra && \
https://s3-eu-west-1.amazonaws.com/softwaremill-public/elasticmq-server-0.14.5.jar && \
(cd localstack/infra/ && unzip -q /tmp/localstack.es.zip && \
mv elasticsearch* elasticsearch && rm /tmp/localstack.es.zip) && \
(cd localstack/infra/elasticsearch/ && \
bin/elasticsearch-plugin install analysis-icu && \
bin/elasticsearch-plugin install ingest-attachment --batch && \
bin/elasticsearch-plugin install ingest-user-agent && \
bin/elasticsearch-plugin install analysis-kuromoji && \
bin/elasticsearch-plugin install mapper-murmur3 && \
bin/elasticsearch-plugin install mapper-size && \
bin/elasticsearch-plugin install analysis-phonetic && \
bin/elasticsearch-plugin install analysis-smartcn && \
bin/elasticsearch-plugin install analysis-stempel && \
bin/elasticsearch-plugin install analysis-ukrainian) && \
mkdir -p /opt/code/localstack/localstack/infra/dynamodb && \
wget -O /tmp/localstack.ddb.zip \
https://s3-us-west-2.amazonaws.com/dynamodb-local/dynamodb_local_latest.zip && \
Expand Down
3 changes: 3 additions & 0 deletions localstack/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,9 @@

# installation constants
ELASTICSEARCH_JAR_URL = 'https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-6.2.0.zip'
# https://docs.aws.amazon.com/ja_jp/elasticsearch-service/latest/developerguide/aes-supported-plugins.html
ELASTICSEARCH_PLUGIN_LIST = ['analysis-icu', 'ingest-attachment', 'ingest-user-agent', 'analysis-kuromoji',
'mapper-murmur3', 'mapper-size', 'analysis-phonetic', 'analysis-smartcn', 'analysis-stempel', 'analysis-ukrainian']
DYNAMODB_JAR_URL = 'https://s3-us-west-2.amazonaws.com/dynamodb-local/dynamodb_local_latest.zip'
ELASTICMQ_JAR_URL = 'https://s3-eu-west-1.amazonaws.com/softwaremill-public/elasticmq-server-0.14.2.jar'
STS_JAR_URL = 'http://central.maven.org/maven2/com/amazonaws/aws-java-sdk-sts/1.11.14/aws-java-sdk-sts-1.11.14.jar'
Expand Down
10 changes: 9 additions & 1 deletion localstack/services/install.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import logging
import tempfile
from localstack.constants import (DEFAULT_SERVICE_PORTS, ELASTICMQ_JAR_URL, STS_JAR_URL,
ELASTICSEARCH_JAR_URL, DYNAMODB_JAR_URL, LOCALSTACK_MAVEN_VERSION)
ELASTICSEARCH_JAR_URL, ELASTICSEARCH_PLUGIN_LIST, DYNAMODB_JAR_URL, LOCALSTACK_MAVEN_VERSION)
from localstack.utils.common import download, parallelize, run, mkdir, save_file, unzip, rm_rf, chmod_r

THIS_PATH = os.path.dirname(os.path.realpath(__file__))
Expand Down Expand Up @@ -47,6 +47,14 @@ def install_elasticsearch():
mkdir(dir_path)
chmod_r(dir_path, 0o777)

# install default plugins
for plugin in ELASTICSEARCH_PLUGIN_LIST:
if is_alpine():
# https://github.com/pires/docker-elasticsearch/issues/56
os.environ['ES_TMPDIR'] = '/tmp'
plugin_binary = os.path.join(INSTALL_DIR_ES, 'bin', 'elasticsearch-plugin')
run('%s install %s' % (plugin_binary, plugin))


def install_elasticmq():
if not os.path.exists(INSTALL_DIR_ELASTICMQ):
Expand Down

0 comments on commit cea1cc5

Please sign in to comment.