From a107048a138b5218bba58341744202230c74676a Mon Sep 17 00:00:00 2001 From: superstar54 Date: Sat, 6 May 2023 15:42:19 +0200 Subject: [PATCH 1/3] add remote port forwarding --- aiidalab_launch/__main__.py | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/aiidalab_launch/__main__.py b/aiidalab_launch/__main__.py index 9cce1fa..e2151b5 100644 --- a/aiidalab_launch/__main__.py +++ b/aiidalab_launch/__main__.py @@ -45,6 +45,11 @@ ssh {user}@{hostname} -NfL {port}:localhost:{port} +If you visit the remote machine through a jump server, you run (replace the J_IP with the jump server IP): + + ssh -J {user}@J_IP {user}@{hostname} -NfL {port}:localhost:{port} + + on your local computer, then open AiiDAlab on your local computer at {url} @@ -87,7 +92,7 @@ def callback(ctx, param, value): # noqa: U100 )(cmd) -@click.group(context_settings={"help_option_names": ["-h", "--help"]}) +@click.group() @click.option( "-v", "--verbose", @@ -351,6 +356,7 @@ async def _async_start( configuration_changed = False try: + InstanceStatus = instance.AiidaLabInstanceStatus # local alias for brevity status = await instance.status() @@ -415,11 +421,9 @@ async def _async_start( raise click.ClickException(f"Unknown error occurred: {error}") else: if wait: - logging_level = logging.getLogger().getEffectiveLevel() try: with spinner("Waiting for AiiDAlab instance to get ready..."): - if logging_level == logging.DEBUG: - echo_logs = asyncio.create_task(instance.echo_logs()) + echo_logs = asyncio.create_task(instance.echo_logs()) await asyncio.wait_for(instance.wait_for_services(), timeout=wait) except asyncio.TimeoutError: raise click.ClickException( @@ -436,8 +440,7 @@ async def _async_start( else: LOGGER.debug("AiiDAlab instance ready.") finally: - if logging_level == logging.DEBUG: - echo_logs.cancel() + echo_logs.cancel() LOGGER.debug("Preparing startup message.") msg_startup = ( From 1b44d0ec2c0aac3bba5d5ecc6342b0d410cc199d Mon Sep 17 00:00:00 2001 From: superstar54 Date: Sat, 6 May 2023 15:44:35 +0200 Subject: [PATCH 2/3] update md --- ssh-forward.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/ssh-forward.md b/ssh-forward.md index a57b6e7..3d22d26 100644 --- a/ssh-forward.md +++ b/ssh-forward.md @@ -26,4 +26,11 @@ This can be easily achieved by creating an SSH tunnel and forwarding the AiiDAla $ ssh user@my-server.org -NfL 8888:localhost:8888 ``` + If you visit the remote machine through a jump server, you run (replace the J_IP with the jump server IP): + + ```console + $ ssh -J {user}@J_IP {user}@{hostname} -NfL {port}:localhost:{port} + ``` + + 5. Finally, open AiiDAlab in the browser of your local machine via the URL provided earlier, something like: http://localhost:8888/?token=74647d5fe0... From f9faa7cf268724545aa567f775e8be68383266c5 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Sat, 6 May 2023 13:46:06 +0000 Subject: [PATCH 3/3] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- aiidalab_launch/__main__.py | 1 - 1 file changed, 1 deletion(-) diff --git a/aiidalab_launch/__main__.py b/aiidalab_launch/__main__.py index e2151b5..18ac54e 100644 --- a/aiidalab_launch/__main__.py +++ b/aiidalab_launch/__main__.py @@ -356,7 +356,6 @@ async def _async_start( configuration_changed = False try: - InstanceStatus = instance.AiidaLabInstanceStatus # local alias for brevity status = await instance.status()