主要是文件
  • 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. Terms of Company

    CMD系统:中国机车远程监视与诊断系统,由车载子系统.车地数据传输子系统和CMD地面综合应用子系统三部分组成. LKJ:列车运行监控装置,机车运行过程中与行车安全相关的信息,如司机号.车次.公里标.速 ...

  2. codeforces 738

    D: 题意:一行1*n的格子放船只,船数为a,船的长度为b,每格为0或1,1表示该格并不是船只的一部分,找出最少的格子数使得射击这些格子至少能打中一艘船. 思路:船的长度为b,即每段连续的长度为b的0 ...

  3. centos、linux查找未挂载磁盘格式化并挂载?

    centos.linux查找未挂载磁盘格式化并挂载? df -h 查看当前linux服务器硬盘: fdisk -l /dev/sda   第一块硬盘 /dev/sdb   第二块硬盘 依此类推 以/d ...

  4. spring security结合数据库验证用户-注解方式

    项目目录结构如下: 首先数据库的建立和数据导入,以及一些类的依赖参考XML配置方式,需要修改一些配置. 一.在AppConfig文件中添加DataSource的配置 @Bean(name = &quo ...

  5. 关系型数据库的ACID规则

    1.A (Atomicity) 原子性 原子性很容易理解,也就是说事务里的所有操作要么全部做完,要么都不做,事务成功的条件是事务里的所有操作都成功,只要有一个操作失败,整个事务就失败,需要回滚. 比如 ...

  6. jQuery和javaScript页面加载完成时触发的事件

    <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title> ...

  7. Pow,求x的y次幂

    算法分析:很显然用递归.但是直接用递归会造成栈溢出,时间复杂度是o(n).所以要用分治思想,时间复杂度是o(logN). public class Power { //栈溢出,时间复杂度是o(n) p ...

  8. gitlab库迁移

    gitlab 迁移 gitlab上一共有两个分之,一级提交记录. git clone --bare http://111.222.333.xxx/jiqing/test.git 执行成功后,会多一个t ...

  9. Pandas级联

    Pandas提供了各种工具(功能),可以轻松地将Series,DataFrame和Panel对象组合在一起. pd.concat(objs,axis=0,join='outer',join_axes= ...

  10. ZZ__知识点

    1. DLL_PROCESS_ATTACH.DLL_PROCESS_DETACH 打印出相关信息 发现,Java Project 项目中,DLL 在 System.loadLibrary(...) 载 ...