Skip to content

Commit

Permalink
README.md: Tweak some formatting
Browse files Browse the repository at this point in the history
Signed-off-by: Zack Cerza <[email protected]>
  • Loading branch information
zmc committed Oct 18, 2023
1 parent 7836e2d commit 073b942
Showing 1 changed file with 32 additions and 30 deletions.
62 changes: 32 additions & 30 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,23 @@
# Teuthology API

A REST API to execute [teuthology commands](https://docs.ceph.com/projects/teuthology/en/latest/commands/list.html).
A REST API to execute [teuthology commands](https://docs.ceph.com/projects/teuthology/en/latest/commands/list.html).

## Setup

#### Option 1: (teuthology docker setup)
### Option 1: (teuthology docker setup)

1. Clone [teuthology](https://github.com/ceph/teuthology) and [teuthology-api](https://github.com/VallariAg/teuthology-api).
2. Rename `.env.dev` file to `.env`.
2. Rename `.env.dev` file to `.env`.
3. Configure secrets:
3.1. Create a Github OAuth Application by following [these](https://docs.github.com/en/apps/oauth-apps/building-oauth-apps/creating-an-oauth-app) instructions. Set "Homepage URL" as `http://localhost:8082/` and "Authorization callback URL" as `http://localhost:8082/login/callback/`.

3.1. Create a Github OAuth Application by following [these](https://docs.github.com/en/apps/oauth-apps/building-oauth-apps/creating-an-oauth-app) instructions. Set "Homepage URL" as `http://localhost:8082/` and "Authorization callback URL" as `http://localhost:8082/login/callback/`.

3.2. Ensure [ceph](https://github.com/ceph) belongs in your public list of organizations[[ref](https://docs.github.com/en/account-and-profile/setting-up-and-managing-your-personal-account-on-github/managing-your-membership-in-organizations/about-organization-membership)]. By default your membership is set private, change that to public by following [these](https://docs.github.com/en/account-and-profile/setting-up-and-managing-your-personal-account-on-github/managing-your-membership-in-organizations/publicizing-or-hiding-organization-membership) steps.

3.3. Save `CLIENT_ID` and `CLIENT_SECRET` from your Github OAuth App to your local `.env` file as `GH_CLIENT_ID` and `GH_CLIENT_SECRET`.

4. Add the following to [teuthology's docker-compose](https://github.com/ceph/teuthology/blob/main/docs/docker-compose/docker-compose.yml) services.

```
teuthology_api:
build:
Expand All @@ -36,7 +37,6 @@ A REST API to execute [teuthology commands](https://docs.ceph.com/projects/teuth
healthcheck:
test: [ "CMD", "curl", "-f", "http://0.0.0.0:8082" ]
```
[optional] For developement use:
Add following things in `teuthology_api` container:
```
Expand All @@ -47,13 +47,14 @@ A REST API to execute [teuthology commands](https://docs.ceph.com/projects/teuth
- ../../../teuthology-api:/teuthology_api/:rw
```
`DEPLOYMENT: development` would run the server in `--reload` mode (server would restart when changes are made in `/src` dir) and `volumes` would mount host directory to docker's directory (local changes would reflect in docker container).
3. Follow teuthology development setup instructions from [here](https://github.com/ceph/teuthology/tree/main/docs/docker-compose).
5. Follow teuthology development setup instructions from [here](https://github.com/ceph/teuthology/tree/main/docs/docker-compose).
## Documentation
The documentation can be accessed at http://localhost:8082/docs after running the application.
Note: To run commands, authenticate by visiting `http://localhost:8082/login` through browser and follow the github authentication steps (this stores the auth token in browser cookies).
Note: To run commands, authenticate by visiting `http://localhost:8082/login` through browser and follow the github authentication steps (this stores the auth token in browser cookies).
### Route `/`
Expand All @@ -66,28 +67,29 @@ Returns `{"root": "success", "session": { <authentication details> }}`.
POST `/suite/`: schedules a run.
Two query parameters:
Two query parameters:
- `dry_run` (boolean) - Do a dry run; do not schedule anything.
- `logs` (boolean) - Send scheduling logs in response.
Example:
```
curl --location --request POST 'http://localhost:8082/suite?dry_run=false&logs=true' \
--header 'Content-Type: application/json' \
--data-raw '{
"--ceph": "wip-dis-testing-2",
"--ceph-repo": "https://github.com/ceph/ceph-ci.git",
"--kernel": "distro",
"--limit": "2",
"--newest": "0",
"--machine-type": "testnode",
"--num": "1",
"--priority": "70",
"--suite": "teuthology:no-ceph",
"--suite-branch": "wip-dis-testing-2",
"--suite-repo": "https://github.com/ceph/ceph-ci.git",
"--teuthology-branch": "main",
"--verbose": "1",
"--user": "vallariag"
}'
```
Example
curl --location --request POST 'http://localhost:8082/suite?dry_run=false&logs=true' \
--header 'Content-Type: application/json' \
--data-raw '{
"--ceph": "wip-dis-testing-2",
"--ceph-repo": "https://github.com/ceph/ceph-ci.git",
"--kernel": "distro",
"--limit": "2",
"--newest": "0",
"--machine-type": "testnode",
"--num": "1",
"--priority": "70",
"--suite": "teuthology:no-ceph",
"--suite-branch": "wip-dis-testing-2",
"--suite-repo": "https://github.com/ceph/ceph-ci.git",
"--teuthology-branch": "main",
"--verbose": "1",
"--user": "vallariag"
}'
xxx

0 comments on commit 073b942

Please sign in to comment.