66 Commits

Author SHA1 Message Date
Alex Ellis (OpenFaaS Ltd)
4bd07e24d9 Update Go version to 1.23
Signed-off-by: Alex Ellis (OpenFaaS Ltd) <alex@openfaas.com>
2024-12-09 09:41:00 +00:00
Alex Ellis (OpenFaaS Ltd)
32b4117aea Dockerfile linting and alpine linux update
Signed-off-by: Alex Ellis (OpenFaaS Ltd) <alex@openfaas.com>
2024-07-16 09:42:21 +01:00
Alex Ellis (OpenFaaS Ltd)
3d2808354d Update go.mod, Alpine to 3.20.0 and to Go 1.22
Signed-off-by: Alex Ellis (OpenFaaS Ltd) <alex@openfaas.com>
2024-05-31 13:55:12 +01:00
Alex Ellis (OpenFaaS Ltd)
4679f27804 Support streaming responses from functions
Signed-off-by: Alex Ellis (OpenFaaS Ltd) <alex@openfaas.com>
2024-01-11 10:56:40 +00:00
Alex Ellis (OpenFaaS Ltd)
6a9ece3cc1 Update module to Go 1.20
Signed-off-by: Alex Ellis (OpenFaaS Ltd) <alex@openfaas.com>
2023-08-22 18:38:00 +01:00
Alex Ellis (OpenFaaS Ltd)
a7d486eee6 Make OpenFaaS CE use the provider for load-balancing
This change removes the direct functions option which was
used originally for Docker Swarm. The Community Edition will
rely on the faas provider - faas-netes / faasd for load-balancing
of requests.

Direct Functions is required in order to delegate load-balancing
to Istio, Linkerd or some other kind of service mesh.

Tested by deploying a modified gateway image to a KinD cluster,
deploying the env function, and scaling to two replicas. This
balanced the load between the two pods by printing out the names
and then I ran a test with hey which returned 200s for all the
requests.

The prober which was part of the Istio support is no longer
required in the CE gateway so is removed for simplicity.

Signed-off-by: Alex Ellis (OpenFaaS Ltd) <alex@openfaas.com>
2023-01-11 12:12:26 +00:00
Alex Ellis (OpenFaaS Ltd)
e1c62f4875 Update Go and alpine versions
Signed-off-by: Alex Ellis (OpenFaaS Ltd) <alex@openfaas.com>
2022-12-14 11:30:41 +00:00
Alex Ellis (OpenFaaS Ltd)
b87b96ae45 Migrate to Go 1.18 and update dependencies
Signed-off-by: Alex Ellis (OpenFaaS Ltd) <alex@openfaas.com>
2022-08-05 09:03:31 +01:00
Alex Ellis (OpenFaaS Ltd)
88eea5f62e Feature for probing functions
Introduces a single-flight call to a function's health
endpoint to verify that it is registered with an Istio
sidecar (Envoy) before letting the invocation through.

Results are cached for 5 seconds, before a probe is
required again.

Tested without Istio, with probe_functions environment
variable set to true, I saw a probe execute in the logs.

Fixes: #1721 for Istio users.

Signed-off-by: Alex Ellis (OpenFaaS Ltd) <alex@openfaas.com>
2022-07-07 10:35:07 +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
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)
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)
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)
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
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
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)
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)
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
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
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
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
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
Ivana Yovcheva (VMware)
2420b387b5 Add architecture to /system/info endpoint
With this change /system/info endpoint is going to give
information about the platform architecture it is running on
(arm64, armhf, x86_64)

Signed-off-by: Ivana Yovcheva (VMware) <iyovcheva@vmware.com>
2019-07-17 10:05:11 +01:00
Alex Ellis
e3c976a428 Fix error handling for ExternalAuth
This corrects an issue where the error body was being hidden
for the external auth handler. It also adds the ca-certs into
the runtime Docker image for when the gateway is calling an
external plugin exposed over HTTPS.

Tested with OAuth2 plugin.

