async def METHOD_NAME(
    docker_swarm: None,
    sidecar_computational_shared_volume: dict[str, Any],
    async_docker_client: aiodocker.Docker,
    image_name: str,
    sidecar_envs: dict[str, str],
    sidecar_mounts: list[dict[str, Any]],
    create_docker_service: Callable[..., Awaitable[dict[str, Any]]],
):
    scheduler_service = await create_docker_service(
        task_template={
            "ContainerSpec": {
                "Image": image_name,
                "Env": sidecar_envs | {"DASK_START_AS_SCHEDULER": "1"},
                "Init": True,
                "Mounts": sidecar_mounts,
            }
        },
        endpoint_spec={"Ports": [{"PublishedPort": 8786, "TargetPort": 8786}]},
        name="pytest_dask_scheduler",
    )
    await _wait_for_service_to_be_ready(
        async_docker_client, scheduler_service["Spec"]["Name"]
    )
    sidecar_service = await create_docker_service(
        task_template={
            "ContainerSpec": {
                "Image": image_name,
                "Env": sidecar_envs
                | {"DASK_SCHEDULER_URL": f"tcp://{get_localhost_ip()}:8786"},
                "Init": True,
                "Mounts": sidecar_mounts,
            }
        },
        name="pytest_dask_sidecar",
    )
    await _wait_for_service_to_be_ready(
        async_docker_client, sidecar_service["Spec"]["Name"]
    )