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

[k8s] Disable autostop for controller on kubernetes #3521

Merged
merged 96 commits into from
May 8, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
96 commits
Select commit Hold shift + click to select a range
34598a2
playing around
romilbhardwaj Feb 1, 2024
95b1eb0
wip with hacks
romilbhardwaj Feb 2, 2024
f93e6dd
wip refactor get_endpoints
romilbhardwaj Feb 5, 2024
c8276bb
working get_endpoints
romilbhardwaj Feb 6, 2024
c713293
wip
romilbhardwaj Feb 6, 2024
aa286e8
fixed circular import
romilbhardwaj Feb 6, 2024
9f768a2
Working for ingress and loadbalancer svc
romilbhardwaj Feb 6, 2024
1848b3a
lint
romilbhardwaj Feb 7, 2024
ba0ff60
add purging from #3094
romilbhardwaj Feb 15, 2024
13f7241
Use local catalog on the controller too
romilbhardwaj Feb 15, 2024
996742a
use externalip if available
romilbhardwaj Feb 19, 2024
7c8b5cd
Merge branch 'master' of https://github.com/skypilot-org/skypilot int…
romilbhardwaj Feb 20, 2024
b222186
Merge branch 'master' of https://github.com/skypilot-org/skypilot int…
romilbhardwaj Feb 23, 2024
d852c61
add dshm_size_limit
romilbhardwaj Feb 23, 2024
b9014df
optimize dependency installation
romilbhardwaj Feb 23, 2024
282bcef
Add todo
romilbhardwaj Feb 24, 2024
d10fb24
Merge branch 'master' of https://github.com/skypilot-org/skypilot int…
romilbhardwaj Feb 28, 2024
3cb948f
optimize ingress
romilbhardwaj Mar 2, 2024
4a7e10a
fix
romilbhardwaj Mar 2, 2024
9e0d910
fix
romilbhardwaj Mar 2, 2024
9e51793
Merge branch 'k8s_ingress_optimization' of https://github.com/skypilo…
romilbhardwaj Mar 3, 2024
68bb6e8
remove autostop timing
romilbhardwaj Mar 4, 2024
b72a814
Fix URLs for raw IP:ports
romilbhardwaj Mar 5, 2024
a22b6d3
fixes
romilbhardwaj Mar 7, 2024
4637f91
wip
romilbhardwaj Mar 7, 2024
d27ae5f
SA wip
romilbhardwaj Mar 7, 2024
cdc2e3f
Allow use of service accounts through remote_identity field
romilbhardwaj Mar 8, 2024
643fb77
Make purge work for no clusters in kubeconfig
romilbhardwaj Mar 8, 2024
7649fcb
Handle ingress namespace not present
romilbhardwaj Mar 8, 2024
8c76eb6
setup optimizations and critical SA key fix
romilbhardwaj Mar 8, 2024
2e20600
fix docs
romilbhardwaj Mar 16, 2024
de6a99c
fix docs
romilbhardwaj Mar 16, 2024
03e44eb
Add support for skypilot.co/external-ip annotation for ingress
romilbhardwaj Mar 24, 2024
7436a7e
Remove dshm_size_limit
romilbhardwaj Mar 25, 2024
3cc5352
Undo kind changes
romilbhardwaj Mar 25, 2024
d836f17
Update service account docs
romilbhardwaj Mar 25, 2024
1b559d2
minor docs
romilbhardwaj Mar 25, 2024
cda27b2
update comment
romilbhardwaj Mar 26, 2024
23d730b
is_same_cloud to cloud_in_list
romilbhardwaj Mar 27, 2024
cba92e3
refactor query_ports to use head_ip
romilbhardwaj Mar 27, 2024
789cefe
autodown + http prefixing in callers
romilbhardwaj Mar 27, 2024
55b63de
fix ssh key issues when user hash is reused
romilbhardwaj Mar 27, 2024
73ad2e6
linting
romilbhardwaj Mar 27, 2024
31418d2
lint
romilbhardwaj Mar 27, 2024
0684f2b
lint, HOST_CONTROLLERS
romilbhardwaj Mar 27, 2024
e7f232e
add serve smoke tests for k8s
romilbhardwaj Mar 28, 2024
2a1b916
disallow file_mounts and workdir if no storage cloud is enabled
romilbhardwaj Mar 28, 2024
f242037
minor
romilbhardwaj Mar 28, 2024
9b12cf1
lint
romilbhardwaj Mar 28, 2024
87330bd
Merge branch 'master' of https://github.com/skypilot-org/skypilot int…
romilbhardwaj Mar 28, 2024
3ca5d47
update fastchat to use --host 127.0.0.1
romilbhardwaj Mar 29, 2024
02ef50a
extend timeout
romilbhardwaj Mar 29, 2024
259917f
docs comments
romilbhardwaj Apr 9, 2024
8066a2a
Merge branch 'master' of https://github.com/skypilot-org/skypilot int…
romilbhardwaj Apr 9, 2024
665a12e
rename to port
romilbhardwaj Apr 10, 2024
fcc63fe
add to core.py
romilbhardwaj Apr 10, 2024
df21a0b
docstrs
romilbhardwaj Apr 10, 2024
5d8c9c7
add docs on exec based auth
romilbhardwaj Apr 10, 2024
937feb6
expand elif
romilbhardwaj Apr 10, 2024
33dfb01
add lb comment
romilbhardwaj Apr 10, 2024
87c77df
refactor
romilbhardwaj Apr 11, 2024
99547db
refactor
romilbhardwaj Apr 11, 2024
3d24b41
fix docs build
romilbhardwaj Apr 11, 2024
750d4d4
add PODIP mode support
romilbhardwaj Apr 8, 2024
87d4d25
make ssh services optional
romilbhardwaj Apr 12, 2024
a31a3bc
nits
romilbhardwaj Apr 29, 2024
e3bb4d7
Revert "make ssh services optional"
romilbhardwaj Apr 29, 2024
12096fd
Revert "add PODIP mode support"
romilbhardwaj Apr 29, 2024
c33572e
nits
romilbhardwaj Apr 29, 2024
803df4a
use 0.0.0.0 when on k8s; use common impl for other clouds
romilbhardwaj Apr 29, 2024
a0ba0d1
return dict instead of raising errors in core.endpoints()
romilbhardwaj Apr 29, 2024
fb88218
lint
romilbhardwaj Apr 29, 2024
1d968a6
Merge branch 'master' of https://github.com/skypilot-org/skypilot int…
romilbhardwaj Apr 29, 2024
e22908a
merge fixes
romilbhardwaj Apr 29, 2024
34a719c
merge fixes
romilbhardwaj Apr 29, 2024
017dcb5
Merge branch 'master' of https://github.com/skypilot-org/skypilot int…
romilbhardwaj May 7, 2024
cd08d0f
merge fixes
romilbhardwaj May 7, 2024
05f1996
lint
romilbhardwaj May 7, 2024
97b1d56
fix smoke tests
romilbhardwaj May 7, 2024
9a8ccd1
fix smoke tests
romilbhardwaj May 7, 2024
3b7d33f
comment
romilbhardwaj May 7, 2024
e029ebc
add enum for remote identity
romilbhardwaj May 7, 2024
7b201f2
lint
romilbhardwaj May 7, 2024
f31553b
disable autostop for kubernetes
romilbhardwaj May 8, 2024
8a54faf
add skip_status_check
romilbhardwaj May 8, 2024
5fb4232
remove zone requirement
romilbhardwaj May 8, 2024
2e8afe9
fix timings for test
romilbhardwaj May 8, 2024
29b05aa
Merge branch 'serve_k8s_final' of https://github.com/skypilot-org/sky…
romilbhardwaj May 8, 2024
736e087
silence curl download
romilbhardwaj May 8, 2024
e3768b4
move jq from yaml to test_minimal
romilbhardwaj May 8, 2024
26cc380
move jq from yaml to test_minimal
romilbhardwaj May 8, 2024
3b7b935
add assert
romilbhardwaj May 8, 2024
7658964
lint
romilbhardwaj May 8, 2024
f2b9d48
Merge branch 'serve_k8s_final' of https://github.com/skypilot-org/sky…
romilbhardwaj May 8, 2024
4e3a3cd
lint
romilbhardwaj May 8, 2024
9c09025
Merge branch 'master' of https://github.com/skypilot-org/skypilot int…
romilbhardwaj May 8, 2024
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
15 changes: 14 additions & 1 deletion sky/backends/cloud_vm_ray_backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -1991,9 +1991,17 @@ def provision_with_retries(
cloud_user = None
else:
cloud_user = to_provision.cloud.get_current_user_identity()

requested_features = self._requested_features.copy()
# Skip stop feature for Kubernetes jobs controller.
if isinstance(to_provision.cloud, clouds.Kubernetes) and controller_utils.Controllers.from_name(
cluster_name) == controller_utils.Controllers.JOBS_CONTROLLER:
requested_features.remove(
romilbhardwaj marked this conversation as resolved.
Show resolved Hide resolved
clouds.CloudImplementationFeatures.STOP)

# Skip if to_provision.cloud does not support requested features
to_provision.cloud.check_features_are_supported(
to_provision, self._requested_features)
to_provision, requested_features)

