Merge pull request #7532 from dannon/plugin-staging

Static plugin staging as a part of client build instead of startup
This commit is contained in:
John Chilton
2019-03-20 13:47:17 -04:00
committed by GitHub
7 changed files with 598 additions and 642 deletions
-3
View File
@@ -256,7 +256,4 @@ if [ $SKIP_CLIENT_BUILD -eq 0 ]; then
exit 1
fi
cd -
else
echo "Regenerating static plugin directories."
python ./scripts/plugin_staging.py
fi
+1 -3
View File
@@ -93,9 +93,7 @@ def _get_uwsgi_args(cliargs, kwargs):
'static-map': ('/static/style={here}/static/style/blue'.format(here=os.getcwd()),
'/static={here}/static'.format(here=os.getcwd()),
'/favicon.ico={here}/static/favicon.ico'.format(here=os.getcwd())),
'static-safe': ('{here}/config/plugins/visualizations'.format(here=os.getcwd()),
'{here}/client/galaxy/images'.format(here=os.getcwd()),
'{here}/config/plugins/interactive_environments'.format(here=os.getcwd())),
'static-safe': ('{here}/client/galaxy/images'.format(here=os.getcwd())),
'die-on-term': True,
'enable-threads': True,
'hook-master-start': ('unix_signal:2 gracefully_kill_them_all',
+7 -5
View File
@@ -7,7 +7,7 @@ import shutil
GXY_ROOT = os.path.abspath(os.path.join(os.path.dirname(os.path.realpath(__file__)), os.pardir))
def link_up_static(f):
def stage_static(f):
src = os.path.join(GXY_ROOT, 'config/plugins', f)
dest = os.path.join(GXY_ROOT, 'static/plugins', f)
dest_parent = os.path.abspath(os.path.join(dest, os.pardir))
@@ -18,12 +18,14 @@ def link_up_static(f):
else:
shutil.rmtree(dest)
elif not os.path.exists(dest_parent):
# Create parent dir structure to symlink directly to static.
os.makedirs(dest_parent)
try:
os.symlink(src, dest)
if os.path.isdir(src):
shutil.copytree(src, dest)
else:
shutil.copy(src, dest)
except Exception:
print("Error symlinking '%s' to '%s'" % (src, dest))
print("Error copying '%s' to '%s'" % (src, dest))
raise
@@ -31,4 +33,4 @@ if __name__ == "__main__":
# This is not awesome, but it's temporary, and it supports two-tier plugin static.
for f in glob.glob(os.path.join(GXY_ROOT, 'config/plugins/*/*/static')) + glob.glob(os.path.join(GXY_ROOT, 'config/plugins/*/*/*/static')):
f = os.path.relpath(f, os.path.join(GXY_ROOT, 'config/plugins'))
link_up_static(f)
stage_static(f)