|
10 | 10 | from dstack._internal.core.backends.base.compute import ( |
11 | 11 | Compute, |
12 | 12 | ComputeWithCreateInstanceSupport, |
13 | | - generate_unique_instance_name, |
14 | 13 | get_shim_commands, |
15 | 14 | ) |
16 | 15 | from dstack._internal.core.backends.base.offers import get_catalog_offers |
@@ -115,13 +114,10 @@ def create_instance( |
115 | 114 | instance_config: InstanceConfiguration, |
116 | 115 | placement_group: Optional[PlacementGroup], |
117 | 116 | ) -> JobProvisioningData: |
118 | | - instance_name = generate_unique_instance_name( |
119 | | - instance_config, max_length=MAX_INSTANCE_NAME_LEN |
120 | | - ) |
121 | 117 | project_ssh_key = instance_config.ssh_keys[0] |
122 | 118 | self.api_client.upload_ssh_key(project_ssh_key.public) |
123 | 119 | vm_payload = self.get_payload_from_offer(instance_offer.instance) |
124 | | - vm_data = self.api_client.create_virtual_machine(vm_payload, instance_name) |
| 120 | + vm_data = self.api_client.create_virtual_machine(vm_payload) |
125 | 121 | return JobProvisioningData( |
126 | 122 | backend=instance_offer.backend, |
127 | 123 | instance_type=instance_offer.instance, |
@@ -178,27 +174,13 @@ def _start_runner( |
178 | 174 | project_ssh_private_key: str, |
179 | 175 | launch_command: str, |
180 | 176 | ): |
181 | | - _setup_instance( |
182 | | - hostname=hostname, |
183 | | - ssh_private_key=project_ssh_private_key, |
184 | | - ) |
185 | 177 | _launch_runner( |
186 | 178 | hostname=hostname, |
187 | 179 | ssh_private_key=project_ssh_private_key, |
188 | 180 | launch_command=launch_command, |
189 | 181 | ) |
190 | 182 |
|
191 | 183 |
|
192 | | -def _setup_instance( |
193 | | - hostname: str, |
194 | | - ssh_private_key: str, |
195 | | -): |
196 | | - setup_commands = ("sudo apt-get update",) |
197 | | - _run_ssh_command( |
198 | | - hostname=hostname, ssh_private_key=ssh_private_key, command=" && ".join(setup_commands) |
199 | | - ) |
200 | | - |
201 | | - |
202 | 184 | def _launch_runner( |
203 | 185 | hostname: str, |
204 | 186 | ssh_private_key: str, |
|
0 commit comments