From 0a6710a8672c994505e3827b6d6dab4786d26626 Mon Sep 17 00:00:00 2001 From: nhertz <nhertz@nrao.edu> Date: Thu, 16 Sep 2021 13:24:25 -0600 Subject: [PATCH] Updated CARTA command and CARTA path to use appropriate settings for new CARTA AppImage --- .../pexable/carta_envoy/carta_envoy/carta.py | 5 ++- .../carta_envoy/carta_envoy/launchers.py | 34 +++++++------------ 2 files changed, 14 insertions(+), 25 deletions(-) diff --git a/apps/cli/executables/pexable/carta_envoy/carta_envoy/carta.py b/apps/cli/executables/pexable/carta_envoy/carta_envoy/carta.py index 8166a84ea..2908ae034 100644 --- a/apps/cli/executables/pexable/carta_envoy/carta_envoy/carta.py +++ b/apps/cli/executables/pexable/carta_envoy/carta_envoy/carta.py @@ -37,7 +37,7 @@ def _get_settings(location: str) -> Dict: return { "timeout": carta_settings.timeoutInMinutes, - "carta_path": "/opt/local/stow/carta/carta-2.0/CARTA-v2.0-redhat.AppImage", + "carta_path": "/home/ssa/bin/CARTA-2.0-no_runtime_config.AppImage", "redis_host": carta_settings.redisHost, "redis_port": carta_settings.redisPort, "redis_password": carta_settings.redisPassword, @@ -133,8 +133,7 @@ def make_arg_parser() -> argparse.ArgumentParser: "--single", action="store_true", required=False, - help="allow CARTA envoy to launch with specified image" - " (Use when data must be retrieved for viewing)", + help="allow CARTA envoy to launch with specified image" " (Use when data must be retrieved for viewing)", ) parser.add_argument( "-wf", diff --git a/apps/cli/executables/pexable/carta_envoy/carta_envoy/launchers.py b/apps/cli/executables/pexable/carta_envoy/carta_envoy/launchers.py index 6937e723f..0181b0e87 100644 --- a/apps/cli/executables/pexable/carta_envoy/carta_envoy/launchers.py +++ b/apps/cli/executables/pexable/carta_envoy/carta_envoy/launchers.py @@ -134,7 +134,7 @@ class CartaLauncher: :param path_to_carta: Path to CARTA executable :param timeout_minutes: Number of minutes to execute CARTA for before stopping it :param file_browser_path: Path to use for CARTA file browser - :param back_end_port: Port to run the CARTA back end with + :param session_port: Port to run the CARTA session with :param wrapper_port: Port to run the CARTA wrapper with :param carta_url: URL used to access CARTA from a web browser :param wrapper_url: URL used to access CARTA wrapper from a web browser @@ -144,14 +144,10 @@ class CartaLauncher: self.logger.info(f"file_browser_path: {file_browser_path}") if not file_browser_path.exists(): - self.logger.error( - f"ERROR: Invalid file browser path. {file_browser_path}: Directory does not exist." - ) + self.logger.error(f"ERROR: Invalid file browser path. {file_browser_path}: Directory does not exist.") return elif not file_browser_path.is_dir(): - self.logger.error( - f"ERROR: Invalid file browser path. {file_browser_path}: Path is not a directory." - ) + self.logger.error(f"ERROR: Invalid file browser path. {file_browser_path}: Path is not a directory.") return if self.settings["useCarta"]: @@ -159,9 +155,11 @@ class CartaLauncher: carta_command = [ path_to_carta, "--no-browser", # 2.0 setting: don't automatically try to open browser - f"--port={str(session_port)}", - f"--top_level_folder={file_browser_path}", - {file_browser_path}, + "--debug_no_auth", # No tokenized authorization + "--no_runtime_config", # Don't send runtime config object to CARTA front-end (fixes a bug) + f"--port={session_port!s}", + f"--top_level_folder={file_browser_path!s}", + f"{file_browser_path!s}", ] try: CARTA_PROCESS = subprocess.Popen( @@ -175,9 +173,7 @@ class CartaLauncher: self.teardown() sys.exit(f"ERROR: Failed to launch CARTA: {err}") else: - CartaWrapperLauncher.deploy_wrapper_html( - file_browser_path, carta_url, session_timeout_date - ) + CartaWrapperLauncher.deploy_wrapper_html(file_browser_path, carta_url, session_timeout_date) # CARTA is running and accessible, so send CARTA URL to AAT system or notify user self.notify_ready(wrapper_url) @@ -185,14 +181,10 @@ class CartaLauncher: # Activate timeout handler signal.signal(signal.SIGALRM, self.signal) signal.alarm(60 * timeout_minutes) - self.logger.info( - f"To access CARTA, enter this URL into a web browser: {wrapper_url}" - ) + self.logger.info(f"To access CARTA, enter this URL into a web browser: {wrapper_url}") self.logger.info("Press Ctrl+C to quit.") - wrapper_server_thread = Thread( - target=CartaWrapperLauncher.run, args=[wrapper_port], daemon=True - ) + wrapper_server_thread = Thread(target=CartaWrapperLauncher.run, args=[wrapper_port], daemon=True) wrapper_server_thread.run() # Loop until process ends or timeout elapses, whichever happens first @@ -256,9 +248,7 @@ class CartaLauncher: timeout_hours, timeout_remainder = math.modf(timeout_minutes / 60) timeout_hours = int(timeout_hours) timeout_minutes = int(timeout_remainder * 60) - logger.info( - f"Timeout longer than 1 hour. Splitting into {timeout_hours}:{timeout_minutes}" - ) + logger.info(f"Timeout longer than 1 hour. Splitting into {timeout_hours}:{timeout_minutes}") timeout_date = pendulum.now().add(hours=timeout_hours, minutes=timeout_minutes) else: timeout_date = pendulum.now().add(minutes=timeout_minutes) -- GitLab