Skip to content

Commit 009e10e

Browse files
authored
Merge pull request #6 from newgene/update-biothing-docker-image
Update ES config with heap size 1G, Update biothing studio build command
2 parents 0ae43b0 + 600a9b3 commit 009e10e

File tree

5 files changed

+23
-3
lines changed

5 files changed

+23
-3
lines changed

.env.example

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@ export AWS_SECRET_KEY=
33
export BIOTHINGS_REPOSITORY=https://github.com/biothings/biothings.api.git
44
export BIOTHINGS_VERSION=master
55
export PYTHON_VERSION=
6+
export ES_HEAP_SIZE=

Dockerfile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -231,6 +231,7 @@ ADD ansible_playbook /tmp/ansible_playbook
231231
ADD inventory /etc/ansible/hosts
232232

233233
COPY --from=build-webapp --chown=root:www-data /build/src/github.com/biothings/biothings_studio/webapp/dist /srv/www/webapp
234+
ARG ES_HEAP_SIZE
234235

235236
WORKDIR /tmp/ansible_playbook
236237
RUN if [ -n "$API_NAME" ]; \
@@ -240,12 +241,14 @@ RUN if [ -n "$API_NAME" ]; \
240241
-e "studio_version=$STUDIO_VERSION" \
241242
-e "api_name=$API_NAME" \
242243
-e "api_version=$API_VERSION" \
244+
-e "es_heap_size=$ES_HEAP_SIZE" \
243245
-c local; \
244246
else \
245247
ansible-playbook biothings_studio.yml \
246248
-e "biothings_version=$BIOTHINGS_VERSION" \
247249
-e "biothings_repository=$BIOTHINGS_REPOSITORY" \
248250
-e "studio_version=$STUDIO_VERSION" \
251+
-e "es_heap_size=$ES_HEAP_SIZE" \
249252
-c local; \
250253
fi
251254

Makefile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ BIOTHINGS_VERSION ?= master
99
BIOTHINGS_REPOSITORY ?= https://github.com/biothings/biothings.api.git
1010
DOCKER_BUILD_EXTRA_OPTS ?= --force-rm
1111
PYTHON_VERSION ?=
12+
ES_HEAP_SIZE ?=
1213

1314
biothings-studio:
1415
docker build $(DOCKER_BUILD_EXTRA_OPTS) \
@@ -75,6 +76,7 @@ demohub:
7576
--build-arg STUDIO_VERSION=$(STUDIO_VERSION) \
7677
--build-arg BIOTHINGS_VERSION=$(BIOTHINGS_VERSION) \
7778
--build-arg BIOTHINGS_REPOSITORY=$(BIOTHINGS_REPOSITORY) \
79+
--build-arg ES_HEAP_SIZE=512m \
7880
--build-arg API_VERSION=master \
7981
--build-arg TEST=1 \
8082
--build-arg AWS_ACCESS_KEY=$(AWS_ACCESS_KEY) \
@@ -86,6 +88,7 @@ demohub-test:
8688
--build-arg STUDIO_VERSION=$(STUDIO_VERSION) \
8789
--build-arg BIOTHINGS_VERSION=$(BIOTHINGS_VERSION) \
8890
--build-arg BIOTHINGS_REPOSITORY=$(BIOTHINGS_REPOSITORY) \
91+
--build-arg ES_HEAP_SIZE=512m \
8992
--build-arg API_VERSION=master \
9093
--build-arg TEST=1 \
9194
--build-arg PYTHON_VERSION=$(PYTHON_VERSION) \

ansible_playbook/configure.yml

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,8 +110,10 @@
110110
- name: mongodb data directory
111111
file: path="{{ software.common_configurations.mongodb.dbpath }}" state=directory owner=mongodb group=mongodb
112112

113+
#- debug: var=software.web_node
114+
113115
- name: biothings (override requirement_web.txt version)
114-
git: repo={{ biothings_repository }} dest=/home/biothings/biothings.api version={{ software.web_node.biothings_git_version }}
116+
git: repo={{ software.web_node.biothings_repository }} dest=/home/biothings/biothings.api version={{ software.web_node.biothings_git_version }}
115117
become_user: "biothings"
116118
become: true
117119

@@ -177,3 +179,14 @@
177179
- {"line": "", "re": "^cluster.initial_master_nodes.*$"}
178180
- {"line": "xpack.security.enabled: false", "re": "^xpack.security.enabled.*$"}
179181

182+
183+
- name: Update /etc/elasticsearch/jvm.options.d/heap.options again replacing min/max heap size
184+
when: software.web_node.elasticsearch.heap_size != ''
185+
shell:
186+
cmd: |
187+
cat > /etc/elasticsearch/jvm.options.d/heap.options << EOF
188+
-Xms{{ software.web_node.elasticsearch.heap_size }}
189+
-Xmx{{ software.web_node.elasticsearch.heap_size }}
190+
EOF
191+
args:
192+
executable: /bin/sh

ansible_playbook/vars/biothings_studio.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ software:
1313
plugin:
1414
head: "mobz/elasticsearch-head"
1515
bigdesk: "lukas-vlcek/bigdesk"
16-
heap_size: "2g"
16+
heap_size: "{{ es_heap_size | default('')}}"
1717
node_roles: ['data', 'master']
18-
biothings_repository: "{{ biothings_repository | default('https://github.com/biothings/biothings.api.git') }}"
18+
biothings_repository: "{{ biothings_repository | default('https://github.com/biothings/biothings.api.git', true) }}"
1919
studio_git_version: "{{ studio_version | default('master')}}"
2020
biothings_git_version: "{{ biothings_version | default('master')}}"
2121
common_configurations:

0 commit comments

Comments
 (0)