#!/usr/bin/env bash
set -euo pipefail

cluster_name="${ARGUS_CLUSTER_NAME:-argus-ray}"
head_ip_file="${ARGUS_HEAD_IP_FILE:?missing ARGUS_HEAD_IP_FILE}"
node_ip="${ARGUS_NODE_IP:?missing ARGUS_NODE_IP}"
ray_port="${ARGUS_RAY_PORT:-6379}"
dashboard_port="${ARGUS_DASHBOARD_PORT:-8265}"
ttl_s="${ARGUS_TTL_S:-60}"
refresh_s="${ARGUS_REFRESH_S:-10}"

exec python3 -m argus.ray.head_publisher \
  --cluster-name "${cluster_name}" \
  --head-ip-file "${head_ip_file}" \
  --head-ip "${node_ip}" \
  --gcs-port "${ray_port}" \
  --dashboard-port "${dashboard_port}" \
  --ttl-s "${ttl_s}" \
  --refresh-s "${refresh_s}"

