|
|
@@ -5,8 +5,9 @@ def get_remote_startup_command(
|
|
|
user_id: int,
|
|
|
plugin_args: list[str],
|
|
|
browsergym_args: list[str],
|
|
|
+ is_root: bool = False,
|
|
|
):
|
|
|
- return [
|
|
|
+ base_cmd = [
|
|
|
'/openhands/micromamba/bin/micromamba',
|
|
|
'run',
|
|
|
'-n',
|
|
|
@@ -27,3 +28,18 @@ def get_remote_startup_command(
|
|
|
str(user_id),
|
|
|
*browsergym_args,
|
|
|
]
|
|
|
+
|
|
|
+ if is_root:
|
|
|
+ # If running as root, set highest priority and lowest OOM score
|
|
|
+ cmd_str = ' '.join(base_cmd)
|
|
|
+ return [
|
|
|
+ 'nice',
|
|
|
+ '-n',
|
|
|
+ '-20', # Highest priority
|
|
|
+ 'sh',
|
|
|
+ '-c',
|
|
|
+ f'echo -1000 > /proc/self/oom_score_adj && exec {cmd_str}'
|
|
|
+ ]
|
|
|
+ else:
|
|
|
+ # If not root, run with normal priority
|
|
|
+ return base_cmd
|