|
RTC Toolkit 6.0.0
|
Classes | |
| class | Repo |
| This class holds context information captured from command line arguments. More... | |
Functions | |
| main (ctx, stdout, datacenter, app_kill_timeout, node, user, sde) | |
| RTCTK Deployment Daemon Nomad/Consul Job Generator. | |
| job (ctx, str component_name, str command, str arguments, bool no_services, bool deployment_daemon) | |
| Generate a nomad job file for running RTC Components. | |
| job_from_psr (ctx, Uri psr, dp_path, global_path) | |
| Generate a nomad job file for c component from deployment information from Persistent Repository (PSR). | |
| services (ctx, str psr, str oldb, str telegraf, bool as_consul_service) | |
| Generate a nomad job file that provides the entries for Service Discovery. | |
Variables | |
| str | RTCTK_JOB_NOMAD = "rtctk/rtctk_component.nomad.jinja2" |
| str | RTCTK_COMMON_SERVICE_CONSUL = "rtctk/rtctk_services.hcl.jinja2" |
| str | RTCTK_COMMON_SERVICE_NOMAD = "rtctk/rtctk_services.nomad.jinja2" |
| rtctk_deployment_gen.job | ( | ctx, | |
| str | component_name, | ||
| str | command, | ||
| str | arguments, | ||
| bool | no_services, | ||
| bool | deployment_daemon ) |
Generate a nomad job file for running RTC Components.
This program requires three strings as input:
ARGUMENTS: A string that contains quoted arguments to pass to the COMMAND. If you need to use arguments with '-' character, please use '–' before that argument. Example:
rtctkDeploymentGen job rtc_sup rtctkRtcSupervisor – -d
try:
path = find_file(
filepath=RTCTK_JOB_NOMAD,
)
except Exception as e:
print(e, file=sys.stderr)
traceback.print_exc()
sys.exit(10)
if not os.path.isfile(path):
print(
f"Could not find file: {RTCTK_JOB_NOMAD}. Please make sure the RTC Toolkit is installed"
" correctly and that the CFGPATH environment variable is correctly configured.",
file=sys.stderr,
)
sys.exit(11)
with open(path) as file_:
template = jinja2.Template(file_.read())
| rtctk_deployment_gen.job_from_psr | ( | ctx, | |
| Uri | psr, | ||
| dp_path, | |||
| global_path ) |
Generate a nomad job file for c component from deployment information from Persistent Repository (PSR).
Mainly to be used for testing.
This program requires as input:
| rtctk_deployment_gen.main | ( | ctx, | |
| stdout, | |||
| datacenter, | |||
| app_kill_timeout, | |||
| node, | |||
| user, | |||
| sde ) |
RTCTK Deployment Daemon Nomad/Consul Job Generator.
| rtctk_deployment_gen.services | ( | ctx, | |
| str | psr, | ||
| str | oldb, | ||
| str | telegraf, | ||
| bool | as_consul_service ) |
Generate a nomad job file that provides the entries for Service Discovery.
This sub-command requires two (optionally three) URIs as input:
| str rtctk_deployment_gen.RTCTK_COMMON_SERVICE_CONSUL = "rtctk/rtctk_services.hcl.jinja2" |
| str rtctk_deployment_gen.RTCTK_COMMON_SERVICE_NOMAD = "rtctk/rtctk_services.nomad.jinja2" |
| str rtctk_deployment_gen.RTCTK_JOB_NOMAD = "rtctk/rtctk_component.nomad.jinja2" |