Skip to content

Commit fad1700

Browse files
committed
Merge remote-tracking branch 'origin/master' into study_pages_public_url
2 parents 3293656 + eec15b3 commit fad1700

14 files changed

+99
-193
lines changed
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
- name: Backup searchengine data
2+
hosts: "{{ idr_environment | default('idr') }}-searchengine-hosts"
3+
4+
tasks:
5+
# Backup the elastic indexed data
6+
- name: backup elastic search indexed data
7+
become: yes
8+
docker_container:
9+
image: "{{ searchengine_docker_image }}"
10+
name: restore_elasticsearch_data
11+
cleanup: True
12+
#auto_remove: yes
13+
networks:
14+
- name: searchengine-net
15+
command: "backup_elasticsearch_data"
16+
state: started
17+
volumes:
18+
- "{{ apps_folder }}/searchengine/searchengine/:/etc/searchengine/"

ansible/decommission/archive-instance-networks.yml

Lines changed: 0 additions & 85 deletions
This file was deleted.

ansible/decommission/archive-instance-services.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Shutdown services on a production instance
22

3-
- hosts: "{{ idr_environment }}-hosts"
3+
- hosts: "{{ idr_environment | default('idr') }}-hosts"
44

55
gather_facts: False
66

ansible/decommission/archive-logs.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
set_fact:
1111
decommission_archive_prefix: "{{ ansible_hostname }}-{{ ansible_date_time.date | replace('-', '') }}"
1212

13-
1413
- hosts: "{{ idr_environment | default('idr') }}-proxy-hosts"
1514
vars:
1615
logs:
@@ -42,7 +41,6 @@
4241
from {{ ansible_hostname }}:{{ item.expanded_paths | join(',') }}
4342
with_items: "{{_decommission_archive_proxy.results}}"
4443

45-
4644
- hosts: "{{ idr_environment | default('idr') }}-management-hosts"
4745
vars:
4846
logs:
@@ -74,11 +72,11 @@
7472
from {{ ansible_hostname }}:{{ item.expanded_paths | join(',') }}
7573
with_items: "{{_decommission_archive_management.results}}"
7674

77-
7875
- hosts: "{{ idr_environment | default('idr') }}-searchengine-hosts"
7976
vars:
8077
logs:
8178
- { name: 'searchengine', path: '/data/searchengine/searchengine/logs' }
79+
- {"name": "searchengine_backup_data", path: "/searchengine_backup"}
8280
tasks:
8381

8482
- name: Archive searchengine logs

ansible/group_vars/proxy-hosts.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -266,8 +266,6 @@ nginx_proxy_direct_locations:
266266
redirect302: /about/curation-workflow.html
267267
- location: "^~ /connection"
268268
alias: /srv/www/connection
269-
- location: "^~ /.well-known/acme-challenge"
270-
alias: /srv/www/letsencrypt/challenge
271269
- location: "= /submitter-survey"
272270
redirect302: https://forms.gle/beR4vqLrgLgRzgSX9
273271
- location: "~ ^/mapr/api/(?!config).*($|/)"

ansible/group_vars/searchengine-hosts.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,22 @@ apps_folder: /data
22
#database_server_url: "{{ omero_db_host_ansible }}"
33
database_port: 5432
44
database_name: idr
5+
default_datasource: idr
56
database_username: omeroreadonly
67
database_user_password: "{{ idr_secret_postgresql_password_ro | default('omero') }}"
78
searchenginecache_folder: /data/searchengine/searchengine/cacheddata/
89
search_engineelasticsearch_docker_image: docker.elastic.co/elasticsearch/elasticsearch:8.8.1
9-
searchengine_docker_image: openmicroscopy/omero-searchengine:0.6.0
10-
#ansible_python_interpreter: path/to/bin/python
10+
searchengine_docker_image: openmicroscopy/omero-searchengine:0.7
11+
# ansible_python_interpreter: path/to/bin/python
1112
searchengine_index: searchengine_index
13+
automatic_refresh: true
1214
cache_rows: 100000
1315
# I think that the following two variables should be in secret
1416
searchengine_secret_key: "{{ idr_searchengine_secret_key | default('secret_key') }}"
1517
searchengineurlprefix: "searchengine"
1618
IDR_TEST_FILE_URL: "https://raw.githubusercontent.com/IDR/idr.openmicroscopy.org/master/_data/studies.tsv"
1719
elasticsearch_no_nodes: 3
20+
# This should be a separate volume, cloned as part of the routine deployment process.
1821
elasticsearch_backup_folder: "/searchengine_backup"
1922
ca_password: "{{ idr_secret_elastic_ca_password | default('ca_password') }}"
2023
keystore_password: "{{ idr_secret_elastic_keystore_password | default('keystore_password') }}"

