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 ...
随机推荐
- 20145201《Java程序设计》第8周学习总结
20145201 <Java程序设计>第八周学习总结 教材学习内容总结 第十五章 通用API 15.1 日志 15.1.1 日志API简介 java.util.logging包提供了日志功 ...
- sqlserver一般需求
1.创建一个函数:将用逗号分隔的字符串变成一个表的一列,这样就可以运用在select 语句的in中查询 create Function StrToTable(@str varchar()) Retur ...
- 解决hive交互模式退格键乱码
在hive的交互模式下,输入退格.方向键等,出现乱码,可以通过如下方法解决: 1.修改bashrc文件: vi ~/.bashrc 在文件最后添加一行: stty erase ^H. 2.使修改生效: ...
- SPFA算法 - Bellman-ford算法的进一步优化
2017-07-27 22:18:11 writer:pprp SPFA算法实质与Bellman-Ford算法的实质一样,每次都要去更新最短路径的估计值. 优化:只有那些在前一遍松弛中改变了距离点的 ...
- 一个问题:C#引用类型传参,说出你的答案
namespace ConsoleApplication1 { class Program { static void Main(string[] args) { People p = new Peo ...
- I方法怎么不能获取多选框的数据
前端代码 <input type="checkbox" name="m_name" value="{$vo.name}" class ...
- Spring -- spring 中使用jdbc, c3p0连接池, dao概念
1. 示例代码 CustomerDao.java ,dao接口 public interface CustomerDao { public void insertCustomer(Customer ...
- codevs 1017 乘积最大 dp
1017 乘积最大 时间限制: 1 s 空间限制: 128000 KB 题目描述 Description 今年是国际数学联盟确定的“2000——世界数学年”,又恰逢我国著名数学家华罗庚 ...
- Sqlserver 查询 临时字段
临时字段格式 字段名=N'字段值' 例子如下: select cEmp_C, cEmp_N, oper_id=N'001', log_pw=N'123', sSex, cDept_C, cDept ...
- LeetCode第[26]题(Java):Remove Duplicates from Sorted Array 标签:Array
题目难度:Easy 题目: Given a sorted array, remove the duplicates in-place such that each element appear onl ...