openfaas 简单试用
参考以前文章,或者使用官方的shell脚本
mkdir rong
cd rong
faas-cli new rong --lang python // 默认会有简单的测试code
// 生成的项目代码
rong rong.yml template
// 完整目录如下,部分是不需要的,只是一些模板,我们需要的就是Python 的
├── rong
│ ├── handler.py
│ └── requirements.txt
├── rong.yml
└── template
├── csharp
│ ├── Dockerfile
│ ├── function
│ │ ├── Function.csproj
│ │ └── FunctionHandler.cs
│ ├── Program.cs
│ └── root.csproj
├── go
│ ├── Dockerfile
│ ├── function
│ │ └── handler.go
│ └── main.go
├── node
│ ├── build.sh
│ ├── Dockerfile
│ ├── function
│ │ ├── handler.js
│ │ └── package.json
│ ├── index.js
│ └── package.json
├── node-arm64
│ ├── build.sh
│ ├── Dockerfile
│ ├── function
│ │ ├── handler.js
│ │ └── package.json
│ ├── index.js
│ └── package.json
├── node-armhf
│ └── Dockerfile
├── python
│ ├── Dockerfile
│ ├── function
│ │ ├── handler.py
│ │ └── requirements.txt
│ ├── index.py
│ └── requirements.txt
├── python3
│ ├── Dockerfile
│ ├── function
│ │ ├── handler.py
│ │ ├── __init__.py
│ │ └── requirements.txt
│ ├── index.py
│ └── requirements.txt
├── python-armhf
│ └── Dockerfile
└── ruby
├── Dockerfile
├── function
│ ├── Gemfile
│ └── handler.rb
├── Gemfile
└── index.rb
// 构建
faas-cli build -f ./rong.yml
// 具体的输出
[0] > Building: rong.
Clearing temporary build folder: ./build/rong/
Preparing ./rong/ ./build/rong/function
Building: rong with python template. Please wait..
docker build -t rong .
Sending build context to Docker daemon 6.144kB
Step 1/15 : FROM python:2.7-alpine
---> 9b06bbaac1c7
Step 2/15 : RUN apk --no-cache add curl && echo "Pulling watchdog binary from Github." && curl -sSL https://github.com/openfaas/faas/releases/download/0.6.1/fwatchdog > /usr/bin/fwatchdog && chmod +x /usr/bin/fwatchdog && apk del curl --no-cache
---> Using cache
---> bd048b13c8ba
Step 3/15 : WORKDIR /root/
---> Using cache
---> 54c96a75a92e
Step 4/15 : COPY index.py .
---> Using cache
---> b6f064e7ff22
Step 5/15 : COPY requirements.txt .
---> Using cache
---> c844fec1e035
Step 6/15 : RUN pip install -r requirements.txt
---> Using cache
---> ca4c6044fa4e
Step 7/15 : COPY function function
---> Using cache
---> 5cd07cf272ff
Step 8/15 : RUN touch ./function/__init__.py
---> Using cache
---> 9d4dd7aee98b
Step 9/15 : WORKDIR /root/function/
---> Using cache
---> 4a1374f1c1f5
Step 10/15 : COPY function/requirements.txt .
---> Using cache
---> 8c0facae743b
Step 11/15 : RUN pip install -r requirements.txt
---> Using cache
---> 62943c5906f8
Step 12/15 : WORKDIR /root/
---> Using cache
---> 907178d97644
Step 13/15 : ENV fprocess "python index.py"
---> Using cache
---> d65f459a52a3
Step 14/15 : HEALTHCHECK --interval=1s CMD [ -e /tmp/.lock ] || exit 1
---> Using cache
---> 3e19415c84b6
Step 15/15 : CMD fwatchdog
---> Using cache
---> e85c978e99a4
Successfully built e85c978e99a4
Successfully tagged rong:latest
Image: rong built.
[0] < Builder done.
// 发布
faas-cli deploy -f ./rong.yml
// 返回信息如下
Deploying: rong.
No existing service to remove
Deployed.
URL: http://localhost:8080/function/rong
200 OK

