Skip to content

A tool to marshal and unmarshal Apache Aurora/Thermos payloads. This is intend to make simpler the creation and maintenance of jobs when using tools such as paypal/gorealis

Notifications You must be signed in to change notification settings

zircote/thermos-payload

Repository files navigation

Thermos Payload

Helper library to provide validation and tools to create Apache Aurora Thermos centric Payloads

thermosTaskConfig := DefaultThermosTaskConfig(
		"hello_world",
	)
// 0.5 CPU 128M RAM 128M Disk 0 GPU
thermosTaskConfig.Task.Resources = &Resources{CPU: .5, Disk:128, RAM:128}
thermosTaskConfig.Task.AddProcess(DefaultProcess("hello", `
while true; do
   echo hello world
   # Privde a port {{thermos.ports[health]}}
   sleep 10
done`))
j := thermosTaskConfig.String()
fmt.Println(j)
	

Result:

 {
   "task": {
     "name": "hello_world",
     "processes": [
       {
         "name": "hello",
         "daemon": false,
         "ephemeral": false,
         "max_failures": 1,
         "min_duration": 5,
         "cmdline": "\n\twhile true; do\n\t   echo hello world\n\t   # Privde a port {{thermos.ports[health]}}\n\t   sleep 10\n\tdone",
         "final": false
       }
     ],
     "finalization_wait": 30,
     "max_failures": 1,
     "max_concurrency": 0,
     "resources": {
       "gpu": 0,
       "disk": 128,
       "ram": 128,
       "cpu": 0.5
     },
     "constraints": [
       {
         "order": [
           "hello"
         ]
       }
     ]
   },
   "cluster": "devcluster",
   "role": "www-data",
   "environment": "prod",
   "name": "hello_world",
   "health_check_config": {
     "initial_interval_secs": 15,
     "health_checker": {
       "http": {
         "expected_response_code": 0,
         "endpoint": "/health",
         "expected_response": "ok"
       }
     },
     "interval_secs": 10,
     "timeout_secs": 1,
     "max_consecutive_failures": 1
   },
   "service": true,
   "max_task_failures": 1,
   "cron_collision_policy": "KILL_EXISTING",
   "enable_hooks": false,
   "lifecycle": {
     "http": {
       "graceful_shutdown_endpoint": "/quitquitquit",
       "port": "health",
       "shutdown_endpoint": "/abortabortabort"
     }
   },
   "priority": 0,
   "production": false
 }

About

A tool to marshal and unmarshal Apache Aurora/Thermos payloads. This is intend to make simpler the creation and maintenance of jobs when using tools such as paypal/gorealis

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages