454 Commits

Author SHA1 Message Date
Alex Ellis (OpenFaaS Ltd)
1d10e89aa2 Add HTTP status code to histogram
The histogram for gateway_functions_seconds excluded the status
code that gives important information for setting up SLOs.

Fixes: #1725

Signed-off-by: Alex Ellis (OpenFaaS Ltd) <alex@openfaas.com>
2022-06-01 09:33:36 +01:00
Alex Ellis (OpenFaaS Ltd)
e778a3a6de Move to Alpine 3.16 and add blog posts
Signed-off-by: Alex Ellis (OpenFaaS Ltd) <alex@openfaas.com>
2022-05-26 15:03:48 +01:00
Alex Ellis (OpenFaaS Ltd)
0d7ace76b6 Pin Alpine Linux patch version
Signed-off-by: Alex Ellis (OpenFaaS Ltd) <alexellis2@gmail.com>
2022-05-06 17:43:02 +01:00
Alex Ellis (OpenFaaS Ltd)
b097c87b80 Update whitespace in Dockerfile
Signed-off-by: Alex Ellis (OpenFaaS Ltd) <alexellis2@gmail.com>
2022-05-06 17:42:10 +01:00
Hilário Coelho
a530b9dd63 update prometheus client golang
update docker/distribution lib

Signed-off-by: Hilário Coelho <hilario.coelho@securityside.com>
2022-05-06 17:40:00 +01:00
Alex Ellis (OpenFaaS Ltd)
4602fa7c97 Fix typo in error message
Signed-off-by: Alex Ellis (OpenFaaS Ltd) <alexellis2@gmail.com>
2022-03-25 10:16:03 +00:00
Alex Ellis (OpenFaaS Ltd)
b4293967d2 Upgrade to alpine:3.15 where possible
Upgrades OS for some base images, no expected issues.

Signed-off-by: Alex Ellis (OpenFaaS Ltd) <alexellis2@gmail.com>
2022-02-21 10:30:22 +00:00
Alex Ellis (OpenFaaS Ltd)
cdb6baddda Deference channel
The defer close statement was causing issues in CI

Signed-off-by: Alex Ellis (OpenFaaS Ltd) <alexellis2@gmail.com>
2022-01-24 16:41:30 +00:00
Alex Ellis (OpenFaaS Ltd)
a07ef4c194 Use the latest license-check binary
Signed-off-by: Alex Ellis (OpenFaaS Ltd) <alexellis2@gmail.com>
2022-01-24 16:09:12 +00:00
Alex Ellis (OpenFaaS Ltd)
feb649be86 Turn off query for usage for invocations
Signed-off-by: Alex Ellis (OpenFaaS Ltd) <alexellis2@gmail.com>
2022-01-24 14:38:12 +00:00
Alex Ellis (OpenFaaS Ltd)
d85d5e7239 Export new metrics for OpenFaaS Pro scaling
* Add service target metric
* Add service min replicas metric
* Add scale type metric

These combined allow new auto-scaling modes and parameters
for OpenFaaS Pro customers.

Signed-off-by: Alex Ellis (OpenFaaS Ltd) <alexellis2@gmail.com>
2022-01-24 14:30:08 +00:00
Alex Ellis (OpenFaaS Ltd)
698713d21a Add open-containers label
Signed-off-by: Alex Ellis (OpenFaaS Ltd) <alexellis2@gmail.com>
2021-10-22 10:16:06 +01:00
Alex Ellis (OpenFaaS Ltd)
a9a77f0eca Update to Alpine 3.14 for base images
3.13 has vulnerabilities

Signed-off-by: Alex Ellis (OpenFaaS Ltd) <alexellis2@gmail.com>
2021-07-27 09:29:43 +01:00
Alex Ellis (OpenFaaS Ltd)
539f0a2c94 Remove queue folder from Docker build
Signed-off-by: Alex Ellis (OpenFaaS Ltd) <alexellis2@gmail.com>
2021-07-26 17:31:09 +01:00
Alex Ellis (OpenFaaS Ltd)
58394bb1de Migrate away from queue type in faas project
The queue type now resides in the provider, so that there is
no risk of a circular reference.

Signed-off-by: Alex Ellis (OpenFaaS Ltd) <alexellis2@gmail.com>
2021-07-26 17:31:09 +01:00
Alex Ellis (OpenFaaS Ltd)
06a51373e2 Upgrade NATS client
For compatibility with newer NATS streaming version

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

