|
57 | 57 | from dstack._internal.utils.path import is_absolute_posix_path |
58 | 58 | from dstack.api._public.repos import get_ssh_keypair |
59 | 59 | from dstack.api._public.runs import Run |
| 60 | +from dstack.api.server import APIClient |
60 | 61 | from dstack.api.utils import load_profile |
61 | 62 |
|
62 | 63 | _KNOWN_AMD_GPUS = {gpu.name.lower() for gpu in gpuhunt.KNOWN_AMD_GPUS} |
@@ -222,6 +223,9 @@ def apply_configuration( |
222 | 223 | format_date=local_time, |
223 | 224 | ) |
224 | 225 | ) |
| 226 | + |
| 227 | + _warn_fleet_autocreated(self.api.client, run) |
| 228 | + |
225 | 229 | console.print( |
226 | 230 | f"\n[code]{run.name}[/] provisioning completed [secondary]({run.status.value})[/]" |
227 | 231 | ) |
@@ -865,3 +869,17 @@ def render_run_spec_diff(old_spec: RunSpec, new_spec: RunSpec) -> Optional[str]: |
865 | 869 | item = NestedListItem(spec_field.replace("_", " ").capitalize()) |
866 | 870 | nested_list.children.append(item) |
867 | 871 | return nested_list.render() |
| 872 | + |
| 873 | + |
| 874 | +def _warn_fleet_autocreated(api: APIClient, run: Run): |
| 875 | + if run._run.fleet is None: |
| 876 | + return |
| 877 | + fleet = api.fleets.get(project_name=run._project, name=run._run.fleet.name) |
| 878 | + if not fleet.spec.autocreated: |
| 879 | + return |
| 880 | + warn( |
| 881 | + f"\nThe run is using automatically created fleet [code]{fleet.name}[/code].\n" |
| 882 | + "Future [code]dstack[/code] versions will stop creating fleets automatically.\n" |
| 883 | + "Create the fleet explicitly to remove this warning and prepare for upcoming changes.\n" |
| 884 | + "Learn more about fleets: https://dstack.ai/docs/concepts/fleets/" |
| 885 | + ) |
0 commit comments