From 88d57655f287f6e34f1ec8aa3756e351f773d14f Mon Sep 17 00:00:00 2001 From: yhaliaw <43424755+yhaliaw@users.noreply.github.com> Date: Mon, 29 Jan 2024 12:52:21 +0800 Subject: [PATCH] Allow root disk as runner-storage --- docs/how-to/configure-runner-storage.md | 1 - src/charm.py | 18 ------------------ 2 files changed, 19 deletions(-) diff --git a/docs/how-to/configure-runner-storage.md b/docs/how-to/configure-runner-storage.md index 75b119a46..68333c16d 100644 --- a/docs/how-to/configure-runner-storage.md +++ b/docs/how-to/configure-runner-storage.md @@ -30,4 +30,3 @@ juju deploy github-runner --constraints="cores=4 mem=6G root-disk=30G virt-type= ``` The above example uses `rootfs`, which is using the root disk of the juju machine. Hence the root-disk size was increase to 30G. -In production environment, a separated storage managed by juju should be used. See [how to manage juju storage](https://juju.is/docs/juju/manage-storage). diff --git a/src/charm.py b/src/charm.py index a058a85ac..e0755b4c8 100755 --- a/src/charm.py +++ b/src/charm.py @@ -232,16 +232,6 @@ def _create_memory_storage(self, path: Path, size: int) -> None: logger.info("Cleaned up storage directory") raise RunnerError("Failed to configure runner storage") from err - def _juju_storage_mounted(self) -> bool: - """Whether a juju storage is mounted on the runner-storage location. - - Returns: - True if a juju storage is mounted on the runner-storage location. - """ - # Use `mount` as Python does not have easy method to get the mount points. - stdout, exit_code = execute_command(["mountpoint", str(self.juju_storage_path)], False) - return exit_code == 0 and str(self.juju_storage_path) in stdout - @retry(tries=5, delay=15, max_delay=60, backoff=1.5, local_logger=logger) def _ensure_runner_storage(self, size: int) -> Path: """Ensure the runner storage is setup. @@ -258,15 +248,7 @@ def _ensure_runner_storage(self, size: int) -> Path: path = self.ram_pool_path self._create_memory_storage(self.ram_pool_path, size) case RunnerStorage.JUJU_STORAGE: - logger.info("Verifying juju storage") path = self.juju_storage_path - if not self._juju_storage_mounted(): - raise ConfigurationError( - ( - "Non-root disk storage should be mount on the runner juju storage to " - "be used as the disk for the runners" - ) - ) # tmpfs storage is not created if required size is 0. if size > 0: