skypilot-nightly 1.0.0.dev20250715__py3-none-any.whl → 1.0.0.dev20250717__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- sky/__init__.py +4 -2
- sky/adaptors/nebius.py +6 -0
- sky/backends/backend.py +8 -4
- sky/backends/cloud_vm_ray_backend.py +50 -1
- sky/backends/docker_utils.py +1 -1
- sky/backends/local_docker_backend.py +2 -1
- sky/catalog/common.py +60 -50
- sky/catalog/data_fetchers/fetch_gcp.py +1 -0
- sky/catalog/data_fetchers/fetch_nebius.py +308 -0
- sky/catalog/gcp_catalog.py +24 -7
- sky/catalog/kubernetes_catalog.py +5 -1
- sky/client/cli/command.py +180 -77
- sky/client/cli/git.py +549 -0
- sky/client/common.py +1 -1
- sky/clouds/gcp.py +1 -1
- sky/clouds/hyperbolic.py +2 -0
- sky/clouds/nebius.py +6 -4
- sky/dashboard/out/404.html +1 -1
- sky/dashboard/out/_next/static/Et5IQ5Y3WvH608nXClo4z/_buildManifest.js +1 -0
- sky/dashboard/out/_next/static/chunks/1141-d8c6404a7c6fffe6.js +11 -0
- sky/dashboard/out/_next/static/chunks/1746.27d40aedc22bd2d6.js +60 -0
- sky/dashboard/out/_next/static/chunks/2641.35edc9ccaeaad9e3.js +1 -0
- sky/dashboard/out/_next/static/chunks/{3785.b3cc2bc1d49d2c3c.js → 3785.95b94f18aaec7233.js} +1 -1
- sky/dashboard/out/_next/static/chunks/4869.bdd42f14b51d1d6f.js +16 -0
- sky/dashboard/out/_next/static/chunks/6990-dcb411b566e64cde.js +1 -0
- sky/dashboard/out/_next/static/chunks/{9025.a7c44babfe56ce09.js → 9025.133e9ba5c780afeb.js} +1 -1
- sky/dashboard/out/_next/static/chunks/9847.46e613d000c55859.js +30 -0
- sky/dashboard/out/_next/static/chunks/pages/{_app-e0f63ea4704026ad.js → _app-771a40cde532309b.js} +1 -1
- sky/dashboard/out/_next/static/chunks/pages/clusters/[cluster]/[job]-9096ea50b8e2cf9e.js +6 -0
- sky/dashboard/out/_next/static/chunks/pages/jobs/[job]-14d404b7dd28502a.js +16 -0
- sky/dashboard/out/_next/static/chunks/pages/{users-cd43fb3c122eedde.js → users-19e98664bdd61643.js} +1 -1
- sky/dashboard/out/_next/static/chunks/pages/volumes-61ea7ba7e56f8d06.js +1 -0
- sky/dashboard/out/_next/static/chunks/pages/{workspaces-06bde99155fa6292.js → workspaces-a1e43d9ef51a9cea.js} +1 -1
- sky/dashboard/out/_next/static/chunks/{webpack-4a336bff3bcec29a.js → webpack-c3b45b7b0eaef66f.js} +1 -1
- sky/dashboard/out/_next/static/css/219887b94512388c.css +3 -0
- sky/dashboard/out/clusters/[cluster]/[job].html +1 -1
- sky/dashboard/out/clusters/[cluster].html +1 -1
- sky/dashboard/out/clusters.html +1 -1
- sky/dashboard/out/config.html +1 -1
- sky/dashboard/out/index.html +1 -1
- sky/dashboard/out/infra/[context].html +1 -1
- sky/dashboard/out/infra.html +1 -1
- sky/dashboard/out/jobs/[job].html +1 -1
- sky/dashboard/out/jobs.html +1 -1
- sky/dashboard/out/users.html +1 -1
- sky/dashboard/out/volumes.html +1 -1
- sky/dashboard/out/workspace/new.html +1 -1
- sky/dashboard/out/workspaces/[name].html +1 -1
- sky/dashboard/out/workspaces.html +1 -1
- sky/exceptions.py +5 -0
- sky/execution.py +5 -1
- sky/provision/hyperbolic/__init__.py +1 -0
- sky/provision/hyperbolic/instance.py +10 -0
- sky/provision/kubernetes/utils.py +6 -0
- sky/server/common.py +4 -3
- sky/setup_files/MANIFEST.in +1 -0
- sky/setup_files/dependencies.py +3 -1
- sky/task.py +12 -2
- sky/utils/command_runner.py +144 -35
- sky/utils/controller_utils.py +4 -3
- sky/utils/git.py +9 -0
- sky/utils/git_clone.sh +460 -0
- sky/utils/schemas.py +15 -1
- sky/utils/tempstore.py +20 -1
- {skypilot_nightly-1.0.0.dev20250715.dist-info → skypilot_nightly-1.0.0.dev20250717.dist-info}/METADATA +5 -3
- {skypilot_nightly-1.0.0.dev20250715.dist-info → skypilot_nightly-1.0.0.dev20250717.dist-info}/RECORD +79 -75
- sky/dashboard/out/_next/static/chunks/1141-726e5a3f00b67185.js +0 -11
- sky/dashboard/out/_next/static/chunks/1691.44e378727a41f3b5.js +0 -21
- sky/dashboard/out/_next/static/chunks/3256.7257acd01b481bed.js +0 -11
- sky/dashboard/out/_next/static/chunks/4697.f5421144224da9fc.js +0 -20
- sky/dashboard/out/_next/static/chunks/6990-d0dc765474fa0eca.js +0 -1
- sky/dashboard/out/_next/static/chunks/8982.a2e214068f30a857.js +0 -1
- sky/dashboard/out/_next/static/chunks/pages/clusters/[cluster]/[job]-4608dc89f95eba89.js +0 -6
- sky/dashboard/out/_next/static/chunks/pages/jobs/[job]-980d6f6b64ca7833.js +0 -16
- sky/dashboard/out/_next/static/chunks/pages/volumes-4ebf6484f7216387.js +0 -1
- sky/dashboard/out/_next/static/css/eacc7d65a8686c76.css +0 -3
- sky/dashboard/out/_next/static/y4pSeZ-9XymSDfPlcWhVO/_buildManifest.js +0 -1
- /sky/dashboard/out/_next/static/{y4pSeZ-9XymSDfPlcWhVO → Et5IQ5Y3WvH608nXClo4z}/_ssgManifest.js +0 -0
- /sky/dashboard/out/_next/static/chunks/{1043-5e5ef6198735ff7e.js → 1043-90a88c46f27b3df5.js} +0 -0
- /sky/dashboard/out/_next/static/chunks/{1871-4d1f786e83bd9ffe.js → 1871-76491ac174a95278.js} +0 -0
- /sky/dashboard/out/_next/static/chunks/{3698-52ad1ca228faa776.js → 3698-9fa11dafb5cad4a6.js} +0 -0
- /sky/dashboard/out/_next/static/chunks/{6601-d38d10f957dff832.js → 6601-d4a381403a8bae91.js} +0 -0
- /sky/dashboard/out/_next/static/chunks/{8969-13bb52ce3cffa4e3.js → 8969-743abf4bc86baf48.js} +0 -0
- /sky/dashboard/out/_next/static/chunks/{938-8e25c8ea0baa271a.js → 938-6a9ffdaa21eee969.js} +0 -0
- /sky/dashboard/out/_next/static/chunks/{9470-21d059a1dfa03f61.js → 9470-b6f6a35283863a6f.js} +0 -0
- /sky/dashboard/out/_next/static/chunks/pages/clusters/{[cluster]-0fbfb1dd0b08c90c.js → [cluster]-0c37ee1ac5f3474d.js} +0 -0
- {skypilot_nightly-1.0.0.dev20250715.dist-info → skypilot_nightly-1.0.0.dev20250717.dist-info}/WHEEL +0 -0
- {skypilot_nightly-1.0.0.dev20250715.dist-info → skypilot_nightly-1.0.0.dev20250717.dist-info}/entry_points.txt +0 -0
- {skypilot_nightly-1.0.0.dev20250715.dist-info → skypilot_nightly-1.0.0.dev20250717.dist-info}/licenses/LICENSE +0 -0
- {skypilot_nightly-1.0.0.dev20250715.dist-info → skypilot_nightly-1.0.0.dev20250717.dist-info}/top_level.txt +0 -0
sky/client/cli/git.py
ADDED
@@ -0,0 +1,549 @@
|
|
1
|
+
"""Git utilities for SkyPilot."""
|
2
|
+
import enum
|
3
|
+
import os
|
4
|
+
import re
|
5
|
+
from typing import List, Optional, Union
|
6
|
+
|
7
|
+
import git
|
8
|
+
import requests
|
9
|
+
|
10
|
+
from sky import exceptions
|
11
|
+
from sky import sky_logging
|
12
|
+
|
13
|
+
logger = sky_logging.init_logger(__name__)
|
14
|
+
|
15
|
+
|
16
|
+
class GitRefType(enum.Enum):
|
17
|
+
"""Type of git reference."""
|
18
|
+
|
19
|
+
BRANCH = 'branch'
|
20
|
+
TAG = 'tag'
|
21
|
+
COMMIT = 'commit'
|
22
|
+
|
23
|
+
|
24
|
+
class GitUrlInfo:
|
25
|
+
"""Information extracted from a git URL."""
|
26
|
+
|
27
|
+
def __init__(self,
|
28
|
+
host: str,
|
29
|
+
path: str,
|
30
|
+
protocol: str,
|
31
|
+
user: Optional[str] = None,
|
32
|
+
port: Optional[int] = None):
|
33
|
+
self.host = host
|
34
|
+
# Repository path (e.g., 'user/repo' or 'org/subgroup/repo').
|
35
|
+
# The path is the part after the host.
|
36
|
+
self.path = path
|
37
|
+
# 'https', 'ssh'
|
38
|
+
self.protocol = protocol
|
39
|
+
# SSH username
|
40
|
+
self.user = user
|
41
|
+
self.port = port
|
42
|
+
|
43
|
+
|
44
|
+
class GitCloneInfo:
|
45
|
+
"""Information about a git clone."""
|
46
|
+
|
47
|
+
def __init__(self,
|
48
|
+
url: str,
|
49
|
+
envs: Optional[dict] = None,
|
50
|
+
token: Optional[str] = None,
|
51
|
+
ssh_key: Optional[str] = None):
|
52
|
+
self.url = url
|
53
|
+
self.envs = envs
|
54
|
+
self.token = token
|
55
|
+
self.ssh_key = ssh_key
|
56
|
+
|
57
|
+
|
58
|
+
class GitRepo:
|
59
|
+
"""Git utilities for SkyPilot."""
|
60
|
+
|
61
|
+
def __init__(self,
|
62
|
+
repo_url: str,
|
63
|
+
ref: str = 'main',
|
64
|
+
git_token: Optional[str] = None,
|
65
|
+
git_ssh_key_path: Optional[str] = None):
|
66
|
+
"""Initialize Git utility.
|
67
|
+
|
68
|
+
Args:
|
69
|
+
repo_url: Git repository URL.
|
70
|
+
ref: Git reference (branch, tag, or commit hash).
|
71
|
+
git_token: GitHub token for private repositories.
|
72
|
+
git_ssh_key_path: Path to SSH private key for authentication.
|
73
|
+
"""
|
74
|
+
self.repo_url = repo_url
|
75
|
+
self.ref = ref
|
76
|
+
self.git_token = git_token
|
77
|
+
self.git_ssh_key_path = git_ssh_key_path
|
78
|
+
|
79
|
+
# Parse URL during initialization to catch format errors early
|
80
|
+
self._parsed_url = self._parse_git_url(self.repo_url)
|
81
|
+
|
82
|
+
def _parse_git_url(self, url: str) -> GitUrlInfo:
|
83
|
+
"""Parse git URL into components.
|
84
|
+
|
85
|
+
Supports various git URL formats:
|
86
|
+
- HTTPS: https://github.com/user/repo.git
|
87
|
+
- SSH: git@github.com:user/repo.git (SCP-like)
|
88
|
+
- SSH full: ssh://git@github.com/user/repo.git
|
89
|
+
- SSH with port: ssh://git@github.com:2222/user/repo.git
|
90
|
+
|
91
|
+
Args:
|
92
|
+
url: Git repository URL in any supported format.
|
93
|
+
|
94
|
+
Returns:
|
95
|
+
GitUrlInfo with parsed components.
|
96
|
+
|
97
|
+
Raises:
|
98
|
+
exceptions.GitError: If URL format is not supported.
|
99
|
+
"""
|
100
|
+
# Remove trailing .git if present
|
101
|
+
clean_url = url.rstrip('/')
|
102
|
+
if clean_url.endswith('.git'):
|
103
|
+
clean_url = clean_url[:-4]
|
104
|
+
|
105
|
+
# Pattern for HTTPS/HTTP URLs
|
106
|
+
https_pattern = r'^(https?)://(?:([^@]+)@)?([^:/]+)(?::(\d+))?/(.+)$'
|
107
|
+
https_match = re.match(https_pattern, clean_url)
|
108
|
+
|
109
|
+
if https_match:
|
110
|
+
protocol, user, host, port_str, path = https_match.groups()
|
111
|
+
port = int(port_str) if port_str else None
|
112
|
+
|
113
|
+
# Validate that path is not empty
|
114
|
+
if not path or path == '/':
|
115
|
+
raise exceptions.GitError(
|
116
|
+
f'Invalid repository path in URL: {url}')
|
117
|
+
|
118
|
+
return GitUrlInfo(host=host,
|
119
|
+
path=path,
|
120
|
+
protocol=protocol,
|
121
|
+
user=user,
|
122
|
+
port=port)
|
123
|
+
|
124
|
+
# Pattern for SSH URLs (full format)
|
125
|
+
ssh_full_pattern = r'^ssh://(?:([^@]+)@)?([^:/]+)(?::(\d+))?/(.+)$'
|
126
|
+
ssh_full_match = re.match(ssh_full_pattern, clean_url)
|
127
|
+
|
128
|
+
if ssh_full_match:
|
129
|
+
user, host, port_str, path = ssh_full_match.groups()
|
130
|
+
port = int(port_str) if port_str else None
|
131
|
+
|
132
|
+
# Validate that path is not empty
|
133
|
+
if not path or path == '/':
|
134
|
+
raise exceptions.GitError(
|
135
|
+
f'Invalid repository path in SSH URL: {url}')
|
136
|
+
|
137
|
+
return GitUrlInfo(host=host,
|
138
|
+
path=path,
|
139
|
+
protocol='ssh',
|
140
|
+
user=user,
|
141
|
+
port=port)
|
142
|
+
|
143
|
+
# Pattern for SSH SCP-like format (exclude URLs with ://)
|
144
|
+
scp_pattern = r'^(?:([^@]+)@)?([^:/]+):(.+)$'
|
145
|
+
scp_match = re.match(scp_pattern, clean_url)
|
146
|
+
|
147
|
+
# Make sure it's not a URL with protocol (should not contain ://)
|
148
|
+
if scp_match and '://' not in clean_url:
|
149
|
+
user, host, path = scp_match.groups()
|
150
|
+
|
151
|
+
# Validate that path is not empty
|
152
|
+
if not path:
|
153
|
+
raise exceptions.GitError(
|
154
|
+
f'Invalid repository path in SSH URL: {url}')
|
155
|
+
|
156
|
+
return GitUrlInfo(host=host,
|
157
|
+
path=path,
|
158
|
+
protocol='ssh',
|
159
|
+
user=user,
|
160
|
+
port=None)
|
161
|
+
|
162
|
+
raise exceptions.GitError(
|
163
|
+
f'Unsupported git URL format: {url}. '
|
164
|
+
'Supported formats: https://host/owner/repo, '
|
165
|
+
'ssh://user@host/owner/repo, user@host:owner/repo')
|
166
|
+
|
167
|
+
def get_https_url(self, with_token: bool = False) -> str:
|
168
|
+
"""Get HTTPS URL for the repository.
|
169
|
+
|
170
|
+
Args:
|
171
|
+
with_token: If True, includes token in URL for authentication
|
172
|
+
|
173
|
+
Returns:
|
174
|
+
HTTPS URL string.
|
175
|
+
"""
|
176
|
+
port_str = f':{self._parsed_url.port}' if self._parsed_url.port else ''
|
177
|
+
path = self._parsed_url.path
|
178
|
+
# Remove .git suffix if present (but not individual characters)
|
179
|
+
if path.endswith('.git'):
|
180
|
+
path = path[:-4]
|
181
|
+
|
182
|
+
if with_token and self.git_token:
|
183
|
+
return f'https://{self.git_token}@{self._parsed_url.host}' \
|
184
|
+
f'{port_str}/{path}.git'
|
185
|
+
return f'https://{self._parsed_url.host}{port_str}/{path}.git'
|
186
|
+
|
187
|
+
def get_ssh_url(self) -> str:
|
188
|
+
"""Get SSH URL for the repository in full format.
|
189
|
+
|
190
|
+
Returns:
|
191
|
+
SSH URL string in full format.
|
192
|
+
"""
|
193
|
+
# Use original user from URL, or default to 'git'
|
194
|
+
ssh_user = self._parsed_url.user or 'git'
|
195
|
+
port_str = f':{self._parsed_url.port}' if self._parsed_url.port else ''
|
196
|
+
path = self._parsed_url.path
|
197
|
+
# Remove .git suffix if present (but not individual characters)
|
198
|
+
if path.endswith('.git'):
|
199
|
+
path = path[:-4]
|
200
|
+
return f'ssh://{ssh_user}@{self._parsed_url.host}{port_str}/{path}.git'
|
201
|
+
|
202
|
+
def get_repo_clone_info(self) -> GitCloneInfo:
|
203
|
+
"""Validate the repository access with comprehensive authentication
|
204
|
+
and return the appropriate clone info.
|
205
|
+
|
206
|
+
This method implements a sequential validation approach:
|
207
|
+
1. Try public access (no authentication)
|
208
|
+
2. If has token and URL is https, try token access
|
209
|
+
3. If URL is ssh, try ssh access with user provided ssh key or
|
210
|
+
default ssh credential
|
211
|
+
|
212
|
+
Returns:
|
213
|
+
GitCloneInfo instance with successful access method.
|
214
|
+
|
215
|
+
Raises:
|
216
|
+
exceptions.GitError: If the git URL format is invalid or
|
217
|
+
the repository cannot be accessed.
|
218
|
+
"""
|
219
|
+
logger.debug(f'Validating access to {self._parsed_url.host}'
|
220
|
+
f'/{self._parsed_url.path}')
|
221
|
+
|
222
|
+
# Step 1: Try public access first (most common case)
|
223
|
+
try:
|
224
|
+
https_url = self.get_https_url()
|
225
|
+
logger.debug(f'Trying public HTTPS access to {https_url}')
|
226
|
+
|
227
|
+
# Use /info/refs endpoint to check public access.
|
228
|
+
# This is more reliable than git ls-remote as it doesn't
|
229
|
+
# use local git config.
|
230
|
+
stripped_url = https_url.rstrip('/')
|
231
|
+
info_refs_url = f'{stripped_url}/info/refs?service=git-upload-pack'
|
232
|
+
|
233
|
+
# Make a simple HTTP request without any authentication
|
234
|
+
response = requests.get(
|
235
|
+
info_refs_url,
|
236
|
+
timeout=10,
|
237
|
+
allow_redirects=True,
|
238
|
+
# Ensure no local credentials are used
|
239
|
+
auth=None)
|
240
|
+
|
241
|
+
if response.status_code == 200:
|
242
|
+
logger.info(
|
243
|
+
f'Successfully validated repository {https_url} access '
|
244
|
+
'using public access')
|
245
|
+
return GitCloneInfo(url=https_url)
|
246
|
+
except Exception as e: # pylint: disable=broad-except
|
247
|
+
logger.debug(f'Public access failed: {str(e)}')
|
248
|
+
|
249
|
+
# Step 2: Try with token if provided
|
250
|
+
if self.git_token and self._parsed_url.protocol == 'https':
|
251
|
+
try:
|
252
|
+
https_url = self.get_https_url()
|
253
|
+
auth_url = self.get_https_url(with_token=True)
|
254
|
+
logger.debug(f'Trying token authentication to {https_url}')
|
255
|
+
git_cmd = git.cmd.Git()
|
256
|
+
git_cmd.ls_remote(auth_url)
|
257
|
+
logger.info(
|
258
|
+
f'Successfully validated repository {https_url} access '
|
259
|
+
'using token authentication')
|
260
|
+
return GitCloneInfo(url=https_url, token=self.git_token)
|
261
|
+
except Exception as e:
|
262
|
+
logger.info(f'Token access failed: {str(e)}')
|
263
|
+
raise exceptions.GitError(
|
264
|
+
f'Failed to access repository {self.repo_url} using token '
|
265
|
+
'authentication. Please verify your token and repository '
|
266
|
+
f'access permissions. Original error: {str(e)}') from e
|
267
|
+
|
268
|
+
# Step 3: Try SSH access with available keys
|
269
|
+
if self._parsed_url.protocol == 'ssh':
|
270
|
+
try:
|
271
|
+
ssh_url = self.get_ssh_url()
|
272
|
+
|
273
|
+
# Get SSH key info using the combined method
|
274
|
+
ssh_key_info = self._get_ssh_key_info()
|
275
|
+
|
276
|
+
if ssh_key_info:
|
277
|
+
key_path, key_content = ssh_key_info
|
278
|
+
git_ssh_command = f'ssh -F none -i {key_path} ' \
|
279
|
+
'-o StrictHostKeyChecking=no ' \
|
280
|
+
'-o UserKnownHostsFile=/dev/null ' \
|
281
|
+
'-o IdentitiesOnly=yes'
|
282
|
+
ssh_env = {'GIT_SSH_COMMAND': git_ssh_command}
|
283
|
+
|
284
|
+
logger.debug(f'Trying SSH authentication to {ssh_url} '
|
285
|
+
f'with {key_path}')
|
286
|
+
git_cmd = git.cmd.Git()
|
287
|
+
git_cmd.update_environment(**ssh_env)
|
288
|
+
git_cmd.ls_remote(ssh_url)
|
289
|
+
logger.info(
|
290
|
+
f'Successfully validated repository {ssh_url} access '
|
291
|
+
f'using SSH key: {key_path}')
|
292
|
+
return GitCloneInfo(url=ssh_url,
|
293
|
+
ssh_key=key_content,
|
294
|
+
envs=ssh_env)
|
295
|
+
else:
|
296
|
+
raise exceptions.GitError(
|
297
|
+
f'No SSH keys found for {self.repo_url}.')
|
298
|
+
except Exception as e: # pylint: disable=broad-except
|
299
|
+
raise exceptions.GitError(
|
300
|
+
f'Failed to access repository {self.repo_url} using '
|
301
|
+
'SSH key authentication. Please verify your SSH key and '
|
302
|
+
'repository access permissions. '
|
303
|
+
f'Original error: {str(e)}') from e
|
304
|
+
|
305
|
+
# If we get here, no authentication methods are available
|
306
|
+
raise exceptions.GitError(
|
307
|
+
f'Failed to access repository {self.repo_url}. '
|
308
|
+
'If this is a private repository, please provide authentication'
|
309
|
+
f' using either: GIT_TOKEN for token-based access, or'
|
310
|
+
f' GIT_SSH_KEY_PATH for SSH access.')
|
311
|
+
|
312
|
+
def _parse_ssh_config(self) -> Optional[str]:
|
313
|
+
"""Parse SSH config file to find IdentityFile for the target host.
|
314
|
+
|
315
|
+
Returns:
|
316
|
+
Path to SSH private key specified in config, or None if not found.
|
317
|
+
"""
|
318
|
+
ssh_config_path = os.path.expanduser('~/.ssh/config')
|
319
|
+
if not os.path.exists(ssh_config_path):
|
320
|
+
logger.debug('SSH config file ~/.ssh/config does not exist')
|
321
|
+
return None
|
322
|
+
|
323
|
+
try:
|
324
|
+
# Try to use paramiko's SSH config parser if available
|
325
|
+
try:
|
326
|
+
import paramiko # pylint: disable=import-outside-toplevel
|
327
|
+
ssh_config = paramiko.SSHConfig()
|
328
|
+
with open(ssh_config_path, 'r', encoding='utf-8') as f:
|
329
|
+
ssh_config.parse(f)
|
330
|
+
# Get config for the target host
|
331
|
+
host_config = ssh_config.lookup(self._parsed_url.host)
|
332
|
+
|
333
|
+
# Look for identity files in the config
|
334
|
+
identity_files: Union[str, List[str]] = host_config.get(
|
335
|
+
'identityfile', [])
|
336
|
+
if not isinstance(identity_files, list):
|
337
|
+
identity_files = [identity_files]
|
338
|
+
|
339
|
+
# Find the first existing identity file
|
340
|
+
for identity_file in identity_files:
|
341
|
+
key_path = os.path.expanduser(identity_file)
|
342
|
+
if os.path.exists(key_path):
|
343
|
+
logger.debug(f'Found SSH key in config for '
|
344
|
+
f'{self._parsed_url.host}: {key_path}')
|
345
|
+
return key_path
|
346
|
+
|
347
|
+
logger.debug(f'No valid SSH keys found in config for host: '
|
348
|
+
f'{self._parsed_url.host}')
|
349
|
+
return None
|
350
|
+
|
351
|
+
except ImportError:
|
352
|
+
logger.debug('paramiko not available')
|
353
|
+
return None
|
354
|
+
|
355
|
+
except Exception as e: # pylint: disable=broad-except
|
356
|
+
logger.debug(f'Error parsing SSH config: {str(e)}')
|
357
|
+
return None
|
358
|
+
|
359
|
+
def _get_ssh_key_info(self) -> Optional[tuple]:
|
360
|
+
"""Get SSH key path and content using comprehensive strategy.
|
361
|
+
|
362
|
+
Strategy:
|
363
|
+
1. Check provided git_ssh_key_path if given
|
364
|
+
2. Check SSH config for host-specific IdentityFile
|
365
|
+
3. Search for common SSH key types in ~/.ssh/ directory
|
366
|
+
|
367
|
+
Returns:
|
368
|
+
Tuple of (key_path, key_content) if found, None otherwise.
|
369
|
+
"""
|
370
|
+
# Step 1: Check provided SSH key path first
|
371
|
+
if self.git_ssh_key_path:
|
372
|
+
try:
|
373
|
+
key_path = os.path.expanduser(self.git_ssh_key_path)
|
374
|
+
|
375
|
+
# Validate SSH key before using it
|
376
|
+
if not os.path.exists(key_path):
|
377
|
+
raise exceptions.GitError(
|
378
|
+
f'SSH key not found at path: {self.git_ssh_key_path}')
|
379
|
+
|
380
|
+
# Check key permissions
|
381
|
+
key_stat = os.stat(key_path)
|
382
|
+
if key_stat.st_mode & 0o077:
|
383
|
+
logger.warning(
|
384
|
+
f'SSH key {key_path} has too open permissions. '
|
385
|
+
f'Recommended: chmod 600 {key_path}')
|
386
|
+
|
387
|
+
# Check if it's a valid private key and read content
|
388
|
+
with open(key_path, 'r', encoding='utf-8') as f:
|
389
|
+
key_content = f.read()
|
390
|
+
if not (key_content.startswith('-----BEGIN') and
|
391
|
+
'PRIVATE KEY' in key_content):
|
392
|
+
raise exceptions.GitError(
|
393
|
+
f'SSH key {key_path} is invalid.')
|
394
|
+
|
395
|
+
logger.debug(f'Using provided SSH key: {key_path}')
|
396
|
+
return (key_path, key_content)
|
397
|
+
except Exception as e: # pylint: disable=broad-except
|
398
|
+
raise exceptions.GitError(
|
399
|
+
f'Validate provided SSH key error: {str(e)}') from e
|
400
|
+
|
401
|
+
# Step 2: Check SSH config for host-specific configuration
|
402
|
+
config_key_path = self._parse_ssh_config()
|
403
|
+
if config_key_path:
|
404
|
+
try:
|
405
|
+
with open(config_key_path, 'r', encoding='utf-8') as f:
|
406
|
+
key_content = f.read()
|
407
|
+
logger.debug(f'Using SSH key from config: {config_key_path}')
|
408
|
+
return (config_key_path, key_content)
|
409
|
+
except Exception as e: # pylint: disable=broad-except
|
410
|
+
logger.debug(f'Could not read SSH key: {str(e)}')
|
411
|
+
|
412
|
+
# Step 3: Search for default SSH keys
|
413
|
+
ssh_dir = os.path.expanduser('~/.ssh')
|
414
|
+
if not os.path.exists(ssh_dir):
|
415
|
+
logger.debug('SSH directory ~/.ssh does not exist')
|
416
|
+
return None
|
417
|
+
|
418
|
+
# Common SSH key file names in order of preference
|
419
|
+
key_candidates = [
|
420
|
+
'id_rsa', # Most common
|
421
|
+
'id_ed25519', # Modern, recommended
|
422
|
+
]
|
423
|
+
|
424
|
+
for key_name in key_candidates:
|
425
|
+
private_key_path = os.path.join(ssh_dir, key_name)
|
426
|
+
|
427
|
+
# Check if both private and public keys exist
|
428
|
+
if not os.path.exists(private_key_path):
|
429
|
+
continue
|
430
|
+
|
431
|
+
# Check private key permissions
|
432
|
+
try:
|
433
|
+
key_stat = os.stat(private_key_path)
|
434
|
+
if key_stat.st_mode & 0o077:
|
435
|
+
logger.warning(
|
436
|
+
f'SSH key {private_key_path} has too open permissions. '
|
437
|
+
f'Consider: chmod 600 {private_key_path}')
|
438
|
+
|
439
|
+
# Validate private key format and read content
|
440
|
+
with open(private_key_path, 'r', encoding='utf-8') as f:
|
441
|
+
key_content = f.read()
|
442
|
+
if not (key_content.startswith('-----BEGIN') and
|
443
|
+
'PRIVATE KEY' in key_content):
|
444
|
+
logger.debug(f'SSH key {private_key_path} is invalid.')
|
445
|
+
continue
|
446
|
+
|
447
|
+
logger.debug(f'Discovered default SSH key: {private_key_path}')
|
448
|
+
return (private_key_path, key_content)
|
449
|
+
|
450
|
+
except Exception as e: # pylint: disable=broad-except
|
451
|
+
logger.debug(
|
452
|
+
f'Error checking SSH key {private_key_path}: {str(e)}')
|
453
|
+
continue
|
454
|
+
|
455
|
+
logger.debug('No suitable SSH keys found')
|
456
|
+
return None
|
457
|
+
|
458
|
+
def get_ref_type(self) -> GitRefType:
|
459
|
+
"""Get the type of the reference.
|
460
|
+
|
461
|
+
Returns:
|
462
|
+
GitRefType.COMMIT if it's a commit hash,
|
463
|
+
GitRefType.BRANCH if it's a branch,
|
464
|
+
GitRefType.TAG if it's a tag.
|
465
|
+
|
466
|
+
Raises:
|
467
|
+
exceptions.GitError: If the reference is invalid.
|
468
|
+
"""
|
469
|
+
clone_info = self.get_repo_clone_info()
|
470
|
+
git_cmd = git.cmd.Git()
|
471
|
+
if clone_info.envs:
|
472
|
+
git_cmd.update_environment(**clone_info.envs)
|
473
|
+
|
474
|
+
try:
|
475
|
+
# Get all remote refs
|
476
|
+
refs = git_cmd.ls_remote(clone_info.url).split('\n')
|
477
|
+
|
478
|
+
# Collect all commit hashes from refs
|
479
|
+
all_commit_hashes = set()
|
480
|
+
|
481
|
+
# Check if it's a branch or tag name
|
482
|
+
for ref in refs:
|
483
|
+
if not ref:
|
484
|
+
continue
|
485
|
+
hash_val, ref_name = ref.split('\t')
|
486
|
+
|
487
|
+
# Store the commit hash for later validation
|
488
|
+
all_commit_hashes.add(hash_val)
|
489
|
+
|
490
|
+
# Check if it's a branch
|
491
|
+
if ref_name.startswith(
|
492
|
+
'refs/heads/') and ref_name[11:] == self.ref:
|
493
|
+
return GitRefType.BRANCH
|
494
|
+
|
495
|
+
# Check if it's a tag
|
496
|
+
if ref_name.startswith(
|
497
|
+
'refs/tags/') and ref_name[10:] == self.ref:
|
498
|
+
return GitRefType.TAG
|
499
|
+
|
500
|
+
# If we get here, it's not a branch or tag name
|
501
|
+
# Check if it looks like a commit hash (hex string)
|
502
|
+
if len(self.ref) >= 4 and all(
|
503
|
+
c in '0123456789abcdef' for c in self.ref.lower()):
|
504
|
+
# First check if it's a complete match with any known commit
|
505
|
+
if self.ref in all_commit_hashes:
|
506
|
+
logger.debug(f'Found exact commit hash match: {self.ref}')
|
507
|
+
return GitRefType.COMMIT
|
508
|
+
|
509
|
+
# Check if it's a prefix match with any known commit
|
510
|
+
matching_commits = [
|
511
|
+
h for h in all_commit_hashes if h.startswith(self.ref)
|
512
|
+
]
|
513
|
+
if len(matching_commits) == 1:
|
514
|
+
logger.debug(
|
515
|
+
f'Found commit hash prefix match: {self.ref} -> '
|
516
|
+
f'{matching_commits[0]}')
|
517
|
+
return GitRefType.COMMIT
|
518
|
+
elif len(matching_commits) > 1:
|
519
|
+
# Multiple matches - ambiguous
|
520
|
+
raise exceptions.GitError(
|
521
|
+
f'Ambiguous commit hash {self.ref!r}. '
|
522
|
+
f'Multiple commits match: '
|
523
|
+
f'{", ".join(matching_commits[:5])}...')
|
524
|
+
|
525
|
+
# If no match found in ls-remote output, we can't verify
|
526
|
+
# the commit exists. This could be a valid commit that's
|
527
|
+
# not at the tip of any branch/tag. We'll assume it's valid
|
528
|
+
# if it looks like a commit hash and let git handle validation
|
529
|
+
# during clone.
|
530
|
+
logger.debug(f'Commit hash not found in ls-remote output, '
|
531
|
+
f'assuming valid: {self.ref}')
|
532
|
+
logger.warning(
|
533
|
+
f'Cannot verify commit {self.ref} exists - it may be a '
|
534
|
+
'commit in history not at any branch/tag tip')
|
535
|
+
return GitRefType.COMMIT
|
536
|
+
|
537
|
+
# If it's not a branch, tag, or hex string, it's invalid
|
538
|
+
raise exceptions.GitError(
|
539
|
+
f'Git reference {self.ref!r} not found. '
|
540
|
+
'Please provide a valid branch, tag, or commit hash.')
|
541
|
+
|
542
|
+
except git.exc.GitCommandError as e:
|
543
|
+
if not (self.git_token or self.git_ssh_key_path):
|
544
|
+
raise exceptions.GitError(
|
545
|
+
'Failed to check repository. If this is a private '
|
546
|
+
'repository, please provide authentication using either '
|
547
|
+
'GIT_TOKEN or GIT_SSH_KEY_PATH.') from e
|
548
|
+
raise exceptions.GitError(
|
549
|
+
f'Failed to check git reference: {str(e)}') from e
|
sky/client/common.py
CHANGED
@@ -272,7 +272,7 @@ def upload_mounts_to_api_server(dag: 'sky.Dag',
|
|
272
272
|
upload_list = []
|
273
273
|
for task_ in dag.tasks:
|
274
274
|
task_.file_mounts_mapping = {}
|
275
|
-
if task_.workdir:
|
275
|
+
if task_.workdir and isinstance(task_.workdir, str):
|
276
276
|
workdir = task_.workdir
|
277
277
|
assert os.path.isabs(workdir)
|
278
278
|
upload_list.append(workdir)
|
sky/clouds/gcp.py
CHANGED
@@ -1174,7 +1174,7 @@ class GCP(clouds.Cloud):
|
|
1174
1174
|
# These series don't support pd-standard, use pd-balanced for LOW.
|
1175
1175
|
_propagate_disk_type(
|
1176
1176
|
lowest=tier2name[resources_utils.DiskTier.MEDIUM])
|
1177
|
-
if instance_type.startswith('a3-ultragpu'):
|
1177
|
+
if instance_type.startswith('a3-ultragpu') or series == 'n4':
|
1178
1178
|
# a3-ultragpu instances only support hyperdisk-balanced.
|
1179
1179
|
_propagate_disk_type(all='hyperdisk-balanced')
|
1180
1180
|
|
sky/clouds/hyperbolic.py
CHANGED
@@ -55,6 +55,8 @@ class Hyperbolic(clouds.Cloud):
|
|
55
55
|
('Auto-stop not supported.'),
|
56
56
|
clouds.CloudImplementationFeatures.AUTODOWN:
|
57
57
|
('Auto-down not supported.'),
|
58
|
+
clouds.CloudImplementationFeatures.CUSTOM_MULTI_NETWORK:
|
59
|
+
('Customized multiple network interfaces not supported.'),
|
58
60
|
}
|
59
61
|
|
60
62
|
PROVISIONER_VERSION = clouds.ProvisionerVersion.SKYPILOT
|
sky/clouds/nebius.py
CHANGED
@@ -219,10 +219,12 @@ class Nebius(clouds.Cloud):
|
|
219
219
|
acc_dict)
|
220
220
|
platform, _ = resources.instance_type.split('_')
|
221
221
|
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
image_family = '
|
222
|
+
# Selecting image_family by platform
|
223
|
+
# https://docs.nebius.com/compute/storage/boot-disk-images
|
224
|
+
if platform.startswith('cpu'):
|
225
|
+
image_family = 'ubuntu24.04-driverless'
|
226
|
+
elif platform.startswith('gpu'):
|
227
|
+
image_family = 'ubuntu24.04-cuda12'
|
226
228
|
else:
|
227
229
|
raise RuntimeError('Unsupported instance type for Nebius cloud:'
|
228
230
|
f' {resources.instance_type}')
|
sky/dashboard/out/404.html
CHANGED
@@ -1 +1 @@
|
|
1
|
-
<!DOCTYPE html><html><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width"/><meta name="next-head-count" content="2"/><link rel="preload" href="/dashboard/_next/static/css/
|
1
|
+
<!DOCTYPE html><html><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width"/><meta name="next-head-count" content="2"/><link rel="preload" href="/dashboard/_next/static/css/219887b94512388c.css" as="style"/><link rel="stylesheet" href="/dashboard/_next/static/css/219887b94512388c.css" data-n-g=""/><noscript data-n-css=""></noscript><script defer="" nomodule="" src="/dashboard/_next/static/chunks/polyfills-78c92fac7aa8fdd8.js"></script><script src="/dashboard/_next/static/chunks/webpack-c3b45b7b0eaef66f.js" defer=""></script><script src="/dashboard/_next/static/chunks/framework-efc06c2733009cd3.js" defer=""></script><script src="/dashboard/_next/static/chunks/main-c0a4f1ea606d48d2.js" defer=""></script><script src="/dashboard/_next/static/chunks/pages/_app-771a40cde532309b.js" defer=""></script><script src="/dashboard/_next/static/chunks/pages/_error-c72a1f77a3c0be1b.js" defer=""></script><script src="/dashboard/_next/static/Et5IQ5Y3WvH608nXClo4z/_buildManifest.js" defer=""></script><script src="/dashboard/_next/static/Et5IQ5Y3WvH608nXClo4z/_ssgManifest.js" defer=""></script></head><body><div id="__next"></div><script id="__NEXT_DATA__" type="application/json">{"props":{"pageProps":{"statusCode":404}},"page":"/_error","query":{},"buildId":"Et5IQ5Y3WvH608nXClo4z","assetPrefix":"/dashboard","nextExport":true,"isFallback":false,"gip":true,"scriptLoader":[]}</script></body></html>
|
@@ -0,0 +1 @@
|
|
1
|
+
self.__BUILD_MANIFEST=function(s,c,a,e,t,f,u,n,r,i,b,j,k,d,o){return{__rewrites:{afterFiles:[],beforeFiles:[],fallback:[]},"/":["static/chunks/pages/index-927ddeebe57a8ac3.js"],"/_error":["static/chunks/pages/_error-c72a1f77a3c0be1b.js"],"/clusters":["static/chunks/pages/clusters-102d169e87913ba1.js"],"/clusters/[cluster]":[s,c,a,e,t,r,b,f,u,n,j,i,k,d,o,"static/chunks/1871-76491ac174a95278.js","static/chunks/pages/clusters/[cluster]-0c37ee1ac5f3474d.js"],"/clusters/[cluster]/[job]":[s,c,a,e,t,f,u,n,"static/chunks/pages/clusters/[cluster]/[job]-9096ea50b8e2cf9e.js"],"/config":["static/chunks/pages/config-a2673b256b6d416f.js"],"/infra":["static/chunks/pages/infra-ae9d2f705ce582c9.js"],"/infra/[context]":["static/chunks/pages/infra/[context]-8b0809f59034d509.js"],"/jobs":["static/chunks/pages/jobs-5bbdc71878f0a068.js"],"/jobs/[job]":[s,c,a,e,t,r,f,u,n,i,"static/chunks/pages/jobs/[job]-14d404b7dd28502a.js"],"/users":["static/chunks/pages/users-19e98664bdd61643.js"],"/volumes":["static/chunks/pages/volumes-61ea7ba7e56f8d06.js"],"/workspace/new":["static/chunks/pages/workspace/new-5629d4e551dba1ee.js"],"/workspaces":["static/chunks/pages/workspaces-a1e43d9ef51a9cea.js"],"/workspaces/[name]":[s,c,a,e,t,r,b,f,u,n,j,i,k,d,o,"static/chunks/1141-d8c6404a7c6fffe6.js","static/chunks/pages/workspaces/[name]-7c0187f43757a548.js"],sortedPages:["/","/_app","/_error","/clusters","/clusters/[cluster]","/clusters/[cluster]/[job]","/config","/infra","/infra/[context]","/jobs","/jobs/[job]","/users","/volumes","/workspace/new","/workspaces","/workspaces/[name]"]}}("static/chunks/616-162f3033ffcd3d31.js","static/chunks/5230-df791914b54d91d9.js","static/chunks/5739-5ea3ffa10fc884f2.js","static/chunks/1664-d65361e92b85e786.js","static/chunks/804-9f5e98ce84d46bdd.js","static/chunks/6989-eab0e9c16b64fd9f.js","static/chunks/3698-9fa11dafb5cad4a6.js","static/chunks/9470-b6f6a35283863a6f.js","static/chunks/1272-1ef0bf0237faccdb.js","static/chunks/8969-743abf4bc86baf48.js","static/chunks/3947-b059261d6fa88a1f.js","static/chunks/6990-dcb411b566e64cde.js","static/chunks/1043-90a88c46f27b3df5.js","static/chunks/6601-d4a381403a8bae91.js","static/chunks/938-6a9ffdaa21eee969.js"),self.__BUILD_MANIFEST_CB&&self.__BUILD_MANIFEST_CB();
|