412 Commits

Author SHA1 Message Date
Alex Ellis (OpenFaaS Ltd)
11ff356cce Remove service namespace from scale request
This field doesn't appear to be used and is supplied via the
querystring which faas-netes (the only ns-enabled provider
already consumes)

Related to PR:

https://github.com/openfaas/faas-netes/pull/671

Signed-off-by: Alex Ellis (OpenFaaS Ltd) <alexellis2@gmail.com>
2020-07-20 10:19:26 +01:00
Alex Ellis (OpenFaaS Ltd)
997c6704b5 Remove unused value
Removes an unused value in the alerthandler.go file, shown
via lgtm.com.

Signed-off-by: Alex Ellis (OpenFaaS Ltd) <alexellis2@gmail.com>
2020-05-06 18:35:49 +01:00
Alex Ellis (OpenFaaS Ltd)
5741610f31 Return cached query when hit
The code was calling into the cache twice, even if the first
call was a cache hit and not a miss.

Signed-off-by: Alex Ellis (OpenFaaS Ltd) <alexellis2@gmail.com>
2020-05-06 18:32:51 +01:00
Alex Ellis (OpenFaaS Ltd)
c45334657a Handle err in queue_proxy
Found on lgtm.com

Signed-off-by: Alex Ellis (OpenFaaS Ltd) <alexellis2@gmail.com>
2020-05-06 18:32:17 +01:00
Alex Ellis (OpenFaaS Ltd)
18f6c720b5 Extract a caching function_query type
This type abstracts the function_query type and introduces an
interface for testing and substitution.

Signed-off-by: Alex Ellis (OpenFaaS Ltd) <alexellis2@gmail.com>
2020-04-22 15:26:42 +01:00
Alex Ellis (OpenFaaS Ltd)
2bfca6d848 Publish to multiple topics
Enables publishing to various topics according to annotations
on the functions. The function cache is moved up one level so
that it can be shared between the scale from zero code and the
queue proxy.

Unit tests added for new internal methods.

Tested e2e with arkade and the newest queue-worker and RC
gateway image with two queues and an annotation on one of the
functions of com.openfaas.queue. It worked as expected including
with multiple namespace support.

Signed-off-by: Alex Ellis (OpenFaaS Ltd) <alexellis2@gmail.com>
2020-04-22 15:26:42 +01:00
Alex Ellis (OpenFaaS Ltd)
a7c6c39200 Add QueueName to async requests
The queue's name will be consumed by the queue worker to
publish to other topics / slow queues.

Signed-off-by: Alex Ellis (OpenFaaS Ltd) <alexellis2@gmail.com>
2020-04-22 12:38:58 +01:00
Alex Ellis (OpenFaaS Ltd)
9bde25aedb Bump queue-worker and NATS
NATS moved its primary library to: github.com/nats-io/stan.go

This commit synchronises the library in the gateway to match the
queue worker.

Signed-off-by: Alex Ellis (OpenFaaS Ltd) <alexellis2@gmail.com>
2020-04-22 10:14:01 +01:00
Alex Ellis (OpenFaaS Ltd)
c44cb74cc7 Propagate context to upstream request
Propagates the context to upstream requests so that
cancellation can cascade.

Closes: #1501 by @SpaWn2KiLl which was not signed-off.

Signed-off-by: Alex Ellis (OpenFaaS Ltd) <alexellis2@gmail.com>
2020-04-05 09:44:31 +01:00
Alex Ellis (OpenFaaS Ltd)
f652692966 Fix test on help description message
Signed-off-by: Alex Ellis (OpenFaaS Ltd) <alexellis2@gmail.com>
2020-03-12 14:02:57 +00:00
Alex Ellis (OpenFaaS Ltd)
37bf15e508 Namespace invocation_total
This should be a "no-harm" change to use the namespace/sub-
system definition for CounterOpts.

