Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions asap-planner-rs/docker-compose.yml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,10 @@ services:
"--output_dir", "/app/output",
"--prometheus_scrape_interval", "{{ prometheus_scrape_interval }}",
"--streaming_engine", "{{ streaming_engine }}",
"--prometheus-url", "{{ prometheus_url }}"{% if punting %},
"--enable-punting"{% endif %}
"--prometheus-url", "{{ prometheus_url }}",
"--query-language", "{{ query_language }}"{% if punting %},
"--enable-punting"{% endif %}{% if data_ingestion_interval is not none %},
"--data-ingestion-interval", "{{ data_ingestion_interval }}"{% endif %}
]
network_mode: "host"
restart: no
24 changes: 24 additions & 0 deletions asap-tools/experiments/generate_controller_compose.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import argparse
import os
import sys
from typing import Optional
from jinja2 import Template


Expand All @@ -19,6 +20,8 @@ def generate_compose_file(
streaming_engine: str,
punting: bool,
prometheus_url: str,
query_language: str,
data_ingestion_interval: Optional[int],
):
"""Generate docker-compose.yml from template with provided variables."""

Expand All @@ -43,6 +46,8 @@ def generate_compose_file(
"streaming_engine": streaming_engine,
"punting": punting,
"prometheus_url": prometheus_url,
"query_language": query_language,
"data_ingestion_interval": data_ingestion_interval,
}

# Render the template
Expand Down Expand Up @@ -124,9 +129,26 @@ def main():
required=True,
help="Base URL of the Prometheus instance for metric label inference (e.g. http://localhost:9090)",
)
parser.add_argument(
"--query-language",
required=True,
choices=["promql", "sql"],
help="Query language for the controller",
)
parser.add_argument(
"--data-ingestion-interval",
type=int,
default=None,
help="Data ingestion interval in seconds (SQL mode only)",
)

args = parser.parse_args()

if args.data_ingestion_interval is not None and args.query_language != "sql":
parser.error(
"--data-ingestion-interval is only valid when --query-language is 'sql'"
)

generate_compose_file(
template_path=args.template_path,
output_path=args.compose_output_path,
Expand All @@ -138,6 +160,8 @@ def main():
streaming_engine=args.streaming_engine,
punting=args.punting,
prometheus_url=args.prometheus_url,
query_language=args.query_language,
data_ingestion_interval=args.data_ingestion_interval,
)


Expand Down
Loading