Skip to content

Commit

Permalink
Merge branch 'blank_slate'
Browse files Browse the repository at this point in the history
  • Loading branch information
FiveMovesAhead committed Dec 22, 2024
2 parents d747b82 + 1248651 commit 5985fb3
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 4 deletions.
2 changes: 1 addition & 1 deletion swagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1428,7 +1428,7 @@ components:
delegatees:
type: object
additionalProperties:
type: float
type: number
SetDelegateeResponse:
type: object
properties:
Expand Down
4 changes: 2 additions & 2 deletions tig-benchmarker/common/structs.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,8 +161,8 @@ class BlockDetails(FromDict):

@dataclass
class BlockData(FromDict):
confirmed_ids: Dict[str, Set[int]]
active_ids: Dict[str, Set[int]]
confirmed_ids: Dict[str, Set[str]]
active_ids: Dict[str, Set[str]]

@dataclass
class Block(FromDict):
Expand Down
10 changes: 9 additions & 1 deletion tig-benchmarker/master/master/submissions_manager.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import brotli
import requests
import threading
import logging
Expand Down Expand Up @@ -46,7 +47,14 @@ def _post(self, submission_type: str, req: Union[SubmitPrecommitRequest, SubmitB
logger.info(f"submitting {submission_type} '{req.benchmark_id}'")
logger.debug(f"{req}")

resp = requests.post(f"{api_url}/submit-{submission_type}", json=req.to_dict(), headers=headers)
data = jsonify(req)
if len(data) > 10 * 1024:
headers.update({
'Content-Encoding': 'br',
'Accept-Encoding': 'br',
})
data = brotli.compress(data)
resp = requests.post(f"{api_url}/submit-{submission_type}", data=data, headers=headers)
if resp.status_code == 200:
logger.info(f"submitted {submission_type} successfully")
elif resp.headers.get("Content-Type") == "text/plain":
Expand Down
1 change: 1 addition & 0 deletions tig-benchmarker/master/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
blake3
brotli
dataclasses
hypercorn
numpy
Expand Down

0 comments on commit 5985fb3

Please sign in to comment.