-
Notifications
You must be signed in to change notification settings - Fork 122
feat: get multi actors working e2e on docker compose #2637
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
MasterPtato
wants to merge
1
commit into
06-20-fix_add_udp_ports_to_docker_compose
from
06-21-feat_get_multi_actors_working_e2e_on_docker_compose
Closed
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
FROM python:3.11-slim | ||
|
||
WORKDIR /app | ||
|
||
# Install required packages | ||
RUN pip install flask | ||
|
||
# Create the debug server | ||
COPY debug_server.py . | ||
|
||
# Expose port 8080 | ||
EXPOSE 8080 | ||
|
||
# Run the server | ||
CMD ["python", "debug_server.py"] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,122 @@ | ||
from flask import Flask, request, jsonify | ||
import gzip | ||
import zlib | ||
from datetime import datetime | ||
|
||
app = Flask(__name__) | ||
|
||
def log_request_details(): | ||
"""Log all request details in a formatted way""" | ||
timestamp = datetime.now().strftime("%Y-%m-%d %H:%M:%S") | ||
|
||
print("=" * 80) | ||
print(f"[{timestamp}] NEW REQUEST") | ||
print("=" * 80) | ||
|
||
# Method and URL | ||
print(f"Method: {request.method}") | ||
print(f"URL: {request.url}") | ||
print(f"Path: {request.path}") | ||
print(f"Query String: {request.query_string.decode('utf-8')}") | ||
|
||
# Headers | ||
print("\n--- HEADERS ---") | ||
for header_name, header_value in request.headers: | ||
print(f"{header_name}: {header_value}") | ||
|
||
# Query Parameters | ||
if request.args: | ||
print("\n--- QUERY PARAMETERS ---") | ||
for key, value in request.args.items(): | ||
print(f"{key}: {value}") | ||
|
||
# Form Data | ||
if request.form: | ||
print("\n--- FORM DATA ---") | ||
for key, value in request.form.items(): | ||
print(f"{key}: {value}") | ||
|
||
# Files | ||
if request.files: | ||
print("\n--- FILES ---") | ||
for key, file in request.files.items(): | ||
print(f"{key}: {file.filename} (Content-Type: {file.content_type})") | ||
|
||
# Raw Body with decompression support | ||
try: | ||
raw_body = request.get_data() | ||
content_encoding = request.headers.get('Content-Encoding', '').lower() | ||
|
||
print("\n--- REQUEST BODY ---") | ||
|
||
if not raw_body: | ||
print("(empty)") | ||
else: | ||
# Handle compressed content | ||
decompressed_body = None | ||
|
||
if content_encoding == 'gzip': | ||
try: | ||
decompressed_body = gzip.decompress(raw_body).decode('utf-8') | ||
print("(Content was gzip-compressed, showing decompressed version)") | ||
except Exception as e: | ||
print(f"Failed to decompress gzip content: {e}") | ||
elif content_encoding == 'deflate': | ||
try: | ||
decompressed_body = zlib.decompress(raw_body).decode('utf-8') | ||
print("(Content was deflate-compressed, showing decompressed version)") | ||
except Exception as e: | ||
print(f"Failed to decompress deflate content: {e}") | ||
elif content_encoding in ['br', 'brotli']: | ||
print("(Content is brotli-compressed - brotli decompression not available)") | ||
print("Raw compressed data (first 200 bytes):") | ||
print(repr(raw_body[:200])) | ||
elif content_encoding == 'zstd': | ||
print("(Content is zstd-compressed - zstd decompression not available)") | ||
print("Raw compressed data (first 200 bytes):") | ||
print(repr(raw_body[:200])) | ||
else: | ||
# No compression or unknown compression | ||
try: | ||
decompressed_body = raw_body.decode('utf-8') | ||
except UnicodeDecodeError: | ||
print("(Binary content - showing first 200 bytes as hex)") | ||
print(raw_body[:200].hex()) | ||
|
||
# Display the decompressed content | ||
if decompressed_body: | ||
print(decompressed_body) | ||
|
||
# Also show raw length info | ||
print(f"\nRaw body length: {len(raw_body)} bytes") | ||
print(f"Decompressed length: {len(decompressed_body)} bytes") | ||
|
||
except Exception as e: | ||
print(f"\n--- REQUEST BODY ---") | ||
print(f"Error reading body: {e}") | ||
|
||
print("=" * 80) | ||
print() | ||
|
||
# Catch all routes for any HTTP method | ||
@app.route('/', defaults={'path': ''}, methods=['GET', 'POST', 'PUT', 'DELETE', 'PATCH', 'HEAD', 'OPTIONS']) | ||
@app.route('/<path:path>', methods=['GET', 'POST', 'PUT', 'DELETE', 'PATCH', 'HEAD', 'OPTIONS']) | ||
def debug_endpoint(path): | ||
log_request_details() | ||
|
||
# Return a simple response | ||
response_data = { | ||
"message": "Request received and logged", | ||
"method": request.method, | ||
"path": f"/{path}" if path else "/", | ||
"timestamp": datetime.now().isoformat() | ||
} | ||
|
||
return jsonify(response_data), 200 | ||
|
||
if __name__ == '__main__': | ||
print("Starting HTTP Debug Server...") | ||
print("All incoming requests will be logged to console") | ||
print("Server listening on port 8080") | ||
print("=" * 80) | ||
app.run(host='0.0.0.0', port=8080, debug=False) |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be "workers", along with other outdated .source checks?