173 Commits

Author SHA1 Message Date
Alex Ellis
f954bf0733 Merge master into breakout_swarm
Signed-off-by: Alex Ellis <alexellis2@gmail.com>
2018-02-01 09:29:54 +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
Alex Ellis
7c28f7d97e Add label support to Swarm
Signed-off-by: Alex Ellis <alexellis2@gmail.com>
2017-12-16 16:08:52 +00:00
Lucas Roesler
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
Lucas Roesler
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
Lucas Roesler
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
Eric Stoekl
4d785c8dfb Remove Content-Type forwarding from Request
Signed-off-by: Eric Stoekl <ems5311@gmail.com>
2017-12-16 16:04:20 +00:00
Alex Ellis
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
Alex Ellis
b1e92f6b93 Add call-id via middleware
Signed-off-by: Alex Ellis <alexellis2@gmail.com>
2017-12-13 06:18:44 -08:00
Alex Ellis
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
Alex Ellis
2452fdea0b Allow min-scale
Signed-off-by: Alex Ellis <alexellis2@gmail.com>
2017-12-05 06:50:08 -06:00
Alex Ellis
78a4580ead Allow CORS to GitHub raw
Signed-off-by: Alex Ellis <alexellis2@gmail.com>
2017-11-29 09:48:58 +01:00
Alex Ellis
b17838ce51 Add Swarm limits
Signed-off-by: Alex Ellis <alexellis2@gmail.com>
2017-11-15 08:42:00 +00:00
Alex Ellis
fb1b35b6eb Don't buffer body / response into memory
Signed-off-by: Alex Ellis <alexellis2@gmail.com>
2017-11-11 15:39:34 +00:00
Alex Ellis
0d45ee9149 Pass on method
Signed-off-by: Alex Ellis <alexellis2@gmail.com>
2017-11-06 09:30:01 +00:00
Alex Ellis
c132195a5c Simple switch to enable 'GET' method'
Signed-off-by: Alex Ellis <alexellis2@gmail.com>
2017-11-06 09:30:01 +00:00
Alex Ellis
b2c579370a Return labels in functions list endpoint
Signed-off-by: Alex Ellis <alexellis2@gmail.com>
2017-11-05 20:11:47 +00:00
Alex Young
0248a5ea1d Return 500 if GET /system/functions fails
Signed-off-by: Alex Young <alex@heuris.io>
2017-10-27 15:38:03 +01:00
Alex Ellis
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
Alex Ellis
ec60d97518 Report async execution duration
Signed-off-by: Alex Ellis <alexellis2@gmail.com>
2017-10-25 19:40:33 +01:00
Alex Ellis
f696d3930d Label support for Update handler
Signed-off-by: Alex Ellis <alexellis2@gmail.com>
2017-10-23 16:19:49 +01:00
Alex Ellis
e4a1ef2d6b Add label support to Swarm
Signed-off-by: Alex Ellis <alexellis2@gmail.com>
2017-10-23 16:19:49 +01:00
Alex Ellis
520a6b05a1 Commit unit tests for content-type order
Signed-off-by: Alex Ellis <alexellis2@gmail.com>
2017-10-20 22:47:30 +02:00
Alex Ellis
4d4a09fa19 Implement header pass-through
Signed-off-by: Alex Ellis <alexellis2@gmail.com>
2017-10-20 22:47:30 +02:00
Alex Ellis
6d5ae1af5b Fix content type pass through
Signed-off-by: Alex Ellis <alexellis2@gmail.com>
2017-10-20 22:47:30 +02:00
Alex Ellis
dde98eb582 Forward path and query string through proxy
Signed-off-by: Alex Ellis <alexellis2@gmail.com>
2017-10-11 18:57:00 +01:00
John McCabe
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
John McCabe
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
Alex Ellis
2229e922d7 Add update endpoint/route
Signed-off-by: Alex Ellis <alexellis2@gmail.com>
2017-09-23 20:42:13 +01:00
Alex Young
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
Eric Stoekl
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
Alex Ellis
ec22a301fe Refactor out handler file from server.go
Signed-off-by: Alex Ellis <alexellis2@gmail.com>
2017-09-13 10:28:40 -07:00
wangguoliang
94a15e44d5 should use strings.Contains() instead of stings.Index()
Signed-off-by: wgliang <liangcszzu@163.com>
2017-09-13 09:55:45 -07:00
Alex Ellis
499d6128e5 remove comment
Signed-off-by: Alex Ellis <alexellis2@gmail.com>
2017-09-13 09:54:05 -07:00
Alex Ellis
5339fdcdbe Query Prometheus API for stats.
Signed-off-by: Alex Ellis <alexellis2@gmail.com>
2017-09-07 22:42:27 +01:00
Alex Ellis
3db2064d91 Handle constraints
Signed-off-by: Alex Ellis <alexellis2@gmail.com>
2017-09-04 13:42:36 +01:00
Alex Ellis
78daa9cd39 Specify Linux constraints by default
Signed-off-by: Alex Ellis <alexellis2@gmail.com>
2017-09-02 20:12:10 +01:00
Alex Ellis
fba2d8aa52 Add MIT header
Signed-off-by: Alex Ellis <alexellis2@gmail.com>
2017-08-29 19:40:08 +01:00
Alex
2cca166dc0 Update async for CallbackUrl
Signed-off-by: Alex <alexellis2@gmail.com>
2017-08-29 19:40:08 +01:00
Alex
3031531b3c Specify callback URL via http header
Signed-off-by: Alex <alexellis2@gmail.com>
2017-08-29 19:40:08 +01:00
Alex
fa069e412c Remove Docker client from NATS
Signed-off-by: Alex <alexellis2@gmail.com>
2017-08-29 19:40:08 +01:00
Alex Ellis
bd146f526c Sync async_nats work with master
Signed-off-by: Alex Ellis <alexellis2@gmail.com>
2017-08-29 19:40:08 +01:00
Alex Ellis
c5815d36ab add_missing_mit_header_27_aug
Signed-off-by: Alex Ellis <alexellis2@gmail.com>
2017-08-27 22:37:19 +01:00
Alex Ellis
b6002e1c85 Add EnvProcess and logo to UI
Signed-off-by: Alex Ellis <alexellis2@gmail.com>
2017-08-23 09:01:44 +01:00
Alex
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
Alex Ellis
f165ce2ca7 External replica proxy 2017-08-08 09:14:46 +01:00
Alex
1e4b5f907a Wrap scaling / alert handling in interface/adapter pattern. 2017-08-08 09:14:46 +01:00
Alex
35a15cff01 Support external URL for FaaS functions 2017-08-08 09:14:46 +01:00
Sebastien Guilloux
9e711b3b5d Handle private docker registry auth
This adds support for private docker registries, by adding
an optional `registryAuth` field in the CreateFunctionRequest.
Auth must be passed as base64-encoded basic auth, similar to
how done in Docker file store credentials (~/.docker/config.json).
Credentials are then passed to swarm at service creation.
2017-05-30 17:10:34 +01:00