From a8959f6fc4ebb38e91e378114841a5d7a8e1d2ef Mon Sep 17 00:00:00 2001 From: Andrew Liaw <43424755+yhaliaw@users.noreply.github.com> Date: Mon, 19 Jun 2023 11:40:52 +0800 Subject: [PATCH] Remove ramdisk config --- config.yaml | 6 ------ src/charm.py | 13 +++---------- 2 files changed, 3 insertions(+), 16 deletions(-) diff --git a/config.yaml b/config.yaml index cc930ffb9..9870c47d7 100644 --- a/config.yaml +++ b/config.yaml @@ -41,12 +41,6 @@ options: description: > Amount of disk space to allocate to root disk for virtual machine runner. Positive integers with KiB, MiB, GiB, TiB, PiB, EiB suffix. - ram-disk: - type: boolean - default: false - description: > - Whether to use system memory as the disk for the runners. The amount of memory allocated for - this would be the disk space per runner multiple by the number of runners. reconcile-interval: type: int default: 10 diff --git a/src/charm.py b/src/charm.py index 6962b73a2..99600e485 100755 --- a/src/charm.py +++ b/src/charm.py @@ -32,12 +32,7 @@ from github_type import GitHubRunnerStatus from runner_manager import RunnerManager, RunnerManagerConfig from runner_type import GitHubOrg, GitHubRepo, ProxySetting, VirtualMachineResources -from utilities import ( - execute_command, - get_env_var, - retry, - secure_run_subprocess, -) +from utilities import execute_command, get_env_var, retry, secure_run_subprocess if TYPE_CHECKING: from ops.model import JsonObject # pragma: no cover @@ -160,7 +155,7 @@ def __init__(self, *args, **kargs) -> None: self.framework.observe(self.on.flush_runners_action, self._on_flush_runners_action) self.framework.observe(self.on.update_runner_bin_action, self._on_update_runner_bin) - def _ensure_ramdisk_lvm_volume_group_exist(self, size: int = 10485760) -> str: + def _ensure_ramdisk_lvm_volume_group_exist(self) -> str: """Create a ramdisk as a LVM volume group if needed. Args: @@ -171,12 +166,10 @@ def _ensure_ramdisk_lvm_volume_group_exist(self, size: int = 10485760) -> str: """ vg_name = "ramdisk_pool" - # execute_command(["rmmod", "brd"]) - # Check if ramdisk at /dev/ram0 exists. result = secure_run_subprocess(["test", "-e", "/dev/ram0"]) if result.returncode != 0: - execute_command(["modprobe", "brd", f"rd_size={size}", "rd_nr=1"]) + execute_command(["modprobe", "brd", "rd_nr=1"]) # Check if volume group exits. result = secure_run_subprocess(["vgdisplay", vg_name])