Skip to content

Commit

Permalink
Remove ramdisk config
Browse files Browse the repository at this point in the history
  • Loading branch information
yhaliaw committed Jun 19, 2023
1 parent 7e66bd0 commit a8959f6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 16 deletions.
6 changes: 0 additions & 6 deletions config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
13 changes: 3 additions & 10 deletions src/charm.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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:
Expand All @@ -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])
Expand Down

0 comments on commit a8959f6

Please sign in to comment.