adaptai / platform /dataops /dto /templates /supervisord.conf.j2
ADAPT-Chase's picture
Add files using upload-large-folder tool
fd357f4 verified
# Generated Supervisord Configuration
# Environment: {{ environment }}
# Generated: {{ generated_timestamp }}
# Generated by: {{ generated_by }}
[unix_http_server]
file={{ services_path }}/supervisor.sock
chmod=0700
[supervisord]
logfile={{ log_path }}/supervisord.log
logfile_maxbytes=50MB
logfile_backups=10
loglevel=info
pidfile={{ services_path }}/supervisord.pid
nodaemon=false
minfds=1024
minprocs=200
[rpcinterface:supervisor]
supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface
[supervisorctl]
serverurl=unix://{{ services_path }}/supervisor.sock
{% for category, services in manifest.services.items() %}
# {{ category|title }} Services
{% for service in services %}
[program:{{ service.name }}]
{% if service.type == 'message-broker' and service.name == 'dto-nats-server' %}
command=/usr/local/bin/nats-server -c {{ base_path }}/events/nats/config.yaml
directory={{ base_path }}/events/nats
{% elif service.type == 'cache-cluster' and service.name == 'dto-dragonfly-cluster' %}
# Dragonfly cluster handled by separate node configs
{% elif service.type == 'graph-database' and service.name == 'dto-janusgraph' %}
command=/opt/janusgraph/bin/janusgraph-server.sh {{ base_path }}/lineage/janusgraph_config.properties
directory=/opt/janusgraph
{% else %}
command=/usr/bin/python3 {{ base_path }}/{{ service.name.replace('dto-', '').replace('-', '_') }}.py
directory={{ base_path }}/{{ service.name.replace('dto-', '').split('-')[0] }}
{% endif %}
user=adaptai
autostart=true
autorestart=true
redirect_stderr=true
stdout_logfile={{ log_path }}/{{ service.name.replace('dto-', '') }}.log
stdout_logfile_maxbytes=10MB
stdout_logfile_backups=5
{% if service.slo_tier == 'critical' %}
priority={{ 100 + loop.index }}
startsecs=10
startretries=2
{% elif service.slo_tier == 'high' %}
priority={{ 300 + loop.index }}
startsecs=5
startretries=3
{% else %}
priority={{ 400 + loop.index }}
startsecs=5
startretries=5
{% endif %}
environment=PYTHONPATH="{{ base_path }}"
{% if service.dependencies %}
# Dependencies: {{ service.dependencies|join(', ') }}
{% endif %}
{% endfor %}
{% endfor %}
# Service groups for management
{% for category, services in manifest.services.items() %}
[group:dto-{{ category }}]
programs={{ services|map(attribute='name')|join(',') }}
priority={{ 999 - loop.index0 }}
{% endfor %}