Skip to content

Commit 3165715

Browse files
fix(experiments): added some command line parameters that were needed (#383)
* fix(experiments): added some command line parameters that were needed * added cmd line arg check
1 parent 4668d8f commit 3165715

2 files changed

Lines changed: 28 additions & 2 deletions

File tree

asap-planner-rs/docker-compose.yml.j2

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,10 @@ services:
1010
"--output_dir", "/app/output",
1111
"--prometheus_scrape_interval", "{{ prometheus_scrape_interval }}",
1212
"--streaming_engine", "{{ streaming_engine }}",
13-
"--prometheus-url", "{{ prometheus_url }}"{% if punting %},
14-
"--enable-punting"{% endif %}
13+
"--prometheus-url", "{{ prometheus_url }}",
14+
"--query-language", "{{ query_language }}"{% if punting %},
15+
"--enable-punting"{% endif %}{% if data_ingestion_interval is not none %},
16+
"--data-ingestion-interval", "{{ data_ingestion_interval }}"{% endif %}
1517
]
1618
network_mode: "host"
1719
restart: no

asap-tools/experiments/generate_controller_compose.py

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import argparse
66
import os
77
import sys
8+
from typing import Optional
89
from jinja2 import Template
910

1011

@@ -19,6 +20,8 @@ def generate_compose_file(
1920
streaming_engine: str,
2021
punting: bool,
2122
prometheus_url: str,
23+
query_language: str,
24+
data_ingestion_interval: Optional[int],
2225
):
2326
"""Generate docker-compose.yml from template with provided variables."""
2427

@@ -43,6 +46,8 @@ def generate_compose_file(
4346
"streaming_engine": streaming_engine,
4447
"punting": punting,
4548
"prometheus_url": prometheus_url,
49+
"query_language": query_language,
50+
"data_ingestion_interval": data_ingestion_interval,
4651
}
4752

4853
# Render the template
@@ -124,9 +129,26 @@ def main():
124129
required=True,
125130
help="Base URL of the Prometheus instance for metric label inference (e.g. http://localhost:9090)",
126131
)
132+
parser.add_argument(
133+
"--query-language",
134+
required=True,
135+
choices=["promql", "sql"],
136+
help="Query language for the controller",
137+
)
138+
parser.add_argument(
139+
"--data-ingestion-interval",
140+
type=int,
141+
default=None,
142+
help="Data ingestion interval in seconds (SQL mode only)",
143+
)
127144

128145
args = parser.parse_args()
129146

147+
if args.data_ingestion_interval is not None and args.query_language != "sql":
148+
parser.error(
149+
"--data-ingestion-interval is only valid when --query-language is 'sql'"
150+
)
151+
130152
generate_compose_file(
131153
template_path=args.template_path,
132154
output_path=args.compose_output_path,
@@ -138,6 +160,8 @@ def main():
138160
streaming_engine=args.streaming_engine,
139161
punting=args.punting,
140162
prometheus_url=args.prometheus_url,
163+
query_language=args.query_language,
164+
data_ingestion_interval=args.data_ingestion_interval,
141165
)
142166

143167

0 commit comments

Comments
 (0)