主要是文件
  • func.yaml
  • func.json
详细说明如下:

An example of a function file:

name: fnproject/hello
version: 0.0.1
type: sync
memory: 128
config:
key: value
key2: value2
keyN: valueN
headers:
Content-Type: text/plain
build:
- make
- make test
expects:
config:
- name: SECRET_1
required: true
- name: SECRET_2
required: false

name is the name and tag to which this function will be pushed to and the route updated to use it.

path (optional) allows you to overwrite the calculated route from the path position. You may use it to override the calculated route. If you plan to use fn test --remote="", this is mandatory.

version represents current version of the function. When deploying, it is appended to the image as a tag.

runtime represents programming language runtime, for example, 'go', 'python', 'java', etc. The runtime 'docker' will use the existing Dockerfile if one exists.

build (optional) is an array of local shell calls which are used to help building the function. TODO: Deprecate this?

type (optional) allows you to set the type of the route. sync, for functions whose response are sent back to the requester; orasync, for functions that are started and return a call ID to customer while it executes in background. Default: sync.

memory (optional) allows you to set a maximum memory threshold for this function. If this function exceeds this limit during execution, it is stopped and error message is logged. Default: 128.

timeout (optional) is the maximum time a function will be allowed to run. Default is 30 seconds.

headers (optional) is a set of HTTP headers to be returned in the response of this function calls.

config (optional) is a set of configuration variables to be passed onto the function as environment variables. These configuration options shall override application configuration during functions execution. See Configuration for more information.

expects (optional) a list of config/env vars that are required to run this function. These vars will be used when running/testing locally, if found in your local environment. If these vars are not found, local testing will fail.

Hot functions

hot functions support also adds two extra options to this configuration file.

format (optional) is one of the streaming formats covered at function-format.md.

idle_timeout (optional) is the time in seconds a container will remain alive without receiving any new requests; hot functions will stay alive as long as they receive a request in this interval. Default: 30.

 
 
 
 
 

fn project Function files 说明的更多相关文章

  1. Using command-line Subversion to access project source files

    Help index About source code version control with Software Configuration Management (Subversion) Usi ...

  2. fn project 打包Function

      Option 1 (recommended): Use the fn cli tool We recommend using the fn cli tool which will handle a ...

  3. fn project 扩展

    目前支持的扩展方式   Listeners - listen to API events such as a route getting updated and react accordingly. ...

  4. fn project 生产环境使用

    此为官方的参考说明   Running Fn in Production The QuickStart guide is intended to quickly get started and kic ...

  5. fn project 对象模型

    Applications At the root of everything are applications. In fn, an application is essentially a grou ...

  6. fn project hot functions 说明

    1. 简单介绍 所谓 hot  functions 实际上就是长时间运行的functions ,简单理解类似后台任务 2. fnproject  处理的方式 fnproject 使用 类似 http的 ...

  7. fn project k8s 集成

    具体部署还是比较简单的,以下为官方参考,只是有一个service type 为 loadBlancer 实际使用需要修改为NodePort  Prerequisite 1: working Kuber ...

  8. fn project 私有镜像发布

    1. 说明 fnproject 默认的docker registry 是 dockerhub 对于企业应用还是不太方便的 还好系统系统了配置参数方便我们进行配置,与开源harbor 进行集成 2. 使 ...

  9. fn project Message Queues 配置

      Message Queues A message queue is used to coordinate asynchronous function calls that run through ...

随机推荐

  1. 纯CSS3实现GIF图片动画效果

    在线演示 本地下载

  2. react-native run-android Starting: Intent Error type 3 Error: Activity class does not exist

    使用”react-native run-android”命令运行android应用时,如果常常出现如下错误: Starting the app (/home/xxx/soft/sdk//platfor ...

  3. HTTP与抓包

    HTTP就是超文本传输协议,底层使用socket TCP长连接,基于请求与响应,是同步请求. socket 绝对多数语言都是支持socket的,底层走的是二进制传输. HTTP协议实际上是对Socke ...

  4. 并发-AQS源码分析

    AQS源码分析 参考: http://www.cnblogs.com/waterystone/p/4920797.html https://blog.csdn.net/fjse51/article/d ...

  5. JAVA 泛型意淫之旅(二)

    编译器如何处理泛型 泛型类编译后长什么样? 接上文,JAVA 泛型意淫之旅1,成功迎娶白富美后,终于迎来了最振奋人心的一刻:造娃!造男娃还是造女娃?对于我们程序猿来说,谁还在乎是男娃女娃,只要是自己的 ...

  6. 智课雅思词汇---二十五、形容词后缀-ate-fic-ose-ulent-olent-ous-ulous-y

    智课雅思词汇---二十五.形容词后缀-ate-fic-ose-ulent-olent-ous-ulous-y 一.总结 一句话总结: 1.形容词后缀-ate(determinate)? determi ...

  7. JSON/JSONP浅谈

    一.什么是JSON? JSON 即 JavaScript Object Notation 的缩写,简而言之就是JS对象的表示方法,是一种轻量级的数据交换格式. JSON 是存储和交换文本信息的语法,类 ...

  8. ubuntu14.04搭建Hadoop2.9.0集群(分布式)环境

    本文进行操作的虚拟机是在伪分布式配置的基础上进行的,具体配置本文不再赘述,请参考本人博文:ubuntu14.04搭建Hadoop2.9.0伪分布式环境 本文主要参考 给力星的博文——Hadoop集群安 ...

  9. angular指令(二)--内置指令

    一.基础ng 属性指令:  ng-href ng-src ng-disabled ng-checked ng-readonly ng-selected ng-class ng-styl ...

  10. 转:A/B测试:实现方法

    概念:http://www.aliued.cn/2010/09/13/ab-testing-basic-concept.html 我们先来看一个图: (注:感谢Algo提供本图.) 上图展示了 A/B ...