468 Commits

Author SHA1 Message Date
Templum
0b28e96a58 Adjusted code accordingly to feedback
Based on the received feedback I updated the documentation of the function. Also replaced variable temp by an more declaritive variable.
Signed-off-by: Simon Pelczer <templum.dev@gmail.com>
2018-04-11 19:30:43 -07:00
Templum
6cd6975fe5 Moved label extraction to dedicated function.
Further I created some unit test which should cover all relevant scenarios for the created function.

Signed-off-by: Simon Pelczer <templum.dev@gmail.com>
2018-04-11 19:30:43 -07:00
Simon Pelczer
7fe67d7af6 Implemented the autoscaling steps to be proportions of the max replicas.
Introduced an new label to set the scaling factor that is used to calculate th proportions, setting it to 0 also allows to disable scaling.
Updated the tests to reflect the changes and added a new test which shows that setting the scaling factor to 0 indeed does disable scaling.
Ensured that the scaling factor is always between [0 and 100].

Signed-off-by: Simon Pelczer <templum.dev@gmail.com>
2018-04-11 19:30:43 -07:00
Ken Fukuyama
8f249792fe On funcstore error, change to manual tab
Fixed the UI so that when an error occurs, the tab automatically changes
to the manual tab in order to show the errors.

Signed-off-by: Ken Fukuyama <kenfdev@gmail.com>
2018-04-10 14:06:51 -07:00
Ken Fukuyama
e6a6aea422 Moved unit test files inside same directory as test target
The unit tests were inside the `gateway/tests` directory which had no
effect to the coverage for `go test`. Therefore, moved the tests inside
the same directory as the test target.

Signed-off-by: Ken Fukuyama <kenfdev@gmail.com>
2018-04-06 14:13:14 +01:00
Alex Ellis (VMware)
daa79aef75 Deprecate routeless proxy test
Routeless proxy allowed no HTTP path to be given when a Header
X-Function: name was given. This has been deprecated - I am
unaware of any usage of the feature.

Signed-off-by: Alex Ellis (VMware) <alexellis2@gmail.com>
2018-04-03 17:55:44 +01:00
Alex Ellis (VMware)
5e0569f75a Update TestGet_Rejected
Get is a supported method so this test failed, I've now changed
this to an unsupported method - i.e. HEAD to trigger the error
and keep the test.

Signed-off-by: Alex Ellis (VMware) <alexellis2@gmail.com>
2018-04-03 17:55:44 +01:00
Alex Ellis (VMware)
bbbb4b536a Bump watchdog to 1.9.4
Signed-off-by: Alex Ellis (VMware) <alexellis2@gmail.com>
2018-04-03 17:55:44 +01:00
Alex Ellis (VMware)
65ed8457af Fix issue in passing-through of proxy body
Proxy body was being passed correctly due to placement of defer
statement. This has been moved into outer scope to resolve issue.

Tested with new e2e tests in certifier component.

Signed-off-by: Alex Ellis (VMware) <alexellis2@gmail.com>
2018-03-27 21:12:38 +01:00
Alex Ellis (VMware)
58bd87c811 Update proxy to pass query-string
HTTP proxy was not passing query-string upstream. This change
reinstates the behaviour through TDD - adding test coverage and
automated regression testing.

Signed-off-by: Alex Ellis (VMware) <alexellis2@gmail.com>
2018-03-27 19:33:43 +01:00
Alex Ellis (VMware)
9a1b119c9f Remove Prometheus tracking for forwarded requests
Forwarded requests were being logged in the function metrics and
I saw this when doing some testing on auto-scaling with K8s.

This change removes the call to the Prometheus notifier for any
calls which are forwarded to the provider and retains them for the
functions.

Signed-off-by: Alex Ellis (VMware) <alexellis2@gmail.com>
2018-03-26 13:12:29 +01:00
Ken Fukuyama
4877a60aee Changed the download functionality to cover IE.
Since IE doesn't work well with `.click()` (because of access denied) we
can take advantage of the `navigator.msSaveOrOpenBlob`.
https://stackoverflow.com/questions/46232980/click-giving-access-denied-in-ie11/46233123#46233123

Signed-off-by: Ken Fukuyama <kenfdev@gmail.com>
2018-03-23 16:43:38 +00:00
Ivana Yovcheva
c633fbb96d Fix mouse click error on IE11
MouseEvent initialization was failing on IE11.
Add a separate case for IE11 that fixes the issue.

