Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Core] Fix docker in image_id #3481

Merged
merged 4 commits into from
Apr 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions sky/provision/docker_utils.py
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we fix that for node providers as well?

self.run(
'sudo jq \'.["exec-opts"] = ["native.cgroupdriver=cgroupfs"]\' '
'/etc/docker/daemon.json > /tmp/daemon.json;'
'sudo mv /tmp/daemon.json /etc/docker/daemon.json;'
'sudo systemctl restart docker',
run_env='host')

Original file line number Diff line number Diff line change
Expand Up @@ -166,8 +166,7 @@ def _run(self,
rc,
cmd,
error_msg='Failed to run docker setup commands',
stderr=stdout + stderr,
stream_logs=False)
stderr=stdout + stderr)
return stdout.strip()

def initialize(self) -> str:
Expand Down Expand Up @@ -231,6 +230,8 @@ def initialize(self) -> str:
# issue with nvidia container toolkit:
# https://github.com/NVIDIA/nvidia-container-toolkit/issues/48
self._run(
'[ -f /etc/docker/daemon.json ] || '
'echo "{}" | sudo tee /etc/docker/daemon.json;'
'sudo jq \'.["exec-opts"] = ["native.cgroupdriver=cgroupfs"]\' '
'/etc/docker/daemon.json > /tmp/daemon.json;'
'sudo mv /tmp/daemon.json /etc/docker/daemon.json;'
Expand Down
2 changes: 2 additions & 0 deletions sky/skylet/providers/command_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,8 @@ def run_init(self, *, as_head: bool, file_mounts: Dict[str, str],
# issue with nvidia container toolkit:
# https://github.com/NVIDIA/nvidia-container-toolkit/issues/48
self.run(
'[ -f /etc/docker/daemon.json ] || '
'echo "{}" | sudo tee /etc/docker/daemon.json;'
'sudo jq \'.["exec-opts"] = ["native.cgroupdriver=cgroupfs"]\' '
'/etc/docker/daemon.json > /tmp/daemon.json;'
'sudo mv /tmp/daemon.json /etc/docker/daemon.json;'
Expand Down
1 change: 1 addition & 0 deletions tests/test_smoke.py
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this fix does not works for k8s?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is unrelated to the test_docker_preinstalled_package for k8s. That one is probably because we did not install the required packages in the docker container.

Original file line number Diff line number Diff line change
Expand Up @@ -1464,6 +1464,7 @@ def test_ibm_job_queue_multinode():
@pytest.mark.no_scp # Doesn't support SCP for now
@pytest.mark.no_oci # Doesn't support OCI for now
@pytest.mark.no_kubernetes # Doesn't support Kubernetes for now
# TODO(zhwu): we should fix this for kubernetes
def test_docker_preinstalled_package(generic_cloud: str):
name = _get_cluster_name()
test = Test(
Expand Down
Loading