Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OpenWhisk Docker Image for Edge component. #2152

Closed
ghost opened this issue Apr 18, 2017 · 12 comments
Closed

OpenWhisk Docker Image for Edge component. #2152

ghost opened this issue Apr 18, 2017 · 12 comments

Comments

@ghost
Copy link

ghost commented Apr 18, 2017

I have seen that there were a bunch of OpenWhisk Docker images for all of the components which is pretty cool. It would be nice to also have an image for Nginx that has all of the extra pieces already baked into it like the CLI and SDKs. This we we would not have to build them and upload them as part of the deployment process.

@rabbah
Copy link
Member

rabbah commented Jun 22, 2017

@csantanapr is this done?

@csantanapr
Copy link
Member

not sure how to go about this one.
Do we create the edge docker image instead of using a mount volume we add the files to the image, what about the configuration do we pass this info as environment variables to replace the template on start of the container?

@ghost
Copy link
Author

ghost commented Jul 5, 2017

@csantanapr the "Edge" image will need to mount in the certs and nginx.conf file since those are environment specific. the "Edge" Docker Image should just need to comprise of the public Nginx image plus any of the CLI/SDKs prebuilt into it.

This means that the current Ansible scripts should more or lest just work as they are. Minus the need to already have the cli prebuilt and build the BlackBox tarball.

Then When deploying Kubernetes, you can take a look at this README for how configuring those same values would go.

@dgrove-oss
Copy link
Member

The only barrier to using a vanilla docker image for nginx now is this stanza in nginx.conf:

        location /cli/go/download {
            autoindex on;
            root /etc/nginx;
        }

I can see four ways to deal with this:

  1. Redirect the generic /cli/go/download to the incubator-openwhisk-cli release page. (Ok if this route is intended for interactive human consumption. Not so nice if we're scripting against it).
  2. Have stanzas for the CLI for each platform that we support that redirects the download to the right release tar ball (not nice if people are used to exploring the available downloads).
  3. Do both 1 and 2.
  4. Decide that we really want to do auto-indexing and so commit to always needing to copy in the CLI binaries to /etc/nginx/cli/download/os/arch/cli.zip.

If we need to take path 4, I think I can do it with an InitContainer in Kubernetetes so we could use a vanilla nginx image + a custom image to do the download of the CLI to the right place in the running containers file system.

@rabbah @csantanapr opinions on what this should look like when we are done?

@csantanapr
Copy link
Member

csantanapr commented Dec 9, 2017

I like option 3
I have being thinking on updating and having additional option on no longer copying the CLI and instead doing redirect

We already cleaned up this way the swift sdk and the docker/blackbox sdk

@dgrove-oss
Copy link
Member

ok. I'll plan on submitting a PR for 3 on Monday unless Rodric weighs in with a different opinion.

@csantanapr
Copy link
Member

Hi @dgrove-oss
Today we have in ansible two modes local and remote
The variable is openwhisk_cli.installation_mode
https://github.com/apache/incubator-openwhisk/blob/master/ansible/group_vars/all#L310-L317
Today the default is "remote" this pulls down the cli, copy the files, and mounts the volume.

One way to do it is to introduce a 3rd option for openwhisk_cli.installation_mode, local, remote and remote_redirect
WDYT?

@dgrove-oss
Copy link
Member

I'm wondering if we need anything other than remote_redirect (just like the SDKs are now). If the core project supports multiple modes, then people might still be depending on having the CLI installed into the nginx image, so I probably have to support the same set of options in the kube variant.

@rabbah
Copy link
Member

rabbah commented Dec 9, 2017 via email

@csantanapr
Copy link
Member

csantanapr commented Dec 9, 2017

I would say going forward we only support redirect mode, and do it for kube like that.
And say that having the CLI installed into the nginx is deprecated eventually remove.

@csantanapr
Copy link
Member

Custom deployment have their choice on how they want to distribute the CLI, it's open based on their use case.

@dgrove-oss
Copy link
Member

Sounds good to me. I'll do a PR to change nginx.conf to have the redirects

dgrove-oss added a commit to dgrove-oss/openwhisk that referenced this issue Dec 11, 2017
As was already done with the iOS starter app and the blackbox SDK,
switch to making the cli binaries available via a redirect to the
openwhisk-cli release page instead of copying cli binaries into
the edge container.  As discussed in issue apache#2152 this eliminates
the need for a custom OpenWhisk edge image for downstream deployments.

Also update GoCLINginxTests to check for redirects instead of direct
downloads and remove the cli role and related variable definitions
from ansible.
dgrove-oss added a commit to dgrove-oss/openwhisk that referenced this issue Dec 11, 2017
As was already done with the iOS starter app and the blackbox SDK,
switch to making the cli binaries available via a redirect to the
openwhisk-cli release page instead of copying cli binaries into
the edge container.  As discussed in issue apache#2152 this eliminates
the need for a custom OpenWhisk edge image for downstream deployments.

Also update GoCLINginxTests to check for redirects instead of direct
downloads and remove the cli role and related variable definitions
from ansible.
dgrove-oss added a commit to dgrove-oss/openwhisk that referenced this issue Dec 12, 2017
As was already done with the iOS starter app and the blackbox SDK,
switch to making the cli binaries available via a redirect to the
openwhisk-cli release page instead of copying cli binaries into
the edge container.  As discussed in issue apache#2152 this eliminates
the need for a custom OpenWhisk edge image for downstream deployments.

Also update GoCLINginxTests to check for redirects instead of direct
downloads and remove the cli role and related variable definitions
from ansible.
dgrove-oss added a commit to dgrove-oss/openwhisk that referenced this issue Dec 13, 2017
Add a third remote_redirect option to the prior local and
remote options for cli installation.  In remote_redirect mode,
the CLI binaries are not installed into the edge server's
file system. All requests to download the CLI are instead
redirected to an external URL (for example to download
from the openwhisk-cli release page).  This follows the
pattern already set for the iOS starter app and blackbox SDK.

See discussion in issue apache#2152.
@rabbah rabbah closed this as completed Dec 18, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants