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

improve view for zipped openwhisk actions #2255

Closed
rabbah opened this issue Aug 7, 2019 · 6 comments
Closed

improve view for zipped openwhisk actions #2255

rabbah opened this issue Aug 7, 2019 · 6 comments
Labels
kind/feature Categorizes issue or PR as related to a new feature. plugin/openwhisk

Comments

@rabbah
Copy link

rabbah commented Aug 7, 2019

Describe the topic
if you create an openwhisk action from a zip file and click on the action in action list, you get a sidecar message which says the action can't be opened because it's a zip file.

Your suggestions for this topic
i think this can be improved, with possible suggestions being: kui could unzip the files locally and allow you to navigate through the archive; or it could show you a manifest of what is in the action; or perhaps there's a way to record where on the local file system the action was deployed from and navigate you there...

@starpit
Copy link
Contributor

starpit commented Aug 7, 2019

kui does have some support for zip actions. or at least it did. has the openwhisk specification changed at all? we have tests for at least one case, and kui, for this scenario, displays the main action source on "action get"

@starpit starpit added plugin/openwhisk kind/feature Categorizes issue or PR as related to a new feature. labels Aug 7, 2019
@rabbah
Copy link
Author

rabbah commented Aug 7, 2019

action code is an attachment by default (in Apache) - so action get may not get the "zip" contents unless you request it. Otherwise the schema is the same.

@starpit
Copy link
Contributor

starpit commented Aug 7, 2019

is it possible that create and get are different? because we do have a test
https://github.com/IBM/kui/blob/master/plugins/plugin-openwhisk/src/test/openwhisk4/zip.ts

that creates a zip action, and expects to see the source in the sidecar. but, looking at that test, it doesn't ever do a get.

@rabbah
Copy link
Author

rabbah commented Aug 17, 2019

I've investigated this a bit further. If the action is created from within kui, then kui will show you index.js (or comparable for other languages). But if you create the same action from outside of kui, then you get a message that the action cannot be displayed because it's a binary action.

The action created from within kui has these annotations (which evidently won't exist for actions created outside of kui).

{
  "binary": true,
  "wskng.combinators": [{
    "badge": "zip",
    "role": "replacement",
    "type": "action.kind"
  }],
  "file": "/path/to/f.zip",
  "exec": "nodejs:10"
}

The key annotation is wskng.combinators - adding a subset of those explicitly outside of kui makes the action's index file visible in the editor.

wsk action update p -a "wskng.combinators" '[{"role": "replacement","badge": "zip"}]'

@rabbah
Copy link
Author

rabbah commented Aug 17, 2019

Is it always the "index" file that's shown? For node.js it's possible to have a different entry file (whether via a --main somefile.somefunction declaration or changing the package.json file entry for the index).

Is the sidecar view limit to just one file (namely the "index" file)? It would be nice to allow more general navigation if so of the contents.

@starpit
Copy link
Contributor

starpit commented Dec 31, 2019

moving to kui-shell/oui#61

@starpit starpit closed this as completed Dec 31, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature Categorizes issue or PR as related to a new feature. plugin/openwhisk
Projects
None yet
Development

No branches or pull requests

2 participants