[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

RE: Custom Cartridge Development In OpenShift



Hi

I am having a look at the redis cart code. For the cartridge I am implementing ,it would suffice If I can set an app env var and have the control script react to it
as you pointed out.

But for some reason I am not able to set env variables in my app.I tried

rhc ssh <yourapp>
cd newcart && echo test > env/test

when I do an echo $ env/test  nothing is listed.

Also tried the following command -


~
$ rhc set-env VAR_NAME=VALUE -a demoapp
The command 'rhc set-env VAR_NAME=VALUE is not recognized.
See 'rhc help' for a list of valid commands.

$ rhc env set VAR_NAME=VALUE HELLO -a demoapp
The command 'rhc env set VAR_NAME=VALUE HELLO' is not recognized.
See 'rhc help' for a list of valid commands.


Any pointers?Appreciate your help.

Thanks
Shabna


-----Original Message-----
From: Madathilthattantav, S.
Sent: Thursday, December 19, 2013 10:19 PM
To: 'Clayton Coleman'
Subject: RE: Custom Cartridge Development In OpenShift

Thanks for the pointers.I will try to set an app env var and have the control script react to it.

-----Original Message-----
From: Clayton Coleman [mailto:ccoleman redhat com]
Sent: Thursday, December 19, 2013 2:45 AM
To: Madathilthattantav, S.
Subject: Re: Custom Cartridge Development In OpenShift



----- Original Message -----
> Thank for the response .This was exactly what I was looking for - "rhc
> add-cartridge mycart A=B" or "rhc add-cartridge mycart input "
>
> If not with add method ,can we have it any other method defined in
> control script of cartridge Basically I want the cartridge to access
> different service( via rest call) and populate some connection env
> varaible based on the app requirement.

We have discussed, but not implemented, the possibility of a cartridge registering custom actions a user could invoke.  In theory, those would be called from RHC, via the REST API, to the cartridge in the application, and the bin/control script would be invoked.  However, that's not in our near term plans.  You could certainly set an app env var and have the control script react to it (we do this in the Redis custom cartridge https://github.com/smarterclayton/openshift-redis-cart/blob/master/bin/control#L75).

>
> Any way of achieving this in OpenShift ?
>
> -----Original Message-----
> From: Clayton Coleman [mailto:ccoleman redhat com]
> Sent: Wednesday, December 18, 2013 11:52 PM
> To: Madathilthattantav, S.
> Cc: bparees redhat com; mateus caruccio;
> users lists openshift redhat com; dev lists openshift redhat com
> Subject: Re: Custom Cartridge Development In OpenShift
>
>
>
> ----- Original Message -----
> > Hi
> >
> > Thanks for the response.
> >
> > I guess  I did not put it across correctly.
> >
> > An example :Cartridge functionality is act as a gateway to access an
> > external service and populate openshift env variables (say external
> > db serviceparams )that my application can be binded to and use it.
> >
> > I need to give some information to my cartridge - how can I do that?
>
> Application environment variables - that's the only way we support
> today.  In the future we might have other options.  "rhc add-cartridge mycart A=B"
> should install the cart and set the env A = B
>
> >
> > I am not talking about giving information to application which can
> > be done via env variables.I need to understand how user while adding
> > cartridge can also pass some info to cartridge which can be used for
> > its functioning.
> >
> > Another example :Say while adding xxx cartridge ,a drop down appears
> > and I can choose which version of xxx and then add. This is not
> > possible via web console Any command line way to achieve this.
> >
> >
> >
> > Hope I am not confusing !
> > Thanks
> > Shabna
> >
> > -----Original Message-----
> > From: Ben Parees [mailto:bparees redhat com]
> > Sent: Wednesday, December 18, 2013 8:26 PM
> > To: Madathilthattantav, S.
> > Cc: dev lists openshift redhat com; users lists openshift redhat com
> > Subject: Re: Custom Cartridge Development In OpenShift
> >
> > 1/2) not sure if this is the best/only option, but you can specify
> > environment variables while creating your app, so that could be used
> > to pass parameters.
> > 3) Not clear on the question?  Do you mean change what parameters
> > the start method takes?  If so then the answer would be no.
> > 4) Again environment variables would be one approach.  Marker files
> > are another way to control your script behavior, but of course it is
> > harder to set those in advance.  (you would need a quickstart that
> > included them, I
> > think)
> >
> >
> > Ben Parees | OpenShift
> >
> > ----- Original Message -----
> > From: "s madathilthattantav" <s madathilthattantav accenture com>
> > To: dev lists openshift redhat com, users lists openshift redhat com
> > Sent: Wednesday, December 18, 2013 8:46:58 AM
> > Subject: Custom Cartridge Development In OpenShift
> >
> >
> >
> > Hi All
> >
> >
> >
> > I was working on custom cartridge development and I have a question
> > regarding the flexibility of the same
> >
> >
> >
> > 1. Do we have the option of giving user-input or parameters while
> > adding a custom cartridge.
> >
> >
> >
> > 2. From web interface this is not a possibility – but what about
> > using rhc command ?
> >
> >
> >
> > 3. Is it possible to change the start method definition of control
> > script. – I assume it as no
> >
> >
> >
> > 4. If option 2 is not possible,which I mostly think – would it be
> > possible to define different methods (say method x) in control
> > script that will take user-input?
> >
> > For ex : it would be two step process-- fisrt add cartridge and then
> > invoke method x on cartridge that will take input and do functionalty.
> >
> >
> >
> > A use case:
> >
> > The custom cartridge will talk to different system ,based on the
> > input given to custom cartridge and do some processing.
> >
> >
> >
> > I hope I am not missing anything obvious-!
> >
> >
> >
> > Thanks
> >
> > Shabna
> >
> >
> >
> > This message is for the designated recipient only and may contain
> > privileged, proprietary, or otherwise confidential information. If
> > you have received it in error, please notify the sender immediately
> > and delete the original. Any other use of the e-mail by you is prohibited.
> > Where allowed by local law, electronic communications with Accenture
> > and its affiliates, including e-mail and instant messaging
> > (including content), may be scanned by our systems for the purposes
> > of information security and assessment of internal compliance with
> > Accenture policy. .
> > ____________________________________________________________________
> > __
> > ________________
> >
> > www.accenture.com
> >
> > _______________________________________________
> > dev mailing list
> > dev lists openshift redhat com
> > http://lists.openshift.redhat.com/openshiftmm/listinfo/dev
> >
> >
> > _______________________________________________
> > users mailing list
> > users lists openshift redhat com
> > http://lists.openshift.redhat.com/openshiftmm/listinfo/users
> >
>
>
> ________________________________
>
> This message is for the designated recipient only and may contain
> privileged, proprietary, or otherwise confidential information. If you
> have received it in error, please notify the sender immediately and
> delete the original. Any other use of the e-mail by you is prohibited.
> Where allowed by local law, electronic communications with Accenture
> and its affiliates, including e-mail and instant messaging (including
> content), may be scanned by our systems for the purposes of
> information security and assessment of internal compliance with Accenture policy. .
> ______________________________________________________________________
> ________________
>
> www.accenture.com
>


________________________________

This message is for the designated recipient only and may contain privileged, proprietary, or otherwise confidential information. If you have received it in error, please notify the sender immediately and delete the original. Any other use of the e-mail by you is prohibited. Where allowed by local law, electronic communications with Accenture and its affiliates, including e-mail and instant messaging (including content), may be scanned by our systems for the purposes of information security and assessment of internal compliance with Accenture policy. .
______________________________________________________________________________________

www.accenture.com


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]