Skip to content

Commit

Permalink
fix: mech pricing patch
Browse files Browse the repository at this point in the history
  • Loading branch information
angrybayblade committed May 31, 2024
1 parent 652dafc commit fc6b3ca
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions operate/services/service.py
Original file line number Diff line number Diff line change
Expand Up @@ -593,6 +593,16 @@ def _build_docker(
for node in deployment["services"]:
if "abci" in node:
deployment["services"][node]["volumes"].extend(_volumes)
if (
"SKILL_TRADER_ABCI_MODELS_PARAMS_ARGS_MECH_REQUEST_PRICE=0"
in deployment["services"][node]["environment"]
):
deployment["services"][node]["environment"].remove(
"SKILL_TRADER_ABCI_MODELS_PARAMS_ARGS_MECH_REQUEST_PRICE=0"
)
deployment["services"][node]["environment"].append(
"SKILL_TRADER_ABCI_MODELS_PARAMS_ARGS_MECH_REQUEST_PRICE=10000000000000000"
)

with (build / DOCKER_COMPOSE_YAML).open("w", encoding="utf-8") as stream:
yaml_dump(data=deployment, stream=stream)
Expand Down Expand Up @@ -663,6 +673,17 @@ def _build_host(self, force: bool = True) -> None:
shutil.rmtree(build)
raise e

# Mech price patch.
agent_vars = json.loads(Path(build, "agent.json").read_text(encoding="utf-8"))
if "SKILL_TRADER_ABCI_MODELS_PARAMS_ARGS_MECH_REQUEST_PRICE" in agent_vars:
agent_vars[
"SKILL_TRADER_ABCI_MODELS_PARAMS_ARGS_MECH_REQUEST_PRICE"
] = 10000000000000000
Path(build, "agent.json").write_text(
json.dumps(agent_vars, indent=4),
encoding="utf-8",
)

self.status = DeploymentStatus.BUILT
self.store()

Expand Down

0 comments on commit fc6b3ca

Please sign in to comment.