Signed-off-by: Alex Ellis (OpenFaaS Ltd) <alexellis2@gmail.com>
2020-03-12 13:51:43 +00:00
Alex Ellis (OpenFaaS Ltd)
c4f924cfb5 Update Started variable to GatewayFunctionInvocationStarted
Signed-off-by: Alex Ellis (OpenFaaS Ltd) <alexellis2@gmail.com>
2020-03-12 13:51:43 +00:00
Alex Ellis (OpenFaaS Ltd)
96812d2cd8 Record metrics for invocations when they start
* This experimental patch records metrics as invocations start
so that the metrics can be used to make better scale to zero
decisions in faas-idler.

Tested with Kubernetes on a single-node cluster, metrics
reported as expected. Existing metrics still report.

Signed-off-by: Alex Ellis (OpenFaaS Ltd) <alexellis2@gmail.com>
2020-03-12 13:51:43 +00:00
Alistair Hey
6880fdc524 Fix issue with Namespace suffix on Gateway UI
There was a case where a deployment with a single namespace on
faas-netes would show the namespace suffix for all functions.  we didn't
need to show this because the gateway will proxy to the default
namespace for fns without the namespace siffix.

This was tested on Swarm (no suffix), faas-netes (single namespace, no
suffix) and faas-netes, multi-ns, suffix shown.

Signed-off-by: Alistair Hey <alistair@heyal.co.uk>
2020-03-05 15:38:17 +00:00
Alistair Hey
b4bed58b66 Fix padding on Fn Store Gateway UI
The padding was off on the Gateway UI for the function
Store popup.

I have removed the 0padding css class from this element and left
it on the elements that require it

Signed-off-by: Alistair Hey <alistair@heyal.co.uk>
2020-03-05 15:38:17 +00:00
Lars Lehtonen
b4a6872c04 gateway/handlers: fix use of testing.T inside goroutine
Signed-off-by: Lars Lehtonen <lars.lehtonen@gmail.com>
2020-02-22 19:03:24 +00:00
Thomas Schmidt
67598e58c5 Update projects to use Go 1.13
Fixes #1442

Signed-off-by: Thomas Schmidt <thomaschmidt@gmail.com>
2020-02-22 19:01:49 +00:00
hasheddan
5fa7e0f8a0 Use license-check docker image instead of curl
Optimizes Docker builds by copying from license-check Docker image
instead of using curl to download the tool.

Signed-off-by: hasheddan <georgedanielmangum@gmail.com>
2020-02-04 15:51:03 +00:00
Vivek Singh
9fd8a59b89 Update logs to reudce verbosity and consistency
Signed-off-by: Vivek Singh <vivekkmr45@yahoo.in>
2020-01-24 12:39:16 +00:00
Alex Ellis (OpenFaaS Ltd)
80b6976c10 Update Golang versions to 1.12
Tested with local Docker build for each component.

Signed-off-by: Alex Ellis (OpenFaaS Ltd) <alexellis2@gmail.com>
2019-12-27 17:53:19 +00:00
Alex Ellis (OpenFaaS Ltd)
b45e2a52a4 Bump alpine to 3.11
There's a new release which appears to have no apparent down-
sides or breakages.

https://www.alpinelinux.org/posts/Alpine-3.11.2-released.html

Signed-off-by: Alex Ellis (OpenFaaS Ltd) <alexellis2@gmail.com>
2019-12-27 10:08:02 +00:00
Lucas Roesler
76e463a7a0 Always apply the function prefix trim for async functions
**What**
- Always apply the `FunctionPrefixTrimmingURLPathTransformer` when
  enqueueing async function requests. This ensures that the context
  information sent to the function is correct

Resolves #85

Signed-off-by: Lucas Roesler <roesler.lucas@gmail.com>
2019-12-25 17:40:39 +00:00
Alistair Hey
59b7839236 Change how and when we fetch and parse namespace info
Signed-off-by: Alistair Hey <alistair@heyal.co.uk>
2019-12-19 10:32:46 +00:00
Alistair Hey
04fead5eab Hide the namespace selector when on swarm or <2 K8s ns
We now hide the new namespace dropdown selector when
there is only 1 namespace, or when we are on swarm
This is also hidden in the function create page and
the function detail page

