zoukankan      html  css  js  c++  java
  • fn project faas 框架试用

    1. 预备环境
    docker 17.05
    docker hub account (测试可选)
    2. 安装
    curl -LSs https://raw.githubusercontent.com/fnproject/cli/master/install | sh
    3. 简单例子
         a. 启动服务
         fn start
         b. go  项目例子
           func.go
       package main
       import (
         "fmt"
        )
       func main() {
         fmt.Println("Hello from Fn!")
       }
    
        c. 运行项目
    # Initialize your function
    # This detects your runtime from the code above and creates a func.yaml
    fn init
    
    # Set your Docker Hub username
    export FN_REGISTRY=<DOCKERHUB_USERNAME>
    
    # Test your function
    # This will run inside a container exactly how it will on the server
    fn run
    
    # Deploy your functions to the Fn server (default localhost:8080)
    # This will create a route to your function as well
    fn deploy --app myapp
     
     
    4. 管理界面
         
        docker 运行模式 
    docker run --rm -it --link functions:api -p 4000:4000 -e "API_URL=http://api:8080" fnproject/ui
     
     
      如下:
     
    5. 参考资料
    https://github.com/fnproject/ui
    https://github.com/fnproject/fn

  • 相关阅读:
    wepy框架构建小程序(1)
    百度地图2
    百度地图1
    VS Code 用户自定义代码片段(React)
    JS MarcoTasks MicroTasks
    JS位运算和遍历
    VueX源码分析(5)
    VueX源码分析(4)
    tensorflow 自带的实现函数翻转的函数
    namedtuple
  • 原文地址:https://www.cnblogs.com/rongfengliang/p/7627169.html
Copyright © 2011-2022 走看看