You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[2020-02-10T20:37:10Z] INFO listeners/httplistener: Started HTTP API listener on :8080
94
+
$ cd cmds/contest
95
+
$ go build .
96
+
$ ./contest
97
+
[2023-05-10T13:59:26.361+02:00 I pluginregistry.go:63] Registering target manager csvfiletargetmanager
98
+
[2023-05-10T13:59:26.361+02:00 I pluginregistry.go:63] Registering target manager targetlist
99
+
[2023-05-10T13:59:26.361+02:00 I pluginregistry.go:76] Registering test fetcher literal
100
+
[2023-05-10T13:59:26.361+02:00 I pluginregistry.go:76] Registering test fetcher uri
101
+
[2023-05-10T13:59:26.361+02:00 I pluginregistry.go:89] Registering test step cmd
102
+
[2023-05-10T13:59:26.361+02:00 I pluginregistry.go:89] Registering test step cpucmd
103
+
[2023-05-10T13:59:26.361+02:00 I pluginregistry.go:89] Registering test step echo
104
+
[2023-05-10T13:59:26.362+02:00 I pluginregistry.go:89] Registering test step exec
105
+
[2023-05-10T13:59:26.362+02:00 I pluginregistry.go:89] Registering test step gathercmd
106
+
[2023-05-10T13:59:26.362+02:00 I pluginregistry.go:89] Registering test step randecho
107
+
[2023-05-10T13:59:26.362+02:00 I pluginregistry.go:89] Registering test step sleep
108
+
[2023-05-10T13:59:26.362+02:00 I pluginregistry.go:89] Registering test step sshcmd
109
+
[2023-05-10T13:59:26.362+02:00 I pluginregistry.go:113] Registering reporter noop
110
+
[2023-05-10T13:59:26.362+02:00 I pluginregistry.go:113] Registering reporter targetsuccess
111
+
[2023-05-10T13:59:26.362+02:00 I server.go:207] Using database URI for primary storage: contest:contest@tcp(localhost:3306)/contest?parseTime=true
112
+
[2023-05-10T13:59:26.370+02:00 I server.go:221] Storage version: 7
113
+
[2023-05-10T13:59:26.370+02:00 I server.go:227] Using database URI for replica storage: contest:contest@tcp(localhost:3306)/contest?parseTime=true
114
+
[2023-05-10T13:59:26.372+02:00 I server.go:241] Storage version: 7
115
+
[2023-05-10T13:59:26.372+02:00 I server.go:269] Locker engine set to auto, using DBLocker
116
+
[2023-05-10T13:59:26.375+02:00 D storage.go:52] consistency model check: <nil>
117
+
[2023-05-10T13:59:26.375+02:00 I jobmanager.go:228] Found 0 zombie jobs for /yourservername
118
+
[2023-05-10T13:59:26.375+02:00 D httplistener.go:253] Serving a listener
119
+
[2023-05-10T13:59:26.376+02:00 I httplistener.go:230] Started HTTP API listener on :8080
103
120
```
104
121
105
122
The server is informing us that it started the HTTP API listener on port 8080, after registering various types of plugins: target managers, test fetchers, test steps, and reporters.
106
123
107
-
ConTest also requires a database to store its state, events and other data.
108
-
The schema is defined under [docker/mysql/initdb.sql](docker/mysql/initdb.sql)
109
-
so you can create your own. We provide a docker image to bring up a database, so
110
-
you can use it with the sample server. Just run
124
+
## Database
125
+
126
+
ConTest requires a database to store its state, events and other data.
127
+
128
+
* DB name and default user are defined in [docker/mysql/initdb.sql](docker/mysql/initdb.sql)
129
+
* DB schema is defined in [db/rdbms/schema/v0/create_contest_db.sql](db/rdbms/schema/v0/create_contest_db.sql)
130
+
* DB migrations are defined in the [db/rdbms/migration directory](db/rdbms/migration)
131
+
132
+
### Using docker
133
+
134
+
We provide a docker image to bring up a database, so you can use it with the
135
+
sample server. Just run
111
136
```
112
137
docker-compose up mysql
113
138
```
114
-
115
139
from the top directory of ConTest's source code.
116
140
141
+
### Using a local mysql instance
142
+
143
+
If you don't want to run Docker, or if you have already a mysql instance you
144
+
want to use, you can:
145
+
146
+
1. Either create a "contest" local database and a "contest" user as described
147
+
in the `initdb.sql` script:
148
+
149
+
```
150
+
mysql -u root -p < docker/mysql/initdb.sql
151
+
```
152
+
153
+
2. Load the database schema
154
+
155
+
```
156
+
mysql -u contest -p < db/rdbms/schema/v0/create_contest_db.sql
157
+
```
158
+
159
+
3. Run all migrations
160
+
161
+
```
162
+
cd tools/migration/rdbms
163
+
go run . -dir ../../../db/rdbms/migration up
164
+
```
165
+
117
166
Once the database is up, it will possible to submit test jobs through the client,
118
167
as shown in the next section.
119
168
120
-
### Submitting jobs to the sample server
169
+
170
+
## Submitting jobs to the sample server
121
171
122
172
ConTest has no official CLI, because every user is different. However we provide
123
173
a sample CLI based on cleartext HTTP that will communicate to the HTTP API. All
124
174
you need to do is building the sample ConTest server as described above, and run
125
-
the CLI tool under [cmds/clients/contestcli-http](cmds/clients/contestcli-http).
175
+
the CLI tool under [cmds/clients/contestcli](cmds/clients/contestcli).
126
176
The tool is very simple:
127
177
```
128
-
$ ./contestcli-http -h
129
-
Usage of contestcli-http:
178
+
$ cd cmds/clients/contestcli
179
+
$ go build .
180
+
$ ./contestcli -h
181
+
Usage of contestcli:
130
182
131
-
contestcli-http [args] command
183
+
contestcli [args] command
132
184
133
185
command: start, stop, status, retry, version
134
186
start
@@ -144,17 +196,17 @@ command: start, stop, status, retry, version
144
196
145
197
args:
146
198
-addr string
147
-
ConTest server [scheme://]host:port[/basepath] to connect to (default "http://localhost:8080")
199
+
ConTest server [scheme://]host:port[/basepath] to connect to (default "http://localhost:8080")
148
200
-r string
149
-
Identifier of the requestor of the API call (default "contestcli-http")
201
+
Identifier of the requestor of the API call (default "contestcli")
150
202
exit status 2
151
203
```
152
204
153
205
To run a job, just feed a [job descriptor](#job-descriptors) to the client's `start` command, e.g. using
0 commit comments