mirror of
https://github.com/fnproject/fn.git
synced 2022-10-28 21:29:17 +03:00
Remove iron...
This commit is contained in:
committed by
Reed Allman
parent
521df8c1ff
commit
9cc12b4b12
@@ -274,7 +274,7 @@ func Test(t *testing.T, ds models.Datastore) {
|
||||
// unchanged
|
||||
AppName: testRoute.AppName,
|
||||
Path: testRoute.Path,
|
||||
Image: "iron/hello",
|
||||
Image: "treeder/hello",
|
||||
Type: "sync",
|
||||
Format: "http",
|
||||
// updated
|
||||
@@ -317,7 +317,7 @@ func Test(t *testing.T, ds models.Datastore) {
|
||||
// unchanged
|
||||
AppName: testRoute.AppName,
|
||||
Path: testRoute.Path,
|
||||
Image: "iron/hello",
|
||||
Image: "treeder/hello",
|
||||
Type: "sync",
|
||||
Format: "http",
|
||||
Timeout: 100,
|
||||
@@ -482,7 +482,7 @@ var testApp = &models.App{
|
||||
var testRoute = &models.Route{
|
||||
AppName: testApp.Name,
|
||||
Path: "/test",
|
||||
Image: "iron/hello",
|
||||
Image: "treeder/hello",
|
||||
Type: "sync",
|
||||
Format: "http",
|
||||
}
|
||||
|
||||
@@ -1,17 +1,3 @@
|
||||
// Copyright 2016 Iron.io
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
package common
|
||||
|
||||
import (
|
||||
|
||||
@@ -1,17 +1,3 @@
|
||||
// Copyright 2016 Iron.io
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
package common
|
||||
|
||||
import "time"
|
||||
|
||||
@@ -1,17 +1,3 @@
|
||||
// Copyright 2016 Iron.io
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
package common
|
||||
|
||||
import (
|
||||
|
||||
@@ -1,17 +1,3 @@
|
||||
// Copyright 2016 Iron.io
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
package common
|
||||
|
||||
import (
|
||||
|
||||
@@ -1,17 +1,3 @@
|
||||
// Copyright 2016 Iron.io
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
package common
|
||||
|
||||
import (
|
||||
|
||||
@@ -1,17 +1,3 @@
|
||||
// Copyright 2016 Iron.io
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
package common
|
||||
|
||||
import (
|
||||
|
||||
@@ -1,17 +1,3 @@
|
||||
// Copyright 2016 Iron.io
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
package stats
|
||||
|
||||
import (
|
||||
|
||||
@@ -1,17 +1,3 @@
|
||||
// Copyright 2016 Iron.io
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
package stats
|
||||
|
||||
import (
|
||||
|
||||
@@ -1,17 +1,3 @@
|
||||
// Copyright 2016 Iron.io
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
package stats
|
||||
|
||||
import (
|
||||
|
||||
@@ -1,17 +1,3 @@
|
||||
// Copyright 2016 Iron.io
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
package stats
|
||||
|
||||
import (
|
||||
|
||||
@@ -1,17 +1,3 @@
|
||||
// Copyright 2016 Iron.io
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
package stats
|
||||
|
||||
import (
|
||||
|
||||
@@ -1,19 +1,5 @@
|
||||
// +build riemann
|
||||
|
||||
// Copyright 2016 Iron.io
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
package stats
|
||||
|
||||
import (
|
||||
|
||||
@@ -1,17 +1,3 @@
|
||||
// Copyright 2016 Iron.io
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
package stats
|
||||
|
||||
import (
|
||||
|
||||
@@ -1,17 +1,3 @@
|
||||
// Copyright 2016 Iron.io
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
package stats
|
||||
|
||||
import (
|
||||
|
||||
@@ -1,17 +1,3 @@
|
||||
// Copyright 2016 Iron.io
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
package stats
|
||||
|
||||
import (
|
||||
@@ -81,8 +67,8 @@ func whoami() string {
|
||||
// keys. The prefix is used as the key prefix.
|
||||
// If config is nil, creates a noop reporter.
|
||||
//
|
||||
// st, e := NewStatsd(config, "ironmq")
|
||||
// st.Inc("enqueue", 1) -> Actually records to key ironmq.enqueue.
|
||||
// st, e := NewStatsd(config, "servicename")
|
||||
// st.Inc("eventname", 1) -> Actually records to key servicename.eventname.
|
||||
func NewStatsd(config *StatsdConfig) (*theStatsdReporter, error) {
|
||||
var client statsd.Statter
|
||||
var err error
|
||||
|
||||
@@ -1,17 +1,3 @@
|
||||
// Copyright 2016 Iron.io
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
package common
|
||||
|
||||
import (
|
||||
|
||||
@@ -1,17 +1,3 @@
|
||||
// Copyright 2016 Iron.io
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
package common
|
||||
|
||||
import (
|
||||
|
||||
@@ -1,17 +1,3 @@
|
||||
// Copyright 2016 Iron.io
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
package docker
|
||||
|
||||
import (
|
||||
|
||||
@@ -1,19 +1,5 @@
|
||||
// +build go1.7
|
||||
|
||||
// Copyright 2016 Iron.io
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
package docker
|
||||
|
||||
import (
|
||||
|
||||
@@ -1,17 +1,3 @@
|
||||
// Copyright 2016 Iron.io
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
package docker
|
||||
|
||||
import (
|
||||
@@ -23,9 +9,9 @@ import (
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/vrischmann/envconfig"
|
||||
"gitlab.oracledx.com/odx/functions/api/runner/common"
|
||||
"gitlab.oracledx.com/odx/functions/api/runner/drivers"
|
||||
"github.com/vrischmann/envconfig"
|
||||
)
|
||||
|
||||
type taskDockerTest struct {
|
||||
@@ -41,7 +27,7 @@ func (f *taskDockerTest) EnvVars() map[string]string {
|
||||
func (f *taskDockerTest) Labels() map[string]string { return nil }
|
||||
func (f *taskDockerTest) Id() string { return f.id }
|
||||
func (f *taskDockerTest) Group() string { return "" }
|
||||
func (f *taskDockerTest) Image() string { return "iron/hello" }
|
||||
func (f *taskDockerTest) Image() string { return "treeder/hello" }
|
||||
func (f *taskDockerTest) Timeout() time.Duration { return 30 * time.Second }
|
||||
func (f *taskDockerTest) Logger() (stdout, stderr io.Writer) { return f.output, nil }
|
||||
func (f *taskDockerTest) WriteStat(drivers.Stat) { /* TODO */ }
|
||||
|
||||
@@ -1,17 +1,3 @@
|
||||
// Copyright 2016 Iron.io
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
// Interface for all container drivers
|
||||
|
||||
package drivers
|
||||
|
||||
@@ -1,17 +1,3 @@
|
||||
// Copyright 2016 Iron.io
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
package drivers
|
||||
|
||||
import (
|
||||
@@ -108,14 +94,14 @@ func TestDecimate(t *testing.T) {
|
||||
|
||||
func TestParseImage(t *testing.T) {
|
||||
cases := map[string][]string{
|
||||
"iron/hello": {"", "iron/hello", "latest"},
|
||||
"iron/hello:v1": {"", "iron/hello", "v1"},
|
||||
"treeder/hello": {"", "treeder/hello", "latest"},
|
||||
"treeder/hello:v1": {"", "treeder/hello", "v1"},
|
||||
"my.registry/hello": {"my.registry", "hello", "latest"},
|
||||
"my.registry/hello:v1": {"my.registry", "hello", "v1"},
|
||||
"mongo": {"", "library/mongo", "latest"},
|
||||
"mongo:v1": {"", "library/mongo", "v1"},
|
||||
"quay.com/iron/hello": {"quay.com", "iron/hello", "latest"},
|
||||
"quay.com:8080/iron/hello:v2": {"quay.com:8080", "iron/hello", "v2"},
|
||||
"quay.com/treeder/hello": {"quay.com", "treeder/hello", "latest"},
|
||||
"quay.com:8080/treeder/hello:v2": {"quay.com:8080", "treeder/hello", "v2"},
|
||||
"localhost.localdomain:5000/samalba/hipache:latest": {"localhost.localdomain:5000", "samalba/hipache", "latest"},
|
||||
}
|
||||
|
||||
|
||||
@@ -1,17 +1,3 @@
|
||||
// Copyright 2016 Iron.io
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
package mock
|
||||
|
||||
import (
|
||||
|
||||
@@ -29,8 +29,8 @@ func TestRunnerHello(t *testing.T) {
|
||||
expectedOut string
|
||||
expectedErr string
|
||||
}{
|
||||
{&models.Route{Image: "iron/hello"}, ``, "success", "Hello World!", ""},
|
||||
{&models.Route{Image: "iron/hello"}, `{"name": "test"}`, "success", "Hello test!", ""},
|
||||
{&models.Route{Image: "treeder/hello"}, ``, "success", "Hello World!", ""},
|
||||
{&models.Route{Image: "treeder/hello"}, `{"name": "test"}`, "success", "Hello test!", ""},
|
||||
} {
|
||||
var stdout, stderr bytes.Buffer
|
||||
cfg := &task.Config{
|
||||
@@ -82,8 +82,8 @@ func TestRunnerError(t *testing.T) {
|
||||
expectedOut string
|
||||
expectedErr string
|
||||
}{
|
||||
{&models.Route{Image: "iron/error"}, ``, "error", "", ""},
|
||||
{&models.Route{Image: "iron/error"}, `{"name": "test"}`, "error", "", ""},
|
||||
{&models.Route{Image: "funcy/error"}, ``, "error", "", ""},
|
||||
{&models.Route{Image: "funcy/error"}, `{"name": "test"}`, "error", "", ""},
|
||||
} {
|
||||
var stdout, stderr bytes.Buffer
|
||||
cfg := &task.Config{
|
||||
|
||||
@@ -9,9 +9,9 @@ import (
|
||||
"time"
|
||||
|
||||
"github.com/Sirupsen/logrus"
|
||||
"gitlab.oracledx.com/odx/functions/api/runner/drivers"
|
||||
"gitlab.oracledx.com/odx/functions/api/runner/protocol"
|
||||
"gitlab.oracledx.com/odx/functions/api/runner/task"
|
||||
"gitlab.oracledx.com/odx/functions/api/runner/drivers"
|
||||
)
|
||||
|
||||
// hot functions - theory of operation
|
||||
@@ -61,7 +61,6 @@ import (
|
||||
// Terminate
|
||||
// (internal clock)
|
||||
|
||||
|
||||
// RunTask helps sending a task.Request into the common concurrency stream.
|
||||
// Refer to StartWorkers() to understand what this is about.
|
||||
func RunTask(tasks chan task.Request, ctx context.Context, cfg *task.Config) (drivers.RunResult, error) {
|
||||
@@ -73,7 +72,7 @@ func RunTask(tasks chan task.Request, ctx context.Context, cfg *task.Config) (dr
|
||||
}
|
||||
|
||||
// StartWorkers operates the common concurrency stream, ie, it will process all
|
||||
// IronFunctions tasks, either sync or async. In the process, it also dispatches
|
||||
// functions tasks, either sync or async. In the process, it also dispatches
|
||||
// the workload to either regular or hot functions.
|
||||
func StartWorkers(ctx context.Context, rnr *Runner, tasks <-chan task.Request) {
|
||||
var wg sync.WaitGroup
|
||||
@@ -262,13 +261,13 @@ func (hc *htfn) serve(ctx context.Context) {
|
||||
var wg sync.WaitGroup
|
||||
cfg := *hc.cfg
|
||||
logger := logrus.WithFields(logrus.Fields{
|
||||
"app": cfg.AppName,
|
||||
"route": cfg.Path,
|
||||
"image": cfg.Image,
|
||||
"memory": cfg.Memory,
|
||||
"format": cfg.Format,
|
||||
"max_concurrency": cfg.MaxConcurrency,
|
||||
"idle_timeout": cfg.IdleTimeout,
|
||||
"app": cfg.AppName,
|
||||
"route": cfg.Path,
|
||||
"image": cfg.Image,
|
||||
"memory": cfg.Memory,
|
||||
"format": cfg.Format,
|
||||
"max_concurrency": cfg.MaxConcurrency,
|
||||
"idle_timeout": cfg.IdleTimeout,
|
||||
})
|
||||
|
||||
wg.Add(1)
|
||||
|
||||
@@ -29,12 +29,12 @@ func TestRouteCreate(t *testing.T) {
|
||||
{datastore.NewMock(), "/v1/apps/a/routes", `{ "path": "/myroute" }`, http.StatusBadRequest, models.ErrRoutesMissingNew},
|
||||
{datastore.NewMock(), "/v1/apps/a/routes", `{ "route": { } }`, http.StatusBadRequest, models.ErrRoutesValidationMissingPath},
|
||||
{datastore.NewMock(), "/v1/apps/a/routes", `{ "route": { "path": "/myroute" } }`, http.StatusBadRequest, models.ErrRoutesValidationMissingImage},
|
||||
{datastore.NewMock(), "/v1/apps/a/routes", `{ "route": { "image": "iron/hello" } }`, http.StatusBadRequest, models.ErrRoutesValidationMissingPath},
|
||||
{datastore.NewMock(), "/v1/apps/a/routes", `{ "route": { "image": "iron/hello", "path": "myroute" } }`, http.StatusBadRequest, models.ErrRoutesValidationInvalidPath},
|
||||
{datastore.NewMock(), "/v1/apps/$/routes", `{ "route": { "image": "iron/hello", "path": "/myroute" } }`, http.StatusInternalServerError, models.ErrAppsValidationInvalidName},
|
||||
{datastore.NewMock(), "/v1/apps/a/routes", `{ "route": { "image": "treeder/hello" } }`, http.StatusBadRequest, models.ErrRoutesValidationMissingPath},
|
||||
{datastore.NewMock(), "/v1/apps/a/routes", `{ "route": { "image": "treeder/hello", "path": "myroute" } }`, http.StatusBadRequest, models.ErrRoutesValidationInvalidPath},
|
||||
{datastore.NewMock(), "/v1/apps/$/routes", `{ "route": { "image": "treeder/hello", "path": "/myroute" } }`, http.StatusInternalServerError, models.ErrAppsValidationInvalidName},
|
||||
|
||||
// success
|
||||
{datastore.NewMock(), "/v1/apps/a/routes", `{ "route": { "image": "iron/hello", "path": "/myroute" } }`, http.StatusOK, nil},
|
||||
{datastore.NewMock(), "/v1/apps/a/routes", `{ "route": { "image": "treeder/hello", "path": "/myroute" } }`, http.StatusOK, nil},
|
||||
} {
|
||||
rnr, cancel := testRunner(t)
|
||||
srv := testServer(test.mock, &mqs.Mock{}, rnr, tasks)
|
||||
@@ -207,7 +207,7 @@ func TestRouteUpdate(t *testing.T) {
|
||||
Path: "/myroute/do",
|
||||
},
|
||||
},
|
||||
), "/v1/apps/a/routes/myroute/do", `{ "route": { "image": "iron/hello" } }`, http.StatusOK, nil},
|
||||
), "/v1/apps/a/routes/myroute/do", `{ "route": { "image": "treeder/hello" } }`, http.StatusOK, nil},
|
||||
|
||||
// Addresses #381
|
||||
{datastore.NewMockInit(nil,
|
||||
|
||||
@@ -45,9 +45,9 @@ func TestRouteRunnerAsyncExecution(t *testing.T) {
|
||||
{Name: "myapp", Config: map[string]string{"app": "true"}},
|
||||
},
|
||||
[]*models.Route{
|
||||
{Type: "async", Path: "/myroute", AppName: "myapp", Image: "iron/hello", Config: map[string]string{"test": "true"}},
|
||||
{Type: "async", Path: "/myerror", AppName: "myapp", Image: "iron/error", Config: map[string]string{"test": "true"}},
|
||||
{Type: "async", Path: "/myroute/:param", AppName: "myapp", Image: "iron/hello", Config: map[string]string{"test": "true"}},
|
||||
{Type: "async", Path: "/myroute", AppName: "myapp", Image: "treeder/hello", Config: map[string]string{"test": "true"}},
|
||||
{Type: "async", Path: "/myerror", AppName: "myapp", Image: "funcy/error", Config: map[string]string{"test": "true"}},
|
||||
{Type: "async", Path: "/myroute/:param", AppName: "myapp", Image: "treeder/hello", Config: map[string]string{"test": "true"}},
|
||||
},
|
||||
)
|
||||
mq := &mqs.Mock{}
|
||||
|
||||
@@ -128,8 +128,8 @@ func TestRouteRunnerExecution(t *testing.T) {
|
||||
{Name: "myapp", Config: models.Config{}},
|
||||
},
|
||||
[]*models.Route{
|
||||
{Path: "/myroute", AppName: "myapp", Image: "iron/hello", Headers: map[string][]string{"X-Function": {"Test"}}},
|
||||
{Path: "/myerror", AppName: "myapp", Image: "iron/error", Headers: map[string][]string{"X-Function": {"Test"}}},
|
||||
{Path: "/myroute", AppName: "myapp", Image: "treeder/hello", Headers: map[string][]string{"X-Function": {"Test"}}},
|
||||
{Path: "/myerror", AppName: "myapp", Image: "funcy/error", Headers: map[string][]string{"X-Function": {"Test"}}},
|
||||
},
|
||||
), &mqs.Mock{}, rnr, tasks)
|
||||
|
||||
@@ -186,7 +186,7 @@ func TestRouteRunnerTimeout(t *testing.T) {
|
||||
{Name: "myapp", Config: models.Config{}},
|
||||
},
|
||||
[]*models.Route{
|
||||
{Path: "/sleeper", AppName: "myapp", Image: "iron/sleeper", Timeout: 1},
|
||||
{Path: "/sleeper", AppName: "myapp", Image: "funcy/sleeper", Timeout: 1},
|
||||
},
|
||||
), &mqs.Mock{}, rnr, tasks)
|
||||
|
||||
|
||||
@@ -14,15 +14,15 @@ import (
|
||||
"github.com/Sirupsen/logrus"
|
||||
"github.com/ccirello/supervisor"
|
||||
"github.com/gin-gonic/gin"
|
||||
"github.com/spf13/viper"
|
||||
"gitlab.oracledx.com/odx/functions/api"
|
||||
"gitlab.oracledx.com/odx/functions/api/datastore"
|
||||
"gitlab.oracledx.com/odx/functions/api/models"
|
||||
"gitlab.oracledx.com/odx/functions/api/mqs"
|
||||
"gitlab.oracledx.com/odx/functions/api/runner"
|
||||
"gitlab.oracledx.com/odx/functions/api/runner/common"
|
||||
"gitlab.oracledx.com/odx/functions/api/runner/task"
|
||||
"gitlab.oracledx.com/odx/functions/api/server/internal/routecache"
|
||||
"gitlab.oracledx.com/odx/functions/api/runner/common"
|
||||
"github.com/spf13/viper"
|
||||
)
|
||||
|
||||
const (
|
||||
@@ -55,7 +55,7 @@ type Server struct {
|
||||
|
||||
const cacheSize = 1024
|
||||
|
||||
// NewFromEnv creates a new IronFunctions server based on env vars.
|
||||
// NewFromEnv creates a new Functions server based on env vars.
|
||||
func NewFromEnv(ctx context.Context) *Server {
|
||||
ds, err := datastore.New(viper.GetString(EnvDBURL))
|
||||
if err != nil {
|
||||
@@ -72,7 +72,7 @@ func NewFromEnv(ctx context.Context) *Server {
|
||||
return New(ctx, ds, mq, apiURL)
|
||||
}
|
||||
|
||||
// New creates a new IronFunctions server with the passed in datastore, message queue and API URL
|
||||
// New creates a new Functions server with the passed in datastore, message queue and API URL
|
||||
func New(ctx context.Context, ds models.Datastore, mq models.MessageQueue, apiURL string, opts ...ServerOption) *Server {
|
||||
metricLogger := runner.NewMetricLogger()
|
||||
funcLogger := runner.NewFuncLogger()
|
||||
|
||||
@@ -120,8 +120,8 @@ func TestFullStack(t *testing.T) {
|
||||
{"create my app", "POST", "/v1/apps", `{ "app": { "name": "myapp" } }`, http.StatusOK, 0},
|
||||
{"list apps", "GET", "/v1/apps", ``, http.StatusOK, 0},
|
||||
{"get app", "GET", "/v1/apps/myapp", ``, http.StatusOK, 0},
|
||||
{"add myroute", "POST", "/v1/apps/myapp/routes", `{ "route": { "name": "myroute", "path": "/myroute", "image": "iron/hello" } }`, http.StatusOK, 1},
|
||||
{"add myroute2", "POST", "/v1/apps/myapp/routes", `{ "route": { "name": "myroute2", "path": "/myroute2", "image": "iron/error" } }`, http.StatusOK, 2},
|
||||
{"add myroute", "POST", "/v1/apps/myapp/routes", `{ "route": { "name": "myroute", "path": "/myroute", "image": "treeder/hello" } }`, http.StatusOK, 1},
|
||||
{"add myroute2", "POST", "/v1/apps/myapp/routes", `{ "route": { "name": "myroute2", "path": "/myroute2", "image": "funcy/error" } }`, http.StatusOK, 2},
|
||||
{"get myroute", "GET", "/v1/apps/myapp/routes/myroute", ``, http.StatusOK, 2},
|
||||
{"get myroute2", "GET", "/v1/apps/myapp/routes/myroute2", ``, http.StatusOK, 2},
|
||||
{"get all routes", "GET", "/v1/apps/myapp/routes", ``, http.StatusOK, 2},
|
||||
|
||||
@@ -30,7 +30,7 @@ func TestSpecialHandlerSet(t *testing.T) {
|
||||
// {Name: "test"},
|
||||
// },
|
||||
// Routes: []*models.Route{
|
||||
// {Path: "/test", Image: "iron/hello", AppName: "test"},
|
||||
// {Path: "/test", Image: "treeder/hello", AppName: "test"},
|
||||
// },
|
||||
// },
|
||||
// MQ: &mqs.Mock{},
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package version
|
||||
|
||||
// Version of IronFunctions
|
||||
// Version of Functions
|
||||
var Version = "0.3.2"
|
||||
|
||||
Reference in New Issue
Block a user