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
Copy file name to clipboardExpand all lines: apps/execution-service/README.md
+74-49Lines changed: 74 additions & 49 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -20,7 +20,32 @@ go run main.go
20
20
21
21
The server will be available at http://localhost:8083.
22
22
23
-
## Running the Application via Docker
23
+
### Setting up message queue with RabbitMQ
24
+
25
+
A message queue is used to pass submission results asynchronously from the execution-service to the history-service.
26
+
27
+
1. In order to do so, we can run the following command to set up a docker container for RabbitMQ:
28
+
29
+
```bash
30
+
docker run -d --name rabbitmq -p 5672:5672 -p 15672:15672 rabbitmq:3-management
31
+
```
32
+
33
+
2. Then we can run the execution-service:
34
+
35
+
```bash
36
+
go run main.go
37
+
```
38
+
39
+
3. We can run the history-service by changing our directory and running the same command:
40
+
41
+
```bash
42
+
cd ../history-service
43
+
go run main.go
44
+
```
45
+
46
+
To view more details on the RabbitMQ queue, we can go to `localhost:15672`, and login using `guest` as the username and password.
47
+
48
+
### Running the Application via Docker
24
49
25
50
To run the application via Docker, run the following command:
26
51
@@ -74,10 +99,10 @@ The following json format will be returned:
74
99
75
100
```json
76
101
[
77
-
{
78
-
"input":"hello",
79
-
"expected":"olleh"
80
-
}
102
+
{
103
+
"input":"hello",
104
+
"expected":"olleh"
105
+
}
81
106
]
82
107
```
83
108
@@ -98,16 +123,16 @@ The following json format will be returned:
98
123
99
124
```json
100
125
{
101
-
"visibleTestResults":[
126
+
"visibleTestResults":[
102
127
{
103
-
"input":"hello",
104
-
"expected":"olleh",
105
-
"actual":"olleh",
106
-
"passed":true,
107
-
"error":""
128
+
"input":"hello",
129
+
"expected":"olleh",
130
+
"actual":"olleh",
131
+
"passed":true,
132
+
"error":""
108
133
}
109
134
],
110
-
"customTestResults":null
135
+
"customTestResults":null
111
136
}
112
137
```
113
138
@@ -127,29 +152,29 @@ The following json format will be returned:
127
152
128
153
```json
129
154
{
130
-
"visibleTestResults":[
155
+
"visibleTestResults":[
131
156
{
132
-
"input":"hello",
133
-
"expected":"olleh",
134
-
"actual":"olleh",
135
-
"passed":true,
136
-
"error":""
157
+
"input":"hello",
158
+
"expected":"olleh",
159
+
"actual":"olleh",
160
+
"passed":true,
161
+
"error":""
137
162
}
138
163
],
139
-
"customTestResults":[
164
+
"customTestResults":[
140
165
{
141
-
"input":"Hannah",
142
-
"expected":"hannaH",
143
-
"actual":"hannaH",
144
-
"passed":true,
145
-
"error":""
166
+
"input":"Hannah",
167
+
"expected":"hannaH",
168
+
"actual":"hannaH",
169
+
"passed":true,
170
+
"error":""
146
171
},
147
172
{
148
-
"input":"abcdefg",
149
-
"expected":"gfedcba",
150
-
"actual":"gfedcba",
151
-
"passed":true,
152
-
"error":""
173
+
"input":"abcdefg",
174
+
"expected":"gfedcba",
175
+
"actual":"gfedcba",
176
+
"passed":true,
177
+
"error":""
153
178
}
154
179
]
155
180
}
@@ -178,40 +203,40 @@ The following json format will be returned:
178
203
179
204
```json
180
205
{
181
-
"visibleTestResults":[
206
+
"visibleTestResults":[
182
207
{
183
-
"input":"hello",
184
-
"expected":"olleh",
185
-
"actual":"olleh",
186
-
"passed":true,
187
-
"error":""
208
+
"input":"hello",
209
+
"expected":"olleh",
210
+
"actual":"olleh",
211
+
"passed":true,
212
+
"error":""
188
213
}
189
214
],
190
-
"hiddenTestResults":{
191
-
"passed":2,
192
-
"total":2
215
+
"hiddenTestResults":{
216
+
"passed":2,
217
+
"total":2
193
218
},
194
-
"status":"Accepted"
219
+
"status":"Accepted"
195
220
}
196
221
```
197
222
198
223
If compilation error exists or any of the tests (visible and hidden) fails, status "Attempted" will be returned:
199
224
200
225
```json
201
226
{
202
-
"visibleTestResults":[
227
+
"visibleTestResults":[
203
228
{
204
-
"input":"hello",
205
-
"expected":"olleh",
206
-
"actual":"",
207
-
"passed":false,
208
-
"error":"Command execution failed: Traceback (most recent call last):\n File \"/tmp/4149249165.py\", line 2, in \u003cmodule\u003e\n prit(name[::-1])\n ^^^^\nNameError: name 'prit' is not defined. Did you mean: 'print'?\n: %!w(*exec.ExitError=\u0026{0x4000364678 []})"
229
+
"input":"hello",
230
+
"expected":"olleh",
231
+
"actual":"",
232
+
"passed":false,
233
+
"error":"Command execution failed: Traceback (most recent call last):\n File \"/tmp/4149249165.py\", line 2, in \u003cmodule\u003e\n prit(name[::-1])\n ^^^^\nNameError: name 'prit' is not defined. Did you mean: 'print'?\n: %!w(*exec.ExitError=\u0026{0x4000364678 []})"
0 commit comments