Update references remove refs to treeder oracle funcy (#376)

* Remove lots of refs to iron and funcy oracle etc..

* more ref replacements

* Replacing more refs. Treeder

* Use Fn not FN
This commit is contained in:
James Jeffrey
2017-09-29 16:22:15 -07:00
committed by Travis Reeder
parent 5219227393
commit c7f3066c75
81 changed files with 211 additions and 398 deletions

View File

@@ -25,7 +25,7 @@ If you are a developer using Fn through the API, this section is for you.
## For Operators
If you are operating Oracle Functions, this section is for you.
If you are operating Fn, this section is for you.
* [Running in Production Overview](operating/production.md)
* [Runtime Options](operating/options.md)
@@ -35,9 +35,9 @@ If you are operating Oracle Functions, this section is for you.
* [Logging](operating/logging.md)
* [Metrics](operating/metrics.md)
* [Triggers](operating/triggers.md)
* [Extending Oracle Functions](operating/extending.md)
* [Extending Fn](operating/extending.md)
* [Docker Configuration](operating/docker.md)
* [Operating On Windows](operating/windows.md)
* Running Oracle Functions on:
* Running Fn on:
* [Kubernetes](operating/kubernetes/README.md)
* [Docker Swarm](operating/docker-swarm/README.md)

View File

@@ -2,20 +2,20 @@
## Which languages are supported?
Since we use containers as the base building block, all languages can be used. There may not be higher level
helper libraries like our Lambda wrapper for every language, but you can use any language if you follow the
Since we use containers as the base building block, all languages can be used. There may not be higher level
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 Oracle Functions?
## Where can I run Fn?
Anywhere. Any cloud, on-premise, on your laptop. As long as you can run a Docker container, you can run Oracle Functions.
Anywhere. Any cloud, on-premise, on your laptop. As long as you can run a Docker container, you can run Fn.
## Which orchestration tools does functions support?
Functions can be deployed using any orchestration tool.
## Does Oracle Functions require Docker?
## Does Fn require Docker?
For now we require Docker primarily for the packaging and distribution via Docker Registries,
For now we require Docker primarily for the packaging and distribution via Docker Registries,
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.

View File

@@ -1,6 +1,6 @@
# Lambda everywhere
Lambda support for Oracle Functios enables you to take your AWS Lambda functions and run them
Lambda support for Fn 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
@@ -14,4 +14,4 @@ fn init --runtime lambda-node-4 --name lambda-node
Be sure the filename for your main handler is `func.js`.
TODO: Make Java and Python use the new workflow too.
TODO: Make Java and Python use the new workflow too.

View File

@@ -5,7 +5,7 @@
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
Oracle Functions compatible Docker Image as follows:
FN compatible Docker Image as follows:
```bash
fn lambda create-function <name> <runtime> <handler> <files...>

View File

@@ -21,11 +21,11 @@ such assumptions, please rewrite it.
## nodejs
* node.js version [0.10.42][funcy/node]
* node.js version [0.10.42][fnproject/node]
* ImageMagick version [6.9.3][magickv] and nodejs [wrapper 6.9.3][magickwrapperv]
* aws-sdk version [2.2.12][awsnodev]
[funcy/node]: https://github.com/treeder/dockers/blob/master/node/Dockerfile
[fnproject/node]: https://github.com/fnproject/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/
@@ -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/funcy/python/tags/
[pythonv]: https://hub.docker.com/r/fnproject/python/tags/
[botov]: https://github.com/boto/boto3/releases/tag/1.2.3
### Event
@@ -84,7 +84,7 @@ a JSON object with trace information.
* OpenJDK Java Runtime [1.8.0][javav]
[javav]: https://hub.docker.com/r/funcy/java/tags/
[javav]: https://hub.docker.com/r/fnproject/java/tags/
The Java8 runtime is significantly lacking at this piont and we **do not
recommend** using it.

View File

@@ -3,7 +3,7 @@
Import existing AWS Lambda functions
====================================
The [fn](https://github.com/treeder/functions/fn/) tool includes a set of
The [fn](https://github.com/fnproject/fn/) tool includes a set of
commands to act on Lambda functions. Most of these are described in
[getting-started](./getting-started.md). One more subcommand is `aws-import`.
@@ -40,7 +40,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 Oracle Functions requires that the Docker image be
Using Lambda with Docker Hub and Fn requires that the Docker image be
named `<Docker Hub username>/<image name>`. This is used to uniquely identify
images on Docker Hub. Please use the `<Docker Hub username>/<image
name>` as the image name with `aws-import` to create a correctly named image.
@@ -54,4 +54,4 @@ You can then deploy the imported lambda as follows:
```
./fn deploy --app myapp
````
Now the function can be reached via ```http://$HOSTNAME/r/user/my-function```
Now the function can be reached via ```http://$HOSTNAME/r/user/my-function```

View File

@@ -1,4 +1,4 @@
# Oracle Functions using BoltDB
# Fn using BoltDB
SQLite3 is the default database, you just need to run the API.
@@ -7,5 +7,5 @@ SQLite3 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/fn.db:/app/fn.db -p 8080:8080 treeder/functions
docker run --rm -it --privileged -v $PWD/fn.db:/app/fn.db -p 8080:8080 fnproject/functions
```

View File

@@ -1,4 +1,4 @@
# Oracle Functions using Postgres
# Fn using Postgres
Let's presuppose you don't have even a MySQL DB ready.
@@ -6,8 +6,8 @@ Let's presuppose you don't have even a MySQL DB ready.
```
docker run --name func-mysql \
-e MYSQL_DATABASE=funcs -e MYSQL_USER=funcy -e MYSQL_PASSWORD=funcypass -d mysql
```
-e MYSQL_DATABASE=funcs -e MYSQL_USER=func -e MYSQL_PASSWORD=funcpass -d mysql
```
For more configuration options, see [docker mysql docs](https://hub.docker.com/_/mysql/).
@@ -15,6 +15,6 @@ For more configuration options, see [docker mysql docs](https://hub.docker.com/_
```
docker run --rm --privileged --link "iron-mysql:mysql" \
-e "DB_URL=mysql://funcy:funcypass@tcp(mysql:3306)/funcs" \
-it -p 8080:8080 treeder/functions
-e "DB_URL=mysql://func:funcpass@tcp(mysql:3306)/funcs" \
-it -p 8080:8080 fnproject/fn
```

View File

@@ -1,27 +1,27 @@
# Oracle Functions using Postgres
# Fn using Postgres
Let's presuppose you don't have even a postgres DB ready.
### 1. Let's start a postgres instance:
```
docker run --name funcy-postgres \
-e POSTGRES_PASSWORD=funcypass -d postgres
```
docker run --name func-postgres \
-e POSTGRES_PASSWORD=funcpass -d postgres
```
### 2. Now let's create a new database for Functions
Creating database:
```
docker run -it --rm --link funcy-postgres:postgres postgres \
docker run -it --rm --link func-postgres:postgres postgres \
psql -h postgres -U postgres -c "CREATE DATABASE funcs;"
```
Granting access to postgres user
```
docker run -it --rm --link funcy-postgres:postgres postgres \
docker run -it --rm --link func-postgres:postgres postgres \
psql -h postgres -U postgres -c 'GRANT ALL PRIVILEGES ON DATABASE funcs TO postgres;'
```
@@ -29,6 +29,6 @@ docker run -it --rm --link funcy-postgres:postgres postgres \
```
docker run --rm --privileged --link "iron-postgres:postgres" \
-e "DB_URL=postgres://postgres:funcypass@postgres/funcs?sslmode=disable" \
-it -p 8080:8080 treeder/functions
-e "DB_URL=postgres://postgres:funcpass@postgres/funcs?sslmode=disable" \
-it -p 8080:8080 fnproject/functions
```

View File

@@ -1,25 +1,25 @@
# Extending Oracle Functions
# Extending Fn
Oracle Functions is extensible so you can add custom functionality and extend the project without needing to modify the core.
FN 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 Oracle Functions.
There are multiple ways to extend the functionality of Fn.
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 Oracle Functions API.
1. Add API Endpoints - extend the default Fn API.
## Listeners
Listeners are the main way to extend Oracle Functions.
Listeners are the main way to extend Fn.
The following listener types are supported:
* App Listeners - [GoDoc](https://godoc.org/github.com/treeder/functions/api/server#AppListener)
* Runner Listeners - [GoDoc](https://godoc.org/github.com/treeder/functions/api/server#RunnerListener)
* App Listeners - [GoDoc](https://godoc.org/github.com/fnproject/functions/api/server#AppListener)
* Runner Listeners - [GoDoc](https://godoc.org/github.com/fnproject/functions/api/server#RunnerListener)
### 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 Oracle Functions 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 Fn API
Example:
@@ -29,8 +29,8 @@ package main
import (
"context"
"github.com/treeder/functions/api/server"
"github.com/treeder/functions/api/models"
"github.com/fnproject/functions/api/server"
"github.com/fnproject/functions/api/models"
)
type myCustomListener struct{}
@@ -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 Oracle Functions server by using the `AddEndpoint` and `AddEndpointFunc` methods.
You can add API endpoints to the Fn server by using the `AddEndpoint` and `AddEndpointFunc` methods.
See examples of this in [examples/extensions/main.go](../../examples/extensions/main.go).

View File

@@ -1,6 +1,6 @@
# Logging
There are a few things to note about what Oracle Functions logs.
There are a few things to note about what Fn logs.
## Logspout

View File

@@ -1,6 +1,6 @@
# Message Queues
A message queue is used to coordinate asynchronous function calls that run through Oracle Functions.
A message queue is used to coordinate asynchronous function calls that run through Fn.
We currently support the following message queues and they are passed in via the `MQ_URL` environment variable. For example:
@@ -19,18 +19,6 @@ the file cannot be the same as the one used for the Bolt Datastore.
See Redis in databases above.
## [IronMQ](https://www.iron.io/platform/ironmq/)
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 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
`ironmq+http`. You can also use a custom port. An example URL is:
`ironmq+http://project_id:token@localhost:8090/queue_prefix`.
## What about message queue X?
We're happy to add more and we love pull requests, so feel free to add one! Copy one of the implementations above as a starting point.

View File

@@ -1,8 +1,8 @@
# Oracle Functions Runtime Options
# Fn Runtime Options
## Configuration
When starting Oracle Functions, you can pass in the following configuration variables as environment variables. Use `-e VAR_NAME=VALUE` in
When starting Fn, 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. | sqlite3:///app/data/fn.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 Oracle Functions 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 Fn 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 Oracle Functions, as it is in the Quickstart guide, is to use docker-in-docker (dind). There are
The default way to run Fn, 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 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.
* You can set resource restrictions for the entire Fn instance. For instance, you can set `--memory` on
the docker run command to set the max memory for the Fn 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 treeder/functions
docker run --rm --name functions -it -v /var/run/docker.sock:/var/run/docker.sock -v $PWD/data:/app/data -p 8080:8080 fnproject/functions
```
### Run outside Docker

View File

@@ -1,21 +1,19 @@
# Running Oracle Functions in Production
# Running Fn 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 Oracle Functions API behind a load balancer and launch run several instances of them (the more the merrier).
* Put the Fn 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:
![Oracle Functions Architecture Diagram](../assets/architecture.png)
![FN Architecture Diagram](../assets/architecture.png)
## 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).
Any load balancer will work, put every instance of Fn that you run behind the load balancer.
## Database
@@ -26,13 +24,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 Oracle Functions runs, in particular if you use a lot of asynchronous function calls.
in how well Fn 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 Oracle Functions. 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 Fn. 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 +39,4 @@ 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 Oracle Functions instances.
synchronous and asynchronous functions. If `wait_time` increases, you'll want to start more Fn instances.

View File

@@ -1,8 +1,8 @@
# Oracle Functions Routes
# Fn Routes
Routes have a many-to-one mapping to an [app](apps.md).
A good practice to get the best performance on your Oracle Functions API is define
A good practice to get the best performance on your Fn 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 Oracle Functions memory management
## Understanding Fn memory management
When Oracle Functions starts it registers the total available memory in your system
When Fn 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

View File

@@ -1,2 +1,2 @@
# Scaling Oracle Functions
# Scaling Fn

View File

@@ -1,6 +1,6 @@
# Triggers
Triggers are integrations that you can use in other systems to fire off functions in Oracle Functions.
Triggers are integrations that you can use in other systems to fire off functions in Fn.
## 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 Oracle Functions.
2. [Picasso](https://github.com/openstack/picasso) - Picasso provides an OpenStack API and Keystone authentication layer on top of Fn.
Please refer to the [Picasso on DevStack](https://github.com/openstack/picasso/blob/master/devstack/README.md) guide for setup instructions.
### Examples

View File

@@ -1,9 +1,9 @@
# User Interface for Oracle Functions
# User Interface for Fn
### Run Functions UI
```sh
docker run --rm -it --link functions:api -p 4000:4000 -e "API_URL=http://api:8080" treeder/functions-ui
docker run --rm -it --link functions:api -p 4000:4000 -e "API_URL=http://api:8080" fnproject/ui
```
For more information, see: https://github.com/treeder/functions-ui
For more information, see: https://github.com/fnproject/ui

View File

@@ -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 treeder/functions
docker run --rm --name functions -it -v /var/run/docker.sock:/var/run/docker.sock -v ${pwd}/data:/app/data -p 8080:8080 fnproject/functions
```
Then everything should work as normal.

View File

@@ -12,12 +12,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 Oracle Functions yourself, the paying part may not apply, but it does apply to
Since you'll be running Fn 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 Oracle Functions (the person who has to manage the servers behind the serverless),
If you will be operating Fn (the person who has to manage the servers behind the serverless),
then the benefits are different, but related.
* Extremely efficient use of resources
@@ -28,7 +28,7 @@ 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 Oracle Functions nodes
* Scaling is simply adding more Fn 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)

View File

@@ -1,6 +1,6 @@
# Detailed Usage
This is a more detailed explanation of the main commands you'll use in Oracle Functions as a developer.
This is a more detailed explanation of the main commands you'll use in Fn as a developer.
### Create an Application
@@ -85,7 +85,7 @@ You should see it say `Hello Johnny!` now instead of `Hello World!`.
### Add an asynchronous function
Oracle Functions supports synchronous function calls like we just tried above, and asynchronous for background processing.
FN supports synchronous function calls like we just tried above, and asynchronous for background processing.
[Asynchronous functions](async.md) 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.

View File

@@ -1,5 +1,5 @@
# Writing Functions
This will give you the basic overview of writing base level functions. You can also use higher level
abstractions that make it easier such as [lambda](lambda/README.md).
@@ -34,11 +34,11 @@ You will also have access to a set of environment variables.
* `FN_PATH` - the matched route, eg: `/hello`
* `FN_METHOD` - the HTTP method for the request, eg: `GET` or `POST`
* `FN_CALL_ID` - a unique ID for each function execution.
* `FN_FORMAT` - a string representing one of the [function formats](function-format.md), currently either `default` or `http`. Default is `default`.
* `FN_FORMAT` - a string representing one of the [function formats](function-format.md), currently either `default` or `http`. Default is `default`.
* `FN_MEMORY` - a number representing the amount of memory available to the call, in MB
* `FN_TYPE` - the type for this call, currently 'sync' or 'async'
* `FN_HEADER_$X` - the HTTP headers that were set for this request. Replace $X with the upper cased name of the header and replace dashes in the header with underscores.
* `$X` - any [configuration values](https://gitlab.oracledx.com/odx/functions/blob/master/fn/README.md#application-level-configuration) you've set
* `$X` - any [configuration values](https://github.com/fnproject/cli/blob/master/README.md#application-level-configuration) you've set
for the Application or the Route. Replace X with the upper cased name of the config variable you set. Ex: `minio_secret=secret` will be exposed via MINIO_SECRET env var.
* `FN_PARAM_$Y` - any variables found from parsing the URL. Replace $Y with any `:var` from the url.
@@ -75,7 +75,7 @@ STDERR.puts("hi")
### Lambda everywhere
Lambda support for Oracle Functios enables you to take your AWS Lambda functions and run them
Lambda support for Fn 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 is not much different than using regular functions, just use
@@ -87,7 +87,7 @@ fn init --runtime lambda-node --name lambda-node
Be sure the filename for your main handler is `func.js`.
TODO: Make Java and Python use the new workflow too.
TODO: Make Java and Python use the new workflow too.
## Next Steps