<div dir="ltr"><div class="gmail_default" style="font-size:small">Here's a quick picture of the proposal.<br><br></div><div class="gmail_default" style="font-size:small"><a href="https://docs.google.com/drawings/d/13mfTkxv_M3jM6WMsgpJtoKkX4nuVuTPcPSfsebN3qKA/edit?usp=sharing">https://docs.google.com/drawings/d/13mfTkxv_M3jM6WMsgpJtoKkX4nuVuTPcPSfsebN3qKA/edit?usp=sharing</a><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Oct 12, 2015 at 8:58 PM, Clayton Coleman <span dir="ltr"><<a href="mailto:ccoleman@redhat.com" target="_blank">ccoleman@redhat.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Including aos-devel.<br>
<span class=""><br>
On Fri, Oct 9, 2015 at 8:03 AM, Carl Trieloff <<a href="mailto:cctrieloff@redhat.com">cctrieloff@redhat.com</a>> wrote:<br>
><br>
> yip looks good<br>
><br>
> On 10/08/2015 09:37 PM, Aaron Weitekamp wrote:<br>
><br>
> On Thu, Oct 8, 2015 at 5:08 PM, Aaron Weitekamp <<a href="mailto:aweiteka@redhat.com">aweiteka@redhat.com</a>> wrote:<br>
>><br>
>> Speaking with Clayton we believe we have a path to running an atomicapp<br>
>> using native OpenShift 'oc' CLI.<br>
>><br>
>> Proposal:<br>
>><br>
>> oc new-app <atomicapp-image> [-p foo=bar,bee=baz]<br>
>><br>
>> This command will kick off running the image in a pod. Inside this pod oc<br>
>> commands will be executed as the user. Remote or composite atomicapps will<br>
>> be chained in the same way via oc new-app <remote-image>.<br>
>><br>
>> For MVP we will not support answerfile or interactive install since oc<br>
>> does not have a mechanism for that today.<br>
>><br>
>> All other application lifecycle commands will be handled by native oc<br>
>> commands as they are today, outside of atomicapp.<br>
>><br>
>> Required changes (for discussion):<br>
>> - identify an io.openshift label for atomicapp image that identifies as an<br>
>> atomicapp<br>
><br>
><br>
>  we could also call it something like io.nulecule.executable so that it is<br>
> not openshift specific but a generic so any tool can read the label.. which<br>
> openshift looks for.<br>
<br>
<br>
</span>That's better.  Or even a label that provides some fundamental info<br>
that is nulecule specific (a unique nulecule id?). Can even just be a<br>
marker label.<br>
<span class=""><br>
<br>
><br>
>> - openshift user token should be passed into the atomicapp pod<br>
<br>
<br>
</span>Proposed flow:<br>
<br>
* oc new-app grabs the image metadata<br>
* if image != nulecule<br>
  * normal flow<br>
* Nulecule requires at minimum edit permission, so for the short term<br>
let's assume the nulecule image needs to use the user's current token<br>
to act as them (in the future we would scope the token down to what<br>
nulecule truly needs, which might be a new default "installer" role or<br>
a list of required permissions and would *only* be for that<br>
namespace).<br>
* Image would define:<br>
  * <a href="http://io.openshift.generate.token.as" rel="noreferrer" target="_blank">io.openshift.generate.token.as</a>=env:TOKEN_ENV_VAR<br>
  * (future) io.openshift.generate.token.scope=...<br>
* if ! "--confirm" flag set<br>
  * warn the user that the image is requesting permission to access<br>
the current token<br>
  * exit<br>
* new-app creates a pod (in the future, a job) with<br>
TOKEN_ENV_VAR=$(current_oauth_token)<br>
* new-app would instruct user to watch the job logs (in the future,<br>
would follow the job logs)<br>
<span class=""><br>
<br>
>> - atomicapp openshift provider should not call docker but use the oc<br>
>> client<br>
>> - params need to be passed into atomicapp pod and need to be parsed by<br>
>> atomicapp<br>
>> - oc client either needs to be built into atomicapp or a sidecar container<br>
>> needs to be spun up in the same pod. TBD<br>
<br>
</span>We need to get `oc` in a package - we should sync with sdodson and<br>
Troy on the status of that.<br>
<span class=""><br>
><br>
><br>
> One more item: since the oc command won't be aware of the params until the<br>
> remote pod is run I think we need to bake these into the image metadata and<br>
> extend openshift to display these. Otherwise the end-user will not know what<br>
> the params are. Something like this in the Dockerfile:<br>
><br>
> LABEL io.openshift.my-app.parameter.FOO.default="bar" \<br>
>             io.openshift.my-app.parameter.FOO.description="Some foo for your<br>
> bar"<br>
<br>
</span>Let's hold off on that in the short term just until we can normalize<br>
that with OpenShift templates (even though I agree this is probably<br>
desirable).<br>
<div class="HOEnZb"><div class="h5"><br>
<br>
><br>
><br>
>><br>
>><br>
>> There are probably many other details I'm missing. It basically means some<br>
>> patches to openshift, refactor openshift provider and support all the edge<br>
>> cases to handle params, etc.<br>
>><br>
><br>
><br>
><br>
> _______________________________________________<br>
> Container-tools mailing list<br>
> <a href="mailto:Container-tools@redhat.com">Container-tools@redhat.com</a><br>
> <a href="https://www.redhat.com/mailman/listinfo/container-tools" rel="noreferrer" target="_blank">https://www.redhat.com/mailman/listinfo/container-tools</a><br>
><br>
><br>
</div></div></blockquote></div><br></div>