Skip to content

Commit a54cc6a

Browse files
gridheadnphilipp
authored andcommitted
Document usage instructions for the CLI
Signed-off-by: Akashdeep Dhar <[email protected]>
1 parent d7e347c commit a54cc6a

File tree

1 file changed

+61
-13
lines changed

1 file changed

+61
-13
lines changed

Diff for: README.md

+61-13
Original file line numberDiff line numberDiff line change
@@ -13,29 +13,77 @@ Duffy is the middle layer running ci.centos.org that manages the provisioning, m
1313

1414
### Installation
1515
To install Duffy:
16-
* Clone the repository.
17-
* Install using Poetry: `poetry install`
16+
1. Clone the repository and navigate into the project directory.
17+
```
18+
git clone https://github.com/CentOS/duffy.git
19+
cd duffy
20+
```
21+
2. Set up and activate a virtual environment.
22+
* Using native virtual environment
23+
```
24+
python3 -m venv duffyenv
25+
source duffyenv/bin/activate
26+
```
27+
Or
28+
* Using virtualenv wrapper
29+
```
30+
virtualenv duffyenv
31+
source duffyenv/bin/activate
32+
```
33+
Or
34+
* Using Poetry virtual environment shell
35+
```
36+
poetry shell
37+
```
38+
3. Install using Poetry
39+
```
40+
poetry install
41+
```
1842
19-
### Running Duffy using poetry
43+
### Running Duffy server
2044
21-
There are two ways to run the app using the virtual environment poetry manages for you:
45+
#### Viewing CLI usage
2246
2347
```
24-
poetry run uvicorn duffy.app.main:app --reload
48+
duffy --help
2549
```
2650
27-
Or:
28-
2951
```
30-
poetry shell
31-
uvicorn duffy.app.main:app --reload
52+
Usage: duffy [OPTIONS]
53+
54+
Duffy is the middle layer running ci.centos.org that manages the
55+
provisioning, maintenance and teardown / rebuild of the Nodes (physical
56+
hardware for now, VMs coming soon) that are used to run the tests in the CI
57+
Cluster.
58+
59+
Options:
60+
-p, --portnumb INTEGER Set the port value [0-65536]
61+
-6, --ipv6 Start the server on an IPv6 address
62+
-4, --ipv4 Start the server on an IPv4 address
63+
-l, --loglevel [critical|error|warning|info|debug|trace]
64+
Set the log level
65+
--version Show the version and exit.
66+
--help Show this message and exit.
3267
```
3368
34-
### Running Duffy in an explicitly defined virtual environment
69+
#### Starting the server at port 8080 using IP version 4 and setting the log level to `trace`
3570
36-
If you create a virtual environment by yourself, poetry will install into this if it's activated. In
37-
this environment, simply run the app like this:
71+
```
72+
duffy -p 8000 -4 -l trace
73+
```
3874
3975
```
40-
uvicorn duffy.app.main:app --reload
76+
* Starting Duffy...
77+
* Port number : 8000
78+
* IP version : 4
79+
* Log level : trace
80+
INFO: Started server process [104283]
81+
INFO: Waiting for application startup.
82+
TRACE: ASGI [1] Started scope={'type': 'lifespan', 'asgi': {'version': '3.0', 'spec_version': '2.0'}}
83+
TRACE: ASGI [1] Receive {'type': 'lifespan.startup'}
84+
TRACE: ASGI [1] Send {'type': 'lifespan.startup.complete'}
85+
INFO: Application startup complete.
86+
INFO: Uvicorn running on http://0.0.0.0:8000 (Press CTRL+C to quit)
4187
```
88+
89+
Exit out of the server using `Ctrl` + `C`

0 commit comments

Comments
 (0)