RTC Toolkit 6.0.0
Loading...
Searching...
No Matches
rtctk_deployment_gen Namespace Reference

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"
 

Function Documentation

◆ job()

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:

  • COMPONENT_NAME: RTC Components name, the identifier of the component..
  • COMMAND: Executable application to run as part of this job.
  • 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

    Exit Codes
  • 11: –cid and COMPONET_NAME values are not the same.
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())

◆ job_from_psr()

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:

  • PSR: Location of the Persistent Repository as an URI.
  • DP_PATH: Path to component's deployment configuration in PSR.
  • [GLOBAL_PATH]: Path to global deployment configuration e.g. nomad in PSR.

◆ main()

rtctk_deployment_gen.main ( ctx,
stdout,
datacenter,
app_kill_timeout,
node,
user,
sde )

RTCTK Deployment Daemon Nomad/Consul Job Generator.

◆ services()

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:

  • PSR: Location of the Persistent Repository as a URI.
  • OLDB: Location of the OLDB as a URI.
  • TELEGRAF: (Optional) Location of the Telegraf endpoint as a URI.

Variable Documentation

◆ RTCTK_COMMON_SERVICE_CONSUL

str rtctk_deployment_gen.RTCTK_COMMON_SERVICE_CONSUL = "rtctk/rtctk_services.hcl.jinja2"

◆ RTCTK_COMMON_SERVICE_NOMAD

str rtctk_deployment_gen.RTCTK_COMMON_SERVICE_NOMAD = "rtctk/rtctk_services.nomad.jinja2"

◆ RTCTK_JOB_NOMAD

str rtctk_deployment_gen.RTCTK_JOB_NOMAD = "rtctk/rtctk_component.nomad.jinja2"