openfaas 简单试用的更多相关文章
- jQuery无刷新上传之uploadify简单试用
先简单的侃两句:貌似已经有两个月的时间没有写过文章了,不过仍会像以前那样每天至少有一至两个小时是泡在园子里看各位大神的文章.前些天在研究“ajax无刷新上传”方面的一些插件,用SWFUpload实现了 ...
- cloudevents js sdk 简单试用
cloudevents 目前官方提供了不同语言的sdk,以下是js 的简单学习试用,从目前来说更新不是很好 clone 代码 git clone https://github.com/cloudeve ...
- podium micro-frontends 简单试用
以下是一个简单的podium 试用,包含了layout 以及podlets,使用docker 运行 podium 主要包含了两大部分 podlets 片段服务 layouts 片段组合服务 环境准备 ...
- Visual Studio Code 的简单试用体验
首先对Visual Studio Code做一个大概的介绍.首先明确一下,这个Visual Studio Code(以下简称 vscode)是一个带GUI的代码编辑器,也就是只能完成简单的代码编辑功能 ...
- Cassandra安装及其简单试用
官方主页:http://cassandra.apache.org/ 简介: The Apache Cassandra Project develops a highly scalable second ...
- nginx ngx_http_image_filter_module 简单试用
nginx包含了一个ngx_http_image_filter_module 模块,我们可以方便的进行图片的缩略图,平时一些简单的功能 已经够用了 环境准备 为了简单使用docker-compose ...
- Apigee 简介与简单试用
 Apigee (国内访问需要***)是一家成立于2004年的API管理公司,于2016年9月被Google收购,作为Google云的服务之一.Apigee提供从API设计.开发.管理.门户.网关等 ...
- vernemq 集群 docker-compose 搭建简单试用
vernemq 是一款开源的mqtt broker, 支持cluster 模式部署,而且部署比较简单 以下是一个使用docker-compose 搭建环境的demo 环境准备 docker-compo ...
- tailor+ skipper 实现micro-frontends 简单试用
tailor 在Mosaic 框架中扮演fragment 模版layout的处理,后端fragment可以用任何服务编写 tailor 主要就是进行layout的处理.tailor的是类似facebo ...
随机推荐
- Vmware ESXi 6.0 多Vlan部署,vSphere Client管理方法
背景: 公司IT部门新购了两台服务器与一台存储,打算做虚拟化,并将存储分成两个部分,分别配给那两台服务器.在宿主机上要安装的虚拟机属于不同的网段,这就涉及了多VLAN,当然这并不是多么高深的技术,属于 ...
- centos 6+安装山逗斯骚尅特
系统支持:CentOS 6+,Debian 7+,Ubuntu 12+ 内存要求:≥128M 关于本脚本 一键安装 Shadowsocks-Python, ShadowsocksR, Shadowso ...
- 20145229吴姗珊逆向BOF实践
20145229吴姗珊逆向BOF实践 实践 实践目标 本次实践的对象是一个名为pwn1的linux可执行文件 该程序正常执行流程是:main调用foo函数,foo函数会简单回显任何用户输入的字符串. ...
- 第二篇:Spark SQL Catalyst源码分析之SqlParser
/** Spark SQL源码分析系列文章*/ Spark SQL的核心执行流程我们已经分析完毕,可以参见Spark SQL核心执行流程,下面我们来分析执行流程中各个核心组件的工作职责. 本文先从入口 ...
- GPL,BSD,Apache,MIT开源许可协议
在linux环境下学习的多了,这些开源协议也听的见的越来越多,感觉有必要仔细了解一下. 1. BSD 先说BSD是因为它的自由度相对来说是比较大的.BSD全称Berkeley Software Dis ...
- Java中异常的捕获顺序(多个catch)
import java.io.IOException; public class ExceptionTryCatchTest { public void doSomething() throws IO ...
- 20165332《Java程序设计》第2周学习总结
<Java程序设计>第2周学习总结 2-3章学习内容 第二章 标识符(名字) 关键字 int class 基本数据类型 逻辑类型 整数类型 字符类型 浮点类型 各类型相互转换 --低级别给 ...
- python脚本5_求素数
#求素数 #素数:只能被1和它自己整除 n = int(input('Please input a number >>>')) flag = False for i in range ...
- docker安装脚本
此docker安装脚本为官方提供的,可以从网上下载,此处直接把脚本内容贴上. #!/bin/sh set -e # This script is meant for quick & easy ...
- 用OpenCV进行视频截取
记录用OpenCV进行视频截取. 核心代码如下: CvCapture* capture = cvCreateFileCapture(src_avi_file.c_str()); if (capture ...