You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@openwhisk.apache.org by OpenWhisk Team Slack <ra...@apache.org> on 2019/05/17 07:53:52 UTC

[slack-digest] [2019-05-16] #random

2019-05-16 05:40:32 UTC - Jin Choi: One question: I have a web action which emits an HTML as the result. The thing is, even if I `curl` it with `--compressed` option the HTML comes in the plain text regarding the headers. Using Chrome browser as a client doesn't make a change. So, can I have my web action's result encoded in gzip in response?
https://openwhisk-team.slack.com/archives/C3UDXSFA6/p1557985232048800
----
2019-05-16 07:08:03 UTC - Rodric Rabbah: If the action compressed the output and base64 encoded it, and sets the proper header, I’d expect it to work.
https://openwhisk-team.slack.com/archives/C3UDXSFA6/p1557990483050700?thread_ts=1557990483.050700&cid=C3UDXSFA6
----
2019-05-16 07:13:35 UTC - Dominic Kim: @Jin Choi I am not sure this is relevant to your case, but when I download `csv` file via a web action, I used following headers:
```
'headers': { 
	'Content-Type': 'text/csv',
	'content-length': str(len(results)),
	'Content-Encoding': 'UTF-32',
	'charset': 'UTF-32LE',
	'Content-Disposition': 'attachment;filename=ExportedData.csv'
},
```
https://openwhisk-team.slack.com/archives/C3UDXSFA6/p1557990815051900?thread_ts=1557990815.051900&cid=C3UDXSFA6
----
2019-05-16 07:15:02 UTC - Dominic Kim: You may need more headers for it.
https://openwhisk-team.slack.com/archives/C3UDXSFA6/p1557990902052800
----
2019-05-16 07:16:15 UTC - Dominic Kim: ```
Content-Encoding: gzip
```
https://openwhisk-team.slack.com/archives/C3UDXSFA6/p1557990975053600
----
2019-05-16 07:23:54 UTC - Jin Choi: Calling a web action
``` $ curl -v -XPOST -H"Content-Type: application/json" -H"Content-Encoding: gzip" -d'{"name":"JIN CHOI"}' <https://DOMAIN/api/v1/web/guest/demo/action.html>

REQUEST HEADER
```&gt; POST /api/v1/web/guest/demo/action.html HTTP/1.1
&gt; Host: DOMAIN
&gt; User-Agent: curl/7.54.0
&gt; Accept: */*
&gt; Content-Type: application/json
&gt; Content-Encoding: gzip
&gt; Content-Length: 39```

RESPONSE HEADER
```&lt; HTTP/1.1 200 OK
&lt; Server: nginx
&lt; Date: Thu, 16 May 2019 07:21:49 GMT
&lt; Content-Type: text/html; charset=UTF-8
&lt; Content-Length: 169
&lt; Connection: keep-alive
&lt; X-Request-ID: 8a93c9b06347353058493ada1562e84b
&lt; Access-Control-Allow-Origin: *
&lt; Access-Control-Allow-Methods: OPTIONS, GET, DELETE, POST, PUT, HEAD, PATCH
&lt; Access-Control-Allow-Headers: Authorization, Origin, X-Requested-With, Content-Type, Accept, User-Agent
&lt; x-openwhisk-activation-id: 8614c025836049c294c0258360e9c23a```
https://openwhisk-team.slack.com/archives/C3UDXSFA6/p1557991434053700?thread_ts=1557990483.050700&cid=C3UDXSFA6
----
2019-05-16 07:25:45 UTC - Jin Choi: Do you mean I need to do extra work on my action logic?
https://openwhisk-team.slack.com/archives/C3UDXSFA6/p1557991545053900?thread_ts=1557990483.050700&cid=C3UDXSFA6
----
2019-05-16 07:26:13 UTC - Jin Choi: For Nginx, it's just about turning on/off an option for gzip, isn't it?
https://openwhisk-team.slack.com/archives/C3UDXSFA6/p1557991573054100?thread_ts=1557990483.050700&cid=C3UDXSFA6
----
2019-05-16 07:27:54 UTC - Jin Choi: Whether you request a specific Content-Encoding is a different matter from whether you get a result in the requested format.
What do you see in the response header for the action call?
https://openwhisk-team.slack.com/archives/C3UDXSFA6/p1557991674054300?thread_ts=1557990815.051900&cid=C3UDXSFA6
----
2019-05-16 07:29:24 UTC - Dominic Kim: I am trying to enable gzip compression in a webaciton, how can I confirm the html is passed with compressions in chrome?
https://openwhisk-team.slack.com/archives/C3UDXSFA6/p1557991764054500?thread_ts=1557990815.051900&cid=C3UDXSFA6
----
2019-05-16 07:30:05 UTC - Jin Choi: I think you need an extension in Chrome to be able to tweak the options. Why don't you use `curl` on terminal?
https://openwhisk-team.slack.com/archives/C3UDXSFA6/p1557991805054800?thread_ts=1557990815.051900&cid=C3UDXSFA6
----
2019-05-16 07:30:57 UTC - Rodric Rabbah: Sure, you can try gzip on in nginx 
https://openwhisk-team.slack.com/archives/C3UDXSFA6/p1557991857055500?thread_ts=1557990483.050700&cid=C3UDXSFA6
----
2019-05-16 07:31:04 UTC - Jin Choi: Oh I think I misunderstood you.
https://openwhisk-team.slack.com/archives/C3UDXSFA6/p1557991864055700?thread_ts=1557990815.051900&cid=C3UDXSFA6
----
2019-05-16 07:31:22 UTC - Jin Choi: You can see the response header in `Developers Tool &gt; Network`
https://openwhisk-team.slack.com/archives/C3UDXSFA6/p1557991882055900?thread_ts=1557990815.051900&cid=C3UDXSFA6
----
2019-05-16 07:32:30 UTC - Dominic Kim: I did this but not quite sure is it zipped or not.
```
$ curl -SLO https://{{MY_HOST}}/api/v1/web/style95/default/gzip -H "Accept-Encoding: gzip" -v
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0*   Trying 10.106.242.22...
* Connected to {{MY_HOST}} (10.106.242.22) port 443 (#0)
* TLS 1.2 connection using TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384
.
.
.
&gt; GET /api/v1/web/style95/default/gzip HTTP/1.1
&gt; Host: {{MY_HOST}}
&gt; User-Agent: curl/7.43.0
&gt; Accept: */*
&gt; Accept-Encoding: gzip
&gt;
&lt; HTTP/1.1 200 OK
&lt; Server: nginx
&lt; Date: Thu, 16 May 2019 07:24:52 GMT
&lt; Content-Type: text/html; charset=UTF-8
&lt; Content-Length: 67
&lt; Connection: keep-alive
&lt; X-Request-ID: 96288076291bb26bbb4555f92853f49a
&lt; Access-Control-Allow-Origin: *
&lt; Access-Control-Allow-Methods: OPTIONS, GET, DELETE, POST, PUT, HEAD, PATCH
&lt; Access-Control-Allow-Headers: Authorization, Origin, X-Requested-With, Content-Type, Accept, User-Agent
&lt; x-openwhisk-activation-id: bc4fc9a123374ffa8fc9a123372ffa9e
&lt; Content-Disposition: attachment;filename=test.gzip
&lt; Content-Encoding: gzip
&lt; X-Request-ID: 96288076291bb26bbb4555f92853f49a
&lt;
{ [67 bytes data]
100    67  100    67    0     0    608      0 --:--:-- --:--:-- --:--:--   614
Connection #0 to host {{MY_HOST}} left intact
```
https://openwhisk-team.slack.com/archives/C3UDXSFA6/p1557991950056200?thread_ts=1557990815.051900&cid=C3UDXSFA6
----
2019-05-16 07:32:49 UTC - Dominic Kim: I can see ` Content-Encoding: gzip` in response header because I added it in my webaction.
https://openwhisk-team.slack.com/archives/C3UDXSFA6/p1557991969056400?thread_ts=1557990815.051900&cid=C3UDXSFA6
----
2019-05-16 07:32:51 UTC - Jin Choi: You mean I need to turn the option on for the Nginx for Openwhisk
https://openwhisk-team.slack.com/archives/C3UDXSFA6/p1557991971056600?thread_ts=1557990483.050700&cid=C3UDXSFA6
----
2019-05-16 07:33:16 UTC - Jin Choi: Thank you very much.
https://openwhisk-team.slack.com/archives/C3UDXSFA6/p1557991996056900?thread_ts=1557990483.050700&cid=C3UDXSFA6
----
2019-05-16 07:33:17 UTC - Dominic Kim: But not quite sure it "is" zipped.
https://openwhisk-team.slack.com/archives/C3UDXSFA6/p1557991997057100?thread_ts=1557990815.051900&cid=C3UDXSFA6
----
2019-05-16 07:36:37 UTC - Jin Choi: `-H "Accept-Encoding: gzip"` on curl option was all you needed to see the `Content-Encoding: gzip` on response header, wasn't it? Did you do something special on your action code for gzip?
https://openwhisk-team.slack.com/archives/C3UDXSFA6/p1557992197057300?thread_ts=1557990815.051900&cid=C3UDXSFA6
----
2019-05-16 07:38:17 UTC - Dominic Kim: Hm.. I think I did wrong as I just included that header in the response of a webaction.
https://openwhisk-team.slack.com/archives/C3UDXSFA6/p1557992297057600?thread_ts=1557990815.051900&cid=C3UDXSFA6
----
2019-05-16 07:38:42 UTC - Dominic Kim: I can even see `Content-Encoding: gzip` on response header even if I don't include `-H "Accept-Encoding: gzip"`.
https://openwhisk-team.slack.com/archives/C3UDXSFA6/p1557992322057800?thread_ts=1557990815.051900&cid=C3UDXSFA6
----
2019-05-16 07:39:24 UTC - Dominic Kim: I feel like you need to manually handle such conditional zipping logic.
https://openwhisk-team.slack.com/archives/C3UDXSFA6/p1557992364058000?thread_ts=1557990815.051900&cid=C3UDXSFA6
----
2019-05-16 07:39:45 UTC - Dominic Kim: I would try and let you know if I found any ways.
https://openwhisk-team.slack.com/archives/C3UDXSFA6/p1557992385058200?thread_ts=1557990815.051900&cid=C3UDXSFA6
----
2019-05-16 15:27:05 UTC - Robert Munteanu: Hi!

I come here from <ma...@infra.apache.org> where I was told that the OpenWhisk project has some integration around Slack which is based on Functions. If that is correct? If it is, where can I find out more details about it? In Apache Sling we are exploring the idea of running our own bots for GitHub integration but don't want to manage the infrastructure so I'm interested in what others are doing.

Thanks!
https://openwhisk-team.slack.com/archives/C3UDXSFA6/p1558020425061200?thread_ts=1558020425.061200&cid=C3UDXSFA6
----
2019-05-16 15:51:47 UTC - Dave Grove: Hi @Robert Munteanu      I am aware of two slack integrations that use functions.  We’ve linked our TravisCI testing to slack notifications using <https://github.com/rabbah/travis-to-slack>.  I think we also have a Slack signup process that automates allowing people to join our slack that uses functions as a backend (I don’t know the details of how this works).  I think @Rodric Rabbah has made some changes to the Slack/Github integration in the last couple of months, so he may be able to tell you more.   our <#C3W9D3UM8|dev> and #dev-pr channel get notified on github operations.
https://openwhisk-team.slack.com/archives/C3UDXSFA6/p1558021907066200?thread_ts=1558021907.066200&cid=C3UDXSFA6
----
2019-05-16 15:52:21 UTC - Dave Grove: @Rodric Rabbah also built automation that sends a daily digest of slack to our dev list.  I think that is also based on functions
https://openwhisk-team.slack.com/archives/C3UDXSFA6/p1558021941066900
----
2019-05-16 15:55:52 UTC - Robert Munteanu: Thanks @Dave Grove! I would be interested in getting more details about how they are implemented and where they are 'hosted'. Hopefully @Rodric Rabbah has that
https://openwhisk-team.slack.com/archives/C3UDXSFA6/p1558022152067000?thread_ts=1558021907.066200&cid=C3UDXSFA6
----
2019-05-16 16:12:03 UTC - Rodric Rabbah: Hi Robert. Are you asking if there’s an Apache hosted openwhisk/functions service to use? Or what functions already exist for project management that you might be able to reuse?
https://openwhisk-team.slack.com/archives/C3UDXSFA6/p1558023123068400?thread_ts=1558020425.061200&cid=C3UDXSFA6
----