Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Debugging docs #437

Merged
merged 7 commits into from
Jun 29, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 25 additions & 16 deletions docs/debugging.md
Original file line number Diff line number Diff line change
@@ -1,27 +1,36 @@
# Debugging Tools
Skyplane has built-in tools for debugging during development.
Skyplane has built-in tools for debugging during development.

## Logs

## Gateway Logs
### Client Logs
When you run a transfer, the client logs will be written to a folder inside of the `/tmp/skyplane/transfer_logs/` directory.

### Dozzle
You can view gateway logs at ???.

### Gateway `ssh`
You can `ssh` into a gateway with:
### Gateway Logs
Inside the `client.log` file, for each provisioned Skyplane gateway there will be the lines:
```
skyplane ssh
[INFO] Log viewer: http://127.0.0.1:[PORT]/container/[CONTAINER_ID]
[INFO] API: http://127.0.0.1:[PORT]
```
which will list running gateways you can `ssh` into.
which correspond to the gateway log viewer and the gateway chunk API. You can view the logs for each gateway by going to the "Log viewer" address for that gateway.

To view the gateway logs on the instance, you can view the docker logs with:
### Chunk API
The gateway chunk API allows for status of chunks on each gateway to be queried externally, and is used by the Skyplane client to monitor transfers.
```
docker logs ??
* GET /api/v1/status - returns status of API
* GET /api/v1/servers - returns list of running servers
* GET /api/v1/chunk_requests - returns list of chunk requests (use {'state': '<state>'} to filter)
* GET /api/v1/chunk_requests/<int:chunk_id> - returns chunk request
* POST /api/v1/chunk_requests - adds a new chunk request
* PUT /api/v1/chunk_requests/<int:chunk_id> - updates chunk request
* GET /api/v1/chunk_status_log - returns list of chunk status log entries
```
You can view downloaded chunks in the ?? folder.


## Chunk API
For a running gateway, you can use HTTP requests to view the chunk state on that gateway.
## Gateway `ssh`
You can `ssh` into a gateway with:
```
skyplane ssh
```
which will list available gateways that you can select to ssh into.

TODO: can we auto-document the chunk API?
Once you've ssh-ed into a gateway instance, you can interact with the Skyplane docker image (??).
2 changes: 1 addition & 1 deletion docs/development_guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,4 +59,4 @@ $ skyplane cp s3://... s3://...
## Development Tips
If testing transfers repeatedly, we recommend using the `--reuse-gateways` to reduce setup time.

Skyplane has debugging tools to `ssh` into gateway instances, view detailed transfer logs, and query chunk states during transfers. See [Debugging Tools](debugging.md) for more.
Skyplane has debugging tools to `ssh` into gateway instances, view detailed transfer logs, and query chunk states during transfers. See [Debugging Tools](debugging.md) for more.