Skip to content

Commit

Permalink
Merge pull request #73 from littlerainxy/yusha-grpc-demo
Browse files Browse the repository at this point in the history
fix golang websocket and grpc yaml
  • Loading branch information
halegreen authored Feb 8, 2023
2 parents 12665dc + 00e1ec5 commit 042b4ed
Show file tree
Hide file tree
Showing 16 changed files with 41 additions and 65 deletions.
2 changes: 1 addition & 1 deletion custom-function/golang/fc-custom-golang-grpc/publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Type: Application
Name: fc-custom-golang-grpc
Provider:
- 阿里云
Version: 0.2.0
Version: 0.4.1
Description: 快速部署一个基于custom runtime 的 Golang grpc 类型的 Hello World 到阿里云函数计算
HomePage: https://github.com/devsapp/start-fc
Tags:
Expand Down
9 changes: 0 additions & 9 deletions custom-function/golang/fc-custom-golang-grpc/src/Makefile

This file was deleted.

This file was deleted.

11 changes: 0 additions & 11 deletions custom-function/golang/fc-custom-golang-grpc/src/certificate

This file was deleted.

Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ import (

"github.com/golang/protobuf/proto"

pb "fc-custom-golang-grpc/proto"
"google.golang.org/grpc"
pb "tmp/proto"
)

var (
Expand Down
5 changes: 0 additions & 5 deletions custom-function/golang/fc-custom-golang-grpc/src/privatekey

This file was deleted.

11 changes: 8 additions & 3 deletions custom-function/golang/fc-custom-golang-grpc/src/s.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,10 @@ services:
component: fc
actions: # 自定义执行逻辑,关于actions 的使用,可以参考:https://www.serverless-devs.com/serverless-devs/yaml#行为描述
pre-deploy: # 在deploy之前运行
- run: make build
path: ./
- run: go mod tidy
path: ./code
- run: GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build -o target/main main.go
path: ./code
# - component: fc build --use-docker --dockerfile ./code/Dockerfile # 要运行的组件,格式为【component: 组件名 命令 参数】(可以通过s cli registry search --type Component 获取组件列表)
# - run: docker build xxx # 要执行的系统命令,类似于一种钩子的形式
# path: ./src # 执行系统命令/钩子的路径
Expand All @@ -55,9 +57,12 @@ services:
timeout: 30
memorySize: 512
runtime: custom
codeUri: ./code
codeUri: ./code/target
instanceConcurrency: 3
caPort: 8089
customRuntimeConfig:
command:
- '/code/main'
triggers:
- name: http2Trigger
type: http
Expand Down
11 changes: 8 additions & 3 deletions custom-function/golang/fc-custom-golang-grpc/src/s_en.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,10 @@ services:
component: fc # The name of the component. The Serverless Devs tool itself is similar to a game console and does not have specific business capabilities. The component is similar to a game card. Users can achieve different functions by inserting different game cards into the game console, that is, by using Different components implement different specific business capabilities
actions: # Customize execution logic. For the use of actions, please refer to: https://www.serverless-devs.com/serverless-devs/yaml#Behavior description
pre-deploy: # run before deploy
- run: make build
path: ./
- run: go mod tidy
path: ./code
- run: GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build -o target/main main.go
path: ./code
# - component: fc build --use-docker --dockerfile ./code/Dockerfile # The component to run, the format is [component: component name command parameter] (you can get the component list through s cli registry search --type Component)
# - run: docker build xxx # System command to execute, similar to a hook
# path: ./src # The path to execute system commands/hooks
Expand All @@ -60,9 +62,12 @@ services:
timeout: 30
memorySize: 512
runtime: custom
codeUri: ./code
codeUri: ./code/target
instanceConcurrency: 3
caPort: 8089
customRuntimeConfig:
command:
- '/code/main'
triggers:
- name: http2Trigger
type: http
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Type: Application
Name: fc-custom-golang-websocket
Provider:
- 阿里云
Version: 0.0.19
Version: 0.0.20
Description: 快速部署一个基于custom runtime 的 Golang WebSocket 类型的 Echo 函数到阿里云函数计算
HomePage: https://github.com/devsapp/start-fc
Tags:
Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module main

go 1.17
11 changes: 8 additions & 3 deletions custom-function/golang/fc-custom-golang-websocket/src/s.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,10 @@ services:
component: fc # 组件名称,Serverless Devs 工具本身类似于一种游戏机,不具备具体的业务能力,组件类似于游戏卡,用户通过向游戏机中插入不同的游戏卡实现不同的功能,即通过使用不同的组件实现不同的具体业务能力
actions: # 自定义执行逻辑,关于actions 的使用,可以参考:https://www.serverless-devs.com/serverless-devs/yaml#行为描述
pre-deploy: # 在deploy之前运行
- run: make build
path: ./
- run: go mod tidy
path: ./code
- run: GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build -o target/main main.go
path: ./code
# - component: fc build --use-docker --dockerfile ./code/Dockerfile # 要运行的组件,格式为【component: 组件名 命令 参数】(可以通过s cli registry search --type Component 获取组件列表)
# - run: docker build xxx # 要执行的系统命令,类似于一种钩子的形式
# path: ./src # 执行系统命令/钩子的路径
Expand All @@ -54,8 +56,11 @@ services:
timeout: 900
memorySize: 512
runtime: custom
codeUri: ./code
codeUri: ./code/target
instanceConcurrency: 10
customRuntimeConfig:
command:
- '/code/main'
triggers:
- name: http_t
type: http
Expand Down
11 changes: 8 additions & 3 deletions custom-function/golang/fc-custom-golang-websocket/src/s_en.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,10 @@ services:
component: fc # The name of the component. The Serverless Devs tool itself is similar to a game console and does not have specific business capabilities. The component is similar to a game card. Users can achieve different functions by inserting different game cards into the game console, that is, by using Different components implement different specific business capabilities
actions: # Customize execution logic. For the use of actions, please refer to: https://www.serverless-devs.com/serverless-devs/yaml#Behavior description
pre-deploy: # run before deploy
- run: make build
path: ./
- run: go mod tidy
path: ./code
- run: GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build -o target/main main.go
path: ./code
# - component: fc build --use-docker --dockerfile ./code/Dockerfile # The component to run, the format is [component: component name command parameter] (you can get the component list through s cli registry search --type Component)
# - run: docker build xxx # System command to execute, similar to a hook
# path: ./src # The path to execute system commands/hooks
Expand All @@ -54,8 +56,11 @@ services:
timeout: 900
memorySize: 512
runtime: custom
codeUri: ./code
codeUri: ./code/target
instanceConcurrency: 10
customRuntimeConfig:
command:
- '/code/main'
triggers:
- name: http_t
type: http
Expand Down
4 changes: 3 additions & 1 deletion update.list
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
event-function/fc-event-python3
http-function/fc-http-python3
http-function/fc-http-python3
custom-function/golang/fc-custom-golang-grpc
custom-function/golang/fc-custom-golang-websocket

0 comments on commit 042b4ed

Please sign in to comment.