@@ -13,29 +13,77 @@ Duffy is the middle layer running ci.centos.org that manages the provisioning, m
13
13
14
14
### Installation
15
15
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
+ ```
18
42
19
- ### Running Duffy using poetry
43
+ ### Running Duffy server
20
44
21
- There are two ways to run the app using the virtual environment poetry manages for you:
45
+ #### Viewing CLI usage
22
46
23
47
```
24
- poetry run uvicorn duffy.app.main:app --reload
48
+ duffy --help
25
49
```
26
50
27
- Or:
28
-
29
51
```
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.
32
67
```
33
68
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`
35
70
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
+ ```
38
74
39
75
```
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)
41
87
```
88
+
89
+ Exit out of the server using `Ctrl` + `C`
0 commit comments