Signed-off-by: Alistair Hey <alistair@heyal.co.uk>
2019-12-15 17:06:20 +00:00
Bruno Miguel Custódio
03dc8824d2 Support customising the NATS Streaming channel.
Signed-off-by: Bruno Miguel Custódio <brunomcustodio@gmail.com>
2019-12-10 11:15:52 +00:00
Alistair Hey
2f683ba236 Add Namespace indicator on Function page part of #1379
This is a precursor to adding a dropdown for namespaces
selection (#1379)

Signed-off-by: Alistair Hey <alistair@heyal.co.uk>
2019-11-25 13:58:33 +00:00
Alistair Hey
7e1af57921 Allow users to create functions in a non-default NS from ui
This allows a uswer to select a non-standard (not openfaas-fn)
namespace from the UI to deploy a function into.

Signed-off-by: Alistair Hey <alistair@heyal.co.uk>
2019-11-25 11:11:48 +00:00
Alistair Hey
dd0608d36c Add Namespace Dropdown to Gateway UI
This PR adds a namespace dropdown for the openfaas
namespaces. If a user has non-default namespaces
installed then a user can select that namespace,
view functions in that namespace, invoke them from
the UI and delete them from that namespace.

Signed-off-by: Alistair Hey <alistair@heyal.co.uk>
2019-11-25 11:11:48 +00:00
Bruno Miguel Custódio
365f459b3f Allow for customizing the name of the target NATS Streaming cluster.
Signed-off-by: Bruno Miguel Custódio <brunomcustodio@gmail.com>
2019-11-25 10:52:39 +00:00
Alex Ellis (OpenFaaS Ltd)
040819b41c Bump faas-provider to 0.12.0
Signed-off-by: Alex Ellis (OpenFaaS Ltd) <alexellis2@gmail.com>
2019-10-19 10:51:24 +01:00
Karthick Prabu
1c9e122370 Updated basic auth plugin faas provider
Signed-off-by: Karthick Prabu <karthikprabu.cs@gmail.com>
2019-10-15 22:25:26 +01:00
Alex Ellis (OpenFaaS Ltd)
d6cf72bb39 Update/delete vendor files
Refreshed / updated vendor dependencies

Tested with "make".

Signed-off-by: Alex Ellis (OpenFaaS Ltd) <alexellis2@gmail.com>
2019-10-08 08:16:08 +01:00
Lucas Roesler
f62bcb0736 Add blog post about CICD with github actions
**What**
- Add blog post to lucasroesler.com about CI/CD with Github Actions

Signed-off-by: Lucas Roesler <roesler.lucas@gmail.com>
2019-10-06 22:25:33 +01:00
Jonatas Baldin
22b15fb0a9 Remove duplicated Secret struct
Signed-off-by: Jonatas Baldin <jonatas.baldin@gmail.com>
2019-10-05 18:58:47 +01:00
Jonatas Baldin
1cc93860d4 Add Namespace to Secret type
Signed-off-by: Jonatas Baldin <jonatas.baldin@gmail.com>
2019-10-05 18:58:47 +01:00
Alex Ellis (OpenFaaS Ltd)
d28fdf0075 Update gateway logo
Signed-off-by: Alex Ellis (OpenFaaS Ltd) <alexellis2@gmail.com>
2019-09-25 11:43:45 +01:00
Alex Ellis (OpenFaaS Ltd)
137b63e61f Add namespaces endpoint
This is being added because multiple namespaces can now be used
on Kubernetes. By listing namespaces, a client such as the UI
or CLI can then enumerate the namespaces to find functions
which may span across more than one namespace.

Signed-off-by: Alex Ellis (OpenFaaS Ltd) <alexellis2@gmail.com>
2019-09-21 18:07:38 +01:00
Alex Ellis (OpenFaaS Ltd)
e632c4c944 Scale from zero using namespace
Signed-off-by: Alex Ellis (OpenFaaS Ltd) <alexellis2@gmail.com>
2019-09-20 18:38:55 +01:00
Alex Ellis (OpenFaaS Ltd)
df4126d8f5 Scale functions with namespace option
Allows alerts to trigger functions to scale when they
also have an optional namespace set.

Tested e2e with Kubernetes 1.15 and a non-default namespace.

Signed-off-by: Alex Ellis (OpenFaaS Ltd) <alexellis2@gmail.com>
2019-09-20 18:38:55 +01:00
Alex Ellis (OpenFaaS Ltd)
238ce1be23 Add feature for invoking namespaced functions
When coupled with the latest version of faas-netes, the gateway
can now invoke, query and deploy functions into alternative
namespaces.

Tested e2e by creating a namespace "fn" and deploying, then
invoking a function deployed there and in the default namespace.

Signed-off-by: Alex Ellis (OpenFaaS Ltd) <alexellis2@gmail.com>
2019-09-20 18:38:55 +01:00
Alex Ellis (OpenFaaS Ltd)
0a90125aba Allow dot in function name
This patch enables the use-case for multiple namepsaces by
allowing a dot to be used in the function name.

dep has been run to update OpenFaaS projects and also to
prune unused files.

Tested by doing a build.

Signed-off-by: Alex Ellis (OpenFaaS Ltd) <alexellis2@gmail.com>
2019-09-20 11:23:57 +01:00
Alex Ellis (OpenFaaS Ltd)
d322f109a8 Fix logo location
Signed-off-by: Alex Ellis (OpenFaaS Ltd) <alexellis2@gmail.com>
2019-09-20 08:30:22 +01:00
Alex Ellis (OpenFaaS Ltd)
64b18d414e Update to SVG logo in UI
Signed-off-by: Alex Ellis (OpenFaaS Ltd) <alexellis2@gmail.com>
2019-09-18 20:27:29 +01:00
Alex Ellis (OpenFaaS Ltd)
cdfa01208d Bump versions
Signed-off-by: Alex Ellis (OpenFaaS Ltd) <alexellis2@gmail.com>
2019-08-22 15:48:23 +01:00
Alex Ellis
14677e0b9a Update alpine shipping versions
Alpine 3.10 is now availabe and is no-harm update.

Signed-off-by: Alex Ellis <alexellis2@gmail.com>
2019-08-21 07:40:51 +01:00
Alex Ellis
e2321fb631 Update contact email
Signed-off-by: Alex Ellis <alexellis2@gmail.com>
2019-08-12 09:01:29 +01:00
Alex Ellis (OpenFaaS Ltd)
df97efafae Migrate away from requests package for Function structs
The function deployment and status structs have been moved away
into the faas-provider package.

Tested with a build, running tests, and CI.

Signed-off-by: Alex Ellis (OpenFaaS Ltd) <alexellis2@gmail.com>
2019-08-05 12:58:30 +01:00
Alex Ellis
a156f26443 Create tag suffix using modified arch value
Signed-off-by: Alex Ellis <alexellis2@gmail.com>
2019-07-21 09:13:43 +01:00
Alex Ellis
c0ed8ac3f3 Add support for ARM64
This patch also removes the need for a separate ARM64 Dockerfile.
It has been tested on an Odroid-C2.

Signed-off-by: Alex Ellis <alexellis2@gmail.com>
2019-07-20 10:43:35 +01:00
Alex Ellis
d3b3130586 Collapse Dockerfile.armhf into Dockerfile
This change which has been tested on armhf and x86_64 removes
the need for a separate Dockerfile for armhf.

CGO_ENABLED and GOARM etc are now passed as ARGs via build.sh.

Signed-off-by: Alex Ellis <alexellis2@gmail.com>
2019-07-20 10:43:35 +01:00