Signed-off-by: Ivana Yovcheva <iyovcheva@vmware.com>
2018-03-23 16:43:38 +00:00
Ivana Yovcheva
0f126ce241 Fix crypto breaking error for IE11
window.crypto is throwing an error on IE11
which required a modification to use window.msCrypto
instead in case of running on IE11

Signed-off-by: Ivana Yovcheva <iyovcheva@vmware.com>
2018-03-23 16:43:38 +00:00
David Muckle
5824d865c6 Add a title to the index.html for the gateway
This will replace the gateway URL showing up as the title.

Signed-off-by: David Muckle <dvdmuckle@dvdmuckle.xyz>
2018-03-23 16:38:19 +00:00
John McCabe
fac3345668 Use http package consts for http methods
This commit replaces occurences of http method strings with the
corresponding consts from the http package.

*Note* UPDATE is not strictly speaking a valid method and as such isn't
part of the http package (should be a PUT or PATCH?)

Signed-off-by: John McCabe <john@johnmccabe.net>
2018-03-23 16:37:33 +00:00
Alex Ellis
0c7e59fe8a Add direct_functions mode to gateway for tuning
Adds a pair of configuration options for performance tuning. The
gateway can now invoke functions directly and can bypass the
provider. See updated table in README.md for configuration values.

BaseURLResolver is added with unit tests that decouples resolving
upstream URL from the reverse proxy client code.

- SingleHostBaseURLResolver resolves a single upstream host
- FunctionAsHostBaseURLResolver resolves host based upon conventions
within the URL of the request to a function for direct access

Tested with Kubernetes (faas-netes) and faas-swarm through UI, CLI
calling system endpoints and functions directly.

Signed-off-by: Alex Ellis (VMware) <alexellis2@gmail.com>
2018-03-23 16:35:37 +00:00
Alex Ellis (VMware)
c716c54868 Break out logging / metrics for functions in forwarding_proxy
Signed-off-by: Alex Ellis (VMware) <alexellis2@gmail.com>
2018-03-20 09:51:42 +00:00
Alex Ellis
3897d1f54e Bump swarm versions
Signed-off-by: Alex Ellis <alexellis2@gmail.com>
2018-03-13 17:30:28 +00:00
Ken Fukuyama
7d860bff41 fixed unexpected behavior where the selected function properties don't get
updated after adding/deleting a different function.

Signed-off-by: Ken Fukuyama <kenfdev@gmail.com>
2018-03-08 22:30:45 +01:00
Ken Fukuyama
02642ffb3f Edited unnecessary fields and $scopes.
Signed-off-by: Ken Fukuyama <kenfdev@gmail.com>
2018-03-08 22:30:45 +01:00
Alex Ellis
b9d705ebd4 UI: in-line ready directive
Signed-off-by: Alex Ellis <alexellis2@gmail.com>
2018-03-08 22:30:45 +01:00
Alex Ellis
a8d91590ab UI: fix ng-model complaint
Signed-off-by: Alex Ellis <alexellis2@gmail.com>
2018-03-08 22:30:45 +01:00
Alex Ellis
ccfb8f7be4 Make UI block until function reports readiness
Signed-off-by: Alex Ellis <alexellis2@gmail.com>
2018-03-08 22:30:45 +01:00
Alex Ellis
37ef024df7 Proxy fix - copy request headers into upstream
Signed-off-by: Alex Ellis <alexellis2@gmail.com>
2018-03-05 15:31:25 +00:00
Alex Ellis
6efaee5b4f Add upstream_timeout as env-var
Signed-off-by: Alex Ellis <alexellis2@gmail.com>
2018-03-05 12:49:25 +00:00
Alex Ellis
30928739ee Use context for upstream timeouts
Signed-off-by: Alex Ellis <alexellis2@gmail.com>
2018-03-05 12:49:25 +00:00
Ken Fukuyama
4cc51adffb added missing return statement
Signed-off-by: Ken Fukuyama <kenfdev@gmail.com>
2018-03-03 17:41:56 +00:00
Ken Fukuyama
d96674468c fixed another missing closing tag.
Signed-off-by: Ken Fukuyama <kenfdev@gmail.com>
2018-03-03 17:41:56 +00:00
Ken Fukuyama
a6a657295f fixed ES6 syntax accidentally used in JavaScript.
fixed markup closing typo.

