Commit Graph

74 Commits

Author SHA1 Message Date
ff9f7a5541 Make debugging less verbose
Signed-off-by: Alex Ellis <alexellis2@gmail.com>
2018-02-01 09:37:05 +00:00
f954bf0733 Merge master into breakout_swarm
Signed-off-by: Alex Ellis <alexellis2@gmail.com>
2018-02-01 09:29:54 +00:00
fe7dd9068f Remove code duplicated during a rebase
Signed-off-by: Lucas Roesler <roesler.lucas@gmail.com>
2017-12-16 16:08:52 +00:00
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
7c28f7d97e Add label support to Swarm
Signed-off-by: Alex Ellis <alexellis2@gmail.com>
2017-12-16 16:08:52 +00:00
35f0e9e657 Clean up docs and refactor createhandler
**What**
- Add a description for the secret key to the api swagger spec.
- Remove optional examples from the secret management guide.
- Update the ApiKeyProtected README to point at the new guide.
- Refactor the `makeSpec` function to accept the already assembled secrets
array because this should be easier to unit test.

Signed-off-by: Lucas Roesler <lucas.roesler@gmail.com>
2017-12-16 16:08:52 +00:00
5dce1deb21 Add advanced secret management
**What**
- Add the ability to specify secrets as a csv
- Vendor the docker/cli/opts
- Update the guide for secrets to use the `faas-cli`

**Why**
- Allowing the csv specification of secrets gives users more control about how
those secrets are mounted into the container.  This is good for things like
key rotation and for developers that are building on top of OpenFaaS.

Signed-off-by: Lucas Roesler <lucas.roesler@gmail.com>
2017-12-16 16:08:52 +00:00
0fef825fb4 Add support to specify secrets in services
**What**
- During function creation, accept an array of strings defining swarm secrets
that are required for the service
- Update docs
- Add new guide on using the secrets capability
- Add new sample function to highlight using environment variables
- Update `ApiKeyProtected` sample function to utilize the new secrets
capabilities

**Why**
- This allows secrets to remain encrypted at rest instead of being unencrypted
in environment variables and yaml files.

Fixes #285

Signed-off-by: Lucas Roesler <lucas.roesler@gmail.com>
2017-12-16 16:08:52 +00:00
4d785c8dfb Remove Content-Type forwarding from Request
Signed-off-by: Eric Stoekl <ems5311@gmail.com>
2017-12-16 16:04:20 +00:00
dc37d131be Don't override X-Call-Id if it already exists in header
Signed-off-by: Alex Ellis <alexellis2@gmail.com>
2017-12-13 06:18:44 -08:00
b1e92f6b93 Add call-id via middleware
Signed-off-by: Alex Ellis <alexellis2@gmail.com>
2017-12-13 06:18:44 -08:00
23a7187435 Refactoring: variable names, adding tests and http constants
Signed-off-by: Alex Ellis <alexellis2@gmail.com>
2017-12-05 06:50:08 -06:00
2452fdea0b Allow min-scale
Signed-off-by: Alex Ellis <alexellis2@gmail.com>
2017-12-05 06:50:08 -06:00
78a4580ead Allow CORS to GitHub raw
Signed-off-by: Alex Ellis <alexellis2@gmail.com>
2017-11-29 09:48:58 +01:00
b17838ce51 Add Swarm limits
Signed-off-by: Alex Ellis <alexellis2@gmail.com>
2017-11-15 08:42:00 +00:00
fb1b35b6eb Don't buffer body / response into memory
Signed-off-by: Alex Ellis <alexellis2@gmail.com>
2017-11-11 15:39:34 +00:00
0d45ee9149 Pass on method
Signed-off-by: Alex Ellis <alexellis2@gmail.com>
2017-11-06 09:30:01 +00:00
c132195a5c Simple switch to enable 'GET' method'
Signed-off-by: Alex Ellis <alexellis2@gmail.com>
2017-11-06 09:30:01 +00:00
b2c579370a Return labels in functions list endpoint
Signed-off-by: Alex Ellis <alexellis2@gmail.com>
2017-11-05 20:11:47 +00:00
0248a5ea1d Return 500 if GET /system/functions fails
Signed-off-by: Alex Young <alex@heuris.io>
2017-10-27 15:38:03 +01:00
12a0c75e91 Add unit tests to build. Pin to specific Alpine tag.
Signed-off-by: Alex Ellis <alexellis2@gmail.com>
2017-10-26 21:02:50 +01:00
ec60d97518 Report async execution duration
Signed-off-by: Alex Ellis <alexellis2@gmail.com>
2017-10-25 19:40:33 +01:00
f696d3930d Label support for Update handler
Signed-off-by: Alex Ellis <alexellis2@gmail.com>
2017-10-23 16:19:49 +01:00
e4a1ef2d6b Add label support to Swarm
Signed-off-by: Alex Ellis <alexellis2@gmail.com>
2017-10-23 16:19:49 +01:00
520a6b05a1 Commit unit tests for content-type order
Signed-off-by: Alex Ellis <alexellis2@gmail.com>
2017-10-20 22:47:30 +02:00
4d4a09fa19 Implement header pass-through
Signed-off-by: Alex Ellis <alexellis2@gmail.com>
2017-10-20 22:47:30 +02:00
6d5ae1af5b Fix content type pass through
Signed-off-by: Alex Ellis <alexellis2@gmail.com>
2017-10-20 22:47:30 +02:00
dde98eb582 Forward path and query string through proxy
Signed-off-by: Alex Ellis <alexellis2@gmail.com>
2017-10-11 18:57:00 +01:00
89878f0c8a Migrate from alexellis org to openfaas
Note, not all `alexellis/github` references should be changed, there are
a number of repos which are not part of the openfaas org, this commit
excludes those.

