Skip to content

Commit

Permalink
Merge branch 'hd/k8s-env-vars-for-ssh'
Browse files Browse the repository at this point in the history
  • Loading branch information
landscapepainter committed Aug 30, 2023
2 parents eef84f0 + da940ff commit 3d977a0
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
5 changes: 5 additions & 0 deletions sky/adaptors/kubernetes.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@
kubernetes = None
urllib3 = None


LOCAL_PORT_FOR_PORT_FORWARD = 23100
PORT_FORWARD_PROXY_CMD_TEMPLATE = 'kubernetes-port-forward-proxy-command.yaml.j2'
PORT_FORWARD_PROXY_CMD_PATH = '~/.sky/port-forward-proxy-cmd-{cluster_name}.sh'

_configured = False
_core_api = None
_auth_api = None
Expand Down
7 changes: 7 additions & 0 deletions sky/backends/backend_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
from sky import skypilot_config
from sky import spot as spot_lib
from sky import status_lib
from sky.adaptors import kubernetes
from sky.backends import onprem_utils
from sky.skylet import constants
from sky.skylet import log_lib
Expand Down Expand Up @@ -710,6 +711,12 @@ def remove_cluster(
docker_user: If not None, use this user to ssh into the docker
"""
username = auth_config['ssh_user']
port_forward_proxy_cmd_path = os.path.expanduser(
kubernetes.PORT_FORWARD_PROXY_CMD_PATH.format(
cluster_name=cluster_name))
if os.path.exists(port_forward_proxy_cmd_path):
os.remove(port_forward_proxy_cmd_path)

config_path = os.path.expanduser(cls.ssh_conf_path)
if not os.path.exists(config_path):
return
Expand Down

0 comments on commit 3d977a0

Please sign in to comment.