Skip to content

Commit

Permalink
format
Browse files Browse the repository at this point in the history
  • Loading branch information
Michaelvll committed Aug 23, 2024
1 parent 8bb7eb5 commit 0f84f72
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 14 deletions.
8 changes: 4 additions & 4 deletions sky/api/requests/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,10 +130,10 @@ def encode(self) -> RequestTaskPayload:
)
except TypeError as e:
print('Error encoding.\n'
f'{self.request_id}\n'
f'{self.name}\n'
f'{self.request_body}\n'
f'{self.return_value}\n')
f'{self.request_id}\n'
f'{self.name}\n'
f'{self.request_body}\n'
f'{self.return_value}\n')
raise

@classmethod
Expand Down
14 changes: 5 additions & 9 deletions sky/api/rest.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,7 @@ def refresh_cluster_status_event():


# Register the events to run in the background.
events = {
'status': refresh_cluster_status_event
}
events = {'status': refresh_cluster_status_event}


class RequestBody(pydantic.BaseModel):
Expand Down Expand Up @@ -162,11 +160,10 @@ def _start_background_request(request_id: str,
@app.on_event('startup')
async def startup():
for event_id, (event_name, event) in enumerate(events.items()):
_start_background_request(
request_id=str(event_id),
request_name=event_name,
request_body={},
func=event)
_start_background_request(request_id=str(event_id),
request_name=event_name,
request_body={},
func=event)


class OptimizeBody(pydantic.BaseModel):
Expand Down Expand Up @@ -271,7 +268,6 @@ async def stop(request: fastapi.Request, stop_body: StopBody):
)



class StatusBody(pydantic.BaseModel):
cluster_names: Optional[List[str]] = None
refresh: bool = False
Expand Down
1 change: 1 addition & 0 deletions sky/api/sdk.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ def optimize(dag: 'sky.Dag') -> str:
}
_add_env_vars_to_body(body)
response = requests.get(f'{_get_server_url()}/optimize', json=body)
print(response.content)
return response.headers['X-Request-ID']


Expand Down
1 change: 0 additions & 1 deletion sky/clouds/fluidstack.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
from sky.provision.fluidstack import fluidstack_utils
from sky.utils import registry
from sky.utils import resources_utils
from sky.utils import registry
from sky.utils import status_lib
from sky.utils.resources_utils import DiskTier

Expand Down
1 change: 1 addition & 0 deletions sky/jobs/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,7 @@ def cancel(name: Optional[str] = None,
raise RuntimeError(
'Please specify the job ID instead of the job name.')


@usage_lib.entrypoint
def tail_logs(name: Optional[str], job_id: Optional[int], follow: bool,
controller: bool) -> None:
Expand Down

0 comments on commit 0f84f72

Please sign in to comment.