Signed-off-by: Ken Fukuyama <kenfdev@gmail.com>
2018-03-03 17:41:56 +00:00
Alex Ellis
76526b0be3 Bump LTS Go version
Signed-off-by: Alex Ellis <alexellis2@gmail.com>
2018-03-03 17:36:33 +00:00
Alex Ellis
fdc7f08ba2 Pass along status code
Signed-off-by: Alex Ellis <alexellis2@gmail.com>
2018-03-03 17:36:33 +00:00
Alex Ellis
7120e4c5f4 Apply comments and naming conventions to HTTP proxy
Signed-off-by: Alex Ellis <alexellis2@gmail.com>
2018-03-03 17:36:33 +00:00
Alex Ellis
26e0de3497 Remove Golang reverseproxy and use http Client
Signed-off-by: Alex Ellis <alexellis2@gmail.com>
2018-03-03 17:36:33 +00:00
Alex Ellis (VMware)
b67d0526ce Expose function endpoint from underlying provider
Signed-off-by: Alex Ellis (VMware) <alexellis2@gmail.com>
2018-03-01 08:34:32 +00:00
Ivan Mikushin
8dd646cf5a Add AvailableReplicas field to requests.Function
Signed-off-by: Ivan Mikushin <imikushin@vmware.com>
2018-03-01 08:26:05 +00:00
Ken Fukuyama
365e348865 upgraded angularjs from 1.5.5 to 1.6.9
The $https service deprecated the `success` method, so changed `success`
to `then`.

This will fix #528

Signed-off-by: Ken Fukuyama <kenfdev@gmail.com>
2018-02-25 12:07:41 +00:00
Ken Fukuyama
ead18a3059 Fixed UI to use relative paths for ajax requests in order to work with kube proxy.
This fixes issue #519.

Signed-off-by: Ken Fukuyama <fukuyama@supersoftware.co.jp>
2018-02-25 11:55:54 +00:00
Vivek Singh
b12a4d0bf2 adds Go durations for timeout configs
Signed-off-by: Vivek Singh <vivekkmr45@yahoo.in>

applied go fmt on config_test file

Signed-off-by: Vivek Singh <vivekkmr45@yahoo.in>

removes extra line in config_test

Signed-off-by: Vivek Singh <vivekkmr45@yahoo.in>
2018-02-10 18:46:23 +00:00
Alex Ellis
6eca86f31e
Update README.md 2018-02-07 09:13:48 +00:00
Alex Ellis
cb1f76a51f Inject arm64 store at build time
Signed-off-by: Alex Ellis <alexellis2@gmail.com>
2018-02-05 08:42:13 +00:00
Alex Ellis
b79d11d07f Update arm64 Dockerfile
Signed-off-by: Alex Ellis <alexellis2@gmail.com>
2018-02-04 21:48:25 +00:00
Alex Ellis
ff9f7a5541 Make debugging less verbose
Signed-off-by: Alex Ellis <alexellis2@gmail.com>
2018-02-01 09:37:05 +00:00
Alex Ellis
f954bf0733 Merge master into breakout_swarm
Signed-off-by: Alex Ellis <alexellis2@gmail.com>
2018-02-01 09:29:54 +00:00
Alex Ellis
e8f8231c39
Update README.md 2018-01-28 09:45:59 +00:00
Alex Ellis
262b0afda7 Make gateway compatible with Prometheus 1.0 and 2.0
Signed-off-by: Alex Ellis <alexellis2@gmail.com>
2018-01-13 09:32:49 +00:00
Alex Ellis
f2baa956b5 Add re-direct for ARMHF function store
Signed-off-by: Alex Ellis <alexellis2@gmail.com>
2017-12-30 09:34:18 +00:00
Alex Ellis
979e44bf8c Escape PromQL query
Signed-off-by: Alex Ellis <alexellis2@gmail.com>
2017-12-29 16:39:24 +00:00
Lucas Roesler
fe7dd9068f Remove code duplicated during a rebase
Signed-off-by: Lucas Roesler <roesler.lucas@gmail.com>
2017-12-16 16:08:52 +00:00
Lucas Roesler
1a055deb49 Add secret management to the update handler
**What**
- Pass secrets to the updateSpec method

Signed-off-by: Lucas Roesler <roesler.lucas@gmail.com>
2017-12-16 16:08:52 +00:00