diff --git a/podman_compose.py b/podman_compose.py index 726eaa9..b2c36bc 100755 --- a/podman_compose.py +++ b/podman_compose.py @@ -1189,6 +1189,10 @@ async def container_to_args(compose, cnt, detached=True, no_deps=False): if cnt.get("runtime"): podman_args.extend(["--runtime", cnt["runtime"]]) + cpuset = cnt.get("cpuset") + if cpuset is not None: + podman_args.extend(["--cpuset-cpus", cpuset]) + # WIP: healthchecks are still work in progress healthcheck = cnt.get("healthcheck", {}) if not isinstance(healthcheck, dict): diff --git a/tests/unit/test_container_to_args.py b/tests/unit/test_container_to_args.py index beb21ca..f241cb5 100644 --- a/tests/unit/test_container_to_args.py +++ b/tests/unit/test_container_to_args.py @@ -612,3 +612,21 @@ class TestContainerToArgs(unittest.IsolatedAsyncioTestCase): "busybox", ], ) + + async def test_cpuset(self): + c = create_compose_mock() + cnt = get_minimal_container() + cnt["cpuset"] = "0-1" + + args = await container_to_args(c, cnt) + self.assertEqual( + args, + [ + "--name=project_name_service_name1", + "-d", + "--network=bridge:alias=service_name", + "--cpuset-cpus", + "0-1", + "busybox", + ], + )