Signed-off-by: Alex Ellis <alexellis2@gmail.com>
2019-06-14 19:17:25 +01:00
Alex Ellis
b26b95cab5 Update Dockerfiles
There is a utility script which can be used for installing
license-check. This is added to the gateway Dockerfiles.

Tested in Docker for Mac.

Signed-off-by: Alex Ellis <alexellis2@gmail.com>
2019-04-11 20:57:17 +01:00
Vivek Singh
90ddd56985 Add new HTTPServer to serve /metrics on port 8082
This commit runs a new HTTPServer on port 8082 in a goroutine to serve
/metrics endpoint on a different port.

This also update the configurations and compose files.

Fixes: #1081

Signed-off-by: Vivek Singh <vivekkmr45@yahoo.in>
2019-03-09 17:28:46 +00:00
Radoslav Dimitrov
350907aacd Update gateway to golang:1.10.4
Signed-off-by: Radoslav Dimitrov <rdimitrow@gmail.com>
2018-12-05 19:59:18 +00:00
Martin Dekov (VMware)
ade5f32513 Bump files to use alpine:3.8
Bump Dockerfiles and mentions of alpine 3.7 to be now
3.8

Signed-off-by: Martin Dekov (VMware) <mdekov@vmware.com>
2018-11-16 20:27:05 +00:00
Alex Ellis (VMware)
9cea08c728 Extract scaling from zero
- extracting this package means it can be used in other components
such as the asynchronous nats-queue-worker which may need to
invoke functions which are scaled down to zero replicas.

Ref: https://github.com/openfaas/nats-queue-worker/issues/32

Tested on Docker Swarm for scaling up, already scaled and not
found error.

Signed-off-by: Alex Ellis (VMware) <alexellis2@gmail.com>
2018-11-01 15:10:08 +00:00
Alex Ellis (VMware)
9512f09d2b Refactor scaling to use existing code
Existing code has been used for scaling up and querying replicas.
This meant the new code was deleted and there is less duplication
now.

The cache store a whole query response rather than just the
available replica count and the tests were updated. This has been
tested with Docker swarm and the image:
 openfaas/gateway:scale-17-07-2018

This feature now needs the env-var of scale_from_zero to be enabled
in order to turn on the scaling behaviour.

Signed-off-by: Alex Ellis (VMware) <alexellis2@gmail.com>
2018-07-20 11:39:36 +01:00
Alex Ellis (VMware)
cba817c499 Allow copyright verbiage
Allows: OpenFaaS Author(s)

Signed-off-by: Alex Ellis (VMware) <alexellis2@gmail.com>
2018-07-09 22:06:57 +01:00
Edward Wilde
aca2c7fe2a Enhance info endpoint to include gateway version
Extend the health endpoint and add gateway version information

Resolves: #733
Signed-off-by: Edward Wilde <ewilde@gmail.com>
2018-07-06 17:50:48 +01:00
Alex Ellis (VMware)
223c561706 Vendor new queue-worker version
Introduces 0.4.6 of queue-worker - see upstream repo for changes.

Signed-off-by: Alex Ellis (VMware) <alexellis2@gmail.com>
2018-06-18 20:10:46 +01:00
Sean Smith
2292aab829 Update to golang 1.9.7
Issue #660 has been open for a while to update to 1.9.6, this
performs the update to the latest in the 1.9 release (1.9.7)

Signed-off-by: Sean Smith <sean@wwsean08.com>
2018-06-16 08:37:11 -07:00
Ivana Yovcheva (VMware)
7f6295c9cf Update alpine version to 3.7
This updates alpine version to 3.7 in sample-functions, gateway
and some markdown docas.

Signed-off-by: Ivana Yovcheva (VMware) <iyovcheva@vmware.com>
2018-05-11 14:14:59 +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
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
76526b0be3 Bump LTS Go version
Signed-off-by: Alex Ellis <alexellis2@gmail.com>
2018-03-03 17:36:33 +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