functions: hot containers (#332)

* functions: modify datastore to accomodate hot containers support

* functions: protocol between functions and hot containers

* functions: add hot containers clockwork

* fn: add hot containers support
This commit is contained in:
C Cirello
2016-11-28 18:45:35 +01:00
committed by Pedro Nasser
parent d0429c3dfd
commit ac0044f7d9
31 changed files with 809 additions and 170 deletions

View File

@@ -40,10 +40,12 @@ func init() {
}
type initFnCmd struct {
name string
force bool
runtime string
entrypoint string
name string
force bool
runtime string
entrypoint string
format string
maxConcurrency int
}
func initFn() cli.Command {
@@ -71,6 +73,18 @@ func initFn() cli.Command {
Usage: "entrypoint is the command to run to start this function - equivalent to Dockerfile ENTRYPOINT.",
Destination: &a.entrypoint,
},
cli.StringFlag{
Name: "format",
Usage: "hot container IO format - json or http",
Destination: &a.format,
Value: "",
},
cli.IntFlag{
Name: "max-concurrency",
Usage: "maximum concurrency for hot container",
Destination: &a.maxConcurrency,
Value: 1,
},
},
}
}
@@ -92,10 +106,12 @@ func (a *initFnCmd) init(c *cli.Context) error {
}
ff := &funcfile{
Name: a.name,
Runtime: &a.runtime,
Version: initialVersion,
Entrypoint: &a.entrypoint,
Name: a.name,
Runtime: &a.runtime,
Version: initialVersion,
Entrypoint: &a.entrypoint,
Format: &a.format,
MaxConcurrency: &a.maxConcurrency,
}
if err := encodeFuncfileYAML("func.yaml", ff); err != nil {