diff --git a/sdk/pyproject.toml b/sdk/pyproject.toml index 0606e8590..6e8004ec2 100644 --- a/sdk/pyproject.toml +++ b/sdk/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "beta9" -version = "0.1.180" +version = "0.1.181" description = "" authors = ["beam.cloud "] packages = [ diff --git a/sdk/src/beta9/abstractions/pod.py b/sdk/src/beta9/abstractions/pod.py index 6038a694a..5907818b6 100644 --- a/sdk/src/beta9/abstractions/pod.py +++ b/sdk/src/beta9/abstractions/pod.py @@ -299,6 +299,7 @@ def cleanup_deployment_artifacts(self): @with_grpc_error_handling def shell(self, url_type: str = ""): + self.authorized = True stub_type = SHELL_STUB_TYPE if not self.prepare_runtime(stub_type=stub_type, force_create_stub=True): diff --git a/sdk/src/beta9/abstractions/shell.py b/sdk/src/beta9/abstractions/shell.py index 1ca1af596..48d639d32 100644 --- a/sdk/src/beta9/abstractions/shell.py +++ b/sdk/src/beta9/abstractions/shell.py @@ -55,6 +55,9 @@ def wait_for_ok(sock: socket.socket, max_retries: int = 5, delay: float = 0.25): raise ConnectionError(f"Failed to setup socket after {max_retries} retries") +EXIT_STATUS_CTRL_C = 130 + + @dataclass class SSHShell: """Interactive ssh shell that can be used as a context manager - for use with 'shell' command""" @@ -136,7 +139,7 @@ def start(self): # Check the exit status after the shell session ends exit_status = self.channel.recv_exit_status() - if exit_status != 0: + if exit_status != 0 and exit_status != EXIT_STATUS_CTRL_C: terminal.warn("Lost connection to shell, attempting to reconnect in 5 seconds...") time.sleep(5) diff --git a/sdk/src/beta9/abstractions/volume.py b/sdk/src/beta9/abstractions/volume.py index 32a5492b8..a4fd43643 100644 --- a/sdk/src/beta9/abstractions/volume.py +++ b/sdk/src/beta9/abstractions/volume.py @@ -85,9 +85,9 @@ class CloudBucketConfig: read_only (bool): Whether the volume is read-only. access_key (str): - The name of the beam secret containing the S3 access key for the external provider. + The name of the secret containing the S3 access key for the external provider. secret_key (str): - The name of the beam secret containing the S3 secret key for the external provider. + The name of the secret containing the S3 secret key for the external provider. endpoint (Optional[str]): The S3 endpoint for the external provider. region (Optional[str]): diff --git a/sdk/src/beta9/terminal.py b/sdk/src/beta9/terminal.py index 37a95ccf4..27943667a 100644 --- a/sdk/src/beta9/terminal.py +++ b/sdk/src/beta9/terminal.py @@ -197,7 +197,7 @@ def reset_terminal() -> None: def progress_description(name: str, max_width: Optional[int] = None): max_desc_width = max_width or len(name) if len(name) > max_desc_width: - text = f"...{name[-(max_desc_width - 3):]}" + text = f"...{name[-(max_desc_width - 3) :]}" else: text = name.ljust(max_desc_width)