Signed-off-by: Alex Ellis (OpenFaaS Ltd) <alexellis2@gmail.com>
2021-07-26 17:31:09 +01:00
Alex Ellis (OpenFaaS Ltd)
a6dbb4cd02 Update faas-provider to include new field
Includes CreatedAt

Signed-off-by: Alex Ellis (OpenFaaS Ltd) <alexellis2@gmail.com>
2021-03-11 21:06:33 +00:00
Alex Ellis (OpenFaaS Ltd)
f8576d5b5d Return error from upstream when calling list functions
This is currently being hidden and needs to be bubbled up
into the logs to show an issue with calling list functions
during a deletion in faasd.

Signed-off-by: Alex Ellis (OpenFaaS Ltd) <alexellis2@gmail.com>
2021-02-27 20:18:34 +00:00
Lucas Roesler
089cd332b8 Add explicit test for the logging notifier middleware
**What**
- Add unit test that verifies the behavior of the logging middleware in
  various reponse cases

Signed-off-by: Lucas Roesler <roesler.lucas@gmail.com>
2021-02-27 09:53:31 +00:00
Alex Ellis (OpenFaaS Ltd)
048a90a150 Reduce cache expiry
Reduce cache expiry to help support issues where a function
may be scaled down by a user, when it is still in use.

The 5s cache meant that all requests would fail until the
expiry. The 250ms setting is a 20x reduction.

Signed-off-by: Alex Ellis (OpenFaaS Ltd) <alexellis2@gmail.com>
2021-02-26 12:24:55 +00:00
Alex Ellis (OpenFaaS Ltd)
4bdb580ae7 Update provider to v0.17.0
Signed-off-by: Alex Ellis (OpenFaaS Ltd) <alexellis2@gmail.com>
2021-02-26 08:53:26 +00:00
Alex Ellis (OpenFaaS Ltd)
d5b98a7078 Restore the X-Call-Id for synchronous calls
This appears to have been removed inadvertently whilst
adding scale from zero logic into the gateway.

Going forward, synchronous and asynchronous calls will have a
header populated.

Signed-off-by: Alex Ellis (OpenFaaS Ltd) <alexellis2@gmail.com>
2021-02-10 09:47:09 +00:00
Alex Ellis (OpenFaaS Ltd)
77be2f3403 Update to latest Alpine base image
Version alpine:3.13 is now available

Signed-off-by: Alex Ellis (OpenFaaS Ltd) <alexellis2@gmail.com>
2021-01-31 09:23:55 +00:00
Alex Ellis (OpenFaaS Ltd)
f98213a428 Remove git commit message from binary
This appears to have broken CI at least three times now and
prevented us from shipping a release binary for a tag.

Signed-off-by: Alex Ellis (OpenFaaS Ltd) <alexellis2@gmail.com>
2021-01-31 09:23:55 +00:00
Vivek Singh
82cd46ef2a Update version info endpoint
This commits updates version endpoint to use ProviderInfo and VersionInfo structs from
faas-provider.GatewayInfo now uses ProviderInfo and VersionInfo structs. GatewayInfo is
left within gateway. Consumer of this endpoint should use typed struct GatewayInfo to
parse response.

Signed-off-by: Vivek Singh <vivekkmr45@yahoo.in>
2021-01-30 14:53:57 +00:00
Alex Ellis (OpenFaaS Ltd)
7ce266adc0 Migrate to Go modules
Signed-off-by: Alex Ellis (OpenFaaS Ltd) <alexellis2@gmail.com>
2021-01-21 19:04:22 +00:00
Alex Ellis (OpenFaaS Ltd)
2e2250afe8 Use a placeholder commit message for development
The faas-cli throws an error because it always expects a
commit_message for the gateway version, and if it's null - it
will crash. This only affects local development.

The code in faas-cli should be changed to use a struct instead
of casting to an interface.

Signed-off-by: Alex Ellis (OpenFaaS Ltd) <alexellis2@gmail.com>
2021-01-20 12:02:15 +00:00
Alex Ellis (OpenFaaS Ltd)
3f98c856e5 Remove Swarm references
Signed-off-by: Alex Ellis (OpenFaaS Ltd) <alexellis2@gmail.com>
2020-12-16 10:01:21 +00:00
Alex Ellis (OpenFaaS Ltd)
8a5b3123e0 Remove Swarm resources from faas repo
This is part of the following activity:

