If you are only interested in the ip/hostname of the slave you are running on, 
you should have a look at the `{{mesos.hostname}}` thermos variable. It will 
resolve to whatever you passed into `--hostname` on the Mesos slave command 
line. (details: 
https://github.com/apache/aurora/blob/master/docs/configuration-reference.md#mesos-namespace)<https://github.com/apache/aurora/blob/master/docs/configuration-reference.md#mesos-namespace>


In general, there are various ways how you could expose environment variable to 
your processes:


* copy your environment file into your sandbox: via wget or by doing a simple 
"echo" process that pipes to a file in order to create it.

* source your environment file before launching your command: "source 
environment && exec ./my-process"

* as a (undocumented) feature there is also `.thermos_profile`. If you create a 
file in your sandbox named like this, it will automatically be sourced 
https://github.com/apache/aurora/blob/024bac9dcb8f37e4b31210e3a0a7aea2345a16ab/src/main/python/apache/thermos/core/process.py#L401


?There is probably also a docker-specific mechanism. I don't know about docker, 
but maybe someone can help here.


Hope this helps to get you started,

Stephan

________________________________
From: Krish <[email protected]>
Sent: Sunday, March 6, 2016 17:25
To: [email protected]
Subject: Source an environment file for jobs

Hi,
How does one source environment files for jobs submitted to slave?

Say for example, I want one of my containers to be aware of the 
COREOS_PUBLIC_IPV4 variable stored in /etc/environment. I was wondering how 
does one factor this while creating a .aurora. I use the docker Parameter 
object with name 'env' and value should be 'public_ip=<source variable here>'.

I was thinking that I can copy the /etc/environment into the sandbox, however, 
I do not know how to source them. Also, I have the specify this resource 
dependency to thermos globally; is it possible to have the 
thermos_executor_resources to be job specific?

Also, are there more .aurora file examples than the hello_world, hello_docker 
and the few in documentation for reference?

Aurora + Mesos is awesome; enjoying playing around with it. Thanks!

--
????h???

Reply via email to