Skip to content

Commit b4621b2

Browse files
committedJun 12, 2022
#20 - merge traffic generation work from csr
1 parent b4abd02 commit b4621b2

File tree

2 files changed

+52
-5
lines changed

2 files changed

+52
-5
lines changed
 

‎README.md

+52-1
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,56 @@ start/stop thread http://127.0.0.1:8888/nbi/forward/reset
1212
- message
1313
- timestamps
1414
- node
15-
- timestanp
15+
- timestamp
16+
17+
# Example Google Cloud Run
18+
19+
HTTPS support is added via Google Cloud Run
20+
21+
source swagger: https://traffic-generation-source-vyua7q27tq-nn.a.run.app/nbi/swagger-ui.html#/application-service-controller/getHealthUsingGET_1
22+
source: https://traffic-generation-source-vyua7q27tq-nn.a.run.app/nbi/api
23+
24+
target: https://traffic-generation-target-vyua7q27tq-pd.a.run.app/nbi/api
25+
26+
Traffic gen API:
27+
```
28+
https://traffic-generation-source-vyua7q27tq-nn.a.run.app/nbi/swagger-ui.html#/forwarding-controller/getPacketUsingGET
29+
30+
source
31+
32+
https://traffic-generation-source-vyua7q27tq-nn.a.run.app/nbi/forward/packet?delay=1000&dnsFrom=traffic-generation-source-vyua7q27tq-nn.a.run.app&dnsTo=traffic-generation-target-vyua7q27tq-pd.a.run.app&from=80&to=80
33+
34+
curl -X GET "https://traffic-generation-source-vyua7q27tq-nn.a.run.app/nbi/forward/packet?delay=1000&dnsFrom=traffic-generation-source-vyua7q27tq-nn.a.run.app&dnsTo=traffic-generation-target-vyua7q27tq-pd.a.run.app&from=80&to=80" -H "accept: */*"
35+
36+
target
37+
38+
https://traffic-generation-target-vyua7q27tq-pd.a.run.app/nbi/forward/packet?delay=1000&dnsFrom=traffic-generation-target-vyua7q27tq-pd.a.run.app&dnsTo=traffic-generation-source-vyua7q27tq-nn.a.run.app&from=80&to=80
39+
40+
41+
## Traffic Generation
42+
43+
2 copies of the traffic gen containers are currently running on cloud run until I move them over to the GKE cluster.
44+
The health check doubles as the target REST endpoint for now.
45+
Note: HTTPS termination is on the cloud run gateway - if we don't terminate on the API Gateway and/or the LB fronting the GKE cluster then I'll add a self signed to the app - for now we use the Google cert for https.
46+
47+
CICD
48+
Currently there is a CSR trigger on cloud build to run the maven build and build/push the container into artifact registry. The cloud run builds are static but can be switched to trigger. I expect we can add a trigger on the cloud deploy job once I have moved the container to GKE.
49+
50+
To view - open swagger or use direct curls or the browser
51+
https://traffic-generation-source-vyua7q27tq-nn.a.run.app/nbi/swagger-ui.html#/forwarding-controller/getTrafficUsingGET
52+
enter for example 120k 1ms traffic https://traffic-generation-source-vyua7q27tq-nn.a.run.app/nbi/forward/traffic?delay=1&dns=traffic-generation-target-vyua7q27tq-pd.a.run.app&iterations=120000&to=80
53+
54+
view the metrics on both source and target. These requests have no real load on the backend (db marshall/unmarshall as part of orm) therefore 1k requests/sec only scales a smaller than normal 1g/1vCore container up to 3 instances. Once we get backend load scaling should occur with over 1k req/sec traffic
55+
56+
https://console.cloud.google.com/run/detail/northamerica-northeast1/traffic-generation-source/metrics
57+
58+
https://console.cloud.google.com/run/detail/northamerica-northeast2/traffic-generation-target/metrics
59+
60+
61+
# local development testing in cloud shell
62+
curl -X GET "http://127.0.0.1:8080/nbi/forward/traffic?dns=127.0.0.1&to=8080&delay=1000&iterations=20"
63+
64+
curl -X GET "http://127.0.0.1:8080/nbi/forward/reset"
65+
```
66+
1667

‎cloudbuild.yaml

-4
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,5 @@ images:
2828
["northamerica-northeast1-docker.pkg.dev/$PROJECT_ID/traffic-generation/traffic-generation:latest"]
2929

3030

31-
#ERROR: failed to find one or more images after execution of build steps: ["gcr.io/innovapost-351413/magellan-nbi:latest"]
32-
#options:
33-
# logging: CLOUD_LOGGING_ONLY
34-
# [END cloudbuild_maven]
3531

3632

0 commit comments

Comments
 (0)
Please sign in to comment.