Skip to content

Commit a85fa24

Browse files
Merge remote-tracking branch 'team/impl/sky_lauch' into impl/demo/100724
2 parents 5f30d0c + dc73b2d commit a85fa24

File tree

9 files changed

+954
-153
lines changed

9 files changed

+954
-153
lines changed

examples/cluster/dev.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ resources:
88
ports : 80
99

1010
workdir: ./src/pymc_server/workDir_test
11-
pymc_module: pymc-marketing
11+
module_name: pymc-marketing
1212
run: |
1313
echo "Hello, SkyPilot!"
1414
uname -a

requirements.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
pymc-marketing
21
nutpie
32
lifetimes
43
numba

src/pymc_server/cli.py

Lines changed: 51 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,20 @@
22
import sky
33
from typing import Any, Dict, List, Optional, Tuple, Union
44
from pymc_server.utils.yaml import merge_yaml
5-
from pymc_server.launch_cli import launch as cli_launch
5+
from pymc_server.launch_cli import launch as cli_launch,cli_launch_
6+
from pymc_server.launch_cli import launch_2
7+
from pymc_server.down_cli import down as down_cli
68
from pymc_server.cli_factory import setup_launch_factory, setup_status_factory
79
from sky.usage import usage_lib
10+
from sky.cli import _get_shell_complete_args, _get_click_major_version, _complete_cluster_name, _NaturalOrderGroup, _DocumentedCodeCommand
11+
from pymc_server.utils.cli_ex import jobs_launch as ex_launch
812

913

1014
from sky.cli import (
1115
status as sky_status,
1216
launch as sky_launch,
1317
check as sky_check
1418
)
15-
1619

1720
# TODO: remove, check pyproject.py for a reference to this function
1821
@click.group()
@@ -24,7 +27,14 @@ def cli():
2427
def status(*args, **kwargs):
2528
""" calls the sky status command by passing the click context"""
2629
ctx = click.get_current_context()
27-
ctx.invoke(sky_status, *args, **kwargs)
30+
#ctx.invoke(_status_test, *args, **kwargs)
31+
print("*args",*args)
32+
33+
34+
data = ctx.invoke(sky_status, *args, **kwargs)
35+
print("DATA",data)
36+
37+
#ctx.invoke(sky_status, *args, **kwargs)
2838

2939

3040
@setup_launch_factory
@@ -40,7 +50,8 @@ def launch(*args, **kwargs):
4050
"""
4151
# cli_launch(*args, **kwargs)
4252
ctx = click.get_current_context()
43-
ctx.invoke(cli_launch, *args, **kwargs)
53+
ctx.invoke(launch_2, *args, **kwargs)
54+
#ctx.invoke(sky_launch, *args, **kwargs)
4455

4556
@setup_status_factory
4657
@usage_lib.entrypoint
@@ -51,6 +62,42 @@ def check(*args, **kwargs):
5162
ctx.invoke(sky_check, *args, **kwargs)
5263

5364

65+
@cli.command(cls=_DocumentedCodeCommand)
66+
@click.argument('clusters',
67+
nargs=-1,
68+
required=False,
69+
**_get_shell_complete_args(_complete_cluster_name))
70+
@click.option('--all',
71+
'-a',
72+
default=None,
73+
is_flag=True,
74+
help='Tear down all existing clusters.')
75+
@click.option('--yes',
76+
'-y',
77+
is_flag=True,
78+
default=False,
79+
required=False,
80+
help='Skip confirmation prompt.')
81+
@click.option(
82+
'--purge',
83+
'-p',
84+
is_flag=True,
85+
default=False,
86+
required=False,
87+
help=('(Advanced) Forcefully remove the cluster(s) from '
88+
'SkyPilot\'s cluster table, even if the actual cluster termination '
89+
'failed on the cloud. WARNING: This flag should only be set sparingly'
90+
' in certain manual troubleshooting scenarios; with it set, it is the'
91+
' user\'s responsibility to ensure there are no leaked instances and '
92+
'related resources.'))
93+
@usage_lib.entrypoint
94+
def down(*args, **kwargs):
95+
ctx = click.get_current_context()
96+
#sky_check(*args, **kwargs)
97+
ctx.invoke(down_cli, *args, **kwargs)
98+
"""Deletes a local cluster."""
99+
100+
54101
cli.add_command(status)
55102
cli.add_command(launch)
56103
cli.add_command(check)

src/pymc_server/cli_factory.py

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,11 +79,18 @@ def setup_launch_factory(func):
7979
type=str,
8080
nargs=-1,
8181
**_get_shell_complete_args(_complete_file_name)),
82-
click.option('--pymc_module',
82+
click.option('--module-name',
8383
'-m',
84+
#default='pymc-marketing',
8485
required=False,
8586
type=str,
86-
help=('Define the PyMC module / project you need tu use')),
87+
help=('Define the PyMC module / project you need tu use. '
88+
'pymc-marketing is default.')),
89+
click.option('--base-config-folder',
90+
'-b',
91+
required=False,
92+
type=str,
93+
help=('define config base Folder')),
8794
click.option('--cluster',
8895
'-c',
8996
default=None,
@@ -164,7 +171,18 @@ def setup_launch_factory(func):
164171
**_get_shell_complete_args(_complete_cluster_name),
165172
help=('[Experimental] Clone disk from an existing cluster to launch '
166173
'a new one. This is useful when the new cluster needs to have '
167-
'the same data on the boot disk as an existing cluster.'))
174+
'the same data on the boot disk as an existing cluster.')),
175+
click.option(
176+
'--down',
177+
default=False,
178+
is_flag=True,
179+
required=False,
180+
help=
181+
('Autodown the cluster: tear down the cluster after all jobs finish '
182+
'(successfully or abnormally). If --idle-minutes-to-autostop is also set, '
183+
'the cluster will be torn down after the specified idle time. '
184+
'Note that if errors occur during provisioning/data syncing/setting up, '
185+
'the cluster will not be torn down for debugging purposes.'))
168186
]
169187

170188
for option in reversed(options):
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
resources:
2+
# Optional; if left out, automatically pick the cheapest cloud.
3+
cloud: aws
4+
#disk_tier: medium
5+
# 1x NVIDIA V100 GPU
6+
#accelerators: V100:1
7+
ports: 9000
8+
9+
# Working directory (optional) containing the project codebase.
10+
# Its contents are synced to ~/sky_workdir/ on the cluster.
11+
workdir: .
12+
13+
# Typical use: pip install -r requirements.txt
14+
# Invoked under the workdir (i.e., can use its files).
15+
setup: |
16+
echo "Running setup."
17+
18+
# Typical use: make use of resources, such as running training.
19+
# Invoked under the workdir (i.e., can use its files).
20+
run: |
21+
echo "Hello, SkyPilot!"
22+
#conda env list

0 commit comments

Comments
 (0)