Hi Pankaj, Ok then let's continue with your approach.
Thanks, Shameera. On Thu, Jul 23, 2015 at 1:15 PM Pankaj Saha <[email protected]> wrote: > Hi Shameera, > > Here is an issue with the env variables. > First time when we create a docker container we will pass the rabbitmq > host ip as env variable in the run command. > > >> docker run -i -d --name test --env RABBITMQ=172.0.23.15 -t server:test > > > But after stopping the container if we restart the container again then > that env variable will no longer be there (as we can not pass env variable > in the start command), which will cause a failure. > > docker start test > > > I have tested with an example, this is a problem. I think the script > approach is fine as it writes the rabbitmq host ip in the properties file > so need not to rely on env variable next time onward. > what do you think? > > Thanks > Pankaj > > > > On Thu, Jul 23, 2015 at 11:47 AM, Shameera Rathnayaka < > [email protected]> wrote: > >> Hi Pankaj, >> >> >> On Thu, Jul 23, 2015 at 11:36 AM Pankaj Saha <[email protected]> >> wrote: >> >>> Yes my startup script reading the ip of the container and on startup and >>> its replacing the properties file's value. >>> >>> What I am asking is how this can be achieved by system properties (as >>> you suggested earlier ) without manipulating the properties file? >>> Do you suggest to set that as env variable on start up and then this env >>> variable can be auto replaced in the airavata-server properties file? I >>> don't know how I can achieve that replacement. >>> >> >> Yes setting with ENV should work . e.g.: ENV rabbitmq.broker.url <url> >> >> >>> On Thu, Jul 23, 2015 at 10:50 AM, Shameera Rathnayaka < >>> [email protected]> wrote: >>> >>>> For this we can use entry point or startup script which set >>>> apiserve.server.host=<docker-ip> system property. You can read docker-ip at >>>> startup, you already do this in startup script isn't it?. >>>> >>>> >>>> >>>> On Thu, Jul 23, 2015 at 10:28 AM Pankaj Saha <[email protected]> >>>> wrote: >>>> >>>>> Hi Shameera, >>>>> Ok if this is the case then we are okay. For rabbitmq host ip this >>>>> will work then. >>>>> but problem with a*piserver.server.host=localhost* will still exist. >>>>> Every time we start a container this will change and we can not pass this >>>>> ass env variables as we don't know the ip of a container until it starts. >>>>> >>>>> please suggest if you have any way out to this problem. >>>>> >>>>> Thanks >>>>> Pankaj >>>>> >>>>> >>>>> >>>>> On Wed, Jul 22, 2015 at 10:44 PM, Shameera Rathnayaka < >>>>> [email protected]> wrote: >>>>> >>>>>> Hi Pankaj, >>>>>> >>>>>> If you pass environment variable then you don't want to edit property >>>>>> file. Airavata give priority to system property then properties from >>>>>> airavata-server.properties file. Hence you don't need to edit properties >>>>>> file. >>>>>> >>>>>> ~Shameera. >>>>>> >>>>>> On Wed, Jul 22, 2015 at 9:40 PM Pankaj Saha <[email protected]> >>>>>> wrote: >>>>>> >>>>>>> Hey Shameera >>>>>>> Can you please explain with an example, I am not able to get what >>>>>>> you are trying to say about system properties. What I have suggested >>>>>>> here >>>>>>> needs env variables to be passed as parameters while running the >>>>>>> containers. Start up script will set these properties before running the >>>>>>> airavata server. >>>>>>> >>>>>>> Thanks >>>>>>> >>>>>>> >>>>>>> Pankaj >>>>>>> On 22-Jul-2015 9:34 PM, "Shameera Rathnayaka" < >>>>>>> [email protected]> wrote: >>>>>>> >>>>>>>> Hi Pankaj, >>>>>>>> >>>>>>>> did you try parsing those values as system properties when you >>>>>>>> start docker images? It should work. Then you can add those system >>>>>>>> properties from startup script instead of manipulating property file. >>>>>>>> >>>>>>>> On Wed, Jul 22, 2015 at 6:15 PM Pankaj Saha <[email protected]> >>>>>>>> wrote: >>>>>>>> >>>>>>>>> I am planning to add a shell script(startup.sh) along with >>>>>>>>> Dockerfile in the source, so that it make required changes and then >>>>>>>>> start >>>>>>>>> the airavata server. This will resolve the issues 2,3,4. >>>>>>>>> like: CMD bash -C './startup.sh';'bash' >>>>>>>>> >>>>>>>>> startup.sh >>>>>>>>> <https://drive.google.com/a/binghamton.edu/file/d/0ByuFJ2KDIjkiaWk4RVZ4cFl6UXM/view?usp=drive_web> >>>>>>>>> >>>>>>>>> For JAVA_HOME dependencies, I remember Suresh knows some changes >>>>>>>>> which can resolve this issue (as he told in previous GSoC meeting). >>>>>>>>> >>>>>>>>> Thanks >>>>>>>>> Pankaj >>>>>>>>> >>>>>>>>> >>>>>>>>> >>>>>>>>> On Wed, Jul 22, 2015 at 12:00 PM, Pankaj Saha < >>>>>>>>> [email protected]> wrote: >>>>>>>>> >>>>>>>>>> adding one more item in the list >>>>>>>>>> 4. Dockerfile should copy the content of airavata server after >>>>>>>>>> maven build is completed. It will only copy the class files and >>>>>>>>>> executable >>>>>>>>>> files no source code is required in the docker image. >>>>>>>>>> Now for each branch, maven is creating zip folder with the branch >>>>>>>>>> id like apache-airavata-server-*0.15*-SNAPSHOT. To automate the >>>>>>>>>> docker image creation we have to provide some common name, otherwise >>>>>>>>>> user >>>>>>>>>> have to modify dockerfile every time for different branches. >>>>>>>>>> >>>>>>>>>> >>>>>>>>>> >>>>>>>>>> On Wed, Jul 22, 2015 at 11:47 AM, Pankaj Saha < >>>>>>>>>> [email protected]> wrote: >>>>>>>>>> >>>>>>>>>>> Hello Devs, >>>>>>>>>>> >>>>>>>>>>> Here are few open items that we need to fix before we allow >>>>>>>>>>> Dockerfile to be part of airavata source tree. >>>>>>>>>>> >>>>>>>>>>> 1. airavata-server.sh still has dependency on JAVA_HOME env >>>>>>>>>>> variable. Which we have to change manually after creating docker >>>>>>>>>>> container. >>>>>>>>>>> >>>>>>>>>>> 2. airavata-server.properties file needs to be modified with >>>>>>>>>>> host address of rabbitmq. Are we planning to pass them as an env >>>>>>>>>>> variable >>>>>>>>>>> while running the docker? Then we need to change the properties >>>>>>>>>>> file such >>>>>>>>>>> that it can identify the env variable and replace it. >>>>>>>>>>> >>>>>>>>>>> 3. apiserver.server.host=localhost needs to be changed to the >>>>>>>>>>> apiserver.server.host=container ip. Container ip will the ip >>>>>>>>>>> address of the >>>>>>>>>>> running container. Which can be fetched by "wk 'NR==1 {print $1}' >>>>>>>>>>> /etc/hosts" command. We need to plan how we are going to feed these >>>>>>>>>>> values >>>>>>>>>>> to the properties file without manual changes. >>>>>>>>>>> >>>>>>>>>>> Thanks >>>>>>>>>>> Pankaj >>>>>>>>>>> >>>>>>>>>>> >>>>>>>>>>> >>>>>>>>>> >>>>>>>>> -- >>>>>>>> Shameera Rathnayaka >>>>>>>> >>>>>>> -- >>>>>> Shameera Rathnayaka >>>>>> >>>>> >>>>> -- >>>> Shameera Rathnayaka >>>> >>> >>> -- >> Shameera Rathnayaka >> > > -- Shameera Rathnayaka
