Skip to content

Commit 8e15aeb

Browse files
authored
chore(dev): replace plork images (vectordotdev#22217)
* chore(dev): replace plork images * add a python server that accepts POST requests * spelling * fix md lint * prune docker images to free up space
1 parent e27ea3a commit 8e15aeb

File tree

5 files changed

+51
-4
lines changed

5 files changed

+51
-4
lines changed

.github/actions/spelling/allow.txt

+1
Original file line numberDiff line numberDiff line change
@@ -510,3 +510,4 @@ UMTS
510510
WCDMA
511511
XMODEM
512512
cbor
513+
requestline

.github/actions/spelling/expect.txt

-1
Original file line numberDiff line numberDiff line change
@@ -442,7 +442,6 @@ PIDs
442442
PII
443443
plainify
444444
ple
445-
plork
446445
podspec
447446
Ponge
448447
POSINT

.github/workflows/integration.yml

+2
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,8 @@ jobs:
8888
with:
8989
submodules: "recursive"
9090

91+
- run: docker image prune -af ; docker container prune -f
92+
9193
- name: Download JSON artifact from changes.yml
9294
uses: actions/download-artifact@v4
9395
with:

docs/tutorials/sinks/2_http_sink.md

+47-2
Original file line numberDiff line numberDiff line change
@@ -457,10 +457,55 @@ incoming events and the `BasicService` we created above.
457457

458458
We can now run our new sink.
459459

460-
Let's run a test HTTP server to accept the responses our sink sends:
460+
Here is a potential `simple_http_server.py` server to accept the responses our sink sends:
461+
462+
```python
463+
import http.server
464+
import socketserver
465+
466+
467+
class RequestHandler(http.server.BaseHTTPRequestHandler):
468+
def do_GET(self):
469+
# Print the request line and headers
470+
print(f"Request Line: {self.requestline}")
471+
print("Headers:")
472+
for header, value in self.headers.items():
473+
print(f"{header}: {value}")
474+
475+
# Send a response
476+
self.send_response(200)
477+
self.send_header('Content-type', 'text/html')
478+
self.end_headers()
479+
self.wfile.write(b'GET request received')
480+
481+
def do_POST(self):
482+
print(f"Request Line: {self.requestline}")
483+
print("Headers:")
484+
for header, value in self.headers.items():
485+
print(f"{header}: {value}")
486+
487+
content_length = int(self.headers['Content-Length'])
488+
post_data = self.rfile.read(content_length)
489+
print(f"Body: {post_data.decode('utf-8')}")
490+
491+
self.send_response(200)
492+
self.send_header('Content-type', 'text/html')
493+
self.end_headers()
494+
self.wfile.write(b'POST request received')
495+
496+
497+
PORT = 3000
498+
Handler = RequestHandler
499+
500+
with socketserver.TCPServer(("", PORT), Handler) as httpd:
501+
print(f"Serving HTTP on port {PORT}...")
502+
httpd.serve_forever()
503+
```
504+
505+
Run the server:
461506

462507
```sh
463-
docker run -p 3000:3000 plork/httpdump
508+
python3 simple_http_server.py
464509
```
465510

466511
Our sink has a new configuration field for the endpoint. Update it to look like:

scripts/integration/gcp/compose.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ services:
77
- PUBSUB_PROJECT1=testproject,topic1:subscription1
88
- PUBSUB_PROJECT2=sourceproject,topic2:subscription2
99
chronicle-emulator:
10-
image: docker.io/plork/chronicle-emulator:${CONFIG_VERSION}
10+
image: docker.io/timberio/chronicle-emulator:${CONFIG_VERSION}
1111
ports:
1212
- 3000:3000
1313
volumes:

0 commit comments

Comments
 (0)