From 9cc12b4b125e920894959ade498907148df13efe Mon Sep 17 00:00:00 2001 From: Travis Reeder Date: Thu, 18 May 2017 18:59:34 +0000 Subject: [PATCH] Remove iron... --- CHANGELOG.md | 78 +---------- CONTRIBUTING.md | 6 +- LICENSE | 8 +- Makefile | 4 +- README.md | 55 ++++---- api/datastore/internal/datastoretest/test.go | 6 +- api/runner/common/backoff.go | 14 -- api/runner/common/clock.go | 14 -- api/runner/common/ctx.go | 14 -- api/runner/common/environment.go | 14 -- api/runner/common/errors.go | 14 -- api/runner/common/logging.go | 14 -- api/runner/common/stats/aggregator.go | 14 -- api/runner/common/stats/aggregator_test.go | 14 -- api/runner/common/stats/log.go | 14 -- api/runner/common/stats/mem.go | 14 -- api/runner/common/stats/newrelic.go | 14 -- api/runner/common/stats/riemann.go | 14 -- api/runner/common/stats/stathat.go | 14 -- api/runner/common/stats/stats.go | 14 -- api/runner/common/stats/statsd.go | 18 +-- api/runner/common/writers.go | 14 -- api/runner/common/writers_test.go | 14 -- api/runner/drivers/docker/docker.go | 14 -- api/runner/drivers/docker/docker_client.go | 14 -- api/runner/drivers/docker/docker_test.go | 18 +-- api/runner/drivers/driver.go | 14 -- api/runner/drivers/driver_test.go | 22 +-- api/runner/drivers/mock/mocker.go | 14 -- api/runner/runner_test.go | 8 +- api/runner/worker.go | 19 ++- api/server/routes_test.go | 10 +- api/server/runner_async_test.go | 6 +- api/server/runner_test.go | 6 +- api/server/server.go | 8 +- api/server/server_test.go | 4 +- api/server/special_handler_test.go | 2 +- api/version/version.go | 2 +- clients/build.rb | 12 +- clients/main.go | 14 +- docs/README.md | 10 +- docs/definitions.md | 8 +- docs/faq.md | 14 +- docs/function-format.md | 2 +- docs/hot-functions.md | 8 +- docs/lambda/README.md | 2 +- docs/lambda/about.md | 4 +- docs/lambda/create.md | 7 +- docs/lambda/environment.md | 22 +-- docs/lambda/getting-started.md | 128 ------------------ docs/lambda/import.md | 4 +- docs/operating/databases/README.md | 2 +- docs/operating/databases/boltdb.md | 6 +- docs/operating/databases/mysql.md | 12 +- docs/operating/databases/postgres.md | 18 +-- docs/operating/docker-swarm/README.md | 44 +++--- docs/operating/extending.md | 14 +- docs/operating/kubernetes/README.md | 26 ++-- .../functions-deployment.yaml | 2 +- .../kubernetes-quick/deployment.yaml | 2 +- docs/operating/logging.md | 2 +- docs/operating/mqs/README.md | 4 +- docs/operating/options.md | 14 +- docs/operating/production.md | 14 +- docs/operating/routes.md | 10 +- docs/operating/scaling.md | 2 +- docs/operating/triggers.md | 4 +- docs/operating/ui.md | 4 +- docs/operating/windows.md | 2 +- docs/packaging.md | 10 +- docs/swagger.yml | 4 +- examples/Dockerfile.glide | 2 +- examples/blog/Dockerfile | 4 +- examples/blog/README.md | 12 +- examples/blog/build.sh | 4 +- examples/blog/func.yaml | 4 +- examples/blog/test.sh | 4 +- examples/caddy-lb/README.md | 14 +- examples/caddy-lb/docker-compose.yml | 24 ++-- examples/caddy-lb/func.yaml | 2 +- examples/checker/Dockerfile | 2 +- examples/checker/README.md | 8 +- examples/checker/build.sh | 2 +- examples/checker/func.yaml | 2 +- examples/checker/test.sh | 2 +- examples/echo/Dockerfile | 2 +- examples/echo/README.md | 8 +- examples/echo/build.sh | 2 +- examples/echo/func.yaml | 2 +- examples/echo/test.sh | 2 +- examples/error/Dockerfile | 2 +- examples/error/README.md | 8 +- examples/error/build.sh | 2 +- examples/error/func.yaml | 2 +- examples/error/test.sh | 2 +- examples/hash/README.md | 8 +- examples/hello/go/README.md | 6 +- examples/hello/node/README.md | 6 +- examples/hello/php/Dockerfile | 2 +- examples/hello/php/README.md | 6 +- examples/hello/php/func.yaml | 2 +- examples/hello/python/Dockerfile | 2 +- examples/hello/python/README.md | 6 +- examples/hello/ruby/README.md | 12 +- examples/hello/rust/README.md | 9 +- examples/middleware/README.md | 2 +- examples/postgres/README.md | 4 +- examples/redis/Dockerfile | 2 +- examples/redis/README.md | 8 +- examples/redis/build.sh | 4 +- examples/redis/func.yaml | 2 +- examples/redis/test.sh | 4 +- examples/s3/Dockerfile | 2 +- examples/s3/Makefile | 2 +- examples/slackbot/guppy/README.md | 6 +- examples/sleeper/Dockerfile | 2 +- examples/sleeper/func.yaml | 2 +- examples/testframework/local/README.md | 2 +- examples/testframework/remote/README.md | 4 +- examples/testframework/remote/func.yaml | 2 +- examples/twitter/Dockerfile | 2 +- examples/twitter/README.md | 8 +- examples/twitter/build.sh | 4 +- examples/twitter/func.yaml | 2 +- examples/twitter/test.sh | 4 +- fn/Makefile | 4 +- fn/README.md | 24 ++-- fn/common.go | 28 ++-- fn/lambda/node/Dockerfile | 2 +- fn/langs/go.go | 2 +- fn/langs/python.go | 2 +- fn/langs/ruby.go | 2 +- fn/main.go | 8 +- fn/testfn.go | 2 +- images/dind/Dockerfile | 15 -- images/dind/build.sh | 16 --- images/dind/chaos/Dockerfile | 16 --- images/dind/chaos/chaos.sh | 14 -- images/dind/chaos/entrypoint.sh | 15 -- images/dind/dind.sh | 14 -- images/dind/entrypoint.sh | 14 -- images/dind/release.sh | 14 -- lb/README.md | 6 +- lb/fnlb/main.go | 2 +- test/fnlb-test-harness/README.md | 18 +-- test/fnlb-test-harness/main.go | 2 +- 146 files changed, 406 insertions(+), 1050 deletions(-) delete mode 100644 docs/lambda/getting-started.md diff --git a/CHANGELOG.md b/CHANGELOG.md index e9a8b3464..1333ed77b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,77 +1 @@ -## v0.2.0 (unreleased) - -### Release Notes - -### Features - -- [#428](https://github.com/treeder/functions/issues/428): Change update route from PUT to PATCH. -- [#368](https://github.com/treeder/functions/issues/368): fn: support route headers tweaks. -- [#316](https://github.com/treeder/functions/issues/316): fnctl: Add rustlang support. -- [#313](https://github.com/treeder/functions/issues/313): fnctl: Add .NET core support?. -- [#310](https://github.com/treeder/functions/issues/310): fnctl: Add python support. -- [#69](https://github.com/treeder/functions/issues/69): Long(er) running containers for better performance aka Hot Containers. -- [#472](https://github.com/treeder/functions/pull/472): Add global lru for routes with keys being the appname + path. -- [#484](https://github.com/treeder/functions/pull/484): Add triggers example for OpenStack project Picasso. -- [#487](https://github.com/treeder/functions/pull/487): Add initial load balancer. - -### Bugfixes - -- [#483](https://github.com/treeder/functions/pull/483): Listen for PORT before running async/sync workers in order to prevent errors. -- [#479](https://github.com/treeder/functions/pull/478): Add routes config set/unset back -- [#429](https://github.com/treeder/functions/issues/429): Broken docs after merge. -- [#422](https://github.com/treeder/functions/issues/422): The headers field in func.yaml expects an array of values for each header key. -- [#421](https://github.com/treeder/functions/issues/421): Can't update a route and show better error message. -- [#420](https://github.com/treeder/functions/issues/420): `fn` tool install script not being updated to new releases. -- [#419](https://github.com/treeder/functions/issues/419): --runtime flag on init doesn't work area/fn . -- [#414](https://github.com/treeder/functions/issues/414): make run-docker is buggy on linux . -- [#413](https://github.com/treeder/functions/issues/413): fnctl: Creating routes ignores the route path and assigns function name. -- [#403](https://github.com/treeder/functions/issues/403): Route update (HTTP PUT) modifies datastore entity by making it inconsistent. -- [#393](https://github.com/treeder/functions/issues/393): Add documentation on how to use hot containers. -- [#384](https://github.com/treeder/functions/issues/384): Multiple routines use non-threadsafe cache. -- [#381](https://github.com/treeder/functions/issues/381): Unable to update route path through HTTP PUT area/api bug. -- [#380](https://github.com/treeder/functions/issues/380): Unable to update app name. -- [#373](https://github.com/treeder/functions/issues/373): fn build should fail if no version in func.yaml. -- [#369](https://github.com/treeder/functions/issues/369): Add documentation related to SpecialHandlers. -- [#366](https://github.com/treeder/functions/issues/366): Documentation lagging behind after Hot Containers. -- [#365](https://github.com/treeder/functions/issues/365): Documentation lagging behind on AppListeners. -- [#364](https://github.com/treeder/functions/issues/364): Remove app_name from per function endpoints. -- [#363](https://github.com/treeder/functions/issues/363): Update CONTRIBUTING with some rules of PRs. -- [#360](https://github.com/treeder/functions/issues/360): HTTP route /version is not described in swagger doc. -- [#352](https://github.com/treeder/functions/issues/352): Improve `fn publish` command . -- [#345](https://github.com/treeder/functions/issues/345): Check and fix for potential goroutine leak in api/runner. -- [#339](https://github.com/treeder/functions/issues/339): Unable to run sync route execution longer than 60 seconds. -- [#320](https://github.com/treeder/functions/issues/320): Change cli tool name to `fn`?. -- [#319](https://github.com/treeder/functions/issues/319): Update docs to link to client libraries. -- [#304](https://github.com/treeder/functions/issues/304): Create an fnctl dns entry and enable ssl for install of the cli tool. -- [#302](https://github.com/treeder/functions/issues/302): Placement of app name in fnctl seems inconsistent . -- [#301](https://github.com/treeder/functions/issues/301): can add a route with /hello but can’t delete it with /hello .. have to delete it with just hello. -- [#299](https://github.com/treeder/functions/issues/299): More obvious USAGE line for where to include app name. -- [#298](https://github.com/treeder/functions/issues/298): deleting a route that doesn't exist says it's deleted. -- [#296](https://github.com/treeder/functions/issues/296): Better error messages for error on creating app. -- [#293](https://github.com/treeder/functions/issues/293): fn: auto release for fn. -- [#288](https://github.com/treeder/functions/issues/288): api: add upsert entrypoint for route updates. -- [#284](https://github.com/treeder/functions/issues/284): Update iron/node image. -- [#275](https://github.com/treeder/functions/issues/275): Functions API /tasks returns only one task ignoring query parameter `n`. -- [#274](https://github.com/treeder/functions/issues/274): Support app deletion API . -- [#254](https://github.com/treeder/functions/issues/254): HTTP POST to /apps/{app}/routes is not returning HTTP 409 in case of existing similar route. -- [#253](https://github.com/treeder/functions/issues/253): HTTP POST to /app for app creation should return HTTP 409 if app already exists. -- [#252](https://github.com/treeder/functions/issues/252): HTTP PUT to /apps/{app} creates new app instead of modifying initial. -- [#251](https://github.com/treeder/functions/issues/251): Maybe drop the CONFIG_ prefix on user defined config vars?. -- [#235](https://github.com/treeder/functions/issues/235): Docs: Missing Redis docs. -- [#229](https://github.com/treeder/functions/issues/229): fnctl change suggestions. -- [#218](https://github.com/treeder/functions/issues/218): Copy s3 event example from treeder/lambda. -- [#216](https://github.com/treeder/functions/issues/216): fnclt lambda commands need to automatically detect region from the AWS config. -- [#197](https://github.com/treeder/functions/issues/197): Create an fnctl dns entry and enable ssl for install of the cli tool. -- [#182](https://github.com/treeder/functions/issues/182): Remove error in logs when image not found. -- [#161](https://github.com/treeder/functions/issues/161): Example slackbot - Copy guppy example over. -- [#134](https://github.com/treeder/functions/issues/134): Dynamic runners scaling. -- [#126](https://github.com/treeder/functions/issues/126): Detect OS and disable Memory profiling if needed. -- [#72](https://github.com/treeder/functions/issues/72): Should the input stream include a headers section, just like HTTP?. -- [#69](https://github.com/treeder/functions/issues/69): How to run on Openstack. -- [#20](https://github.com/treeder/functions/issues/20): Make function testing framework. -- [#3](https://github.com/treeder/functions/issues/3): Make "function tool" in ironcli. -- [#2](https://github.com/treeder/functions/issues/2): Allow setting content-type on a route, then use that when responding. - -## v0.1.0 [2016-11-18] - -Alpha 1 Release \ No newline at end of file +TODO diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index a495f8c2a..404f4069c 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,4 +1,4 @@ -# Contributing to IronFunctions +# Contributing to Oracle Functions We welcome all contributions! @@ -52,7 +52,7 @@ make test make docker-run ``` -will start IronFunctions inside a Docker container. +will start Functions inside a Docker container. ## Tests in Docker @@ -61,4 +61,4 @@ make docker-test ``` -will test IronFunctions inside a Docker container. +will test Functions inside a Docker container. diff --git a/LICENSE b/LICENSE index 6d8503efd..9b4519e48 100644 --- a/LICENSE +++ b/LICENSE @@ -186,7 +186,7 @@ same "printed page" as the copyright notice for easier identification within third-party archives. - Copyright 2016 Iron.io + Copyright 2017 Oracle Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -198,4 +198,8 @@ 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. \ No newline at end of file + limitations under the License. + +========================= + +Copyright for portions of this project are held by Iron.io, 2016 as part of project IronFunctions. diff --git a/Makefile b/Makefile index f0c581cb5..6821b3991 100644 --- a/Makefile +++ b/Makefile @@ -28,7 +28,7 @@ docker-dep: docker run --rm -it -v ${CURDIR}:/go/src/github.com/treeder/functions -w /go/src/github.com/treeder/functions treeder/glide install -v docker-build: - docker run --rm -v ${CURDIR}:/go/src/github.com/treeder/functions -w /go/src/github.com/treeder/functions iron/go:dev go build -o functions-alpine + docker run --rm -v ${CURDIR}:/go/src/github.com/treeder/functions -w /go/src/github.com/treeder/functions funcy/go:dev go build -o functions-alpine docker build --build-arg HTTP_PROXY -t treeder/functions:latest . docker-run: docker-build @@ -39,7 +39,7 @@ docker-test: -v /var/run/docker.sock:/var/run/docker.sock \ -v ${CURDIR}:/go/src/github.com/treeder/functions \ -w /go/src/github.com/treeder/functions \ - iron/go:dev go test \ + funcy/go:dev go test \ -v $(shell docker run -ti -v ${CURDIR}:/go/src/github.com/treeder/functions -w /go/src/github.com/treeder/functions -e GOPATH=/go golang:alpine sh -c 'go list ./... | grep -v vendor | grep -v examples | grep -v tool | grep -v fn | grep -v datastore') all: dep build diff --git a/README.md b/README.md index b730b76e4..b5a8196d2 100644 --- a/README.md +++ b/README.md @@ -1,19 +1,19 @@ -![IronFunctions](docs/assets/logo-black-400w.png) +# NONAME... :( [![CircleCI](https://circleci.com/gh/treeder/functions.svg?style=svg)](https://circleci.com/gh/treeder/functions) [![GoDoc](https://godoc.org/github.com/treeder/functions?status.svg)](https://godoc.org/github.com/treeder/functions) -Welcome to IronFunctions! The open source serverless platform. +Welcome to Oracle Functions! The open source serverless platform. -## What is IronFunctions? +## What is Oracle Functions? -IronFunctions is an open source serverless platform, or as we like to refer to it, Functions as a +Oracle Functions is an open source serverless platform, or as we like to refer to it, Functions as a Service (FaaS) platform that you can run anywhere. * Write once * [Any language](docs/faq.md#which-languages-are-supported) * [AWS Lambda format supported](docs/lambda/README.md) -* [Run anywhere](docs/faq.md#where-can-i-run-ironfunctions) +* [Run anywhere](docs/faq.md#where-can-i-run-functions) * Public, private and hybrid cloud * [Import functions directly from Lambda](docs/lambda/import.md) and run them wherever you want * Easy to use [for developers](docs/README.md#for-developers) @@ -34,12 +34,12 @@ The main benefits that most people refer to are on the developer side and they i * Pay by the milliseconds your code is executing -- unlike a typical application that runs 24/7, and you're paying 24/7, functions only run when needed -Since you'll be running IronFunctions yourself, the paying part may not apply, but it does apply to +Since you'll be running Oracle Functions yourself, the paying part may not apply, but it does apply to cost savings on your infrastructure bills as you'll read below. ### Benefits for operators -If you will be operating IronFunctions (the person who has to manage the servers behind the serverless), +If you will be operating Oracle Functions (the person who has to manage the servers behind the serverless), then the benefits are different, but related. * Extremely efficient use of resources @@ -50,18 +50,15 @@ then the benefits are different, but related. * Single system for code written in any language or any technology * Single system to monitor * Scaling is the same for all functions, you don't scale each app independently - * Scaling is simply adding more IronFunctions nodes + * Scaling is simply adding more Oracle Functions nodes -There is a lot more reading you can do on the topic, just search for ["what is serverless"](https://www.google.com/webhp?sourceid=chrome-instant&ion=1&espv=2&ie=UTF-8#q=what%20is%20serverless) -and you'll find plenty of information. We have pretty thorough post on the Iron.io blog called -[What is Serverless Computing and Why is it Important](https://www.iron.io/what-is-serverless-computing/). +There is a lot more reading you can do on the topic, just search for +["what is serverless"](https://www.google.com/webhp?sourceid=chrome-instant&ion=1&espv=2&ie=UTF-8#q=what%20is%20serverless) +and you'll find plenty of information. ## Join Our Community -Join our Slack community to get help and give feedback. - -[![Slack Status](https://open-iron.herokuapp.com/badge.svg)]( -get.iron.io/open-slack) +TODO: Slack or Discord community. ## Quickstart @@ -69,12 +66,12 @@ This guide will get you up and running in a few minutes. ### Prequisites -* Docker 1.12 or later installed and running +* Docker 17.05 or later installed and running * Logged into Docker Hub (`docker login`) -### Run IronFunctions +### Run Oracle Functions -To get started quickly with IronFunctions, just fire up an `treeder/functions` container: +To get started quickly with Oracle Functions, just fire up a `treeder/functions` container: ```sh docker run --rm -it --name functions -v ${PWD}/data:/app/data -v /var/run/docker.sock:/var/run/docker.sock -p 8080:8080 treeder/functions @@ -82,12 +79,12 @@ docker run --rm -it --name functions -v ${PWD}/data:/app/data -v /var/run/docker *where ${PWD}/data is the directory where the functions application data files will be stored* -This will start IronFunctions in single server mode, using an embedded database and message queue. You can find all the +This will start Oracle Functions in single server mode, using an embedded database and message queue. You can find all the configuration options [here](docs/operating/options.md). If you are on Windows, check [here](docs/operating/windows.md). ### CLI tool -Install the IronFunctions CLI tool: +Install the Oracle Functions CLI tool: ```sh curl -LSs https://goo.gl/KKDFGn | sh @@ -155,7 +152,7 @@ write your functions in AWS's [Lambda format](docs/lambda/README.md). ## Usage -This is a more detailed explanation of the main commands you'll use in IronFunctions as a developer. +This is a more detailed explanation of the main commands you'll use in Oracle Functions as a developer. ### Create an Application @@ -180,12 +177,12 @@ Now that we have an app, we can route endpoints to functions. ### Add a Route A route is a way to define a path in your application that maps to a function. In this example, we'll map -`/hello` to a simple `Hello World!` function called `iron/hello` which is a function we already made that you +`/hello` to a simple `Hello World!` function called `treeder/hello` which is a function we already made that you can use -- yes, you can share functions! The source code for this function is in the [examples directory](examples/hello/go). You can read more about [writing your own functions here](docs/writing.md). ```sh -fn routes create myapp /hello -i iron/hello +fn routes create myapp /hello -i treeder/hello ``` Or using cURL: @@ -194,7 +191,7 @@ Or using cURL: curl -H "Content-Type: application/json" -X POST -d '{ "route": { "path":"/hello", - "image":"iron/hello" + "image":"treeder/hello" } }' http://localhost:8080/v1/apps/myapp/routes ``` @@ -240,7 +237,7 @@ You should see it say `Hello Johnny!` now instead of `Hello World!`. ### Add an asynchronous function -IronFunctions supports synchronous function calls like we just tried above, and asynchronous for background processing. +Oracle Functions supports synchronous function calls like we just tried above, and asynchronous for background processing. Asynchronous function calls are great for tasks that are CPU heavy or take more than a few seconds to complete. For instance, image processing, video processing, data processing, ETL, etc. @@ -256,7 +253,7 @@ curl -H "Content-Type: application/json" -X POST -d '{ "route": { "type": "async", "path":"/hello-async", - "image":"iron/hello" + "image":"treeder/hello" } }' http://localhost:8080/v1/apps/myapp/routes ``` @@ -284,7 +281,7 @@ Read more on [logging](docs/logging.md). ## Functions UI ```sh -docker run --rm -it --link functions:api -p 4000:4000 -e "API_URL=http://api:8080" iron/functions-ui +docker run --rm -it --link functions:api -p 4000:4000 -e "API_URL=http://api:8080" treeder/functions-ui ``` For more information, see: https://github.com/treeder/functions-ui @@ -319,11 +316,11 @@ These are the high level roadmap goals. See [milestones](https://github.com/tree You can get community support via: -* [Stack Overflow](http://stackoverflow.com/questions/tagged/ironfunctions) +* [Stack Overflow](http://stackoverflow.com/questions/tagged/functions) * [Slack](http://get.iron.io/open-slack) You can get commercial support by contacting [Iron.io](https://iron.io/contact) -## Want to contribute to IronFunctions? +## Want to contribute to Oracle Functions? See [contributing](CONTRIBUTING.md). diff --git a/api/datastore/internal/datastoretest/test.go b/api/datastore/internal/datastoretest/test.go index bb468afa0..37ff1f972 100644 --- a/api/datastore/internal/datastoretest/test.go +++ b/api/datastore/internal/datastoretest/test.go @@ -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", } diff --git a/api/runner/common/backoff.go b/api/runner/common/backoff.go index 226b0c611..bd7966734 100644 --- a/api/runner/common/backoff.go +++ b/api/runner/common/backoff.go @@ -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 ( diff --git a/api/runner/common/clock.go b/api/runner/common/clock.go index 1c91cf2f0..71e812c6e 100644 --- a/api/runner/common/clock.go +++ b/api/runner/common/clock.go @@ -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" diff --git a/api/runner/common/ctx.go b/api/runner/common/ctx.go index 19e2cb1c1..cc9e49669 100644 --- a/api/runner/common/ctx.go +++ b/api/runner/common/ctx.go @@ -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 ( diff --git a/api/runner/common/environment.go b/api/runner/common/environment.go index fdd578e6e..bb84dca0c 100644 --- a/api/runner/common/environment.go +++ b/api/runner/common/environment.go @@ -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 ( diff --git a/api/runner/common/errors.go b/api/runner/common/errors.go index adcf73975..ee9801b3d 100644 --- a/api/runner/common/errors.go +++ b/api/runner/common/errors.go @@ -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 ( diff --git a/api/runner/common/logging.go b/api/runner/common/logging.go index 3391fc8fa..32ba27ceb 100644 --- a/api/runner/common/logging.go +++ b/api/runner/common/logging.go @@ -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 ( diff --git a/api/runner/common/stats/aggregator.go b/api/runner/common/stats/aggregator.go index fa5e4bc30..33067b95b 100644 --- a/api/runner/common/stats/aggregator.go +++ b/api/runner/common/stats/aggregator.go @@ -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 ( diff --git a/api/runner/common/stats/aggregator_test.go b/api/runner/common/stats/aggregator_test.go index b2af47714..c733e89f6 100644 --- a/api/runner/common/stats/aggregator_test.go +++ b/api/runner/common/stats/aggregator_test.go @@ -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 ( diff --git a/api/runner/common/stats/log.go b/api/runner/common/stats/log.go index c7114206e..fde95448f 100644 --- a/api/runner/common/stats/log.go +++ b/api/runner/common/stats/log.go @@ -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 ( diff --git a/api/runner/common/stats/mem.go b/api/runner/common/stats/mem.go index 69ad09b98..944cbc08c 100644 --- a/api/runner/common/stats/mem.go +++ b/api/runner/common/stats/mem.go @@ -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 ( diff --git a/api/runner/common/stats/newrelic.go b/api/runner/common/stats/newrelic.go index 7f0110074..281ab3ada 100644 --- a/api/runner/common/stats/newrelic.go +++ b/api/runner/common/stats/newrelic.go @@ -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 ( diff --git a/api/runner/common/stats/riemann.go b/api/runner/common/stats/riemann.go index 154c3d72a..084bea0ff 100644 --- a/api/runner/common/stats/riemann.go +++ b/api/runner/common/stats/riemann.go @@ -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 ( diff --git a/api/runner/common/stats/stathat.go b/api/runner/common/stats/stathat.go index 1947a3912..c897089ae 100644 --- a/api/runner/common/stats/stathat.go +++ b/api/runner/common/stats/stathat.go @@ -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 ( diff --git a/api/runner/common/stats/stats.go b/api/runner/common/stats/stats.go index babb1f170..4f4ea8975 100644 --- a/api/runner/common/stats/stats.go +++ b/api/runner/common/stats/stats.go @@ -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 ( diff --git a/api/runner/common/stats/statsd.go b/api/runner/common/stats/statsd.go index 1ff1c22e0..e1bfc0947 100644 --- a/api/runner/common/stats/statsd.go +++ b/api/runner/common/stats/statsd.go @@ -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 diff --git a/api/runner/common/writers.go b/api/runner/common/writers.go index d18f09eca..2347b70f1 100644 --- a/api/runner/common/writers.go +++ b/api/runner/common/writers.go @@ -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 ( diff --git a/api/runner/common/writers_test.go b/api/runner/common/writers_test.go index 2691c9bc9..12c9ea71d 100644 --- a/api/runner/common/writers_test.go +++ b/api/runner/common/writers_test.go @@ -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 ( diff --git a/api/runner/drivers/docker/docker.go b/api/runner/drivers/docker/docker.go index 9931733ed..345229066 100644 --- a/api/runner/drivers/docker/docker.go +++ b/api/runner/drivers/docker/docker.go @@ -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 ( diff --git a/api/runner/drivers/docker/docker_client.go b/api/runner/drivers/docker/docker_client.go index ee70fd746..a31a2dbcc 100644 --- a/api/runner/drivers/docker/docker_client.go +++ b/api/runner/drivers/docker/docker_client.go @@ -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 ( diff --git a/api/runner/drivers/docker/docker_test.go b/api/runner/drivers/docker/docker_test.go index 45798ad2e..f358a5162 100644 --- a/api/runner/drivers/docker/docker_test.go +++ b/api/runner/drivers/docker/docker_test.go @@ -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 */ } diff --git a/api/runner/drivers/driver.go b/api/runner/drivers/driver.go index ff1821d49..0b20e3c9b 100644 --- a/api/runner/drivers/driver.go +++ b/api/runner/drivers/driver.go @@ -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 diff --git a/api/runner/drivers/driver_test.go b/api/runner/drivers/driver_test.go index 2148b0a32..4099ce2e0 100644 --- a/api/runner/drivers/driver_test.go +++ b/api/runner/drivers/driver_test.go @@ -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"}, } diff --git a/api/runner/drivers/mock/mocker.go b/api/runner/drivers/mock/mocker.go index 6d5c959fe..cfced992b 100644 --- a/api/runner/drivers/mock/mocker.go +++ b/api/runner/drivers/mock/mocker.go @@ -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 ( diff --git a/api/runner/runner_test.go b/api/runner/runner_test.go index a8e716981..d6843d30d 100644 --- a/api/runner/runner_test.go +++ b/api/runner/runner_test.go @@ -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{ diff --git a/api/runner/worker.go b/api/runner/worker.go index b7d7e4e45..f514794f2 100644 --- a/api/runner/worker.go +++ b/api/runner/worker.go @@ -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) diff --git a/api/server/routes_test.go b/api/server/routes_test.go index e38e52769..623901079 100644 --- a/api/server/routes_test.go +++ b/api/server/routes_test.go @@ -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, diff --git a/api/server/runner_async_test.go b/api/server/runner_async_test.go index 7206406fe..aea12267d 100644 --- a/api/server/runner_async_test.go +++ b/api/server/runner_async_test.go @@ -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{} diff --git a/api/server/runner_test.go b/api/server/runner_test.go index 567ef89a6..661e84caa 100644 --- a/api/server/runner_test.go +++ b/api/server/runner_test.go @@ -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) diff --git a/api/server/server.go b/api/server/server.go index 8ac14f2d9..4bb6af58a 100644 --- a/api/server/server.go +++ b/api/server/server.go @@ -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() diff --git a/api/server/server_test.go b/api/server/server_test.go index adb8773c2..7c7d1da66 100644 --- a/api/server/server_test.go +++ b/api/server/server_test.go @@ -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}, diff --git a/api/server/special_handler_test.go b/api/server/special_handler_test.go index b43414da5..b494a904c 100644 --- a/api/server/special_handler_test.go +++ b/api/server/special_handler_test.go @@ -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{}, diff --git a/api/version/version.go b/api/version/version.go index 999537dc9..88a210334 100644 --- a/api/version/version.go +++ b/api/version/version.go @@ -1,4 +1,4 @@ package version -// Version of IronFunctions +// Version of Functions var Version = "0.3.2" diff --git a/clients/build.rb b/clients/build.rb index e0bce2b18..c4679d016 100644 --- a/clients/build.rb +++ b/clients/build.rb @@ -62,22 +62,22 @@ languages.each do |l| when 'ruby' clone(l) fruby = "functions_ruby" - gem_name = "iron_functions" + gem_name = "oracle_functions" glob_pattern = ["**", "*.rb"] # just rb files skip_files = ["#{gem_name}.gemspec"] deploy = ["gem build #{gem_name}.gemspec", "gem push #{gem_name}-#{version}.gem"] options['gemName'] = gem_name - options['moduleName'] = "IronFunctions" + options['moduleName'] = "OracleFunctions" options['gemVersion'] = version options['gemHomepage'] = "https://github.com/treeder/#{fruby}" - options['gemSummary'] = 'Ruby gem for IronFunctions' - options['gemDescription'] = 'Ruby gem for IronFunctions.' - options['gemAuthorEmail'] = 'travis@iron.io' + options['gemSummary'] = 'Ruby gem for Oracle Functions' + options['gemDescription'] = 'Ruby gem for Oracle Functions.' + options['gemAuthorEmail'] = 'treeder@gmail.com' when 'javascript' lshort = 'js' # copy_dir = "javascript-client/." clone(lshort) - options['projectName'] = "iron_functions" + options['projectName'] = "oracle_functions" deploy << "npm publish" else puts "Skipping #{l}" diff --git a/clients/main.go b/clients/main.go index 5299903c4..ef2aba7c0 100644 --- a/clients/main.go +++ b/clients/main.go @@ -83,16 +83,16 @@ func main() { case "ruby": skipFiles = append(skipFiles, "#{gem_name}.gemspec") deploy = append(deploy, []string{"gem", "build #{gem_name}.gemspec", "gem push #{gem_name}-#{version}.gem"}) - options["gemName"] = "iron_functions" - options["moduleName"] = "IronFunctions" + options["gemName"] = "oracle_functions" + options["moduleName"] = "OracleFunctions" options["gemVersion"] = version options["gemHomepage"] = "https://github.com/treeder/functions_ruby" - options["gemSummary"] = "Ruby gem for IronFunctions" - options["gemDescription"] = "Ruby gem for IronFunctions." - options["gemAuthorEmail"] = "travis@iron.io" + options["gemSummary"] = "Ruby gem for Oracle Functions" + options["gemDescription"] = "Ruby gem for Oracle Functions." + options["gemAuthorEmail"] = "treeder@gmail.com" case "javascript": short = "js" - options["projectName"] = "iron_functions" + options["projectName"] = "oracle_functions" deploy = append(deploy, []string{"npm", "publish"}) default: continue @@ -305,7 +305,7 @@ func genSwaggerClient(target string) error { return err } - cmd := exec.Command("docker", "run", "--rm", "-u", fmt.Sprintf("%s:%s", u.Uid, u.Gid), "-v", fmt.Sprintf("%s/%s:/go/src/github.com/iron-io/functions_go", cwd, target), "-v", fmt.Sprintf("%s/%s:/go/swagger.spec", cwd, swaggerURL), "-w", "/go/src", "quay.io/goswagger/swagger", "generate", "client", "-f", "/go/swagger.spec", "-t", "github.com/iron-io/functions_go", "-A", "functions") + cmd := exec.Command("docker", "run", "--rm", "-u", fmt.Sprintf("%s:%s", u.Uid, u.Gid), "-v", fmt.Sprintf("%s/%s:/go/src/github.com/treeder/functions_go", cwd, target), "-v", fmt.Sprintf("%s/%s:/go/swagger.spec", cwd, swaggerURL), "-w", "/go/src", "quay.io/goswagger/swagger", "generate", "client", "-f", "/go/swagger.spec", "-t", "github.com/iron-io/functions_go", "-A", "functions") d, err := cmd.CombinedOutput() if err != nil { log.Printf("Error running go-swagger: %s\n", d) diff --git a/docs/README.md b/docs/README.md index a0226a269..4d88dfb85 100644 --- a/docs/README.md +++ b/docs/README.md @@ -1,10 +1,10 @@ -# IronFunctions Documentation +# Oracle Functions Documentation * [FAQ](faq.md) ## For Developers -If you are a developer using IronFunctions through the API, this section is for you. +If you are a developer using Oracle Functions through the API, this section is for you. * [Quickstart](https://github.com/treeder/functions#quickstart) * [Definitions](definitions.md) @@ -19,7 +19,7 @@ If you are a developer using IronFunctions through the API, this section is for ## For Operators -If you are operating IronFunctions, this section is for you. +If you are operating Oracle Functions, this section is for you. * [Running in Production Overview](operating/production.md) * [Runtime Options](operating/options.md) @@ -29,9 +29,9 @@ If you are operating IronFunctions, this section is for you. * [Logging](operating/logging.md) * [Metrics](operating/metrics.md) * [Triggers](operating/triggers.md) -* [Extending IronFunctions](operating/extending.md) +* [Extending Oracle Functions](operating/extending.md) * [Docker Configuration](operating/docker.md) * [Operating On Windows](operating/windows.md) -* Running IronFunctions on: +* Running Oracle Functions on: * [Kubernetes](operating/kubernetes/README.md) * [Docker Swarm](operating/docker-swarm/README.md) diff --git a/docs/definitions.md b/docs/definitions.md index 87d13a6ce..cc94419b8 100644 --- a/docs/definitions.md +++ b/docs/definitions.md @@ -58,10 +58,10 @@ Note: Route level configuration overrides app level configuration. Using `fn`: ```sh -fn routes create myapp /path --config k1=v1 --config k2=v2 --image iron/hello +fn routes create myapp /path --config k1=v1 --config k2=v2 --image treeder/hello ``` -Or using a cURL: +Or using cURL: ```sh curl -H "Content-Type: application/json" -X POST -d '{ @@ -80,7 +80,7 @@ curl -H "Content-Type: application/json" -X POST -d '{ ```json { "path": "/hello", - "image": "iron/hello", + "image": "treeder/hello", "type": "sync", "memory": 128, "config": { @@ -150,4 +150,4 @@ This properties are only used if the function is in `hot function` mode #### max_concurrency (string) -This property defines the maximum amount of concurrent hot functions instances the function should have (per IronFunction node). \ No newline at end of file +This property defines the maximum amount of concurrent hot functions instances the function should have (per Oracle Functions node). \ No newline at end of file diff --git a/docs/faq.md b/docs/faq.md index 889f43fd7..cee842ed2 100644 --- a/docs/faq.md +++ b/docs/faq.md @@ -6,16 +6,16 @@ Since we use containers as the base building block, all languages can be used. T helper libraries like our Lambda wrapper for every language, but you can use any language if you follow the base [function format](function-format.md). -## Where can I run IronFunctions? +## Where can I run Oracle Functions? -Anywhere. Any cloud, on-premise, on your laptop. As long as you can run a Docker container, you can run IronFunctions. +Anywhere. Any cloud, on-premise, on your laptop. As long as you can run a Docker container, you can run Oracle Functions. -## Which orchestration tools does IronFunctions support? +## Which orchestration tools does functions support? -IronFunctions can be deployed using any orchestration tool. +Functions can be deployed using any orchestration tool. -## Does IronFunctions require Docker? +## Does Oracle Functions require Docker? For now we require Docker primarily for the packaging and distribution via Docker Registries, -but we've built IronFunctions in a way that abstracts the container technology so we can support others as -needed. For instance, we'll eventually add rkt support. +but we've built Functions in a way that abstracts the container technology so we can support others as +needed. For instance, we may add rkt support. diff --git a/docs/function-format.md b/docs/function-format.md index 276d8abb5..eb66f5e38 100644 --- a/docs/function-format.md +++ b/docs/function-format.md @@ -54,7 +54,7 @@ hello world The header keys and values would be populated with information about the function call such as the request URL and query parameters. -`Content-Length` is determined by the [Content-Length](https://tools.ietf.org/html/rfc7230#section-3.3.3) header, which is mandatory both for input and output. It is used by IronFunctions to know when stop writing to STDIN and reading from STDOUT. +`Content-Length` is determined by the [Content-Length](https://tools.ietf.org/html/rfc7230#section-3.3.3) header, which is mandatory both for input and output. It is used by Functions to know when stop writing to STDIN and reading from STDOUT. Pros: diff --git a/docs/hot-functions.md b/docs/hot-functions.md index d1a742585..9ffc72f80 100644 --- a/docs/hot-functions.md +++ b/docs/hot-functions.md @@ -1,6 +1,6 @@ # Hot functions -IronFunctions is built on top of container technologies, for each incoming +Oracle Functions is built on top of container technologies, for each incoming workload, it spins a new container, feed it with the payload and sends the answer back to the caller. You can expect an average start time of 300ms per container. You may refer to [this blog](https://medium.com/travis-on-docker/the-overhead-of-docker-run-f2f06d47c9f3#.96tj75ugb) post to understand the details better. @@ -13,7 +13,7 @@ Thus, it means that once you decide to use a hot function, you must be able to tell the moment it should reading from standard input to start writing to standard output. -Currently, IronFunctions implements a HTTP-like protocol to operate hot +Currently, Functions implements a HTTP-like protocol to operate hot containers, but instead of communication through a TCP/IP port, it uses standard input/output. @@ -57,7 +57,7 @@ The next step in the cycle is to do some processing: ``` And finally, we return the result with a `Content-Length` header, so -IronFunctions daemon would know when to stop reading the gotten response. +Functions daemon would know when to stop reading the gotten response. ```go res := http.Response{ @@ -78,7 +78,7 @@ Rinse and repeat for each incoming workload. ## Deploying a hot function Once your functions is adapted to be handled as hot function, you must tell -IronFunctions daemon that this function is now ready to be reused across +Functions daemon that this function is now ready to be reused across requests: ```json diff --git a/docs/lambda/README.md b/docs/lambda/README.md index 4d7e609a1..d4022310b 100644 --- a/docs/lambda/README.md +++ b/docs/lambda/README.md @@ -1,6 +1,6 @@ # Lambda everywhere -Lambda support for IronFunctions enables you to take your AWS Lambda functions and run them +Lambda support for Oracle Functios enables you to take your AWS Lambda functions and run them anywhere. You should be able to take your code and run them without any changes. ## Creating Lambda Functions diff --git a/docs/lambda/about.md b/docs/lambda/about.md index c8fa20ab2..4bd463fd7 100644 --- a/docs/lambda/about.md +++ b/docs/lambda/about.md @@ -2,11 +2,11 @@ AWS Lambda introduced serverless computing to the masses. Wouldn't it be nice if you could run the same Lambda functions on any platform, in any cloud? -Iron.io is proud to release a set of tools that allow just this. Package your +Oracle is proud to release a set of tools that allow just this. Package your Lambda function in a Docker container and run it anywhere with an environment similar to AWS Lambda. -Using a job scheduler such as IronFunctions, you can connect these functions to +Using a job scheduler such as Oracle Functions, you can connect these functions to webhooks and run them on-demand, at scale. You can also use a container management system paired with a task queue to run these functions in a self-contained, platform-independent manner. diff --git a/docs/lambda/create.md b/docs/lambda/create.md index 5f1f73ec6..d44330157 100644 --- a/docs/lambda/create.md +++ b/docs/lambda/create.md @@ -1,8 +1,10 @@ # Creating Docker images out of Lambda functions + Docker images created by running the `create-function` subcommand on a Lambda function are ready to execute. You can convert any Lambda function of type nodejs 0.10, python 2.7 and Java 8 into an -IronFunction compatible Docker Image as follows: +Oracle Functions compatible Docker Image as follows: + ```bash fn lambda create-function ``` @@ -16,7 +18,8 @@ fn lambda create-function * file: the files to be converted, however for java8 only one file of type `jar` is allowed. e.g: + ```bash -fn lambda create-function irontest/node-exec:1 nodejs node_exec.handler node_exec.js +fn lambda create-function test/node-exec:1 nodejs node_exec.handler node_exec.js ``` diff --git a/docs/lambda/environment.md b/docs/lambda/environment.md index c04c2446d..077172638 100644 --- a/docs/lambda/environment.md +++ b/docs/lambda/environment.md @@ -6,7 +6,7 @@ Lambda and Dockerized Lambda. ## Request/Response -IronFunctions has sync/async communication with Request/Response workflows. +Functions has sync/async communication with Request/Response workflows. * sync: returns the result as the body of the response * async: returns the task id in the body of the response as a json @@ -21,11 +21,11 @@ such assumptions, please rewrite it. ## nodejs -* node.js version [0.10.42][iron/node] +* node.js version [0.10.42][funcy/node] * ImageMagick version [6.9.3][magickv] and nodejs [wrapper 6.9.3][magickwrapperv] * aws-sdk version [2.2.12][awsnodev] -[iron/node]: https://github.com/treeder/dockers/blob/master/node/Dockerfile +[funcy/node]: https://github.com/treeder/dockers/blob/master/node/Dockerfile [magickv]: https://pkgs.alpinelinux.org/package/main/x86_64/imagemagick [magickwrapperv]: https://www.npmjs.com/package/imagemagick [awsnodev]: https://aws.amazon.com/sdk-for-node-js/ @@ -38,12 +38,12 @@ Payloads MUST be a valid JSON object literal. * context.fail() does not currently truncate error logs. * `context.functionName` is of the form of a docker image, for example - `iron/test-function`. + `username/test-function`. * `context.functionVersion` is always the string `"$LATEST"`. * `context.invokedFunctionArn` is not supported. Value is empty string. * `context.memoryLimitInMB` does not reflect reality. Value is always `256`. * `context.awsRequestId` reflects the environment variable `TASK_ID`. On local - runs from `ironcli` this is a UUID. On IronFunctions this is the task ID. + runs from `fn` tool this is a UUID. On Functions server this is the task ID. * `logGroupName` and `logStreamName` are empty strings. * `identity` and `clientContext` are always `null`. @@ -57,7 +57,7 @@ If your handler throws an exception, we only log the error message. There is no * CPython [2.7.11][pythonv] * boto3 (Python AWS SDK) [1.2.3][botov]. -[pythonv]: https://hub.docker.com/r/iron/python/tags/ +[pythonv]: https://hub.docker.com/r/funcy/python/tags/ [botov]: https://github.com/boto/boto3/releases/tag/1.2.3 ### Event @@ -68,11 +68,11 @@ literal. ### Context object * `context.functionName` is of the form of a docker image, for example - `iron/test-function`. + `username/test-function`. * `context.functionVersion` is always the string `"$LATEST"`. * `context.invokedFunctionArn` is `None`. * `context.awsRequestId` reflects the environment variable `TASK_ID` which is - set to the task ID on IronFunctions. If TASK_ID is empty, a new UUID is used. + set to the task ID on Functions. If TASK_ID is empty, a new UUID is used. * `logGroupName`, `logStreamName`, `identity` and `clientContext` are `None`. ### Exceptions @@ -84,7 +84,7 @@ a JSON object with trace information. * OpenJDK Java Runtime [1.8.0][javav] -[javav]: https://hub.docker.com/r/iron/java/tags/ +[javav]: https://hub.docker.com/r/funcy/java/tags/ The Java8 runtime is significantly lacking at this piont and we **do not recommend** using it. @@ -163,8 +163,8 @@ to CloudWatch are not supported. ### Context object * `context.getFunctionName()` returns a String of the form of a docker image, - for example `iron/test-function`. + for example `username/test-function`. * `context.getFunctionVersion()` is always the string `"$LATEST"`. * `context.getAwsRequestId()` reflects the environment variable `TASK_ID` which is - set to the task ID on IronFunctions. If TASK_ID is empty, a new UUID is used. + set to the task ID on Functions. If TASK_ID is empty, a new UUID is used. * `getInvokedFunctionArn()`, `getLogGroupName()`, `getLogStreamName()`, `getIdentity()`, `getClientContext()`, `getLogger()` return `null`. diff --git a/docs/lambda/getting-started.md b/docs/lambda/getting-started.md deleted file mode 100644 index 5b401c502..000000000 --- a/docs/lambda/getting-started.md +++ /dev/null @@ -1,128 +0,0 @@ -# Introduction - -This guide will walk you through creating and testing a simple Lambda function. - -We need the the `fn` tool for the rest of this guide. You can install it -by following [these instructions](https://github.com/treeder/function/fn). - -*For this getting started we are assuming you already have working lambda function code available, if not head to the [import instructions] (import.md) and skip the next section.* - -## Creating the function - -Let's convert the `hello_world` AWS Lambda example to Docker. - -```python -def my_handler(event, context): - message = 'Hello {} {}!'.format(event['first_name'], - event['last_name']) - return { - 'message' : message - } -``` - -Create an empty directory for your project and save this code in a file called -`hello_world.py`. - -Now let's use `fn`'s Lambda functionality to create a Docker image. We can -then run the Docker image with a payload to execute the Lambda function. - -```sh -$ fn lambda create-function irontest/hello_world:1 python2.7 hello_world.my_handler hello_world.py -Creating directory: irontest/hello_world:1 ... OK -Creating Dockerfile: irontest/hello_world:1/Dockerfile ... OK -Copying file: irontest/hello_world/hello_world:1.py ... OK -Creating function.yaml ... OK -``` - -As you can see, this is very similar to creating a Lambda function using the -`aws` CLI tool. We name the function as we would name other Docker images. The -`1` indicates the version. You can use any string. This way you can configure -your deployment environment to use different versions. The handler is -the name of the function to run, in the form that python expects -(`module.function`). Where you would package the files into a `.zip` to upload -to Lambda, we just pass the list of files to `fn`. - -## Deploying the function to IronFunctions - -Next we want to deploy the function to our IronFunctions -```sh - $ fn deploy -v -d ./irontest irontest - deploying irontest/hello_world:1/function.yaml - Sending build context to Docker daemon 4.096 kB - Step 1 : FROM iron/lambda-python2.7 - latest: Pulling from iron/lambda-python2.7 - c52e3ed763ff: Pull complete - 789cf808491a: Pull complete - d1b635efed57: Pull complete - fe23c3dbcfa8: Pull complete - 63c874a9687e: Pull complete - a6d462dae1df: Pull complete - Digest: sha256:c5dde3bf3be776c0f6b909d4ad87255a0af9b6696831fbe17c5f659655a0494a - Status: Downloaded newer image for iron/lambda-python2.7:latest - ---> 66d3adf47835 - Step 2 : ADD hello_world.py ./hello_world:1.py - ---> 91a592e0dfa9 - Removing intermediate container 1a1ef40ff0dd - Step 3 : CMD hello_world.my_handler - ---> Running in 318da1bba060 - ---> db9b9644168e - Removing intermediate container 318da1bba060 - Successfully built db9b9644168e - The push refers to a repository [docker.io/irontest/hello_world:1] - 5d9d142e21b2: Pushed - 11d8145d6038: Layer already exists - 23885f85dbd0: Layer already exists - 6a350a8d14ee: Layer already exists - e67f7ef625c5: Layer already exists - 321db514ef85: Layer already exists - 6102f0d2ad33: Layer already exists - latest: digest: sha256:5926ff413f134fa353e4b42f2d4a0d2d4f5b3a39489cfdf6dd5b4a63c4e40dee size: 1784 - updating API with appName: irontest route: /hello_world:1 image: irontest/hello_world:1 - path result - irontest/hello_world:1/function.yaml done -``` - -This will deploy the generated function under the app `irontest` with `hello_world` as a route, e.g: -`http:///r/irontest/hello_world:1`, - -You should also now see the generated Docker image. - -```sh - $ docker images - REPOSITORY TAG IMAGE ID CREATED VIRTUAL SIZE - irontest/hello_world:1 latest db9b9644168e About a minute ago 108.4 MB - ... -``` - -## Testing the function - -The `test-function` subcommand can launch the Dockerized function with the -right parameters. - -```sh - $ fn lambda test-function irontest/hello_world:1 --payload '{ "first_name": "Jon", "last_name": "Snow" }' - {"message": "Hello Jon Snow!"} -``` - -You should see the output. - -## Calling the function from IronFunctions - -The `fn call` command can call the deployed version with a given payload. - -```sh - $ echo '{ "first_name": "Jon", "last_name": "Snow" }' | ./fn call irontest /hello_world:1 - {"message": "Hello Jon Snow!"} -``` - -You should see the output. - - -## Commands documentation -* [create-function](create.md) -* [test-function](test.md) -* [aws-import](import.md) - -## More documentation -* [env](environment.md) -* [aws](aws.md) \ No newline at end of file diff --git a/docs/lambda/import.md b/docs/lambda/import.md index d190e3d39..71f7f08b2 100644 --- a/docs/lambda/import.md +++ b/docs/lambda/import.md @@ -38,7 +38,7 @@ fn lambda aws-import arn:aws:lambda:us-west-2:123141564251:function:my-function will import the function code from the region `us-east-1` to a directory called `./user/my-function`. Inside the directory you will find the `function.yml`, `Dockerfile`, and all the files needed for running the function. -Using Lambda with Docker Hub and IronFunctions requires that the Docker image be +Using Lambda with Docker Hub and Oracle Functions requires that the Docker image be named `/`. This is used to uniquely identify images on Docker Hub. Please use the `/` as the image name with `aws-import` to create a correctly named image. @@ -50,6 +50,6 @@ by passing `--version .` You can then deploy the imported lambda as follows: ``` -./fn deploy -d ./user/my-function user +./fn deploy myapp ```` Now the function can be reached via ```http://$HOSTNAME/r/user/my-function``` \ No newline at end of file diff --git a/docs/operating/databases/README.md b/docs/operating/databases/README.md index 8b1f5d6c8..0b23275ee 100644 --- a/docs/operating/databases/README.md +++ b/docs/operating/databases/README.md @@ -20,7 +20,7 @@ the directory on your host. eg: `docker run -v $PWD/data:/functions/data -e DB_U URL: `postgres://user123:pass456@ec2-117-21-174-214.compute-1.amazonaws.com:6212/db982398` -Use a PostgreSQL database. If you're using IronFunctions in production, you should probably start here. +Use a PostgreSQL database. If you're using Functions in production, you should probably start here. [More on PostgreSQL](postgres.md) diff --git a/docs/operating/databases/boltdb.md b/docs/operating/databases/boltdb.md index 979ca9c7e..e5a9dde21 100644 --- a/docs/operating/databases/boltdb.md +++ b/docs/operating/databases/boltdb.md @@ -1,4 +1,4 @@ -# IronFunctions using BoltDB +# Oracle Functions using BoltDB BoltDB is the default database, you just need to run the API. @@ -7,5 +7,5 @@ BoltDB is the default database, you just need to run the API. To keep it persistent, add a volume flag to the command: ``` -docker run --rm -it --privileged -v $PWD/bolt.db:/app/bolt.db -p 8080:8080 iron/functions -``` \ No newline at end of file +docker run --rm -it --privileged -v $PWD/bolt.db:/app/bolt.db -p 8080:8080 treeder/functions +``` diff --git a/docs/operating/databases/mysql.md b/docs/operating/databases/mysql.md index c1501e2b5..3ea0689eb 100644 --- a/docs/operating/databases/mysql.md +++ b/docs/operating/databases/mysql.md @@ -1,20 +1,20 @@ -# IronFunctions using Postgres +# Oracle Functions using Postgres Let's presuppose you don't have even a MySQL DB ready. ### 1. Let's start a MySQL instance: ``` -docker run --name iron-mysql \ - -e MYSQL_DATABASE=funcs -e MYSQL_USER=iron -e MYSQL_PASSWORD=ironfunctions -d mysql +docker run --name func-mysql \ + -e MYSQL_DATABASE=funcs -e MYSQL_USER=funcy -e MYSQL_PASSWORD=funcypass -d mysql ``` For more configuration options, see [docker mysql docs](https://hub.docker.com/_/mysql/). -### 2. Now let's start IronFunctions connecting to our new mysql instance +### 2. Now let's start Functions connecting to our new mysql instance ``` docker run --rm --privileged --link "iron-mysql:mysql" \ - -e "DB_URL=mysql://iron:ironfunctions@tcp(mysql:3306)/funcs" \ - -it -p 8080:8080 iron/functions + -e "DB_URL=mysql://funcy:funcypass@tcp(mysql:3306)/funcs" \ + -it -p 8080:8080 treeder/functions ``` diff --git a/docs/operating/databases/postgres.md b/docs/operating/databases/postgres.md index 5d851a586..baca7af4e 100644 --- a/docs/operating/databases/postgres.md +++ b/docs/operating/databases/postgres.md @@ -1,34 +1,34 @@ -# IronFunctions using Postgres +# Oracle Functions using Postgres Let's presuppose you don't have even a postgres DB ready. ### 1. Let's start a postgres instance: ``` -docker run --name iron-postgres \ - -e POSTGRES_PASSWORD=ironfunctions -d postgres +docker run --name funcy-postgres \ + -e POSTGRES_PASSWORD=funcypass -d postgres ``` -### 2. Now let's create a new database to IronFunctions +### 2. Now let's create a new database for Functions Creating database: ``` -docker run -it --rm --link iron-postgres:postgres postgres \ +docker run -it --rm --link funcy-postgres:postgres postgres \ psql -h postgres -U postgres -c "CREATE DATABASE funcs;" ``` Granting access to postgres user ``` -docker run -it --rm --link iron-postgres:postgres postgres \ +docker run -it --rm --link funcy-postgres:postgres postgres \ psql -h postgres -U postgres -c 'GRANT ALL PRIVILEGES ON DATABASE funcs TO postgres;' ``` -### 3. Now let's start IronFunctions connecting to our new postgres instance +### 3. Now let's start Functions connecting to our new postgres instance ``` docker run --rm --privileged --link "iron-postgres:postgres" \ - -e "DB_URL=postgres://postgres:ironfunctions@postgres/funcs?sslmode=disable" \ - -it -p 8080:8080 iron/functions + -e "DB_URL=postgres://postgres:funcypass@postgres/funcs?sslmode=disable" \ + -it -p 8080:8080 treeder/functions ``` diff --git a/docs/operating/docker-swarm/README.md b/docs/operating/docker-swarm/README.md index aa938f2c1..f395b79ac 100644 --- a/docs/operating/docker-swarm/README.md +++ b/docs/operating/docker-swarm/README.md @@ -1,6 +1,6 @@ -# Docker Swarm and IronFunctions +# Docker Swarm and Oracle Functions -How to run IronFunction as a scheduler on top of Docker Standalone Swarm cluster. +How to run Oracle Functions as a scheduler on top of Docker Standalone Swarm cluster. ## Quick installation @@ -8,11 +8,11 @@ How to run IronFunction as a scheduler on top of Docker Standalone Swarm cluster *Prerequisite 2: It assumes that your running environment is already configured to use Swarm's master scheduler.* -This is a step-by-step procedure to execute IronFunction on top of Docker Swarm cluster. It works by having IronFunction daemon started through Swarm's master, and there enqueueing tasks through Swarm API. +This is a step-by-step procedure to execute Oracle Functions on top of Docker Swarm cluster. It works by having Oracle Functions daemon started through Swarm's master, and there enqueueing tasks through Swarm API. ### Steps -1. Start IronFunction in the Swarm Master. It expects all basic Docker environment variables to be present (DOCKER_TLS_VERIFY, DOCKER_HOST, DOCKER_CERT_PATH, DOCKER_MACHINE_NAME). The important part is that the working Swarm master environment must be passed to Functions daemon: +1. Start Oracle Functions in the Swarm Master. It expects all basic Docker environment variables to be present (DOCKER_TLS_VERIFY, DOCKER_HOST, DOCKER_CERT_PATH, DOCKER_MACHINE_NAME). The important part is that the working Swarm master environment must be passed to Functions daemon: ```ShellSession $ docker login # if you plan to use private images $ docker volume create --name functions-datafiles @@ -24,7 +24,7 @@ $ docker run -d --name functions \ -e DOCKER_MACHINE_NAME \ -v $DOCKER_CERT_PATH:/docker-cert \ -v functions-datafiles:/app/data \ - iron/functions + treeder/functions ``` 2. Once the daemon is started, check where it is listening for connections: @@ -32,23 +32,23 @@ $ docker run -d --name functions \ ```ShellSession # docker info CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES -5a0846e6a025 iron/functions "/usr/local/bin/entry" 59 seconds ago Up 58 seconds 2375/tcp, 10.0.0.1:8080->8080/tcp swarm-agent-00/functions +5a0846e6a025 treeder/functions "/usr/local/bin/entry" 59 seconds ago Up 58 seconds 2375/tcp, 10.0.0.1:8080->8080/tcp swarm-agent-00/functions ```` -Note `10.0.0.1:8080` in `PORTS` column, this is where the service is listening. IronFunction will use Docker Swarm scheduler to deliver tasks to all nodes present in the cluster. +Note `10.0.0.1:8080` in `PORTS` column, this is where the service is listening. Oracle Functions will use Docker Swarm scheduler to deliver tasks to all nodes present in the cluster. 3. Test the cluster: ```ShellSession -$ export IRON_FUNCTION=$(docker port functions | cut -d ' ' -f3) +$ export FUNCTIONS=$(docker port functions | cut -d ' ' -f3) -$ curl -H "Content-Type: application/json" -X POST -d '{ "app": { "name":"myapp" } }' http://$IRON_FUNCTION/v1/apps +$ curl -H "Content-Type: application/json" -X POST -d '{ "app": { "name":"myapp" } }' http://$FUNCTIONS/v1/apps {"message":"App successfully created","app":{"name":"myapp","config":null}} -$ curl -H "Content-Type: application/json" -X POST -d '{ "route": { "type": "sync", "path":"/hello-sync", "image":"iron/hello" } }' http://$IRON_FUNCTION/v1/apps/myapp/routes -{"message":"Route successfully created","route":{"app_name":"myapp","path":"/hello-sync","image":"iron/hello","memory":128,"type":"sync","config":null}} +$ curl -H "Content-Type: application/json" -X POST -d '{ "route": { "type": "sync", "path":"/hello-sync", "image":"treeder/hello" } }' http://$FUNCTIONS/v1/apps/myapp/routes +{"message":"Route successfully created","route":{"app_name":"myapp","path":"/hello-sync","image":"treeder/hello","memory":128,"type":"sync","config":null}} -$ curl -H "Content-Type: application/json" -X POST -d '{ "name":"Johnny" }' http://$IRON_FUNCTION/r/myapp/hello-sync +$ curl -H "Content-Type: application/json" -X POST -d '{ "name":"Johnny" }' http://$FUNCTIONS/r/myapp/hello-sync Hello Johnny! ``` @@ -58,7 +58,7 @@ Hello Johnny! *Prerequisite 2: It assumes that your running environment is already configured to use Swarm's master scheduler.* -This is a step-by-step procedure to execute IronFunction on top of Docker Swarm cluster. It works by having IronFunction daemon started through Swarm's master, however the tasks are executed on each host locally. In production, database and message queue must be external to IronFunction execution, this guarantees robustness of the service against failures. +This is a step-by-step procedure to execute Oracle Functions on top of Docker Swarm cluster. It works by having Oracle Functions daemon started through Swarm's master, however the tasks are executed on each host locally. In production, database and message queue must be external to Oracle Functions execution, this guarantees robustness of the service against failures. We strongly recommend you deploy your own HA Redis and PostgreSQL clusters. Otherwise, you can follow the instructions below and have them set in single nodes. @@ -74,7 +74,7 @@ docker-machine create -d virtualbox --swarm --swarm-master --swarm-discovery etc # Set aside one host for DB activities docker-machine create -d virtualbox --engine-label use=db --swarm --swarm-discovery etcd://$ETCD_HOST:2379/swarm --engine-opt="cluster-store=etcd://$ETCD_HOST:2379/network" --engine-opt="cluster-advertise=eth1:2376" swarm-db; -# The rest is a horizontally scalable set of hosts for IronFunction +# The rest is a horizontally scalable set of hosts for Oracle Functions docker-machine create -d virtualbox --engine-label use=worker --swarm --swarm-discovery etcd://$ETCD_HOST:2379/swarm --engine-opt="cluster-store=etcd://$ETCD_HOST:2379/network" --engine-opt="cluster-advertise=eth1:2376" swarm-worker-00; docker-machine create -d virtualbox --engine-label use=worker --swarm --swarm-discovery etcd://$ETCD_HOST:2379/swarm --engine-opt="cluster-store=etcd://$ETCD_HOST:2379/network" --engine-opt="cluster-advertise=eth1:2376" swarm-worker-01 ``` @@ -83,7 +83,7 @@ docker-machine create -d virtualbox --engine-label use=worker --swarm --swarm-di If you using externally deployed Redis and PostgreSQL cluster, you may skip to step 4. -1. Build a multi-host network for IronFunction: +1. Build a multi-host network for Oracle Functions: ```ShellSession $ docker network create --driver overlay --subnet=10.0.9.0/24 functions-network ```` @@ -100,7 +100,7 @@ $ docker create -e constraint:use==db --network=functions-network -v /var/lib/po $ docker run -d -e constraint:use==db --network=functions-network --volumes-from postgresql-data --name functions-postgres -e POSTGRES_PASSWORD=mysecretpassword postgres ``` -4. Start IronFunctions: +4. Start Oracle Functions: ```ShellSession $ docker run -d --name functions-00 \ -l functions \ @@ -110,7 +110,7 @@ $ docker run -d --name functions-00 \ -v /var/run/docker.sock:/var/run/docker.sock \ -e 'MQ_URL=redis://functions-redis' \ -e 'DB_URL=postgres://postgres:mysecretpassword@functions-postgres/?sslmode=disable' \ - iron/functions + treeder/functions ``` 5. Load Balancer: @@ -120,14 +120,14 @@ $ export BACKENDS=$(docker ps --filter label=functions --format="{{ .ID }}" | xa $ docker run -d --name functions-lb -p 80:80 -e BACKENDS noqcks/haproxy -$ export IRON_FUNCTION=$(docker port functions-lb | cut -d ' ' -f3) +$ export FUNCTIONS=$(docker port functions-lb | cut -d ' ' -f3) -$ curl -H "Content-Type: application/json" -X POST -d '{ "app": { "name":"myapp" } }' http://$IRON_FUNCTION/v1/apps +$ curl -H "Content-Type: application/json" -X POST -d '{ "app": { "name":"myapp" } }' http://$FUNCTIONS/v1/apps {"message":"App successfully created","app":{"name":"myapp","config":null}} -$ curl -H "Content-Type: application/json" -X POST -d '{ "route": { "type": "sync", "path":"/hello-sync", "image":"iron/hello" } }' http://$IRON_FUNCTION/v1/apps/myapp/routes -{"message":"Route successfully created","route":{"app_name":"myapp","path":"/hello-sync","image":"iron/hello","memory":128,"type":"sync","config":null}} +$ curl -H "Content-Type: application/json" -X POST -d '{ "route": { "type": "sync", "path":"/hello-sync", "image":"treeder/hello" } }' http://$FUNCTIONS/v1/apps/myapp/routes +{"message":"Route successfully created","route":{"app_name":"myapp","path":"/hello-sync","image":"treeder/hello","memory":128,"type":"sync","config":null}} -$ curl -H "Content-Type: application/json" -X POST -d '{ "name":"Johnny" }' http://$IRON_FUNCTION/r/myapp/hello-sync +$ curl -H "Content-Type: application/json" -X POST -d '{ "name":"Johnny" }' http://$FUNCTIONS/r/myapp/hello-sync Hello Johnny! ``` diff --git a/docs/operating/extending.md b/docs/operating/extending.md index b5d6c9640..941bfc4a7 100644 --- a/docs/operating/extending.md +++ b/docs/operating/extending.md @@ -1,16 +1,16 @@ -# Extending IronFunctions +# Extending Oracle Functions -IronFunctions is extensible so you can add custom functionality and extend the project without needing to modify the core. +Oracle Functions is extensible so you can add custom functionality and extend the project without needing to modify the core. -There are multiple ways to extend the functionality of IronFunctions. +There are multiple ways to extend the functionality of Oracle Functions. 1. Listeners - listen to API events such as a route getting updated and react accordingly. 1. Middleware - a chain of middleware is executed before an API handler is called. -1. Add API Endpoints - extend the default IronFunctions API. +1. Add API Endpoints - extend the default Oracle Functions API. ## Listeners -Listeners are the main way to extend IronFunctions. +Listeners are the main way to extend Oracle Functions. The following listener types are supported: @@ -19,7 +19,7 @@ The following listener types are supported: ### Creating a Listener -You can easily use app and runner listeners by creating a struct with valid methods satisfying the interface for the respective listener and adding it to the IronFunctions API +You can easily use app and runner listeners by creating a struct with valid methods satisfying the interface for the respective listener and adding it to the Oracle Functions API Example: @@ -67,6 +67,6 @@ See examples of this in [examples/middleware/main.go](../../examples/middleware/ ## Adding API Endpoints -You can add API endpoints to the IronFunctions server by using the `AddEndpoint` and `AddEndpointFunc` methods. +You can add API endpoints to the Oracle Functions server by using the `AddEndpoint` and `AddEndpointFunc` methods. See examples of this in [examples/extensions/main.go](../../examples/extensions/main.go). \ No newline at end of file diff --git a/docs/operating/kubernetes/README.md b/docs/operating/kubernetes/README.md index ea933971c..20965aab4 100644 --- a/docs/operating/kubernetes/README.md +++ b/docs/operating/kubernetes/README.md @@ -1,4 +1,4 @@ -# HOWTO run IronFunction in Kubernetes at AWS +# HOWTO run Oracle Functions in Kubernetes at AWS *Prerequisite 1: it assumes you have a working Kubernetes, and a locally configured kubectl.* @@ -9,7 +9,7 @@ ### Steps -1. Start IronFunction in the Kubernetes cluster: +1. Start Oracle Functions in the Kubernetes cluster: ```ShellSession $ cd docs/ $ kubectl create -f kubernetes-quick @@ -44,15 +44,15 @@ Note `a23122e39900111e681ba0e29b70bb46-630391493.us-east-1.elb.amazonaws.com` in 3. Test the cluster: ```ShellSession -$ export IRON_FUNCTION=$(kubectl get -o json svc functions | jq -r '.status.loadBalancer.ingress[0].hostname'):8080 +$ export FUNCTIONS=$(kubectl get -o json svc functions | jq -r '.status.loadBalancer.ingress[0].hostname'):8080 -$ curl -H "Content-Type: application/json" -X POST -d '{ "app": { "name":"myapp" } }' http://$IRON_FUNCTION/v1/apps +$ curl -H "Content-Type: application/json" -X POST -d '{ "app": { "name":"myapp" } }' http://$FUNCTIONS/v1/apps {"message":"App successfully created","app":{"name":"myapp","config":null}} -$ curl -H "Content-Type: application/json" -X POST -d '{ "route": { "type": "sync", "path":"/hello-sync", "image":"iron/hello" } }' http://$IRON_FUNCTION/v1/apps/myapp/routes -{"message":"Route successfully created","route":{"app_name":"myapp","path":"/hello-sync","image":"iron/hello","memory":128,"type":"sync","config":null}} +$ curl -H "Content-Type: application/json" -X POST -d '{ "route": { "type": "sync", "path":"/hello-sync", "image":"treeder/hello" } }' http://$FUNCTIONS/v1/apps/myapp/routes +{"message":"Route successfully created","route":{"app_name":"myapp","path":"/hello-sync","image":"treeder/hello","memory":128,"type":"sync","config":null}} -$ curl -H "Content-Type: application/json" -X POST -d '{ "name":"Johnny" }' http://$IRON_FUNCTION/r/myapp/hello-sync +$ curl -H "Content-Type: application/json" -X POST -d '{ "name":"Johnny" }' http://$FUNCTIONS/r/myapp/hello-sync Hello Johnny! ``` @@ -60,7 +60,7 @@ Hello Johnny! ### Steps -1. Start IronFunction and its dependencies: +1. Start Oracle Functions and its dependencies: ```ShellSession $ cd docs/ $ kubectl create -f kubernetes-production @@ -97,14 +97,14 @@ Note `a23122e39900111e681ba0e29b70bb46-630391493.us-east-1.elb.amazonaws.com` in 3. Test the cluster: ```ShellSession -$ export IRON_FUNCTION=$(kubectl get -o json svc functions | jq -r '.status.loadBalancer.ingress[0].hostname'):8080 +$ export FUNCTIONS=$(kubectl get -o json svc functions | jq -r '.status.loadBalancer.ingress[0].hostname'):8080 -$ curl -H "Content-Type: application/json" -X POST -d '{ "app": { "name":"myapp" } }' http://$IRON_FUNCTION/v1/apps +$ curl -H "Content-Type: application/json" -X POST -d '{ "app": { "name":"myapp" } }' http://$FUNCTIONS/v1/apps {"message":"App successfully created","app":{"name":"myapp","config":null}} -$ curl -H "Content-Type: application/json" -X POST -d '{ "route": { "type": "sync", "path":"/hello-sync", "image":"iron/hello" } }' http://$IRON_FUNCTION/v1/apps/myapp/routes -{"message":"Route successfully created","route":{"app_name":"myapp","path":"/hello-sync","image":"iron/hello","memory":128,"type":"sync","config":null}} +$ curl -H "Content-Type: application/json" -X POST -d '{ "route": { "type": "sync", "path":"/hello-sync", "image":"treeder/hello" } }' http://$FUNCTIONS/v1/apps/myapp/routes +{"message":"Route successfully created","route":{"app_name":"myapp","path":"/hello-sync","image":"treeder/hello","memory":128,"type":"sync","config":null}} -$ curl -H "Content-Type: application/json" -X POST -d '{ "name":"Johnny" }' http://$IRON_FUNCTION/r/myapp/hello-sync +$ curl -H "Content-Type: application/json" -X POST -d '{ "name":"Johnny" }' http://$FUNCTIONS/r/myapp/hello-sync Hello Johnny! ``` \ No newline at end of file diff --git a/docs/operating/kubernetes/kubernetes-production/functions-deployment.yaml b/docs/operating/kubernetes/kubernetes-production/functions-deployment.yaml index 13f8378d0..8caaa7bfa 100644 --- a/docs/operating/kubernetes/kubernetes-production/functions-deployment.yaml +++ b/docs/operating/kubernetes/kubernetes-production/functions-deployment.yaml @@ -14,7 +14,7 @@ spec: spec: containers: - name: functions - image: iron/functions + image: treeder/functions securityContext: privileged: true env: diff --git a/docs/operating/kubernetes/kubernetes-quick/deployment.yaml b/docs/operating/kubernetes/kubernetes-quick/deployment.yaml index ba45ff24a..83766ca49 100644 --- a/docs/operating/kubernetes/kubernetes-quick/deployment.yaml +++ b/docs/operating/kubernetes/kubernetes-quick/deployment.yaml @@ -14,7 +14,7 @@ spec: spec: containers: - name: functions - image: iron/functions + image: treeder/functions securityContext: privileged: true env: diff --git a/docs/operating/logging.md b/docs/operating/logging.md index 48383bccd..9df73fb2f 100644 --- a/docs/operating/logging.md +++ b/docs/operating/logging.md @@ -1,6 +1,6 @@ # Logging -There are a few things to note about what IronFunctions logs. +There are a few things to note about what Oracle Functions logs. ## Logspout diff --git a/docs/operating/mqs/README.md b/docs/operating/mqs/README.md index 8349d8b65..c08d2d7ff 100644 --- a/docs/operating/mqs/README.md +++ b/docs/operating/mqs/README.md @@ -1,6 +1,6 @@ # Message Queues -A message queue is used to coordinate asynchronous function calls that run through IronFunctions. +A message queue is used to coordinate asynchronous function calls that run through Oracle Functions. We currently support the following message queues and they are passed in via the `MQ_URL` environment variable. For example: @@ -23,7 +23,7 @@ See Redis in databases above. URL: `ironmq://project_id:token@mq-aws-us-east-1.iron.io/queue_prefix` -IronMQ is a hosted message queue service provided by [Iron.io](http://iron.io). If you're using IronFunctions in production and don't +IronMQ is a hosted message queue service provided by [Iron.io](http://iron.io). If you're using Oracle Functions in production and don't want to manage a message queue, you should start here. The IronMQ connector uses HTTPS by default. To use HTTP set the scheme to diff --git a/docs/operating/options.md b/docs/operating/options.md index a9e7f672e..888653291 100644 --- a/docs/operating/options.md +++ b/docs/operating/options.md @@ -1,8 +1,8 @@ -# IronFunctions Runtime Options +# Oracle Functions Runtime Options ## Configuration -When starting IronFunctions, you can pass in the following configuration variables as environment variables. Use `-e VAR_NAME=VALUE` in +When starting Oracle Functions, you can pass in the following configuration variables as environment variables. Use `-e VAR_NAME=VALUE` in docker run. For example: ```sh @@ -13,7 +13,7 @@ docker run -e VAR_NAME=VALUE ... | --------------|-------------|----------------| | DB_URL | The database URL to use in URL format. See [Databases](databases/README.md) for more information. | bolt:///app/data/bolt.db | | MQ_URL | The message queue to use in URL format. See [Message Queues](mqs/README.md) for more information. | bolt:///app/data/worker_mq.db | -| API_URL | The primary IronFunctions API URL to that this instance will talk to. In a production environment, this would be your load balancer URL. | N/A | +| API_URL | The primary Oracle Functions API URL to that this instance will talk to. In a production environment, this would be your load balancer URL. | N/A | | PORT | Sets the port to run on | 8080 | | LOG_LEVEL | Set to DEBUG to enable debugging | INFO | | DOCKER_HOST | Docker remote API URL | /var/run/docker.sock:/var/run/docker.sock | @@ -23,12 +23,12 @@ docker run -e VAR_NAME=VALUE ... ## Starting without Docker in Docker -The default way to run IronFunctions, as it is in the Quickstart guide, is to use docker-in-docker (dind). There are +The default way to run Oracle Functions, as it is in the Quickstart guide, is to use docker-in-docker (dind). There are a couple reasons why we did it this way: * It's clean. Once the container exits, there is nothing left behind including all the function images. -* You can set resource restrictions for the entire IronFunctions instance. For instance, you can set `--memory` on -the docker run command to set the max memory for the IronFunctions instance AND all of the functions it's running. +* You can set resource restrictions for the entire Oracle Functions instance. For instance, you can set `--memory` on +the docker run command to set the max memory for the Oracle Functions instance AND all of the functions it's running. There are some reasons you may not want to use dind, such as using the image cache during testing or you're running [Windows](windows.md). @@ -38,7 +38,7 @@ There are some reasons you may not want to use dind, such as using the image cac One way is to mount the host Docker. Everything is essentially the same except you add a `-v` flag: ```sh -docker run --rm --name functions -it -v /var/run/docker.sock:/var/run/docker.sock -v $PWD/data:/app/data -p 8080:8080 iron/functions +docker run --rm --name functions -it -v /var/run/docker.sock:/var/run/docker.sock -v $PWD/data:/app/data -p 8080:8080 treeder/functions ``` ### Run outside Docker diff --git a/docs/operating/production.md b/docs/operating/production.md index dd606d0f1..e67b5f94a 100644 --- a/docs/operating/production.md +++ b/docs/operating/production.md @@ -1,19 +1,19 @@ -# Running IronFunctions in Production +# Running Oracle Functions in Production The [QuickStart guide](/README.md#quickstart) is intended to quickly get started and kick the tires. To run in production and be ready to scale, you need to use more production ready components. -* Put the IronFunctions API behind a load balancer and launch run several instances of them (the more the merrier). +* Put the Oracle Functions API behind a load balancer and launch run several instances of them (the more the merrier). * Run a database that can scale. * Asynchronous functions requires a message queue (preferably one that scales). Here's a rough diagram of what a production deployment looks like: -![IronFunctions Architecture Diagram](../assets/architecture.png) +![Oracle Functions Architecture Diagram](../assets/architecture.png) ## Load Balancer -Any load balancer will work, put every instance of IronFunctions that you run behind the load balancer. +Any load balancer will work, put every instance of Oracle Functions that you run behind the load balancer. **Note**: We will work on a smart load balancer that can direct traffic in a smarter way. See [#151](https://github.com/treeder/functions/issues/151). @@ -26,13 +26,13 @@ The database is pluggable and we currently support a few options that can be [fo ## Message Queue The message queue is an important part of asynchronous functions, essentially buffering requests for processing when resources are available. The reliability and scale of the message queue will play an important part -in how well IronFunctions runs, in particular if you use a lot of asynchronous function calls. +in how well Oracle Functions runs, in particular if you use a lot of asynchronous function calls. The message queue is pluggable and we currently support a few options that can be [found here](mqs/README.md). We welcome pull requests for more! ## Logging, Metrics and Monitoring -Logging is a particularly important part of IronFunctions. It not only emits logs, but metrics are also emitted to the logs. Ops teams can then decide how they want +Logging is a particularly important part of Oracle Functions. It not only emits logs, but metrics are also emitted to the logs. Ops teams can then decide how they want to use the logs and metrics without us prescribing a particular technology. For instance, you can [logspout-statsd](https://github.com/treeder/logspout-statsd) to capture metrics from the logs and forward them to statsd. @@ -41,5 +41,5 @@ from the logs and forward them to statsd. ## Scaling There are metrics emitted to the logs that can be used to notify you when to scale. The most important being the `wait_time` metrics for both the -synchronous and asynchronous functions. If `wait_time` increases, you'll want to start more IronFunctions instances. +synchronous and asynchronous functions. If `wait_time` increases, you'll want to start more Oracle Functions instances. diff --git a/docs/operating/routes.md b/docs/operating/routes.md index 88c7327be..37be4f6cb 100644 --- a/docs/operating/routes.md +++ b/docs/operating/routes.md @@ -1,8 +1,8 @@ -# IronFunctions Routes +# Oracle Functions Routes Routes have a many-to-one mapping to an [app](apps.md). -A good practice to get the best performance on your IronFunctions API is define +A good practice to get the best performance on your Oracle Functions API is define the required memory for each function. ## Route level configuration @@ -26,9 +26,9 @@ Note: Route level configuration overrides app level configuration. TODO: link to swagger doc on swaggerhub after it's updated. -## Understanding IronFunctions memory management +## Understanding Oracle Functions memory management -When IronFunctions starts it registers the total available memory in your system +When Oracle Functions starts it registers the total available memory in your system in order to know during its runtime if the system has the required amount of free memory to run each function. Every function starts the runner reduces the amount of memory used by that function from the available memory register. When @@ -56,7 +56,7 @@ some container configuration values. curl -H "Content-Type: application/json" -X POST -d '{ "route": { "path":"/hello", - "image":"iron/hello", + "image":"treeder/hello", "memory": 100, "type": "sync", "config": {"APPLOG": "stderr"} diff --git a/docs/operating/scaling.md b/docs/operating/scaling.md index 071f4d7c4..b0fdc5ee4 100644 --- a/docs/operating/scaling.md +++ b/docs/operating/scaling.md @@ -1,2 +1,2 @@ -# Scaling IronFunctions +# Scaling Oracle Functions diff --git a/docs/operating/triggers.md b/docs/operating/triggers.md index 41e69ca19..180ffaeca 100644 --- a/docs/operating/triggers.md +++ b/docs/operating/triggers.md @@ -1,6 +1,6 @@ # Triggers -Triggers are integrations that you can use in other systems to fire off functions in IronFunctions. +Triggers are integrations that you can use in other systems to fire off functions in Oracle Functions. ## OpenStack @@ -12,7 +12,7 @@ Triggers are integrations that you can use in other systems to fire off function * Kernel: 4.7 or newer with overlay2 or aufs module * Docker: 1.12 or newer -2. [Picasso](https://github.com/openstack/picasso) - Picasso provides an OpenStack API and Keystone authentication layer on top of IronFunctions. +2. [Picasso](https://github.com/openstack/picasso) - Picasso provides an OpenStack API and Keystone authentication layer on top of Oracle Functions. Please refer to the [Picasso on DevStack](https://github.com/openstack/picasso/blob/master/devstack/README.md) guide for setup instructions. ### Examples diff --git a/docs/operating/ui.md b/docs/operating/ui.md index a69a048f6..dc35dfa9e 100644 --- a/docs/operating/ui.md +++ b/docs/operating/ui.md @@ -1,9 +1,9 @@ -# User Interface for IronFunctions +# User Interface for Oracle Functions ### Run Functions UI ```sh -docker run --rm -it --link functions:api -p 4000:4000 -e "API_URL=http://api:8080" iron/functions-ui +docker run --rm -it --link functions:api -p 4000:4000 -e "API_URL=http://api:8080" treeder/functions-ui ``` For more information, see: https://github.com/treeder/functions-ui diff --git a/docs/operating/windows.md b/docs/operating/windows.md index f81530c53..3c03a83df 100644 --- a/docs/operating/windows.md +++ b/docs/operating/windows.md @@ -3,7 +3,7 @@ Windows doesn't support Docker in Docker so you'll change the run command to the following: ```sh -docker run --rm --name functions -it -v /var/run/docker.sock:/var/run/docker.sock -v ${pwd}/data:/app/data -p 8080:8080 iron/functions +docker run --rm --name functions -it -v /var/run/docker.sock:/var/run/docker.sock -v ${pwd}/data:/app/data -p 8080:8080 treeder/functions ``` Then everything should work as normal. diff --git a/docs/packaging.md b/docs/packaging.md index b1286e707..c58038a20 100644 --- a/docs/packaging.md +++ b/docs/packaging.md @@ -11,19 +11,13 @@ Once it's pushed to a registry, you can use it by referencing it when adding a r This is the easiest way to build, package and deploy your functions. - - - - -## - ### Creating an image The basic Dockerfile for most languages is along these lines: ``` # Choose base image -FROM iron/go +FROM golang:alpine # Set the working directory WORKDIR /function # Add your binary or code to the working directory @@ -35,7 +29,7 @@ ENTRYPOINT ["./funcbin"] Then you simply build your function: ```sh -docker run --rm -v ${pwd}:/go/src/$FUNCPKG -w /go/src/$FUNCPKG iron/go:dev go build -o funcbin +docker run --rm -v ${pwd}:/go/src/$FUNCPKG -w /go/src/$FUNCPKG funcy/go:dev go build -o funcbin docker build -t $USERNAME/myfunction . ``` diff --git a/docs/swagger.yml b/docs/swagger.yml index e86c391fa..59d953eba 100644 --- a/docs/swagger.yml +++ b/docs/swagger.yml @@ -1,10 +1,10 @@ -# This is the IronFunctions API spec +# This is the Oracle Functions API spec # If you make changes here, remember to run `go generate` in api/models/ and # api/server to make sure you use the changes. swagger: '2.0' info: - title: IronFunctions + title: Oracle Functions description: The open source serverless platform. version: "0.1.29" # the domain of the service diff --git a/examples/Dockerfile.glide b/examples/Dockerfile.glide index 996a8b7cf..c525a8438 100644 --- a/examples/Dockerfile.glide +++ b/examples/Dockerfile.glide @@ -1,4 +1,4 @@ -FROM iron/go:dev +FROM funcy/go:dev RUN mkdir -p /go/src/github.com/Masterminds ENV GOPATH=/go diff --git a/examples/blog/Dockerfile b/examples/blog/Dockerfile index f5f8ab200..9d6ee7329 100644 --- a/examples/blog/Dockerfile +++ b/examples/blog/Dockerfile @@ -1,5 +1,5 @@ -FROM iron/go +FROM alpine ADD func . -ENTRYPOINT ["./func"] \ No newline at end of file +ENTRYPOINT ["./func"] diff --git a/examples/blog/README.md b/examples/blog/README.md index 24f786021..7ed61114c 100644 --- a/examples/blog/README.md +++ b/examples/blog/README.md @@ -5,7 +5,7 @@ A simple serverless blog API ## Requirements - Remote MongoDB instance (for example heroku) -- Running IronFunctions API +- Running Oracle Functions API ## Development @@ -16,7 +16,7 @@ A simple serverless blog API USERNAME=YOUR_DOCKER_HUB_USERNAME # build it -docker run --rm -v "$PWD":/go/src/github.com/treeder/hello -w /go/src/github.com/treeder/hello iron/go:dev go build -o function +docker run --rm -v "$PWD":/go/src/github.com/treeder/hello -w /go/src/github.com/treeder/hello funcy/go:dev go build -o function docker build -t $USERNAME/func-blog . ``` @@ -31,9 +31,9 @@ docker tag $USERNAME/func-blog:latest $USERNAME/func-blog:`cat VERSION` docker push $USERNAME/func-blog ``` -## Running it on IronFunctions +## Running it on Oracle Functions -First you need a running IronFunctions API +First you need a running Oracle Functions API ### First, let's define this environment variables @@ -53,7 +53,7 @@ MONGODB=YOUR_MONGODB_ADDRESS ./test.sh ``` -### Running with IronFunctions +### Running with Oracle Functions With this command we are going to create an application with name `blog` and also defining the app configuration `DB`. @@ -101,7 +101,7 @@ curl -X POST --data '{ #### Testing function -Now that we created our IronFunction route, let's test our routes +Now that we created our Oracle Functions route, let's test our routes ``` curl -X POST http://$FUNCAPI/r/blog/posts diff --git a/examples/blog/build.sh b/examples/blog/build.sh index 198caaf19..663610afd 100755 --- a/examples/blog/build.sh +++ b/examples/blog/build.sh @@ -8,5 +8,5 @@ FUNCPKG=$(pwd | sed "s|$GOPATH/src/||") docker run --rm -v "$PWD":/go/src/$FUNCPKG -w /go/src/$FUNCPKG glide up # build image -docker run --rm -v "$PWD":/go/src/$FUNCPKG -w /go/src/$FUNCPKG iron/go:dev go build -o func -docker build -t iron/func-blog . \ No newline at end of file +docker run --rm -v "$PWD":/go/src/$FUNCPKG -w /go/src/$FUNCPKG funcy/go:dev go build -o func +docker build -t username/func-blog . diff --git a/examples/blog/func.yaml b/examples/blog/func.yaml index 541608545..b696b91c3 100644 --- a/examples/blog/func.yaml +++ b/examples/blog/func.yaml @@ -1,3 +1,3 @@ -name: iron/func-blog +name: username/func-blog build: - - ./build.sh \ No newline at end of file + - ./build.sh diff --git a/examples/blog/test.sh b/examples/blog/test.sh index 53be3d049..2a4ccae02 100755 --- a/examples/blog/test.sh +++ b/examples/blog/test.sh @@ -9,8 +9,8 @@ docker rm test-mongo-func docker run -p 27017:27017 --name test-mongo-func -d mongo -echo '{ "title": "My New Post", "body": "Hello world!", "user": "test" }' | docker run --rm -i -e METHOD=POST -e ROUTE=/posts -e DB=mongo:27017 --link test-mongo-func:mongo -e TEST=1 iron/func-blog -docker run --rm -i -e METHOD=GET -e ROUTE=/posts -e DB=mongo:27017 --link test-mongo-func:mongo -e TEST=1 iron/func-blog +echo '{ "title": "My New Post", "body": "Hello world!", "user": "test" }' | docker run --rm -i -e METHOD=POST -e ROUTE=/posts -e DB=mongo:27017 --link test-mongo-func:mongo -e TEST=1 username/func-blog +docker run --rm -i -e METHOD=GET -e ROUTE=/posts -e DB=mongo:27017 --link test-mongo-func:mongo -e TEST=1 username/func-blog docker stop test-mongo-func docker rm test-mongo-func \ No newline at end of file diff --git a/examples/caddy-lb/README.md b/examples/caddy-lb/README.md index 6dbee85f0..e46032477 100644 --- a/examples/caddy-lb/README.md +++ b/examples/caddy-lb/README.md @@ -1,19 +1,19 @@ -# IronFunctions Load Balance example using Caddy +# Oracle Functions Load Balance example using Caddy -Simple example of IronFunctions load balancer using Caddy Server +Simple example of Oracle Functions load balancer using Caddy Server -## Run IronFunctions +## Run Oracle Functions -Start the IronFunctions instances +Start the Oracle Functions instances -Ref: https://github.com/treeder/functions/blob/master/README.md#start-the-ironfunctions-api +Ref: https://github.com/treeder/functions/blob/master/README.md#start-the-functions-api ## Configure environment variable -Pass the host and port of IronFunctions instances in environment variables, -this example uses three IronFunctions instances. +Pass the host and port of Oracle Functions instances in environment variables, +this example uses three Oracle Functions instances. ```sh export LB_HOST01="172.17.0.1:8080" diff --git a/examples/caddy-lb/docker-compose.yml b/examples/caddy-lb/docker-compose.yml index 2841f9731..582beee81 100644 --- a/examples/caddy-lb/docker-compose.yml +++ b/examples/caddy-lb/docker-compose.yml @@ -1,12 +1,12 @@ -ironfunctions01: +functions01: restart: always - image: iron/functions -ironfunctions02: + image: treeder/functions +functions02: restart: always - image: iron/functions -ironfunctions03: + image: treeder/functions +functions03: restart: always - image: iron/functions + image: treeder/functions caddy: image: abiosoft/caddy volumes: @@ -14,10 +14,10 @@ caddy: ports: - "9000:9000" environment: - - LB_HOST01=ironfunctions01:8080 - - LB_HOST02=ironfunctions02:8080 - - LB_HOST03=ironfunctions03:8080 + - LB_HOST01=functions01:8080 + - LB_HOST02=functions02:8080 + - LB_HOST03=functions03:8080 links: - - ironfunctions01 - - ironfunctions02 - - ironfunctions03 \ No newline at end of file + - functions01 + - functions02 + - functions03 \ No newline at end of file diff --git a/examples/caddy-lb/func.yaml b/examples/caddy-lb/func.yaml index 6be246270..a4690ab9c 100644 --- a/examples/caddy-lb/func.yaml +++ b/examples/caddy-lb/func.yaml @@ -1,3 +1,3 @@ -name: iron/func-caddy-lb +name: username/func-caddy-lb build: - ./build.sh \ No newline at end of file diff --git a/examples/checker/Dockerfile b/examples/checker/Dockerfile index 44987d673..4c785796b 100644 --- a/examples/checker/Dockerfile +++ b/examples/checker/Dockerfile @@ -1,4 +1,4 @@ -FROM iron/ruby:dev +FROM funcy/ruby:dev WORKDIR /function ADD Gemfile /function/ diff --git a/examples/checker/README.md b/examples/checker/README.md index 823f45060..9847cd71f 100644 --- a/examples/checker/README.md +++ b/examples/checker/README.md @@ -4,7 +4,7 @@ This images compares the payload info with the header. ## Requirements -- IronFunctions API +- Oracle Functions API ## Development @@ -35,7 +35,7 @@ docker push $USERNAME/func-checker ./test.sh ``` -## Running it on IronFunctions +## Running it on Oracle Functions ### Let's define some environment variables @@ -45,7 +45,7 @@ docker push $USERNAME/func-checker FUNCAPI=YOUR_FUNCTIONS_ADDRESS ``` -### Running with IronFunctions +### Running with Oracle Functions With this command we are going to create an application with name `checker`. @@ -71,7 +71,7 @@ curl -X POST --data '{ #### Testing function -Now that we created our IronFunction route, let's test our new route +Now that we created our Oracle Functions route, let's test our new route ``` curl -X POST --data '{ "env_vars": { "test": "1" } }' http://$FUNCAPI/r/checker/check diff --git a/examples/checker/build.sh b/examples/checker/build.sh index 5d9cf9a94..b8bb7ca81 100755 --- a/examples/checker/build.sh +++ b/examples/checker/build.sh @@ -2,4 +2,4 @@ set -ex # build image -docker build -t iron/func-checker . \ No newline at end of file +docker build -t username/func-checker . \ No newline at end of file diff --git a/examples/checker/func.yaml b/examples/checker/func.yaml index 645f6ed01..f486ef72e 100644 --- a/examples/checker/func.yaml +++ b/examples/checker/func.yaml @@ -1,3 +1,3 @@ -name: iron/func-checker +name: username/func-checker build: - ./build.sh \ No newline at end of file diff --git a/examples/checker/test.sh b/examples/checker/test.sh index a3c9ff1c7..4a1996c06 100755 --- a/examples/checker/test.sh +++ b/examples/checker/test.sh @@ -6,4 +6,4 @@ set -x PAYLOAD='{"env_vars": {"FOO": "bar"}}' # test it -echo $PAYLOAD | docker run --rm -i -e TEST=1 -e FOO=bar iron/func-checker \ No newline at end of file +echo $PAYLOAD | docker run --rm -i -e TEST=1 -e FOO=bar username/func-checker \ No newline at end of file diff --git a/examples/echo/Dockerfile b/examples/echo/Dockerfile index e60bd3b48..5cd308034 100644 --- a/examples/echo/Dockerfile +++ b/examples/echo/Dockerfile @@ -1,4 +1,4 @@ -FROM iron/ruby:dev +FROM funcy/ruby:dev WORKDIR /function ADD Gemfile /function/ diff --git a/examples/echo/README.md b/examples/echo/README.md index 67e6f9f9a..193edf9a1 100644 --- a/examples/echo/README.md +++ b/examples/echo/README.md @@ -4,7 +4,7 @@ This images compares the payload info with the header. ## Requirements -- IronFunctions API +- Oracle Functions API ## Development @@ -35,7 +35,7 @@ docker push $USERNAME/func-echo ./test.sh ``` -## Running it on IronFunctions +## Running it on Oracle Functions ### Let's define some environment variables @@ -45,7 +45,7 @@ docker push $USERNAME/func-echo FUNCAPI=YOUR_FUNCTIONS_ADDRESS ``` -### Running with IronFunctions +### Running with Oracle Functions With this command we are going to create an application with name `echo`. @@ -70,7 +70,7 @@ curl -X POST --data '{ #### Testing function -Now that we created our IronFunction route, let's test our new route +Now that we created our Oracle Functions route, let's test our new route ``` curl -X POST --data '{"input": "yoooo"}' http://$FUNCAPI/r/echo/echo diff --git a/examples/echo/build.sh b/examples/echo/build.sh index 8b35ad511..38813619a 100755 --- a/examples/echo/build.sh +++ b/examples/echo/build.sh @@ -2,4 +2,4 @@ set -ex # build image -docker build -t iron/func-echo . \ No newline at end of file +docker build -t username/func-echo . \ No newline at end of file diff --git a/examples/echo/func.yaml b/examples/echo/func.yaml index 7266fe8b3..66e4b5021 100644 --- a/examples/echo/func.yaml +++ b/examples/echo/func.yaml @@ -1,3 +1,3 @@ -name: iron/func-echo +name: username/func-echo build: - ./build.sh \ No newline at end of file diff --git a/examples/echo/test.sh b/examples/echo/test.sh index ba4e41231..55cfce0f9 100755 --- a/examples/echo/test.sh +++ b/examples/echo/test.sh @@ -6,4 +6,4 @@ set -x PAYLOAD='{"input": "yoooo"}' # test it -echo $PAYLOAD | docker run --rm -i -e TEST=1 iron/func-echo \ No newline at end of file +echo $PAYLOAD | docker run --rm -i -e TEST=1 username/func-echo \ No newline at end of file diff --git a/examples/error/Dockerfile b/examples/error/Dockerfile index f810193e9..d347e76fa 100644 --- a/examples/error/Dockerfile +++ b/examples/error/Dockerfile @@ -1,4 +1,4 @@ -FROM iron/ruby:dev +FROM funcy/ruby:dev WORKDIR /worker ADD Gemfile* /worker/ diff --git a/examples/error/README.md b/examples/error/README.md index 3e210a9cf..6daccb3c4 100644 --- a/examples/error/README.md +++ b/examples/error/README.md @@ -4,7 +4,7 @@ This images compares the payload info with the header. ## Requirements -- IronFunctions API +- Oracle Functions API ## Development @@ -35,7 +35,7 @@ docker push $USERNAME/func-error ./test.sh ``` -## Running it on IronFunctions +## Running it on Oracle Functions ### Let's define some environment variables @@ -45,7 +45,7 @@ docker push $USERNAME/func-error FUNCAPI=YOUR_FUNCTIONS_ADDRESS ``` -### Running with IronFunctions +### Running with Oracle Functions With this command we are going to create an application with name `error`. @@ -70,7 +70,7 @@ curl -X POST --data '{ #### Testing function -Now that we created our IronFunction route, let's test our new route +Now that we created our Oracle Functions route, let's test our new route ``` curl -X POST --data '{"input": "yoooo"}' http://$FUNCAPI/r/error/error diff --git a/examples/error/build.sh b/examples/error/build.sh index c93fa16b0..e8702889b 100755 --- a/examples/error/build.sh +++ b/examples/error/build.sh @@ -1,4 +1,4 @@ #!/bin/bash set -ex -docker build -t iron/func-error . \ No newline at end of file +docker build -t username/func-error . \ No newline at end of file diff --git a/examples/error/func.yaml b/examples/error/func.yaml index 37345b04f..aa48cd735 100644 --- a/examples/error/func.yaml +++ b/examples/error/func.yaml @@ -1,3 +1,3 @@ -name: iron/func-error +name: username/func-error build: - ./build.sh \ No newline at end of file diff --git a/examples/error/test.sh b/examples/error/test.sh index 133cf550f..bf4d794dc 100755 --- a/examples/error/test.sh +++ b/examples/error/test.sh @@ -6,4 +6,4 @@ set -x PAYLOAD='{"input": "yoooo"}' # test it -echo $PAYLOAD | docker run --rm -i -e TEST=1 iron/func-error \ No newline at end of file +echo $PAYLOAD | docker run --rm -i -e TEST=1 username/func-error \ No newline at end of file diff --git a/examples/hash/README.md b/examples/hash/README.md index aaf247dbf..24b4a0c7a 100644 --- a/examples/hash/README.md +++ b/examples/hash/README.md @@ -6,10 +6,10 @@ Make sure you downloaded and installed [dotnet](https://www.microsoft.com/net/co dotnet new ``` -By default dotnet creates a ```Program.cs``` file with a main method. To make it work with IronFunction's `fn` tool please rename it to ```func.cs```. -Now change the code as you desire to do whatever magic you need it to do. Once done you can now create an iron function out of it. +By default dotnet creates a ```Program.cs``` file with a main method. To make it work with Oracle Functions's `fn` tool please rename it to ```func.cs```. +Now change the code as you desire to do whatever magic you need it to do. Once done you can now create a function out of it. -## Creating an IronFunction +## Creating an Oracle Functions Simply run ```bash @@ -31,7 +31,7 @@ fn push This will create a docker image and push the image to docker. -## Publishing to IronFunctions +## Publishing to Oracle Functions ```bash fn routes create diff --git a/examples/hello/go/README.md b/examples/hello/go/README.md index 0571e7073..ced7b8d99 100644 --- a/examples/hello/go/README.md +++ b/examples/hello/go/README.md @@ -1,6 +1,6 @@ # Quick Example for a Go Function (3 minutes) -This example will show you how to test and deploy Go (Golang) code to IronFunctions. +This example will show you how to test and deploy Go (Golang) code to Oracle Functions. ```sh # create your func.yaml file @@ -11,11 +11,11 @@ fn build cat hello.payload.json | fn run # push it to Docker Hub fn push -# Create a route to this function on IronFunctions +# Create a route to this function on Oracle Functions fn routes create myapp /hello ``` -Now you can call your function on IronFunctions: +Now you can call your function on Oracle Functions: ```sh curl -H "Content-Type: application/json" -X POST -d @hello.payload.json http://localhost:8080/r/myapp/hello diff --git a/examples/hello/node/README.md b/examples/hello/node/README.md index cc8ca5040..2a4baff97 100644 --- a/examples/hello/node/README.md +++ b/examples/hello/node/README.md @@ -1,6 +1,6 @@ ## Quick Example for a NodeJS Function (4 minutes) -This example will show you how to test and deploy a Node function to IronFunctions. +This example will show you how to test and deploy a Node function to Oracle Functions. ```sh # create your func.yaml file @@ -11,7 +11,7 @@ fn build cat hello.payload.json | fn run # push it to Docker Hub fn push -# Create a route to this function on IronFunctions +# Create a route to this function on Oracle Functions fn routes create myapp /hello ``` @@ -24,7 +24,7 @@ Create a [package.json](https://docs.npmjs.com/getting-started/using-a-package.j Run: ```sh -docker run --rm -v "$PWD":/function -w /function iron/node:dev npm install +docker run --rm -v "$PWD":/function -w /function funcy/node:dev npm install ``` Then everything should work. diff --git a/examples/hello/php/Dockerfile b/examples/hello/php/Dockerfile index e92bd9d0a..1da497e06 100644 --- a/examples/hello/php/Dockerfile +++ b/examples/hello/php/Dockerfile @@ -1,4 +1,4 @@ -FROM iron/php +FROM funcy/php WORKDIR /app ADD . /app diff --git a/examples/hello/php/README.md b/examples/hello/php/README.md index 88b01afcf..1ccc9b1d1 100644 --- a/examples/hello/php/README.md +++ b/examples/hello/php/README.md @@ -1,6 +1,6 @@ ## Quick Example for a PHP Function (4 minutes) -This example will show you how to test and deploy Go (Golang) code to IronFunctions. +This example will show you how to test and deploy Go (Golang) code to Oracle Functions. ### 1. Prepare the `func.yaml` file: @@ -11,7 +11,7 @@ name: USERNAME/hello version: 0.0.1 path: /hello build: -- docker run --rm -v "$PWD":/worker -w /worker iron/php:dev composer install +- docker run --rm -v "$PWD":/worker -w /worker funcy/php:dev composer install ``` The important step here is to ensure you replace `USERNAME` with your Docker Hub account name. Some points of note: @@ -27,7 +27,7 @@ fn build cat hello.payload.json | fn run # push it to Docker Hub fn push -# Create a route to this function on IronFunctions +# Create a route to this function on Oracle Functions fn routes create phpapp /hello ``` diff --git a/examples/hello/php/func.yaml b/examples/hello/php/func.yaml index 4a09ae8b5..027b012ee 100644 --- a/examples/hello/php/func.yaml +++ b/examples/hello/php/func.yaml @@ -2,4 +2,4 @@ name: USERNAME/hello version: 0.0.1 path: /hello build: -- docker run --rm -v "$PWD":/worker -w /worker iron/php:dev composer install +- docker run --rm -v "$PWD":/worker -w /worker funcy/php:dev composer install diff --git a/examples/hello/python/Dockerfile b/examples/hello/python/Dockerfile index b70c9eb48..3a7f4cd67 100644 --- a/examples/hello/python/Dockerfile +++ b/examples/hello/python/Dockerfile @@ -1,4 +1,4 @@ -FROM iron/python:2 +FROM funcy/python:2 WORKDIR /app ADD . /app diff --git a/examples/hello/python/README.md b/examples/hello/python/README.md index 3a05e76a7..cdce4655d 100644 --- a/examples/hello/python/README.md +++ b/examples/hello/python/README.md @@ -1,6 +1,6 @@ ## Quick Example for a Python Function (4 minutes) -This example will show you how to test and deploy Go (Golang) code to IronFunctions. +This example will show you how to test and deploy Go (Golang) code to Oracle Functions. ### 1. Prepare the `func.yaml` file: @@ -11,7 +11,7 @@ name: USERNAME/hello version: 0.0.1 path: /hello build: -- docker run --rm -v "$PWD":/worker -w /worker iron/python:2-dev pip install -t packages -r requirements.txt +- docker run --rm -v "$PWD":/worker -w /worker funcy/python:2-dev pip install -t packages -r requirements.txt ``` The important step here is to ensure you replace `USERNAME` with your Docker Hub account name. Some points of note: @@ -27,7 +27,7 @@ fn build cat hello.payload.json | fn run # push it to Docker Hub fn push -# Create a route to this function on IronFunctions +# Create a route to this function on Oracle Functions fn routes create pythonapp /hello ``` diff --git a/examples/hello/ruby/README.md b/examples/hello/ruby/README.md index cdbe579a7..05ef81eea 100644 --- a/examples/hello/ruby/README.md +++ b/examples/hello/ruby/README.md @@ -1,19 +1,19 @@ ## Quick Example for a Ruby Function (4 minutes) -This example will show you how to test and deploy a Ruby function to IronFunctions. +This example will show you how to test and deploy a Ruby function to Oracle Functions. ```sh # create your func.yaml file fn init /hello # install dependencies, we need the json gem to run this -docker run --rm -it -v ${pwd}:/worker -w /worker iron/ruby:dev bundle install --standalone --clean +docker run --rm -it -v ${pwd}:/worker -w /worker funcy/ruby:dev bundle install --standalone --clean # build the function fn build # test it cat hello.payload.json | fn run # push it to Docker Hub fn push -# Create a route to this function on IronFunctions +# Create a route to this function on Oracle Functions fn routes create myapp /hello ``` @@ -24,7 +24,7 @@ Now surf to: http://localhost:8080/r/myapp/hello Create a [Gemfile](http://bundler.io/gemfile.html) file in your function directory, then run: ```sh -docker run --rm -it -v ${pwd}:/worker -w /worker iron/ruby:dev bundle install --standalone --clean +docker run --rm -it -v ${pwd}:/worker -w /worker funcy/ruby:dev bundle install --standalone --clean ``` Ruby doesn't pick up the gems automatically, so you'll have to add this to the top of your `func.rb` file: @@ -38,7 +38,7 @@ Open `func.rb` to see it in action. To update dependencies: ```sh -docker run --rm -it -v ${pwd}:/worker -w /worker iron/ruby:dev bundle update +docker run --rm -it -v ${pwd}:/worker -w /worker funcy/ruby:dev bundle update # then install again to vendor them -docker run --rm -it -v ${pwd}:/worker -w /worker iron/ruby:dev bundle update +docker run --rm -it -v ${pwd}:/worker -w /worker funcy/ruby:dev bundle update ``` diff --git a/examples/hello/rust/README.md b/examples/hello/rust/README.md index 1cd547c84..895f3ba51 100644 --- a/examples/hello/rust/README.md +++ b/examples/hello/rust/README.md @@ -1,16 +1,19 @@ # Using rust with functions -The easiest way to create a iron function in rust is via ***cargo*** and ***fn***. +The easiest way to create a function in rust is via ***cargo*** and ***fn***. ## Prerequisites + First create an epty rust project as follows: + ```bash cargo init --name func --bin ``` -Make sure the project name is ***func*** and is of type ***bin***. Now just edit your code, once done you can create an iron function. +Make sure the project name is ***func*** and is of type ***bin***. Now just edit your code, once done you can create a function. + +## Creating a function -## Creating an IronFunction Simply run ```bash diff --git a/examples/middleware/README.md b/examples/middleware/README.md index eb549cbd6..0f77044f5 100644 --- a/examples/middleware/README.md +++ b/examples/middleware/README.md @@ -1,6 +1,6 @@ # Middleware Example -This example adds a simple authentication middleware to IronFunctions. See [main.go](main.go) for example code. +This example adds a simple authentication middleware to Oracle Functions. See [main.go](main.go) for example code. ## Building and Running diff --git a/examples/postgres/README.md b/examples/postgres/README.md index 4b8c2d105..b0f8ccd8b 100644 --- a/examples/postgres/README.md +++ b/examples/postgres/README.md @@ -11,13 +11,13 @@ fn build ./test.sh # Push it to Docker Hub fn push -# Create routes to this function on IronFunctions +# Create routes to this function on Oracle Functions fn apps create --config SERVER= fn routes create --config TABLE= --config COMMAND=INSERT //insert fn routes create --config TABLE= --config COMMAND=SELECT //select ``` -Now you can call your function on IronFunctions: +Now you can call your function on Oracle Functions: ``` echo | fn call ///insert diff --git a/examples/redis/Dockerfile b/examples/redis/Dockerfile index f5f8ab200..aa1c6aa99 100644 --- a/examples/redis/Dockerfile +++ b/examples/redis/Dockerfile @@ -1,4 +1,4 @@ -FROM iron/go +FROM funcy/go ADD func . diff --git a/examples/redis/README.md b/examples/redis/README.md index efe3c2c4a..26f3fbbeb 100644 --- a/examples/redis/README.md +++ b/examples/redis/README.md @@ -5,7 +5,7 @@ This function basically executes a GET/SET in a given redis server. ## Requirements - Redis Server -- IronFunctions API +- Functions API ## Development @@ -36,7 +36,7 @@ docker push $USERNAME/func-redis ./test.sh ``` -## Running it on IronFunctions +## Running it on Oracle Functions ### Let's define some environment variables @@ -53,7 +53,7 @@ REDIS=YOUR_REDIS_ADDRESS REDIS_AUTH=REDIS_AUTH_KEY ``` -### Running with IronFunctions +### Running with Oracle Functions With this command we are going to create an application with name `redis`. @@ -101,7 +101,7 @@ curl -X POST --data '{ #### Testing function -Now that we created our IronFunction route, let's test our new route +Now that we created our Oracle Functions route, let's test our new route ``` curl -X POST --data '{"key": "name", "value": "Johnny"}' http://$FUNCAPI/r/redis/set diff --git a/examples/redis/build.sh b/examples/redis/build.sh index d3e8997d4..174e294c5 100755 --- a/examples/redis/build.sh +++ b/examples/redis/build.sh @@ -8,5 +8,5 @@ FUNCPKG=$(pwd | sed "s|$GOPATH/src/||") docker run --rm -v "$PWD":/go/src/$FUNCPKG -w /go/src/$FUNCPKG glide up # build image -docker run --rm -v "$PWD":/go/src/$FUNCPKG -w /go/src/$FUNCPKG iron/go:dev go build -o func -docker build -t iron/func-redis . \ No newline at end of file +docker run --rm -v "$PWD":/go/src/$FUNCPKG -w /go/src/$FUNCPKG funcy/go:dev go build -o func +docker build -t username/func-redis . \ No newline at end of file diff --git a/examples/redis/func.yaml b/examples/redis/func.yaml index c3762d507..6809e6271 100644 --- a/examples/redis/func.yaml +++ b/examples/redis/func.yaml @@ -1,3 +1,3 @@ -name: iron/func-redis +name: username/func-redis build: - ./build.sh \ No newline at end of file diff --git a/examples/redis/test.sh b/examples/redis/test.sh index 5c497357a..22472aefa 100755 --- a/examples/redis/test.sh +++ b/examples/redis/test.sh @@ -14,8 +14,8 @@ docker rm test-redis-func docker run -p 6379:6379 --name test-redis-func -d redis -echo $PAYLOAD | docker run --rm -i -e SERVER=redis:6379 -e COMMAND=SET --link test-redis-func:redis iron/func-redis -echo $PAYLOAD | docker run --rm -i -e SERVER=redis:6379 -e COMMAND=GET --link test-redis-func:redis iron/func-redis +echo $PAYLOAD | docker run --rm -i -e SERVER=redis:6379 -e COMMAND=SET --link test-redis-func:redis username/func-redis +echo $PAYLOAD | docker run --rm -i -e SERVER=redis:6379 -e COMMAND=GET --link test-redis-func:redis username/func-redis docker stop test-redis-func docker rm test-redis-func \ No newline at end of file diff --git a/examples/s3/Dockerfile b/examples/s3/Dockerfile index 528e257bf..f37fb4673 100644 --- a/examples/s3/Dockerfile +++ b/examples/s3/Dockerfile @@ -1,4 +1,4 @@ -FROM iron/lambda-nodejs +FROM username/lambda-nodejs ADD example.js ./example.js diff --git a/examples/s3/Makefile b/examples/s3/Makefile index 188e7429d..7e85a92b8 100644 --- a/examples/s3/Makefile +++ b/examples/s3/Makefile @@ -1,4 +1,4 @@ -IMAGE=iron/lambda-node-aws-example +IMAGE=username/lambda-node-aws-example create: Dockerfile docker build -t $(IMAGE) . diff --git a/examples/slackbot/guppy/README.md b/examples/slackbot/guppy/README.md index ba086da36..ddf9358e3 100644 --- a/examples/slackbot/guppy/README.md +++ b/examples/slackbot/guppy/README.md @@ -1,6 +1,6 @@ ## Quick Example for a SlackBot command in Ruby -This example will show you how to test and deploy a SlackBot command to IronFunctions. +This example will show you how to test and deploy a SlackBot command to Oracle Functions. ```sh # create your func.yaml file @@ -11,7 +11,7 @@ fn build cat slack.payload | fn run # push it to Docker Hub fn push -# Create a route to this function on IronFunctions +# Create a route to this function on Oracle Functions fn routes create slackbot /guppy # Change the route response header content-type to application/json fn routes headers set slackbot /guppy Content-Type application/json @@ -21,7 +21,7 @@ cat slack.payload | fn call slackbot /guppy ## Create a Slash Command integration in Slack -In Slack, go to Integrations, find Slash Commands, click Add, type in / as the command then click Add again. On the next page, take the IronFunctions route URL and paste it into the URL field then click Save Integration. +In Slack, go to Integrations, find Slash Commands, click Add, type in / as the command then click Add again. On the next page, take the Oracle Functions route URL and paste it into the URL field then click Save Integration. If running in localhost, use [ngrok](https://github.com/inconshreveable/ngrok). diff --git a/examples/sleeper/Dockerfile b/examples/sleeper/Dockerfile index f6c10018d..61cec63cd 100644 --- a/examples/sleeper/Dockerfile +++ b/examples/sleeper/Dockerfile @@ -1,4 +1,4 @@ -FROM iron/ruby:dev +FROM funcy/ruby:dev WORKDIR /function ADD Gemfile* /function/ diff --git a/examples/sleeper/func.yaml b/examples/sleeper/func.yaml index e59a998f3..ac83cbabe 100644 --- a/examples/sleeper/func.yaml +++ b/examples/sleeper/func.yaml @@ -1,2 +1,2 @@ -name: iron/sleeper +name: username/sleeper version: 0.0.3 diff --git a/examples/testframework/local/README.md b/examples/testframework/local/README.md index c5e232603..94b0bdbcf 100644 --- a/examples/testframework/local/README.md +++ b/examples/testframework/local/README.md @@ -1,4 +1,4 @@ -# Example of IronFunctions test framework - running functions locally +# Example of Oracle Functions test framework - running functions locally This example will show you how to run a test suite on a function. diff --git a/examples/testframework/remote/README.md b/examples/testframework/remote/README.md index 88811fb5c..f4ee674d8 100644 --- a/examples/testframework/remote/README.md +++ b/examples/testframework/remote/README.md @@ -1,9 +1,9 @@ -# Example of IronFunctions test framework - running functions remotely +# Example of Oracle Functions test framework - running functions remotely This example will show you how to run a test suite on a function. ```sh -# build the test image (iron/functions-testframework:0.0.1) +# build the test image (username/functions-testframework:0.0.1) fn build # push it fn push diff --git a/examples/testframework/remote/func.yaml b/examples/testframework/remote/func.yaml index afaa81e75..29fbeed39 100644 --- a/examples/testframework/remote/func.yaml +++ b/examples/testframework/remote/func.yaml @@ -1,4 +1,4 @@ -name: iron/functions-testframework +name: treeder/functions-testframework version: 0.0.1 runtime: go entrypoint: ./func diff --git a/examples/twitter/Dockerfile b/examples/twitter/Dockerfile index f5f8ab200..aa1c6aa99 100644 --- a/examples/twitter/Dockerfile +++ b/examples/twitter/Dockerfile @@ -1,4 +1,4 @@ -FROM iron/go +FROM funcy/go ADD func . diff --git a/examples/twitter/README.md b/examples/twitter/README.md index 13460a070..e299dcded 100644 --- a/examples/twitter/README.md +++ b/examples/twitter/README.md @@ -4,7 +4,7 @@ This function exemplifies an authentication in Twitter API and get latest tweets ## Requirements -- IronFunctions API +- Oracle Functions API - Configure a [Twitter App](https://apps.twitter.com/) and [configure Customer Access and Access Token](https://dev.twitter.com/oauth/overview/application-owner-access-tokens). ## Development @@ -36,7 +36,7 @@ docker push $USERNAME/func-twitter ./test.sh ``` -## Running it on IronFunctions +## Running it on Oracle Functions ### Let's define some environment variables @@ -51,7 +51,7 @@ ACCESS_TOKEN="XXXXXX" ACCESS_SECRET="XXXXXX" ``` -### Running with IronFunctions +### Running with Oracle Functions With this command we are going to create an application with name `twitter`. @@ -82,7 +82,7 @@ curl -X POST --data '{ #### Testing function -Now that we created our IronFunction route, let's test our new route +Now that we created our Oracle Functions route, let's test our new route ``` curl -X POST --data '{"username": "getiron"}' http://$FUNCAPI/r/twitter/tweets diff --git a/examples/twitter/build.sh b/examples/twitter/build.sh index 0dc577168..881b1b8a0 100755 --- a/examples/twitter/build.sh +++ b/examples/twitter/build.sh @@ -8,5 +8,5 @@ FUNCPKG=$(pwd | sed "s|$GOPATH/src/||") docker run --rm -v "$PWD":/go/src/$FUNCPKG -w /go/src/$FUNCPKG glide up # build image -docker run --rm -v "$PWD":/go/src/$FUNCPKG -w /go/src/$FUNCPKG iron/go:dev go build -o func -docker build -t iron/func-twitter . \ No newline at end of file +docker run --rm -v "$PWD":/go/src/$FUNCPKG -w /go/src/$FUNCPKG funcy/go:dev go build -o func +docker build -t username/func-twitter . diff --git a/examples/twitter/func.yaml b/examples/twitter/func.yaml index 5ede21210..dfabe3006 100644 --- a/examples/twitter/func.yaml +++ b/examples/twitter/func.yaml @@ -1,3 +1,3 @@ -name: iron/func-twitter +name: username/func-twitter build: - ./build.sh \ No newline at end of file diff --git a/examples/twitter/test.sh b/examples/twitter/test.sh index 59e170323..203b49efe 100755 --- a/examples/twitter/test.sh +++ b/examples/twitter/test.sh @@ -3,7 +3,7 @@ set -x ./build.sh -PAYLOAD='{"username": "getiron"}' +PAYLOAD='{"username": "joe"}' # test it -echo $PAYLOAD | docker run --rm -i iron/func-twitter \ No newline at end of file +echo $PAYLOAD | docker run --rm -i username/func-twitter \ No newline at end of file diff --git a/fn/Makefile b/fn/Makefile index 670b0f1e7..92bd44e6c 100644 --- a/fn/Makefile +++ b/fn/Makefile @@ -6,8 +6,8 @@ build: docker: vendor GOOS=linux go build -o fn - docker build -t iron/fn . - docker push iron/fn + docker build -t treeder/fn . + docker push treeder/fn vendor: dep ensure diff --git a/fn/README.md b/fn/README.md index 119c00792..a520b4a39 100644 --- a/fn/README.md +++ b/fn/README.md @@ -1,4 +1,4 @@ -# IronFunctions CLI +# Oracle Functions CLI ## Creating Functions @@ -53,7 +53,7 @@ fn push ## Using the API -You can operate IronFunctions from the command line. +You can operate Oracle Functions from the command line. ```sh $ fn apps list # list apps @@ -71,10 +71,10 @@ otherapp $ fn routes list myapp # list routes of an app path image -/hello iron/hello +/hello treeder/hello -$ fn routes create otherapp /hello iron/hello # create route -/hello created with iron/hello +$ fn routes create otherapp /hello treeder/hello # create route +/hello created with treeder/hello $ fn routes delete otherapp hello # delete route /hello deleted @@ -111,7 +111,7 @@ choices are: `memory`, `type` and `config`. Thus a more complete example of route creation will look like: ```sh -fn routes create --memory 256 --type async --config DB_URL=http://example.org/ otherapp /hello iron/hello +fn routes create --memory 256 --type async --config DB_URL=http://example.org/ otherapp /hello treeder/hello ``` You can also update existent routes configurations using the command `fn routes update` @@ -119,7 +119,7 @@ You can also update existent routes configurations using the command `fn routes For example: ```sh -fn routes update --memory 64 --type sync --image iron/hello +fn routes update --memory 64 --type sync --image treeder/hello ``` To know exactly what configurations you can update just use the command @@ -144,7 +144,7 @@ $ fn ... Also there is the `deploy` command that is going to scan all local directory for functions, rebuild them and push them to Docker Hub and update them in -IronFunction. It will use the `route` entry in the existing function file to +Oracle Functions. It will use the `route` entry in the existing function file to see the update in the daemon. @@ -183,7 +183,7 @@ Once you application is done and deployed, you can run tests remotely: # test the function locally first $ fn test -b -# push it to Docker Hub and IronFunctions +# push it to Docker Hub and Oracle Functions $ fn push $ fn routes create myapp @@ -195,7 +195,7 @@ $ fn test --remote myapp ### Creating a new function from source ``` -fn init iron/hello --runtime ruby +fn init treeder/hello --runtime ruby fn deploy myapp /hello ``` @@ -206,7 +206,7 @@ fn deploy myapp (discover route path if available in func.yaml) ### Testing function locally ``` -fn run iron/hello +fn run treeder/hello ``` ### Testing route @@ -225,7 +225,7 @@ fn apps delete myapp ### Route management ``` -fn routes create myapp /hello iron/hello +fn routes create myapp /hello treeder/hello # routes update will also update any changes in the func.yaml file too. fn routes update myapp /hello --timeout 30 --type async fn routes config set myapp /hello log_level info diff --git a/fn/common.go b/fn/common.go index 9d0c8a074..30643961f 100644 --- a/fn/common.go +++ b/fn/common.go @@ -118,22 +118,22 @@ func exists(name string) bool { } var acceptableFnRuntimes = map[string]string{ - "elixir": "iron/elixir", - "erlang": "iron/erlang", - "gcc": "iron/gcc", - "go": "iron/go", - "java": "iron/java", - "leiningen": "iron/leiningen", - "mono": "iron/mono", - "node": "iron/node", - "perl": "iron/perl", - "php": "iron/php", - "python": "iron/python:2", - "ruby": "iron/ruby", - "scala": "iron/scala", + "elixir": "funcy/elixir", + "erlang": "funcy/erlang", + "gcc": "funcy/gcc", + "go": "funcy/go", + "java": "funcy/java", + "leiningen": "funcy/leiningen", + "mono": "funcy/mono", + "node": "funcy/node", + "perl": "funcy/perl", + "php": "funcy/php", + "python": "funcy/python:2", + "ruby": "funcy/ruby", + "scala": "funcy/scala", "rust": "corey/rust-alpine", "dotnet": "microsoft/dotnet:runtime", - "lambda-nodejs4.3": "iron/functions-lambda:nodejs4.3", + "lambda-nodejs4.3": "funcy/functions-lambda:nodejs4.3", } const tplDockerfile = `FROM {{ .BaseImage }} diff --git a/fn/lambda/node/Dockerfile b/fn/lambda/node/Dockerfile index b8a3d1acf..04953c69f 100644 --- a/fn/lambda/node/Dockerfile +++ b/fn/lambda/node/Dockerfile @@ -6,7 +6,7 @@ WORKDIR /function RUN apk update && apk --no-cache add imagemagick RUN npm install aws-sdk@2.2.32 imagemagick && npm cache clear -# ironcli should forbid this name +# cli should forbid this name ADD bootstrap.js /function/lambda-bootstrap.js # Run the handler, with a payload in the future. diff --git a/fn/langs/go.go b/fn/langs/go.go index bc3d1dea0..c3f373054 100644 --- a/fn/langs/go.go +++ b/fn/langs/go.go @@ -26,7 +26,7 @@ func (lh *GoLangHelper) PreBuild() error { return err } // todo: this won't work if the function is more complex since the import paths won't match up, need to fix - pbcmd := fmt.Sprintf("docker run --rm -v %s:/go/src/github.com/x/y -w /go/src/github.com/x/y iron/go:dev go build -o func", wd) + pbcmd := fmt.Sprintf("docker run --rm -v %s:/go/src/github.com/x/y -w /go/src/github.com/x/y funcy/go:dev go build -o func", wd) fmt.Println("Running prebuild command:", pbcmd) parts := strings.Fields(pbcmd) head := parts[0] diff --git a/fn/langs/python.go b/fn/langs/python.go index beafed0cd..fb7cb5da2 100644 --- a/fn/langs/python.go +++ b/fn/langs/python.go @@ -26,7 +26,7 @@ func (lh *PythonHelper) PreBuild() error { return err } - pbcmd := fmt.Sprintf("docker run --rm -v %s:/worker -w /worker iron/python:2-dev pip install -t packages -r requirements.txt", wd) + pbcmd := fmt.Sprintf("docker run --rm -v %s:/worker -w /worker funcy/python:2-dev pip install -t packages -r requirements.txt", wd) fmt.Println("Running prebuild command:", pbcmd) parts := strings.Fields(pbcmd) head := parts[0] diff --git a/fn/langs/ruby.go b/fn/langs/ruby.go index 158b5fb83..a87672349 100644 --- a/fn/langs/ruby.go +++ b/fn/langs/ruby.go @@ -30,7 +30,7 @@ func (lh *RubyLangHelper) PreBuild() error { return nil } - pbcmd := fmt.Sprintf("docker run --rm -v %s:/worker -w /worker iron/ruby:dev bundle install --standalone --clean", wd) + pbcmd := fmt.Sprintf("docker run --rm -v %s:/worker -w /worker funcy/ruby:dev bundle install --standalone --clean", wd) fmt.Println("Running prebuild command:", pbcmd) parts := strings.Fields(pbcmd) head := parts[0] diff --git a/fn/main.go b/fn/main.go index d7fa3280e..0a93c1283 100644 --- a/fn/main.go +++ b/fn/main.go @@ -7,9 +7,9 @@ import ( "os" "strings" - vers "gitlab.oracledx.com/odx/functions/api/version" functions "github.com/iron-io/functions_go" "github.com/urfave/cli" + vers "gitlab.oracledx.com/odx/functions/api/version" ) var aliases = map[string]cli.Command{ @@ -35,8 +35,8 @@ func newFn() *cli.App { app := cli.NewApp() app.Name = "fn" app.Version = vers.Version - app.Authors = []cli.Author{{Name: "iron.io"}} - app.Description = "IronFunctions command line tools" + app.Authors = []cli.Author{{Name: "Oracle Corporation"}} + app.Description = "Oracle Functions command line tools" app.UsageText = `Check the manual at https://github.com/treeder/functions/blob/master/fn/README.md` cli.AppHelpTemplate = `{{.Name}} {{.Version}}{{if .Description}} @@ -47,7 +47,7 @@ USAGE: {{if .UsageText}}{{.UsageText}}{{else}}{{.HelpName}} {{if .VisibleFlags}}[global options]{{end}}{{if .Commands}} command [command options]{{end}} {{if .ArgsUsage}}{{.ArgsUsage}}{{else}}[arguments...]{{end}}{{end}} ENVIRONMENT VARIABLES: - API_URL - IronFunctions remote API address{{if .VisibleCommands}} + API_URL - Oracle Functions remote API address{{if .VisibleCommands}} COMMANDS:{{range .VisibleCategories}}{{if .Name}} {{.Name}}:{{end}}{{range .VisibleCommands}} diff --git a/fn/testfn.go b/fn/testfn.go index 0758eed66..2c3c8e4b0 100644 --- a/fn/testfn.go +++ b/fn/testfn.go @@ -41,7 +41,7 @@ func (t *testcmd) flags() []cli.Flag { }, cli.StringFlag{ Name: "remote", - Usage: "run tests by calling the function on IronFunctions daemon on `appname`", + Usage: "run tests by calling the function on Oracle Functions daemon on `appname`", Destination: &t.remote, }, } diff --git a/images/dind/Dockerfile b/images/dind/Dockerfile index 4a2565036..b5e4db4f1 100644 --- a/images/dind/Dockerfile +++ b/images/dind/Dockerfile @@ -1,18 +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. - - FROM docker:1.13.1-dind RUN apk update && apk upgrade && apk add --no-cache ca-certificates diff --git a/images/dind/build.sh b/images/dind/build.sh index 0bef6b1a6..d15958d29 100755 --- a/images/dind/build.sh +++ b/images/dind/build.sh @@ -1,19 +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. - - set -ex docker build -t treeder/dind:latest . diff --git a/images/dind/chaos/Dockerfile b/images/dind/chaos/Dockerfile index a8f1926f2..b70084db6 100644 --- a/images/dind/chaos/Dockerfile +++ b/images/dind/chaos/Dockerfile @@ -1,19 +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. - - -# iron/dind-chaos FROM docker:1.12-rc-dind RUN apk update && apk upgrade && apk add --no-cache ca-certificates diff --git a/images/dind/chaos/chaos.sh b/images/dind/chaos/chaos.sh index 84042c513..6815653d7 100755 --- a/images/dind/chaos/chaos.sh +++ b/images/dind/chaos/chaos.sh @@ -1,19 +1,5 @@ #!/bin/sh -# 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. - set -ex sleep 600 # 10 minutes diff --git a/images/dind/chaos/entrypoint.sh b/images/dind/chaos/entrypoint.sh index 26401dc45..487a9f5ea 100755 --- a/images/dind/chaos/entrypoint.sh +++ b/images/dind/chaos/entrypoint.sh @@ -1,20 +1,5 @@ #!/bin/sh -# 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. - - set -ex # modified from: https://github.com/docker-library/docker/blob/866c3fbd87e8eeed524fdf19ba2d63288ad49cd2/1.11/dind/dockerd-entrypoint.sh diff --git a/images/dind/dind.sh b/images/dind/dind.sh index 2c691fcd2..db3a15b9f 100755 --- a/images/dind/dind.sh +++ b/images/dind/dind.sh @@ -1,19 +1,5 @@ #!/bin/sh -# 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. - set -ex # modified from: https://github.com/docker-library/docker/blob/866c3fbd87e8eeed524fdf19ba2d63288ad49cd2/1.11/dind/dockerd-entrypoint.sh # this will run either overlay or aufs as the docker fs driver, if the OS has both, overlay is preferred. diff --git a/images/dind/entrypoint.sh b/images/dind/entrypoint.sh index 3c719e11a..b05bbe475 100755 --- a/images/dind/entrypoint.sh +++ b/images/dind/entrypoint.sh @@ -1,19 +1,5 @@ #!/bin/sh -# 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. - set -ex /usr/local/bin/dind.sh & diff --git a/images/dind/release.sh b/images/dind/release.sh index 067a0c770..8812e7f0c 100755 --- a/images/dind/release.sh +++ b/images/dind/release.sh @@ -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. - set -e ./build.sh diff --git a/lb/README.md b/lb/README.md index 45f21c602..14033be33 100644 --- a/lb/README.md +++ b/lb/README.md @@ -1,7 +1,7 @@ -# IronFunctions LoadBalancer +# Oracle Functions LoadBalancer -## Loadbalancing several IronFunctions -You can run multiple IronFunctions instances and balance the load amongst them using `fnlb` as follows: +## Loadbalancing several Oracle Functions +You can run multiple Oracle Functions instances and balance the load amongst them using `fnlb` as follows: ```sh fnlb --listen --nodes ,, diff --git a/lb/fnlb/main.go b/lb/fnlb/main.go index 66066fc5f..67d8acccc 100644 --- a/lb/fnlb/main.go +++ b/lb/fnlb/main.go @@ -17,7 +17,7 @@ var ( ) func init() { - flag.StringVar(&fnodes, "nodes", "127.0.0.1:8080", "comma separated list of IronFunction nodes") + flag.StringVar(&fnodes, "nodes", "127.0.0.1:8080", "comma separated list of Oracle Functions nodes") flag.StringVar(&flisten, "listen", "0.0.0.0:8081", "listening port for incoming connections") flag.Parse() } diff --git a/test/fnlb-test-harness/README.md b/test/fnlb-test-harness/README.md index 07959946f..ab0978ff1 100644 --- a/test/fnlb-test-harness/README.md +++ b/test/fnlb-test-harness/README.md @@ -1,7 +1,7 @@ # fnlb-test-harness Test harness that exercises the fnlb load balancer in order to verify that it works properly. ## How it works -This is a test harness that makes calls to an IronFunctions route through the fnlb load balancer, which routes traffic to multiple IronFunctions nodes. +This is a test harness that makes calls to an Oracle Functions route through the fnlb load balancer, which routes traffic to multiple Oracle Functions nodes. The test harness keeps track of which node each request was routed to so we can assess how the requests are being distributed across the nodes. The functionality of fnlb is to normally route traffic to the same small number of nodes so that efficiences can be achieved and to support reuse of hot functions. ### Primes function @@ -14,25 +14,25 @@ where: - *loops*: number of times to calculate the primes (repeating the count consumes additional CPU without consuming additional memory) ## How to use it -The test harness requires running one or more IronFunctions nodes and one instance of fnlb. The list of nodes must be provided both to fnlb and to the test harness +The test harness requires running one or more Oracle Functions nodes and one instance of fnlb. The list of nodes must be provided both to fnlb and to the test harness because the test harness must call each node directly one time in order to discover the node's container id. After it has run, examine the results to see how the requests were distributed across the nodes. ### How to run it locally -Each of the IronFunctions nodes needs to connect to the same database. +Each of the Oracle Functions nodes needs to connect to the same database. STEP 1: Create a route for the primes function. Example: ``` fn apps create primesapp fn routes create primesapp /primes jconning/primes:0.0.1 ``` -STEP 2: Run five IronFunctions nodes locally. Example (runs five nodes in the background using Docker): +STEP 2: Run five Oracle Functions nodes locally. Example (runs five nodes in the background using Docker): ``` -sudo docker run -d -it --name functions-8082 --privileged -v ${HOME}/data-8082:/app/data -p 8082:8080 -e "DB_URL=postgres://dbUser:dbPassword@dbHost:5432/dbName" iron/functions -sudo docker run -d -it --name functions-8083 --privileged -v ${HOME}/data-8083:/app/data -p 8083:8080 -e "DB_URL=postgres://dbUser:dbPassword@dbHost:5432/dbName" iron/functions -sudo docker run -d -it --name functions-8084 --privileged -v ${HOME}/data-8084:/app/data -p 8084:8080 -e "DB_URL=postgres://dbUser:dbPassword@dbHost:5432/dbName" iron/functions -sudo docker run -d -it --name functions-8085 --privileged -v ${HOME}/data-8085:/app/data -p 8085:8080 -e "DB_URL=postgres://dbUser:dbPassword@dbHost:5432/dbName" iron/functions -sudo docker run -d -it --name functions-8086 --privileged -v ${HOME}/data-8086:/app/data -p 8086:8080 -e "DB_URL=postgres://dbUser:dbPassword@dbHost:5432/dbName" iron/functions +sudo docker run -d -it --name functions-8082 --privileged -v ${HOME}/data-8082:/app/data -p 8082:8080 -e "DB_URL=postgres://dbUser:dbPassword@dbHost:5432/dbName" treeder/functions +sudo docker run -d -it --name functions-8083 --privileged -v ${HOME}/data-8083:/app/data -p 8083:8080 -e "DB_URL=postgres://dbUser:dbPassword@dbHost:5432/dbName" treeder/functions +sudo docker run -d -it --name functions-8084 --privileged -v ${HOME}/data-8084:/app/data -p 8084:8080 -e "DB_URL=postgres://dbUser:dbPassword@dbHost:5432/dbName" treeder/functions +sudo docker run -d -it --name functions-8085 --privileged -v ${HOME}/data-8085:/app/data -p 8085:8080 -e "DB_URL=postgres://dbUser:dbPassword@dbHost:5432/dbName" treeder/functions +sudo docker run -d -it --name functions-8086 --privileged -v ${HOME}/data-8086:/app/data -p 8086:8080 -e "DB_URL=postgres://dbUser:dbPassword@dbHost:5432/dbName" treeder/functions ``` STEP 3: Run fnlb locally. Example (runs fnlb on the default port 8081): ``` diff --git a/test/fnlb-test-harness/main.go b/test/fnlb-test-harness/main.go index 6b02de166..5af879771 100644 --- a/test/fnlb-test-harness/main.go +++ b/test/fnlb-test-harness/main.go @@ -107,7 +107,7 @@ func invokeLoadBalancer(hostPort, path string, numExecutions, max, loops int) { func discoverContainerIds() { // Discover the Docker hostname of each node; create a mapping of hostnames to host/port. - // This is needed because IronFunctions doesn't make the host/port available to the function (as of Mar 2017). + // This is needed because Oracle Functions doesn't make the host/port available to the function (as of Mar 2017). fmt.Println("Discovering container ids for every node (use Docker's HOSTNAME env var as a container id)...") for _, s := range nodes { if e, err := executeFunction(s, route, 100, 1); err == nil {