From 13501e2e30987010e04c728b713b820a8acd3471 Mon Sep 17 00:00:00 2001 From: Romil Bhardwaj Date: Mon, 30 Dec 2024 13:04:13 -0800 Subject: [PATCH] [Core] Deprecate LocalDockerBackend (#4516) Deprecate local docker backend --- examples/local_docker/docker_in_docker.yaml | 19 ------------------ examples/local_docker/ping.py | 22 --------------------- examples/local_docker/ping.yaml | 19 ------------------ sky/cli.py | 11 +++++++++-- 4 files changed, 9 insertions(+), 62 deletions(-) delete mode 100644 examples/local_docker/docker_in_docker.yaml delete mode 100644 examples/local_docker/ping.py delete mode 100644 examples/local_docker/ping.yaml diff --git a/examples/local_docker/docker_in_docker.yaml b/examples/local_docker/docker_in_docker.yaml deleted file mode 100644 index bdb6ed70ecf..00000000000 --- a/examples/local_docker/docker_in_docker.yaml +++ /dev/null @@ -1,19 +0,0 @@ -# Runs a docker container as a SkyPilot task. -# -# This demo can be run using the --docker flag, demonstrating the -# docker-in-docker (dind) capabilities of SkyPilot docker mode. -# -# Usage: -# sky launch --docker -c dind docker_in_docker.yaml -# sky down dind - -name: dind - -resources: - cloud: aws - -setup: | - echo "No setup required!" - -run: | - docker run --rm hello-world diff --git a/examples/local_docker/ping.py b/examples/local_docker/ping.py deleted file mode 100644 index c3a90c62243..00000000000 --- a/examples/local_docker/ping.py +++ /dev/null @@ -1,22 +0,0 @@ -"""An example app which pings localhost. - -This script is designed to demonstrate the use of different backends with -SkyPilot. It is useful to support a LocalDockerBackend that users can use to -debug their programs even before they run them on the Sky. -""" - -import sky - -# Set backend here. It can be either LocalDockerBackend or CloudVmRayBackend. -backend = sky.backends.LocalDockerBackend( -) # or sky.backends.CloudVmRayBackend() - -with sky.Dag() as dag: - resources = sky.Resources(accelerators={'K80': 1}) - setup_commands = 'apt-get update && apt-get install -y iputils-ping' - task = sky.Task(run='ping 127.0.0.1 -c 100', - docker_image='ubuntu', - setup=setup_commands, - name='ping').set_resources(resources) - -sky.launch(dag, backend=backend) diff --git a/examples/local_docker/ping.yaml b/examples/local_docker/ping.yaml deleted file mode 100644 index 0d0efd12419..00000000000 --- a/examples/local_docker/ping.yaml +++ /dev/null @@ -1,19 +0,0 @@ -# A minimal ping example. -# -# Runs a task that pings localhost 100 times. -# -# Usage: -# sky launch --docker -c ping ping.yaml -# sky down ping - -name: ping - -resources: - cloud: aws - -setup: | - sudo apt-get update --allow-insecure-repositories - sudo apt-get install -y iputils-ping - -run: | - ping 127.0.0.1 -c 100 diff --git a/sky/cli.py b/sky/cli.py index 5d4f07d535f..d00aae9b646 100644 --- a/sky/cli.py +++ b/sky/cli.py @@ -998,8 +998,10 @@ def cli(): @click.option('--docker', 'backend_name', flag_value=backends.LocalDockerBackend.NAME, - default=False, - help='If used, runs locally inside a docker container.') + hidden=True, + help=('(Deprecated) Local docker support is deprecated. ' + 'To run locally, create a local Kubernetes cluster with ' + '``sky local up``.')) @_add_click_options(_TASK_OPTIONS_WITH_NAME + _EXTRA_RESOURCES_OPTIONS) @click.option( '--idle-minutes-to-autostop', @@ -1142,6 +1144,11 @@ def launch( backend: backends.Backend if backend_name == backends.LocalDockerBackend.NAME: backend = backends.LocalDockerBackend() + click.secho( + 'WARNING: LocalDockerBackend is deprecated and will be ' + 'removed in a future release. To run locally, create a local ' + 'Kubernetes cluster with `sky local up`.', + fg='yellow') elif backend_name == backends.CloudVmRayBackend.NAME: backend = backends.CloudVmRayBackend() else: