Skip to content

Commit

Permalink
HC-469: Cannot properly update GRQ when cluster is configured with AW…
Browse files Browse the repository at this point in the history
…S OpenSearch Service (#102)

* HC-469: Call script to install base ES template

* bump version

* fixed typo

* grq is in grq2 path

* install base es template after pushing out settings.cfg

* push up celery config first

---------

Co-authored-by: Mike Cayanan <michael.d.cayanan@jpl.nasa.gov>
  • Loading branch information
mcayanan and Mike Cayanan authored May 12, 2023
1 parent 58697ae commit 191d10f
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 14 deletions.
2 changes: 1 addition & 1 deletion sdscli/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
from __future__ import division
from __future__ import absolute_import

__version__ = "1.2.1"
__version__ = "1.2.2"
__url__ = "https://github.com/sdskit/sdscli"
__description__ = "Command line interface for SDSKit"
6 changes: 5 additions & 1 deletion sdscli/adapters/hysds/fabfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -476,7 +476,11 @@ def install_base_es_template():
"es_template-base.json",
"/tmp/es_template-base.json"
)
run("curl -XPUT 'localhost:9200/_template/index_defaults?pretty' -H 'Content-Type: application/json' -d@/tmp/es_template-base.json")
dir = role
if role == "grq":
dir = "grq2"
with prefix('source %s/bin/activate' % hysds_dir):
run(f'{hysds_dir}/ops/{dir}/scripts/install_base_es_template.sh /tmp/es_template-base.json')


def install_es_policy():
Expand Down
24 changes: 12 additions & 12 deletions sdscli/adapters/hysds/update.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,13 @@ def update_mozart(conf, ndeps=False, config_only=False, comp='mozart'):
execute(fab.npm_install_package_json, '~/mozart/ops/hysds_ui', roles=[comp])
bar.update()

# update celery config
set_bar_desc(bar, 'Updating celery config')
execute(fab.rm_rf, '~/mozart/ops/hysds/celeryconfig.py', roles=[comp])
execute(fab.rm_rf, '~/mozart/ops/hysds/celeryconfig.pyc', roles=[comp])
execute(fab.send_celeryconf, 'mozart', roles=[comp])
bar.update()

# set default ES shard number
set_bar_desc(bar, 'Setting default ES shard number')
execute(fab.install_base_es_template, roles=[comp])
Expand All @@ -86,13 +93,6 @@ def update_mozart(conf, ndeps=False, config_only=False, comp='mozart'):
execute(fab.send_logstash_jvm_options, 'mozart', roles=[comp])
bar.update()

# update celery config
set_bar_desc(bar, 'Updating celery config')
execute(fab.rm_rf, '~/mozart/ops/hysds/celeryconfig.py', roles=[comp])
execute(fab.rm_rf, '~/mozart/ops/hysds/celeryconfig.pyc', roles=[comp])
execute(fab.send_celeryconf, 'mozart', roles=[comp])
bar.update()

# update supervisor config
set_bar_desc(bar, 'Updating supervisor config')
execute(fab.rm_rf, '~/mozart/etc/supervisord.conf', roles=[comp])
Expand Down Expand Up @@ -450,11 +450,6 @@ def update_grq(conf, ndeps=False, config_only=False, comp='grq'):
'~/sciflo/ops/pele', ndeps, roles=[comp])
bar.update()

# set default ES shard number
set_bar_desc(bar, 'Setting default ES shard number')
execute(fab.install_base_es_template, roles=[comp])
bar.update()

# update celery config
set_bar_desc(bar, 'Updating celery config')
execute(fab.rm_rf, '~/sciflo/ops/hysds/celeryconfig.py', roles=[comp])
Expand All @@ -468,6 +463,11 @@ def update_grq(conf, ndeps=False, config_only=False, comp='grq'):
execute(fab.send_grq2conf, roles=[comp])
bar.update()

# set default ES shard number
set_bar_desc(bar, 'Setting default ES shard number')
execute(fab.install_base_es_template, roles=[comp])
bar.update()

# update pele config
set_bar_desc(bar, 'Updating pele config')
execute(fab.rm_rf, '~/sciflo/ops/pele/settings.cfg', roles=[comp])
Expand Down

0 comments on commit 191d10f

Please sign in to comment.