Signed-off-by: John McCabe <john@johnmccabe.net>
2017-10-04 09:18:06 +01:00
40e1fac1c2 Implement Swarm update handler using PUT
This commit implements an update handler for Docker Swarm, it queries the
current spec, updates values in-situ before calling ServiceUpdate.

The UpdateConfig FailureAction is set to rollback, so in the event of
supplying values to the update that would result in the service failing
then the update will be rolled back.

The UpdateConfig Parallelism param is set to an explicit value of 1 which
will result in functions being updated 1 by 1 rather than all at once.

It also moves the restartDelay declaration out of the create and update
handlers and into the main server function alongside maxRestarts.

And finally this commit uses the PUT HTTP verb for updates rather than
the non-HTTP UPDATE verb which was being used initially (also adding it
to the Swagger definition).

Signed-off-by: John McCabe <john@johnmccabe.net>
2017-09-27 09:58:03 +01:00
2229e922d7 Add update endpoint/route
Signed-off-by: Alex Ellis <alexellis2@gmail.com>
2017-09-23 20:42:13 +01:00
031a0bc18c Add tests around error handing done in #196
Signed-off-by: Alex Young <alex@heuris.io>
2017-09-22 14:39:01 +01:00
1622fadd9c Return error when ServiceCreate fails in
gateway/handler/createhandler.go

Signed-off-by: Eric Stoekl <ems5311@gmail.com>
2017-09-19 20:14:05 +01:00
ec22a301fe Refactor out handler file from server.go
Signed-off-by: Alex Ellis <alexellis2@gmail.com>
2017-09-13 10:28:40 -07:00
94a15e44d5 should use strings.Contains() instead of stings.Index()
Signed-off-by: wgliang <liangcszzu@163.com>
2017-09-13 09:55:45 -07:00
499d6128e5 remove comment
Signed-off-by: Alex Ellis <alexellis2@gmail.com>
2017-09-13 09:54:05 -07:00
5339fdcdbe Query Prometheus API for stats.
Signed-off-by: Alex Ellis <alexellis2@gmail.com>
2017-09-07 22:42:27 +01:00
3db2064d91 Handle constraints
Signed-off-by: Alex Ellis <alexellis2@gmail.com>
2017-09-04 13:42:36 +01:00
78daa9cd39 Specify Linux constraints by default
Signed-off-by: Alex Ellis <alexellis2@gmail.com>
2017-09-02 20:12:10 +01:00
fba2d8aa52 Add MIT header
Signed-off-by: Alex Ellis <alexellis2@gmail.com>
2017-08-29 19:40:08 +01:00
2cca166dc0 Update async for CallbackUrl
Signed-off-by: Alex <alexellis2@gmail.com>
2017-08-29 19:40:08 +01:00
3031531b3c Specify callback URL via http header
Signed-off-by: Alex <alexellis2@gmail.com>
2017-08-29 19:40:08 +01:00
fa069e412c Remove Docker client from NATS
Signed-off-by: Alex <alexellis2@gmail.com>
2017-08-29 19:40:08 +01:00
bd146f526c Sync async_nats work with master
Signed-off-by: Alex Ellis <alexellis2@gmail.com>
2017-08-29 19:40:08 +01:00
c5815d36ab add_missing_mit_header_27_aug
Signed-off-by: Alex Ellis <alexellis2@gmail.com>
2017-08-27 22:37:19 +01:00
b6002e1c85 Add EnvProcess and logo to UI
Signed-off-by: Alex Ellis <alexellis2@gmail.com>
2017-08-23 09:01:44 +01:00
3ac73340c3 Allow restarts of up to 5 times with 5 sec delays
Signed-off-by: Alex <alexellis2@gmail.com>
2017-08-16 21:34:05 +01:00
f165ce2ca7 External replica proxy 2017-08-08 09:14:46 +01:00
1e4b5f907a Wrap scaling / alert handling in interface/adapter pattern. 2017-08-08 09:14:46 +01:00
35a15cff01 Support external URL for FaaS functions 2017-08-08 09:14:46 +01:00