config_dict = self._retry_zones(
to_provision,
Expand Down Expand Up @@ -4045,6 +4053,11 @@ def set_autostop(self,
# The core.autostop() function should have already checked that the
# cloud and resources support requested autostop.
if idle_minutes_to_autostop is not None:
# Skip auto-stop for Kubernetes clusters.
if isinstance(handle.launched_resources.cloud, clouds.Kubernetes):
logger.info('Auto-stop is not supported for Kubernetes '
romilbhardwaj marked this conversation as resolved.
Show resolved Hide resolved
'clusters. Skipping.')
return

# Check if we're stopping spot
assert (handle.launched_resources is not None and
Expand Down
7 changes: 0 additions & 7 deletions sky/clouds/kubernetes.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,13 +71,6 @@ class Kubernetes(clouds.Cloud):
'tiers are not '
'supported in '
'Kubernetes.',
# Kubernetes may be using exec-based auth, which may not work by
# directly copying the kubeconfig file to the controller.
# Support for service accounts for auth will be added in #3377, which
# will allow us to support hosting controllers.
clouds.CloudImplementationFeatures.HOST_CONTROLLERS: 'Kubernetes can '
'not host '
'controllers.',
}

IMAGE_CPU = 'skypilot:cpu-ubuntu-2004'
Expand Down
16 changes: 15 additions & 1 deletion sky/utils/controller_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,21 @@ def _get_cloud_dependencies_installation_commands(
commands.append(
f'echo -en "\\r{prefix_str}Kubernetes{empty_str}" && '
'pip list | grep kubernetes > /dev/null 2>&1 || '
'pip install "kubernetes>=20.0.0" > /dev/null 2>&1')
'pip install "kubernetes>=20.0.0" > /dev/null 2>&1 &&'
# Install k8s + skypilot dependencies
'sudo bash -c "if '
'! command -v curl &> /dev/null || '
'! command -v socat &> /dev/null || '
'! command -v netcat &> /dev/null; '
'then apt update && apt install curl socat netcat -y; '
'fi" && '
# Install kubectl
'(command -v kubectl &>/dev/null || '
'(curl -LO "https://dl.k8s.io/release/'
'$(curl -L -s https://dl.k8s.io/release/stable.txt)'
'/bin/linux/amd64/kubectl" && '
'sudo install -o root -g root -m 0755 '
'kubectl /usr/local/bin/kubectl))')
elif isinstance(cloud, clouds.RunPod):
commands.append(
f'echo -en "\\r{prefix_str}RunPod{empty_str}" && '
Expand Down
Loading