Skip to content

Commit 85f3cb4

Browse files
author
Mike Cayanan
committed
updates to support the inclusion of wrapper scripts to support the editable and pypi installation use-cases
1 parent fc6af58 commit 85f3cb4

1 file changed

Lines changed: 53 additions & 0 deletions

File tree

sdscli/adapters/hysds/update.py

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,16 @@ def update_mozart(conf, ndeps=False, config_only=False, comp='mozart'):
8383
execute(fab.send_logstash_jvm_options, 'mozart', roles=[comp])
8484
bar.update()
8585

86+
# Copy script wrappers for PyPI compatibility
87+
set_bar_desc(bar, 'Installing script wrappers')
88+
for script in ['log_instance_stats.sh', 'process_events.sh', 'watchdog_job_timeouts.sh',
89+
'watchdog_task_timeouts.sh', 'watchdog_worker_timeouts.sh']:
90+
wrapper_src = execute(fab.get_package_resource_path, 'hysds', f'scripts/{script}',
91+
remote=True, resource_type='file', roles=[comp])
92+
execute(fab.copy, wrapper_src[comp], f'~/mozart/bin/{script}', roles=[comp])
93+
execute(fab.chmod, 755, f'~/mozart/bin/{script}', roles=[comp])
94+
bar.update()
95+
8696
# update supervisor config
8797
set_bar_desc(bar, 'Updating supervisor config')
8898
execute(fab.rm_rf, '~/mozart/etc/supervisord.conf', roles=[comp])
@@ -340,6 +350,14 @@ def update_metrics(conf, ndeps=False, config_only=False, comp='metrics'):
340350
execute(fab.send_logstash_jvm_options, 'metrics', roles=[comp])
341351
bar.update()
342352

353+
# Copy script wrappers for PyPI compatibility
354+
set_bar_desc(bar, 'Installing script wrappers')
355+
wrapper_src = execute(fab.get_package_resource_path, 'hysds', 'scripts/log_instance_stats.sh',
356+
remote=True, resource_type='file', roles=[comp])
357+
execute(fab.copy, wrapper_src[comp], '~/metrics/bin/log_instance_stats.sh', roles=[comp])
358+
execute(fab.chmod, 755, '~/metrics/bin/log_instance_stats.sh', roles=[comp])
359+
bar.update()
360+
343361
# update celery config
344362
set_bar_desc(bar, 'Updating celery config')
345363
execute(fab.rm_rf, '~/metrics/ops/hysds/celeryconfig.py', roles=[comp])
@@ -485,6 +503,14 @@ def update_grq(conf, ndeps=False, config_only=False, comp='grq'):
485503
execute(fab.create_hysds_ios_grq_index, roles=[comp])
486504
bar.update()
487505

506+
# Copy script wrappers for PyPI compatibility
507+
set_bar_desc(bar, 'Installing script wrappers')
508+
wrapper_src = execute(fab.get_package_resource_path, 'hysds', 'scripts/log_instance_stats.sh',
509+
remote=True, resource_type='file', roles=[comp])
510+
execute(fab.copy, wrapper_src[comp], '~/sciflo/bin/log_instance_stats.sh', roles=[comp])
511+
execute(fab.chmod, 755, '~/sciflo/bin/log_instance_stats.sh', roles=[comp])
512+
bar.update()
513+
488514
# update supervisor config
489515
set_bar_desc(bar, 'Updating supervisor config')
490516
execute(fab.rm_rf, '~/sciflo/etc/supervisord.conf', roles=[comp])
@@ -600,6 +626,14 @@ def update_factotum(conf, ndeps=False, config_only=False, comp='factotum'):
600626
'~/verdi/ops/chimera', ndeps, roles=[comp])
601627
bar.update()
602628

629+
# Copy script wrappers for PyPI compatibility
630+
set_bar_desc(bar, 'Installing script wrappers')
631+
wrapper_src = execute(fab.get_package_resource_path, 'hysds', 'scripts/log_instance_stats.sh',
632+
remote=True, resource_type='file', roles=[comp])
633+
execute(fab.copy, wrapper_src[comp], '~/verdi/bin/log_instance_stats.sh', roles=[comp])
634+
execute(fab.chmod, 755, '~/verdi/bin/log_instance_stats.sh', roles=[comp])
635+
bar.update()
636+
603637
# update celery config
604638
set_bar_desc(bar, 'Updating celery config')
605639
execute(fab.rm_rf, '~/verdi/ops/hysds/celeryconfig.py', roles=[comp])
@@ -720,6 +754,15 @@ def update_verdi(conf, ndeps=False, config_only=False, comp='verdi'):
720754
execute(fab.send_celeryconf, 'verdi', roles=[comp])
721755
bar.update()
722756

757+
# Copy script wrappers for PyPI compatibility
758+
set_bar_desc(bar, 'Installing script wrappers')
759+
wrapper_src = execute(fab.get_package_resource_path, 'hysds', 'scripts/log_instance_stats.sh',
760+
remote=True, resource_type='file', roles=[comp])
761+
execute(fab.copy, wrapper_src[comp], '~/verdi/bin/log_instance_stats.sh', roles=[comp])
762+
execute(fab.chmod, 755, '~/verdi/bin/log_instance_stats.sh', roles=[comp])
763+
bar.update()
764+
765+
723766
# update supervisor config
724767
set_bar_desc(bar, 'Updating supervisor config')
725768
execute(fab.rm_rf, '~/verdi/etc/supervisord.conf', roles=[comp])
@@ -753,6 +796,11 @@ def update_verdi(conf, ndeps=False, config_only=False, comp='verdi'):
753796
execute(fab.ln_sf, '~/verdi/log', '/data/work/log', roles=[comp])
754797
bar.update()
755798

799+
# Create ops/hysds directory for PyPI compatibility (needed for factotum supervisord)
800+
set_bar_desc(bar, 'Creating ops directories')
801+
execute(fab.mkdir, '~/verdi/ops/hysds', None, None, roles=[comp])
802+
bar.update()
803+
756804
# ship netrc
757805
netrc = os.path.join(get_user_files_path(), 'netrc')
758806
if os.path.exists(netrc):
@@ -851,6 +899,11 @@ def ship_verdi(conf, encrypt=False, comp='mozart'):
851899
execute(fab.ensure_venv, comp, roles=[comp])
852900
bar.update()
853901

902+
# Create ops/hysds directory for PyPI compatibility (included in code bundles)
903+
set_bar_desc(bar, 'Creating ops directories')
904+
execute(fab.mkdir, '~/verdi/ops/hysds', None, None, roles=[comp])
905+
bar.update()
906+
854907
# iterate over queues
855908
for queue in queues:
856909

0 commit comments

Comments
 (0)