Skip to content

Commit

Permalink
Merge pull request #6 from newgene/update-biothing-docker-image
Browse files Browse the repository at this point in the history
Update ES config with heap size 1G, Update biothing studio build command
  • Loading branch information
newgene authored Jul 20, 2022
2 parents 0ae43b0 + 600a9b3 commit 009e10e
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 3 deletions.
1 change: 1 addition & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ export AWS_SECRET_KEY=
export BIOTHINGS_REPOSITORY=https://github.com/biothings/biothings.api.git
export BIOTHINGS_VERSION=master
export PYTHON_VERSION=
export ES_HEAP_SIZE=
3 changes: 3 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,7 @@ ADD ansible_playbook /tmp/ansible_playbook
ADD inventory /etc/ansible/hosts

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

WORKDIR /tmp/ansible_playbook
RUN if [ -n "$API_NAME" ]; \
Expand All @@ -240,12 +241,14 @@ RUN if [ -n "$API_NAME" ]; \
-e "studio_version=$STUDIO_VERSION" \
-e "api_name=$API_NAME" \
-e "api_version=$API_VERSION" \
-e "es_heap_size=$ES_HEAP_SIZE" \
-c local; \
else \
ansible-playbook biothings_studio.yml \
-e "biothings_version=$BIOTHINGS_VERSION" \
-e "biothings_repository=$BIOTHINGS_REPOSITORY" \
-e "studio_version=$STUDIO_VERSION" \
-e "es_heap_size=$ES_HEAP_SIZE" \
-c local; \
fi

Expand Down
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ BIOTHINGS_VERSION ?= master
BIOTHINGS_REPOSITORY ?= https://github.com/biothings/biothings.api.git
DOCKER_BUILD_EXTRA_OPTS ?= --force-rm
PYTHON_VERSION ?=
ES_HEAP_SIZE ?=

biothings-studio:
docker build $(DOCKER_BUILD_EXTRA_OPTS) \
Expand Down Expand Up @@ -75,6 +76,7 @@ demohub:
--build-arg STUDIO_VERSION=$(STUDIO_VERSION) \
--build-arg BIOTHINGS_VERSION=$(BIOTHINGS_VERSION) \
--build-arg BIOTHINGS_REPOSITORY=$(BIOTHINGS_REPOSITORY) \
--build-arg ES_HEAP_SIZE=512m \
--build-arg API_VERSION=master \
--build-arg TEST=1 \
--build-arg AWS_ACCESS_KEY=$(AWS_ACCESS_KEY) \
Expand All @@ -86,6 +88,7 @@ demohub-test:
--build-arg STUDIO_VERSION=$(STUDIO_VERSION) \
--build-arg BIOTHINGS_VERSION=$(BIOTHINGS_VERSION) \
--build-arg BIOTHINGS_REPOSITORY=$(BIOTHINGS_REPOSITORY) \
--build-arg ES_HEAP_SIZE=512m \
--build-arg API_VERSION=master \
--build-arg TEST=1 \
--build-arg PYTHON_VERSION=$(PYTHON_VERSION) \
Expand Down
15 changes: 14 additions & 1 deletion ansible_playbook/configure.yml
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,10 @@
- name: mongodb data directory
file: path="{{ software.common_configurations.mongodb.dbpath }}" state=directory owner=mongodb group=mongodb

#- debug: var=software.web_node

- name: biothings (override requirement_web.txt version)
git: repo={{ biothings_repository }} dest=/home/biothings/biothings.api version={{ software.web_node.biothings_git_version }}
git: repo={{ software.web_node.biothings_repository }} dest=/home/biothings/biothings.api version={{ software.web_node.biothings_git_version }}
become_user: "biothings"
become: true

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


- name: Update /etc/elasticsearch/jvm.options.d/heap.options again replacing min/max heap size
when: software.web_node.elasticsearch.heap_size != ''
shell:
cmd: |
cat > /etc/elasticsearch/jvm.options.d/heap.options << EOF
-Xms{{ software.web_node.elasticsearch.heap_size }}
-Xmx{{ software.web_node.elasticsearch.heap_size }}
EOF
args:
executable: /bin/sh
4 changes: 2 additions & 2 deletions ansible_playbook/vars/biothings_studio.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ software:
plugin:
head: "mobz/elasticsearch-head"
bigdesk: "lukas-vlcek/bigdesk"
heap_size: "2g"
heap_size: "{{ es_heap_size | default('')}}"
node_roles: ['data', 'master']
biothings_repository: "{{ biothings_repository | default('https://github.com/biothings/biothings.api.git') }}"
biothings_repository: "{{ biothings_repository | default('https://github.com/biothings/biothings.api.git', true) }}"
studio_git_version: "{{ studio_version | default('master')}}"
biothings_git_version: "{{ biothings_version | default('master')}}"
common_configurations:
Expand Down

0 comments on commit 009e10e

Please sign in to comment.