ansible/idr-02-services.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,6 @@
99
## Search services
1010
- import_playbook: idr-elasticsearch.yml
1111
- import_playbook: idr-searchengine.yml
12+
13+
## Restore searchengine data if existence
14+
- import_playbook: restore_searchengine_data.yml

ansible/idr-elasticsearch.yml

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -73,18 +73,6 @@
7373
mode: 0755
7474
with_sequence: start=1 count={{ elasticsearch_no_nodes }}
7575

76-
- name: Create ELasticsearch backup folder
77-
become: yes
78-
file:
79-
path: "{{ elasticsearch_backup_folder }}"
80-
recurse: yes
81-
state: directory
82-
owner: 1000
83-
group: root
84-
mode: 0755
85-
86-
87-
8876
- name: Add elastic nodes to instances_nodes
8977
set_fact:
9078
instances_nodes: "{{instances_nodes + [( {'name' : 'searchengine_elasticsearch_node'+item, 'dns': ['searchengine_elasticsearch_node'+item,'localhost'],'ip': '127.0.0.1'})] }}"
@@ -130,7 +118,7 @@
130118
#fi;
131119
state: started
132120
volumes:
133-
- "{{ apps_folder }}/searchengine/elasticsearch/certs: /certs"
121+
- "{{ apps_folder }}/searchengine/elasticsearch/certs:/certs"
134122
- "{{ apps_folder }}/searchengine/elasticsearch/certs:/usr/share/elasticsearch/config/certificates"
135123

136124
- name: Wait for CA file
@@ -163,7 +151,7 @@
163151

164152
state: started
165153
volumes:
166-
- "{{ apps_folder }}/searchengine/elasticsearch/certs: /certs"
154+
- "{{ apps_folder }}/searchengine/elasticsearch/certs:/certs"
167155
- "{{ apps_folder }}/searchengine/elasticsearch/certs:/usr/share/elasticsearch/config/certificates"
168156
- /tmp/instances.yaml:/tmp/instances.yaml
169157

ansible/idr-proxy-letsencrypt.yml

Lines changed: 0 additions & 81 deletions
This file was deleted.

ansible/idr-searchengine.yml

Lines changed: 29 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,6 @@
6868
volumes:
6969
- "{{ apps_folder }}/searchengine/searchengine/:/etc/searchengine/"
7070

71-
7271
- name: configure database for docker searchengine
7372
become: yes
7473
docker_container:
@@ -77,16 +76,28 @@
7776
cleanup: True
7877
#auto_remove: yes
7978
command: >
80-
set_database_configuration -u {{ database_server_url }}
81-
-d {{ database_name }} -s {{ database_port }} -n {{ database_username }} -p {{ database_user_password }}
82-
#networks:
79+
set_database_configuration -d {{ database_name }} -s {{ database_port }} -n {{ database_username }} -p {{ database_user_password }} -b {{ apps_folder }} -w {{ default_datasource }} -u {{ database_server_url }}
80+
#networks::
8381
#- name: searchengine-net
8482
#published_ports:
8583
#- "5577:5577"
8684
state: started
8785
volumes:
8886
- "{{ apps_folder }}/searchengine/searchengine/:/etc/searchengine/"
8987

88+
- name: set default data source
89+
become: yes
90+
docker_container:
91+
image: "{{ searchengine_docker_image }}"
92+
name: searchengine_database
93+
cleanup: True
94+
#auto_remove: yes
95+
command: >
96+
set_default_datasource -d {{ default_datasource }}
97+
state: started
98+
volumes:
99+
- "{{ apps_folder }}/searchengine/searchengine/:/etc/searchengine/"
100+
90101
- name: configure IDR_TEST_FILE_URL item
91102
become: yes
92103
docker_container:
@@ -98,7 +109,6 @@
98109
volumes:
99110
- "{{ apps_folder }}/searchengine/searchengine/:/etc/searchengine/"
100111

101-
102112
- name: configure cache folder for docker searchengine
103113
become: yes
104114
docker_container:
@@ -151,6 +161,20 @@
151161
volumes:
152162
- "{{ apps_folder }}/searchengine/searchengine/:/etc/searchengine/"
153163

164+
# automatic refreshing when configuration change is detected
165+
166+
- name: Set automatic refreshing the configuration
167+
become: yes
168+
docker_container:
169+
image: "{{ searchengine_docker_image }}"
170+
name: elastics_password
171+
cleanup: True
172+
#auto_remove: yes
173+
command: "set_automatic_refresh -a {{ automatic_refresh }}"
174+
state: started
175+
volumes:
176+
- "{{ apps_folder }}/searchengine/searchengine/:/etc/searchengine/"
177+
154178
- name: Run docker searchengine
155179
become: yes
156180
docker_container:

0 commit comments

Comments
 (0)