import sys
from os import environ
from apipod.CONSTS import ORCHESTRATOR, COMPUTE, PROVIDER

APIPOD_ORCHESTRATOR = environ.get("APIPOD_ORCHESTRATOR", ORCHESTRATOR.LOCAL)
APIPOD_COMPUTE = environ.get("APIPOD_COMPUTE", COMPUTE.DEDICATED)
APIPOD_PROVIDER = environ.get("APIPOD_PROVIDER", PROVIDER.LOCALHOST)
APIPOD_REGION = environ.get("APIPOD_REGION", "")

APIPOD_HOST = environ.get("APIPOD_HOST", "0.0.0.0")
APIPOD_PORT = int(environ.get("APIPOD_PORT", 8000))

SERVER_DOMAIN = environ.get("SERVER_DOMAIN", "")

DEFAULT_DATE_TIME_FORMAT = environ.get("FTAPI_DATETIME_FORMAT", '%Y-%m-%dT%H:%M:%S.%f%z')

if (APIPOD_ORCHESTRATOR == ORCHESTRATOR.SOCAITY or APIPOD_ORCHESTRATOR == ORCHESTRATOR.LOCAL) and APIPOD_PROVIDER == PROVIDER.RUNPOD and APIPOD_COMPUTE == COMPUTE.SERVERLESS:
    sys.argv.extend(['rp_serve_api', '1'])
    sys.argv.extend(['--rp_serve_api', '1'])
