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

add remote_redirect mode for openwhisk_cli installation #3100

Closed
wants to merge 1 commit into from

Conversation

dgrove-oss
Copy link
Member

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 #2152.

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.
@dgrove-oss
Copy link
Member Author

Closes #2152

This is a rework of PR #3093 based on feedback from @csantanapr

@dgrove-oss
Copy link
Member Author

dgrove-oss commented Dec 13, 2017

PG1 2454 - timed out during testing overnight. Trying again.
PG3 1537 - GoCLI test failure due to missing companion PR. Fixed.
PG3 1539 - passing -- 1 unrelated failure on intermittently failing test.

@dgrove-oss
Copy link
Member Author

needs labels: review, companion.

@rabbah rabbah added review Review for this PR has been requested and yet needs to be done. companion deployment labels Dec 13, 2017
@dgrove-oss
Copy link
Member Author

@csantanapr @houshengbo -- reminder to review

Copy link
Contributor

@jonpspri jonpspri left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No doubt that this will work, if it's merged before #3133, and I can make the appropriate changes to it; however, I think we should separate the Nginx-related configuration (making the CLI available for download) from the sourcing of bin/wsk for 'local' execution within the cluster.

{% if openwhisk_cli.installation_mode == "remote_redirect" %}
# redirect requests for specific binaries to the matching one from the {{ openwhisk_cli_tag }} openwhisk-cli release.
{% for os in cli_os %}
{% for arch in cli_arch %}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This concerns me given changes I made in #3133 to introduce cli_os_arch. It will be a simple update, depending on which goes first.

@@ -26,3 +27,7 @@
when: cli_installation_mode == "local"

- include: download_cli.yml
when: cli_installation_mode != "remote_redirect"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My gut says this should be cli_installation_mode == "remote" because selecting local install is usually because the download is broken for a particular platform. Of course, I'm not sure local is functionally complete in the configuration. But, more to the point, we should separate making the CLI available for download via NGinx from sourcing the binary for /wsk/bin for local use.


- name: "set the file name to download for linux"
set_fact:
cli_download_name={{ openwhisk_cli.remote_redirect.package_name }}-{{ openwhisk_cli_tag }}-linux-amd64.tgz
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a bit more complicated now, because there will be multiple linux architectures (amd64, s390x). Is there a reason we can't reuse the existing ansible files for downloading the cli? It seems configuring Nginx should be a separate problem from downloading a binary for "local" use.

@dgrove-oss
Copy link
Member Author

dgrove-oss commented Dec 27, 2017

Thinking about this change more over break, it seems to me that it would be cleaner to not conflate local building vs. downloading of the CLU and embedding the CLI in the edge host vs. putting a redirect in the nginx.conf file. So instead of having 3 modes for cli_installation_mode we would have two boolean properties: cli_build_locally (default to false) and cli_download_redirect (default to true). Thoughts?

@jonpspri
Copy link
Contributor

jonpspri commented Dec 28, 2017

I was heading in the same direction. My intention was to have build occur in the 'incubator-openwhisk-cli' project. The build would actually create two artifacts:

  1. The wsk binaries (as it does today).

  2. A tarball for deployment in Nginx consisting of the binaries directory structure and the content.json file.

Riffing on that, the CLI "download" could pull the tarball from a URL, and for local build the configuration could override that URL with file://../../incubator-openwhisk-cli/build/<path-to-tarball>.tgz. So we only need to address the two Nginx configurations (download vs redirect) -- anyone wanting local build should be savvy enough to do the build themselves before overriding the URL. Local CLI sourcing is similar -- is a URL override provided? Get that. Otherwise, get the 'default' CLI for the local OS and architecture from the github release page. @csantanapr @rabbah @houshengbo

@dgrove-oss
Copy link
Member Author

What do we want to do with this PR? Should I close it in favor of the work @jonpspri is doing, or is there some piece of it that is worth pulling as a separate PR that complements his cli changes?

@markusthoemmes
Copy link
Contributor

@csantanapr ^^ WDYT wrt @dgrove-oss 's comment? How do we want to proceed?

@csantanapr
Copy link
Member

I like @jonpspri proposal

So we only need to address the two Nginx configurations (download vs redirect)
#3100 (comment)

Closing this PR, if @jonpspri needs something from this PR he is free to take it here.

@csantanapr csantanapr closed this Feb 20, 2018
@dgrove-oss dgrove-oss deleted the nginx-redirect-remote branch August 17, 2018 13:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
companion deployment review Review for this PR has been requested and yet needs to be done.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants