Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/creack/telepilot
TelePilot - The Job Manager for Teleport coding assignment
https://github.com/creack/telepilot
Last synced: 26 days ago
JSON representation
TelePilot - The Job Manager for Teleport coding assignment
- Host: GitHub
- URL: https://github.com/creack/telepilot
- Owner: creack
- License: mit
- Created: 2024-09-30T19:33:54.000Z (3 months ago)
- Default Branch: main
- Last Pushed: 2024-10-11T13:00:48.000Z (3 months ago)
- Last Synced: 2024-11-27T05:09:15.055Z (about 1 month ago)
- Language: Go
- Size: 225 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# TelePilot
TelePilot is a coding assignment for Teleport. It is a remote process manager.
## Build
To build the binary, use `make build`. It will create binaries:
- the client `./bin/telepilot`
- the server `./bin/telepilotd`## Tests
Use `make test` to run the tests. This will generate all the necessary files,
including keys and certs then run the test suite.### Manual testing
To help with cgroup testing, test scripts are provided under [./test/scripts](./test/scripts).
Assuming the server is up and running, from the reposiroty root:
#### CPU
In one shell
```sh
./bin/telepilot start ./test/scripts/cpu.sh | tee /tmp/job_id"
```Somewhere else using `htop` or similar, observe CPU usage. Should be 50% while the script attempts to use 100%.
Don't forget to kill the test.
```sh
./bin/telepilot stop "$(cat /tmp/job_id)"
```#### Memory
```sh
job_id=$(./bin/telepilot start ./test/scripts/memory.sh) && ./bin/telepilot logs "${job_id}"
```This will run for at most one minute. It may OOM before then. Using `htop` or similar, observe that the memory
usage never exceeds 50MB.#### IO
```sh
job_id=$(./bin/telepilot start ./test/scripts/memory.sh) && ./bin/telepilot logs "${job_id}"
```This will run for 10 seconds and show the output of `dd` including the bandwidth. It should be 1MB/s for both read and write.
## Usage
Before getting started, run `make all` to build binaries, generate a CA, server and client keys/certs.
### Server
In one shell, from the reposiroty root, run the server as root: `sudo ./bin/telepilotd`.
See `./bin/telepilotd -h` for options concerning cert directory.
### Client
In a different shell, from the reposiroty root, you can now use the client:
See `./bin/telepilot -h` for detailed usage / flags.
```bash
job_id=$(./bin/telepilot -user alice start sh -c 'sleep 5; echo hello' | tee /dev/stderr)
./bin/telepilot -user alice status "${job_id}"
./bin/telepilot -user alice logs "${job_id}"./bin/telepilot -user bob stop "${job_id}" # Expected to fail with Permission Denied.
```## User Management
Running `make mtls` generates 3 clients: `alice`, `bob` and `dave`.
New clients can be generated on the fly by running `make certs/client-.pem`.