Skip to content

Commit c31f730

Browse files
authored
Merge pull request #30 from devsapp/new_docs
update docs
2 parents 2bafcc4 + a110221 commit c31f730

File tree

39 files changed

+379
-140
lines changed

39 files changed

+379
-140
lines changed

async-task/python3/cloudshell.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
# 快速体验 Python3.6 Event 函数案例
1+
# 快速体验 Python3.6 Async Task 函数案例
22

3-
欢迎您使用Serverless Devs开发者工具进行项目开发,本实验是基于Serverless Devs部署 Python3.6 Event 案例到阿里云函数计算。
3+
欢迎您使用Serverless Devs开发者工具进行项目开发,本实验是基于Serverless Devs部署 Python3.6 Async Task 案例到阿里云函数计算。
44

55
整个实验过程包括:
66
- [下载工具](#下载工具)
@@ -9,7 +9,7 @@
99
- [部署项目](#部署项目)
1010
- [更多信息](#更多信息)
1111

12-
> - [:octocat: 源代码](https://github.com/devsapp/start-fc/tree/master/event-function/fc-event-python3.6/src)
12+
> - [:octocat: 源代码](https://github.com/devsapp/start-fc/tree/master/async-task/python3/src)
1313
1414
## 下载工具
1515

@@ -38,14 +38,14 @@ npm install -g @serverless-devs/s
3838
进行项目初始化:
3939

4040
```
41-
s init start-fc-event-python3 -d start-fc-event-python3
41+
s init start-async-task-python3 -d start-async-task-python3
4242
```
4343

4444
在初始化的过程中,可能涉及到部分服务的开通、参数的获取以及参数的定义,请根据命令行的提醒进行具体的操作。
4545

4646
## 部署项目
4747

48-
- 进入项目:`cd start-fc-event-python3`
48+
- 进入项目:`cd start-async-task-python3`
4949
- 进行项目的部署:`s deploy`
5050

5151
稍等片刻,即可完成项目的部署。

async-task/python3/publish.yaml

Lines changed: 41 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Type: Application
22
Name: start-async-task-python3
3-
Version: 0.0.2
3+
Version: 0.1.1
44
Provider:
55
- 阿里云
66
Description: 快速部署一个 Python 3.6 的 async task 函数到阿里云函数计算。
@@ -13,8 +13,43 @@ Category: 新手入门
1313
Service:
1414
函数计算:
1515
Authorities:
16-
- 创建函数
17-
- 删除函数
18-
- 创建服务
19-
- 删除服务
20-
Runtime: Python
16+
- AliyunFCFullAccess
17+
- AliyunLogFullAccess
18+
Runtime: custom container
19+
Parameters:
20+
type: object
21+
additionalProperties: false # 不允许增加其他属性
22+
required: # 必填项
23+
- region
24+
- serviceName
25+
properties:
26+
region:
27+
title: 地域
28+
type: string
29+
default: cn-hangzhou
30+
description: 创建应用所在的地区
31+
enum:
32+
- cn-beijing
33+
- cn-hangzhou
34+
- cn-shanghai
35+
- cn-qingdao
36+
- cn-zhangjiakou
37+
- cn-huhehaote
38+
- cn-shenzhen
39+
- cn-chengdu
40+
- cn-hongkong
41+
- ap-southeast-1
42+
- ap-southeast-2
43+
- ap-southeast-3
44+
- ap-southeast-5
45+
- ap-northeast-1
46+
- eu-central-1
47+
- eu-west-1
48+
- us-west-1
49+
- us-east-1
50+
- ap-south-1
51+
serviceName:
52+
title: 服务名
53+
type: string
54+
default: async-task-service
55+
description: 服务名称,只能包含字母、数字、下划线和中划线。不能以数字、中划线开头。长度在 1-128 之间

async-task/python3/readme.md

Lines changed: 58 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,61 @@
1-
# 阿里云函数计算 Python 3.6 async task 案例
1+
# 阿里云函数计算 Python3.6 Async Task 函数案例
22

3-
只需几步就可以快速在阿里云函数计算服务上体验 Python 3.6 的 async task:
3+
<toc>
44

5-
- 初始化项目:`s init start-async-task-python3`
5+
<p align="center"><b> 中文 | <a href="./readme_en.md"> English </a> </b></p>
6+
7+
- [快速开始](#快速开始)
8+
- [通过应用中心部署](#通过应用中心部署)
9+
- [通过命令行工具部署](#通过命令行工具部署)
10+
- [通过阿里云CloudShell部署](#通过阿里云CloudShell部署)
11+
- [应用详情](#应用详情)
12+
- [关于我们](#关于我们)
13+
14+
</toc>
15+
16+
# 快速开始
17+
18+
- [:octocat: 源代码](https://github.com/devsapp/start-fc/tree/master/async-task/python3/src)
19+
20+
## 通过应用中心部署
21+
22+
<appcenter>
23+
24+
您可以在阿里云 [:earth_asia: Serverless 应用中心](https://fcnext.console.aliyun.com/applications/create?template=start-async-task-python3) ,快速体验该应用:
25+
26+
[![Deploy with Severless Devs](https://img.alicdn.com/imgextra/i1/O1CN01w5RFbX1v45s8TIXPz_!!6000000006118-55-tps-95-28.svg)](https://fcnext.console.aliyun.com/applications/create?template=start-async-task-python3)
27+
28+
</appcenter>
29+
30+
## 通过命令行工具部署
31+
32+
> 在开始之前,需要先安装 Serverless Devs 开发者工具:`npm install @serverless-devs/s -g`,更多安装方法,可以参考[Serverless Devs 安装文档](https://www.serverless-devs.com/serverless-devs/install) ,针对阿里云还需要配置密钥信息,配置密钥信息的方法可以参考[阿里云密钥配置文档](https://www.serverless-devs.com/fc/config)
33+
34+
- 初始化项目:`s init start-async-task-python3 -d start-async-task-python3`
35+
> 涉及到确定密钥的选择、服务名称的确定、函数名称的确定以及容器镜像的确定
636
- 进入项目:`cd start-async-task-python3`
7-
- 部署项目:`s deploy`
8-
- 触发项目
9-
- 1. `s async-task invoke -e {} --invocation-type async`, 成功调用一次 task 函数, 预计 30s 后, 函数执行成功, 会触发调用dest-succ 函数一次
10-
- 2. `s async-task invoke -e {"mock_error":1} --invocation-type async`, 调用一次 task 函数, 预期让 task 函数执行失败一次,会触发调用 dest-fail 函数一次
11-
- 3. `s async-task invoke -e {} --invocation-type async`, 成功调用一次 task 函数, 在函数执行过程中,在控制台取消这次任务函数的执行, 会触发调用 dest-fail 函数一次
12-
13-
即可实现`Python 3.6` async task 案例的初始化、部署整个流程。
14-
15-
> 本应用仓库地址:https://github.com/devsapp/start-fc
16-
17-
------------------------------------
18-
> # More
19-
> 欢迎您使用阿里云函数计算 FC 组件进行项目开发
20-
> 组件仓库地址/帮助文档:https://github.com/devsapp/fc
21-
> Yaml参考文档:https://github.com/devsapp/fc/blob/main/docs/zh/yaml.md
22-
> 快速入门:
23-
> - 快速创建应用:https://github.com/devsapp/fc/blob/main/docs/zh/quick_start_application.md
24-
> - 快速使用命令:https://github.com/devsapp/fc/blob/main/docs/zh/quick_start_function.md
25-
------------------------------------
37+
- 部署项目:`s deploy -y`
38+
- 调用函数:
39+
- 1. `s async-task invoke -e {} --invocation-type async`, 成功调用一次 task 函数, 预计 30s 后, 函数执行成功, 会触发调用dest-succ 函数一次
40+
- 2. `s async-task invoke -e {"mock_error":1} --invocation-type async`, 调用一次 task 函数, 预期让 task 函数执行失败一次,会触发调用 dest-fail 函数一次
41+
- 3. `s async-task invoke -e {} --invocation-type async`, 成功调用一次 task 函数, 在函数执行过程中,在控制台取消这次任务函数的执行, 会触发调用 dest-fail 函数一次
42+
43+
44+
## 通过阿里云CloudShell部署
45+
46+
如果您不想在应用中心中快速体验,也不想下载命令行工具体验,您也可以在[ :rocket: 阿里云 CloudShell](https://api.aliyun.com/new#/tutorial?action=git_open&git_repo=https://github.com/devsapp/start-fc.git&tutorial=async-task/python3/cloudshell.md) 中快速体验。
47+
48+
# 应用详情
49+
50+
本应用仅作为学习和参考使用,您可以基于本项目进行二次开发和完善,实现自己的业务逻辑
51+
52+
# 关于我们
53+
54+
- Serverless Devs 工具:
55+
- 仓库:[https://www.github.com/serverless-devs/serverless-devs](https://www.github.com/serverless-devs/serverless-devs)
56+
> 欢迎帮我们增加一个 :star2:
57+
- 官网:[https://www.serverless-devs.com/](https://www.serverless-devs.com/)
58+
- 阿里云函数计算组件:
59+
- 仓库:[https://github.com/devsapp/fc](https://github.com/devsapp/fc)
60+
- 帮助文档:[https://www.serverless-devs.com/fc/readme](https://www.serverless-devs.com/fc/readme)
61+
- 钉钉交流群:33947367

async-task/python3/readme_en.md

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Alibaba Cloud Function Compute Python3.6 Event function case
1+
# Alibaba Cloud Function Compute Python3.6 Async Task function case
22

33
<toc>
44

@@ -13,17 +13,20 @@
1313

1414
# Quick start
1515

16-
- [:octocat: source](https://github.com/devsapp/start-fc/tree/master/event-function/fc-event-python3.6/src)
16+
- [:octocat: source](https://github.com/devsapp/start-fc/tree/master/async-task/python3/src)
1717

1818
## Deploy via command line tools
1919

2020
> Before starting, you need to install the Serverless Devs developer tools: `npm install @serverless-devs/s -g`, for more installation methods, please refer to [Serverless Devs Installation Documentation](https://www.serverless-devs.com/serverless-devs/install) , you also need to configure key information for Alibaba Cloud. For the method of configuring key information, please refer to [Alibaba Cloud Key Configuration Document](https://www.serverless-devs.com/fc/config)
2121
22-
- Initialize the project: `s init start-fc-event-python3 -d start-fc-event-python3`
22+
- Initialize the project: `s init start-async-task-python3 -d start-async-task-python3`
2323
> It involves determining the selection of the key, the determination of the service name, the determination of the function name, and the determination of the container image
24-
- Enter the project: `cd start-fc-event-python3`
24+
- Enter the project: `cd start-async-task-python3`
2525
- Deploy the project: `s deploy -y`
26-
- Invoke function: `s invoke -e '{"key":"val"}'`
26+
- Invoke function:
27+
- 1. `s async-task invoke -e {} --invocation-type async`, The task function is called successfully once. It is expected that after 30s, the function will be executed successfully, which will trigger the call of DeST succ function once
28+
- 2. `s async-task invoke -e {"mock_error":1} --invocation-type async`, Call the task function once. It is expected that if the task function fails once, it will trigger the call of DeST fail function once
29+
- 3. `s async-task invoke -e {} --invocation-type async`, Successfully call the task function once. During the function execution, canceling the execution of the task function on the console will trigger the call of DeST fail function once
2730

2831
# Application details
2932

async-task/python3/src/readme.md

Lines changed: 58 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,61 @@
1-
# 阿里云函数计算 Python 3.6 async task 案例
1+
# 阿里云函数计算 Python3.6 Async Task 函数案例
22

3-
只需几步就可以快速在阿里云函数计算服务上体验 Python 3.6 的 async task:
3+
<toc>
44

5-
- 初始化项目:`s init start-async-task-python3`
5+
<p align="center"><b> 中文 | <a href="./readme_en.md"> English </a> </b></p>
6+
7+
- [快速开始](#快速开始)
8+
- [通过应用中心部署](#通过应用中心部署)
9+
- [通过命令行工具部署](#通过命令行工具部署)
10+
- [通过阿里云CloudShell部署](#通过阿里云CloudShell部署)
11+
- [应用详情](#应用详情)
12+
- [关于我们](#关于我们)
13+
14+
</toc>
15+
16+
# 快速开始
17+
18+
- [:octocat: 源代码](https://github.com/devsapp/start-fc/tree/master/async-task/python3/src)
19+
20+
## 通过应用中心部署
21+
22+
<appcenter>
23+
24+
您可以在阿里云 [:earth_asia: Serverless 应用中心](https://fcnext.console.aliyun.com/applications/create?template=start-async-task-python3) ,快速体验该应用:
25+
26+
[![Deploy with Severless Devs](https://img.alicdn.com/imgextra/i1/O1CN01w5RFbX1v45s8TIXPz_!!6000000006118-55-tps-95-28.svg)](https://fcnext.console.aliyun.com/applications/create?template=start-async-task-python3)
27+
28+
</appcenter>
29+
30+
## 通过命令行工具部署
31+
32+
> 在开始之前,需要先安装 Serverless Devs 开发者工具:`npm install @serverless-devs/s -g`,更多安装方法,可以参考[Serverless Devs 安装文档](https://www.serverless-devs.com/serverless-devs/install) ,针对阿里云还需要配置密钥信息,配置密钥信息的方法可以参考[阿里云密钥配置文档](https://www.serverless-devs.com/fc/config)
33+
34+
- 初始化项目:`s init start-async-task-python3 -d start-async-task-python3`
35+
> 涉及到确定密钥的选择、服务名称的确定、函数名称的确定以及容器镜像的确定
636
- 进入项目:`cd start-async-task-python3`
7-
- 部署项目:`s deploy`
8-
- 触发项目
9-
- 1. `s async-task invoke -e {} --invocation-type async`, 成功调用一次 task 函数, 预计 30s 后, 函数执行成功, 会触发调用dest-succ 函数一次
10-
- 2. `s async-task invoke -e {"mock_error":1} --invocation-type async`, 调用一次 task 函数, 预期让 task 函数执行失败一次,会触发调用 dest-fail 函数一次
11-
- 3. `s async-task invoke -e {} --invocation-type async`, 成功调用一次 task 函数, 在函数执行过程中,在控制台取消这次任务函数的执行, 会触发调用 dest-fail 函数一次
12-
13-
即可实现`Python 3.6` async task 案例的初始化、部署整个流程。
14-
15-
> 本应用仓库地址:https://github.com/devsapp/start-fc
16-
17-
------------------------------------
18-
> # More
19-
> 欢迎您使用阿里云函数计算 FC 组件进行项目开发
20-
> 组件仓库地址/帮助文档:https://github.com/devsapp/fc
21-
> Yaml参考文档:https://github.com/devsapp/fc/blob/main/docs/zh/yaml.md
22-
> 快速入门:
23-
> - 快速创建应用:https://github.com/devsapp/fc/blob/main/docs/zh/quick_start_application.md
24-
> - 快速使用命令:https://github.com/devsapp/fc/blob/main/docs/zh/quick_start_function.md
25-
------------------------------------
37+
- 部署项目:`s deploy -y`
38+
- 调用函数:
39+
- 1. `s async-task invoke -e {} --invocation-type async`, 成功调用一次 task 函数, 预计 30s 后, 函数执行成功, 会触发调用dest-succ 函数一次
40+
- 2. `s async-task invoke -e {"mock_error":1} --invocation-type async`, 调用一次 task 函数, 预期让 task 函数执行失败一次,会触发调用 dest-fail 函数一次
41+
- 3. `s async-task invoke -e {} --invocation-type async`, 成功调用一次 task 函数, 在函数执行过程中,在控制台取消这次任务函数的执行, 会触发调用 dest-fail 函数一次
42+
43+
44+
## 通过阿里云CloudShell部署
45+
46+
如果您不想在应用中心中快速体验,也不想下载命令行工具体验,您也可以在[ :rocket: 阿里云 CloudShell](https://api.aliyun.com/new#/tutorial?action=git_open&git_repo=https://github.com/devsapp/start-fc.git&tutorial=async-task/python3/cloudshell.md) 中快速体验。
47+
48+
# 应用详情
49+
50+
本应用仅作为学习和参考使用,您可以基于本项目进行二次开发和完善,实现自己的业务逻辑
51+
52+
# 关于我们
53+
54+
- Serverless Devs 工具:
55+
- 仓库:[https://www.github.com/serverless-devs/serverless-devs](https://www.github.com/serverless-devs/serverless-devs)
56+
> 欢迎帮我们增加一个 :star2:
57+
- 官网:[https://www.serverless-devs.com/](https://www.serverless-devs.com/)
58+
- 阿里云函数计算组件:
59+
- 仓库:[https://github.com/devsapp/fc](https://github.com/devsapp/fc)
60+
- 帮助文档:[https://www.serverless-devs.com/fc/readme](https://www.serverless-devs.com/fc/readme)
61+
- 钉钉交流群:33947367

0 commit comments

Comments
 (0)