https://github.com/openfaas/docs/pull/249

Signed-off-by: Alex Ellis (OpenFaaS Ltd) <alexellis2@gmail.com>
2020-12-16 09:58:26 +00:00
Alistair Hey
ca3d53c0a5 Add publish step to github actions
Signed-off-by: Alistair Hey <alistair@heyal.co.uk>
2020-12-10 14:54:38 +00:00
Alistair Hey
e3b18e6324 Convert Basic-Auth to multi-arch
Signed-off-by: Alistair Hey <alistair@heyal.co.uk>
2020-12-10 14:54:38 +00:00
Alistair Hey
a5583074e0 Convert Gateway to Github Actions
Signed-off-by: Alistair Hey <alistair@heyal.co.uk>
2020-12-10 14:54:38 +00:00
Alex Ellis (OpenFaaS Ltd)
4ced7cacd0 Update scaling polling interval
Polls every 100 ms instead of every 50ms for use with a new
faas-netes PR:

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

The call is much faster now, so this request should me made
at a lower frequency.

Also adds error handling for URL building in the external
service query code.

Signed-off-by: Alex Ellis (OpenFaaS Ltd) <alexellis2@gmail.com>
2020-12-10 14:00:31 +00:00
Alex Ellis (OpenFaaS Ltd)
9bbb25e3c7 Fix a bug that caused the services list to keep growing
This patch changes the code which looks up service and appends
them to the Exporter's list. It previously would create an
endless list and cause a memory leak.

Signed-off-by: Alex Ellis (OpenFaaS Ltd) <alexellis2@gmail.com>
2020-12-05 12:57:47 +00:00
Alistair Hey
7b6cc60bd9 Fix Invocation count wrong for multiple namespace
Fixes https://github.com/openfaas/faas/issues/1413
Fixes https://github.com/openfaas/faas-netes/issues/707

This fixes the Gateway UI not updating the
invocation count automatically without a page reload.

Tested by deploying on a local cluster and making sure invocations go up
with and without namespace suffix

Signed-off-by: Alistair Hey <alistair@heyal.co.uk>
2020-11-17 10:04:33 +00:00
Vivek Singh
c9c2b39601 Use namespace while filtering metric result
Signed-off-by: Vivek Singh <vivekkmr45@yahoo.in>
2020-11-02 10:35:57 +00:00
Vivek Singh
c0ba41ce33 Use default namespace in metrics exporter
Signed-off-by: Vivek Singh <vivekkmr45@yahoo.in>
2020-11-02 10:35:57 +00:00
Vivek Singh
f7b02b47f8 Add namespace in function name for metrics
This commit adds namespace in function names while logging metrics to
prometheus, irrespective of the function is invoked with namespace suffix
or not.

This is also required to add multiple namespace support to faas-idler

https://github.com/openfaas-incubator/faas-idler/issues/37 which is part
of https://github.com/openfaas/faas-netes/issues/511

Signed-off-by: Vivek Singh <vivekkmr45@yahoo.in>
2020-11-02 10:35:57 +00:00
Alex Ellis (OpenFaaS Ltd)
8f76b77857 Closes #1568
Signed-off-by: Alex Ellis (OpenFaaS Ltd) <alexellis2@gmail.com>
2020-10-29 10:01:38 +00:00
Alex Ellis (OpenFaaS Ltd)
f612947df7 Remove deprecated Angular/material versions
Signed-off-by: Alex Ellis (OpenFaaS Ltd) <alexellis2@gmail.com>
2020-10-14 15:33:51 +01:00
Alex Ellis (OpenFaaS Ltd)
f864d88bb3 Add maps for AngularJS
Signed-off-by: Alex Ellis (OpenFaaS Ltd) <alexellis2@gmail.com>
2020-10-14 15:33:15 +01:00
Alex Ellis (OpenFaaS Ltd)
66c89c7b8a Upgrade Angular to 1.8.0
* Updates AngularJS to 1.8.0
* Updates the MaterialUI theme to 1.2.1
* Fixes: #1576

Tested by running the gateway locally, with NATS, Prometheus,
and a gateway port-forwarded from a local KinD cluster.

The UI rendered and the newer files were served. Functions
could be deployed and invoked from the store and CLI.

Signed-off-by: Alex Ellis (OpenFaaS Ltd) <alexellis2@gmail.com>
2020-10-14 15:31:16 +01:00
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