Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/email_api' into email_api
Browse files Browse the repository at this point in the history
  • Loading branch information
seeflood committed Aug 19, 2022
2 parents a895df8 + c2bfb48 commit 4503b6c
Show file tree
Hide file tree
Showing 103 changed files with 33,139 additions and 646 deletions.
3 changes: 3 additions & 0 deletions .github/dead_link_check_config.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@
{
"pattern": "^https://console.cloud.tencent.com/cos/bucket"
},
{
"pattern": "^https://docs.buf.build/"
},
{
"pattern": "^#"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:

jobs:
check:
name: "🍀 Markdown Lint"
name: "🍀 Markdown Validation"
runs-on: ubuntu-latest
steps:
- name: Check out code
Expand Down
25 changes: 25 additions & 0 deletions .github/workflows/proto-checker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Layotto Env Pipeline 🌊

on:
pull_request:
branches:
- main

jobs:
check:
name: "🍀 Proto Validation"
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v2

- name: buf-setup
uses: bufbuild/buf-setup-action@v1
with:
version: '1.6.0'

- name: Install buf-lint
uses: bufbuild/buf-lint-action@v1

- name: Check comments in proto files
run: buf lint
39 changes: 39 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ include make/golang.mk
include make/image.mk
include make/wasm.mk
include make/ci.mk
include make/deploy.mk
include make/proto.mk

# ==============================================================================
Expand Down Expand Up @@ -165,6 +166,34 @@ wasm.image:
wasm.image.push:
@$(MAKE) go.wasm.image.push

# ==============================================================================
## deploy: Deploy Layotto to Kubernetes
# ==============================================================================
.PHONY: deploy
deploy:
@$(MAKE) deploy.k8s

# ==============================================================================
## deploy.standalone: Deploy Layotto to Kubernetes in Standalone Mode
# ==============================================================================
.PHONY: deploy.standalone
deploy.standalone:
@$(MAKE) deploy.k8s.standalone

# ==============================================================================
## undeploy: Remove Layotto in Kubernetes
# ==============================================================================
.PHONY: undeploy
undeploy:
@$(MAKE) undeploy.k8s

# ==============================================================================
## undeploy.standalone: Remove Layotto in Kubernetes in Standalone Mode
# ==============================================================================
.PHONY: undeploy.standalone
undeploy.standalone:
@$(MAKE) undeploy.k8s.standalone

# ==============================================================================
## check: Run all go checks of code sources.
# ==============================================================================
Expand Down Expand Up @@ -254,6 +283,13 @@ clean:
proto.doc:
@$(MAKE) proto.gen.doc

# ==============================================================================
## proto: Generate code and documentation based on the proto files.
# ==============================================================================
.PHONY: proto
proto:
@$(MAKE) proto.gen.all

# ==============================================================================
## proto.init: Install protoc-gen-go and protoc-gen-go-grpc
# ==============================================================================
Expand Down Expand Up @@ -291,6 +327,9 @@ ARGS:
This option is available when using: make build.multiarch/image.multiarch/push.multiarch
Example: make image.multiarch IMAGES="layotto" PLATFORMS="linux_amd64 linux_arm64"
Supported Platforms: linux_amd64 linux_arm64 darwin_amd64 darwin_arm64
NAMESPACE The namepace to deploy. Default is `default`.
This option is available when using: make deploy/deploy.standalone/undeploy/undeploy.standalone
Example: make deploy NAMESPACE="layotto"
endef
export USAGE_OPTIONS

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ Layotto enriches the <a href="https://landscape.cncf.io/serverless">CNCF CLOUD N

| Platform | Link |
| :----------------------------------------------------- | :----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| 💬 [DingTalk](https://www.dingtalk.com/en) (preferred) | Search the group number: 31912621 or scan the QR code below <br> <img src="https://raw.githubusercontent.com/mosn/layotto/main/docs/img/ding-talk-group-1.png" height="200px"> |
| 💬 [DingTalk](https://www.dingtalk.com/en) (preferred) | Search the group number: 31912621 or scan the QR code below <br> <img src="https://gw.alipayobjects.com/mdn/rms_5891a1/afts/img/A*HUKsSrFthtUAAAAAAAAAAAAAARQnAQ" height="200px"> |

[comment]: <> (| 💬 [Wechat]&#40;https://www.wechat.com/en/&#41; | Scan the QR code below and she will invite you into the wechat group <br> <img src="/img/wechat-group.jpg" height="200px">)

Expand Down
11 changes: 11 additions & 0 deletions buf.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
version: v1
lint:
use:
- MINIMAL
- COMMENT_ENUM
- COMMENT_ENUM_VALUE
- COMMENT_FIELD
- COMMENT_MESSAGE
- COMMENT_ONEOF
- COMMENT_RPC
- COMMENT_SERVICE
39 changes: 25 additions & 14 deletions cmd/layotto/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,16 @@ import (
"strconv"
"time"

"mosn.io/layotto/components/oss"

aws_oss "mosn.io/layotto/components/oss/aws"

aliyun_oss "mosn.io/layotto/components/oss/aliyun"

"mosn.io/mosn/pkg/istio"

aliyun_file "mosn.io/layotto/components/file/aliyun"

"github.com/dapr/components-contrib/secretstores"
"github.com/dapr/components-contrib/secretstores/aws/parameterstore"
"github.com/dapr/components-contrib/secretstores/aws/secretmanager"
Expand All @@ -34,14 +42,15 @@ import (
secretstore_env "github.com/dapr/components-contrib/secretstores/local/env"
secretstore_file "github.com/dapr/components-contrib/secretstores/local/file"

"mosn.io/layotto/components/file/aws"
"mosn.io/layotto/components/file/minio"
"mosn.io/layotto/components/file/qiniu"
"mosn.io/layotto/components/file/tencentcloud"

"mosn.io/layotto/pkg/grpc/default_api"
secretstores_loader "mosn.io/layotto/pkg/runtime/secretstores"

"mosn.io/layotto/components/file/local"
"mosn.io/layotto/components/file/s3/alicloud"
"mosn.io/layotto/components/file/s3/aws"
"mosn.io/layotto/components/file/s3/minio"

mock_state "mosn.io/layotto/pkg/mock/components/state"

dbindings "github.com/dapr/components-contrib/bindings"
Expand Down Expand Up @@ -126,10 +135,6 @@ import (
sequencer_redis "mosn.io/layotto/components/sequencer/redis"
sequencer_zookeeper "mosn.io/layotto/components/sequencer/zookeeper"

// File
"mosn.io/layotto/components/file/s3/qiniu"
"mosn.io/layotto/components/file/s3/tencentcloud"

// Actuator
_ "mosn.io/layotto/pkg/actuator"
"mosn.io/layotto/pkg/actuator/health"
Expand Down Expand Up @@ -200,6 +205,8 @@ import (
_ "mosn.io/mosn/pkg/upstream/servicediscovery/dubbod"

_ "mosn.io/layotto/diagnostics/exporter_iml"

s3ext "mosn.io/layotto/pkg/grpc/extension/s3"
)

// loggerForDaprComp is constructed for reusing dapr's components.
Expand Down Expand Up @@ -251,6 +258,7 @@ func NewRuntimeGrpcServer(data json.RawMessage, opts ...grpc.ServerOption) (mgrp
// register your gRPC API here
runtime.WithGrpcAPI(
default_api.NewGrpcAPI,
s3ext.NewS3Server,
),
// Hello
runtime.WithHelloFactory(
Expand All @@ -269,14 +277,17 @@ func NewRuntimeGrpcServer(data json.RawMessage, opts ...grpc.ServerOption) (mgrp

// File
runtime.WithFileFactory(
file.NewFileFactory("aliOSS", alicloud.NewAliCloudOSS),
file.NewFileFactory("minioOSS", minio.NewMinioOss),
file.NewFileFactory("awsOSS", aws.NewAwsOss),
file.NewFileFactory("tencentCloudOSS", tencentcloud.NewTencentCloudOSS),
file.NewFileFactory("aliyun.oss", aliyun_file.NewAliyunFile),
file.NewFileFactory("minio", minio.NewMinioOss),
file.NewFileFactory("aws.s3", aws.NewAwsFile),
file.NewFileFactory("tencent.oss", tencentcloud.NewTencentCloudOSS),
file.NewFileFactory("local", local.NewLocalStore),
file.NewFileFactory("qiniuOSS", qiniu.NewQiniuOSS),
file.NewFileFactory("qiniu.oss", qiniu.NewQiniuOSS),
),
runtime.WithOssFactory(
oss.NewFactory("aws.oss", aws_oss.NewAwsOss),
oss.NewFactory("aliyun.oss", aliyun_oss.NewAliyunOss),
),

// PubSub
runtime.WithPubSubFactory(
pubsub.NewFactory("redis", func() dapr_comp_pubsub.PubSub {
Expand Down
47 changes: 30 additions & 17 deletions cmd/layotto_multiple_api/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,14 @@ import (
"strconv"
"time"

"mosn.io/layotto/cmd/layotto_multiple_api/helloworld/component"
"mosn.io/layotto/components/custom"
"mosn.io/layotto/pkg/grpc/dapr"
"mosn.io/layotto/components/oss"

aws_oss "mosn.io/layotto/components/oss/aws"

aliyun_oss "mosn.io/layotto/components/oss/aliyun"

aliyun_file "mosn.io/layotto/components/file/aliyun"
"mosn.io/layotto/components/file/local"

"mosn.io/mosn/pkg/istio"

Expand All @@ -47,15 +52,21 @@ import (
_ "mosn.io/layotto/pkg/wasm/uninstall"
_ "mosn.io/layotto/pkg/wasm/update"

"mosn.io/layotto/components/file/local"
"mosn.io/layotto/components/file/s3/alicloud"
"mosn.io/layotto/components/file/s3/aws"
"mosn.io/layotto/components/file/s3/minio"
_ "mosn.io/mosn/pkg/filter/stream/grpcmetric"

dbindings "github.com/dapr/components-contrib/bindings"
"github.com/dapr/components-contrib/bindings/http"
"mosn.io/pkg/log"

"mosn.io/layotto/cmd/layotto_multiple_api/helloworld/component"
"mosn.io/layotto/components/custom"
aws_file "mosn.io/layotto/components/file/aws"
"mosn.io/layotto/components/file/minio"
"mosn.io/layotto/components/file/qiniu"
"mosn.io/layotto/components/file/tencentcloud"
"mosn.io/layotto/pkg/grpc/dapr"
s3ext "mosn.io/layotto/pkg/grpc/extension/s3"

"mosn.io/layotto/components/configstores/etcdv3"
"mosn.io/layotto/components/file"
"mosn.io/layotto/components/sequencer"
Expand Down Expand Up @@ -134,10 +145,6 @@ import (
sequencer_redis "mosn.io/layotto/components/sequencer/redis"
sequencer_zookeeper "mosn.io/layotto/components/sequencer/zookeeper"

// File
"mosn.io/layotto/components/file/s3/qiniu"
"mosn.io/layotto/components/file/s3/tencentcloud"

// Actuator
_ "mosn.io/layotto/pkg/actuator"
"mosn.io/layotto/pkg/actuator/health"
Expand All @@ -151,7 +158,6 @@ import (
mgrpc "mosn.io/mosn/pkg/filter/network/grpc"
_ "mosn.io/mosn/pkg/filter/network/proxy"
_ "mosn.io/mosn/pkg/filter/stream/flowcontrol"
_ "mosn.io/mosn/pkg/filter/stream/grpcmetric"
_ "mosn.io/mosn/pkg/metrics/sink"
_ "mosn.io/mosn/pkg/metrics/sink/prometheus"
_ "mosn.io/mosn/pkg/network"
Expand Down Expand Up @@ -262,6 +268,7 @@ func NewRuntimeGrpcServer(data json.RawMessage, opts ...grpc.ServerOption) (mgrp
// Currently it only support Dapr's InvokeService,secret API,state API and InvokeBinding API.
// Note: this feature is still in Alpha state and we don't recommend that you use it in your production environment.
dapr.NewDaprAPI_Alpha,
s3ext.NewS3Server,
),
// Hello
runtime.WithHelloFactory(
Expand All @@ -280,12 +287,18 @@ func NewRuntimeGrpcServer(data json.RawMessage, opts ...grpc.ServerOption) (mgrp

// File
runtime.WithFileFactory(
file.NewFileFactory("aliOSS", alicloud.NewAliCloudOSS),
file.NewFileFactory("minioOSS", minio.NewMinioOss),
file.NewFileFactory("awsOSS", aws.NewAwsOss),
file.NewFileFactory("tencentCloudOSS", tencentcloud.NewTencentCloudOSS),
file.NewFileFactory("aliyun.oss", aliyun_file.NewAliyunFile),
file.NewFileFactory("minio", minio.NewMinioOss),
file.NewFileFactory("aws.s3", aws_file.NewAwsFile),
file.NewFileFactory("tencent.oss", tencentcloud.NewTencentCloudOSS),
file.NewFileFactory("local", local.NewLocalStore),
file.NewFileFactory("qiniuOSS", qiniu.NewQiniuOSS),
file.NewFileFactory("qiniu.oss", qiniu.NewQiniuOSS),
),

//OSS
runtime.WithOssFactory(
oss.NewFactory("aws.oss", aws_oss.NewAwsOss),
oss.NewFactory("aliyun.oss", aliyun_oss.NewAliyunOss),
),

// PubSub
Expand Down
35 changes: 23 additions & 12 deletions cmd/layotto_without_xds/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,18 @@ import (
"strconv"
"time"

"mosn.io/layotto/components/oss"

aws_oss "mosn.io/layotto/components/oss/aws"

aliyun_oss "mosn.io/layotto/components/oss/aliyun"

"mosn.io/layotto/components/file/aliyun"
aws_file "mosn.io/layotto/components/file/aws"
"mosn.io/layotto/components/file/minio"
"mosn.io/layotto/components/file/qiniu"
"mosn.io/layotto/components/file/tencentcloud"

"github.com/dapr/components-contrib/secretstores"
"github.com/dapr/components-contrib/secretstores/aws/parameterstore"
"github.com/dapr/components-contrib/secretstores/aws/secretmanager"
Expand All @@ -36,9 +48,6 @@ import (
secretstores_loader "mosn.io/layotto/pkg/runtime/secretstores"

"mosn.io/layotto/components/file/local"
"mosn.io/layotto/components/file/s3/alicloud"
"mosn.io/layotto/components/file/s3/aws"
"mosn.io/layotto/components/file/s3/minio"

mock_state "mosn.io/layotto/pkg/mock/components/state"

Expand Down Expand Up @@ -123,10 +132,6 @@ import (
sequencer_redis "mosn.io/layotto/components/sequencer/redis"
sequencer_zookeeper "mosn.io/layotto/components/sequencer/zookeeper"

// File
"mosn.io/layotto/components/file/s3/qiniu"
"mosn.io/layotto/components/file/s3/tencentcloud"

// Actuator
_ "mosn.io/layotto/pkg/actuator"
"mosn.io/layotto/pkg/actuator/health"
Expand Down Expand Up @@ -254,12 +259,12 @@ func NewRuntimeGrpcServer(data json.RawMessage, opts ...grpc.ServerOption) (mgrp

// File
runtime.WithFileFactory(
file.NewFileFactory("aliOSS", alicloud.NewAliCloudOSS),
file.NewFileFactory("minioOSS", minio.NewMinioOss),
file.NewFileFactory("awsOSS", aws.NewAwsOss),
file.NewFileFactory("tencentCloudOSS", tencentcloud.NewTencentCloudOSS),
file.NewFileFactory("aliyun.oss", aliyun.NewAliyunFile),
file.NewFileFactory("minio", minio.NewMinioOss),
file.NewFileFactory("aws.s3", aws_file.NewAwsFile),
file.NewFileFactory("tencent.oss", tencentcloud.NewTencentCloudOSS),
file.NewFileFactory("local", local.NewLocalStore),
file.NewFileFactory("qiniuOSS", qiniu.NewQiniuOSS),
file.NewFileFactory("qiniu.oss", qiniu.NewQiniuOSS),
),

// PubSub
Expand Down Expand Up @@ -394,6 +399,12 @@ func NewRuntimeGrpcServer(data json.RawMessage, opts ...grpc.ServerOption) (mgrp
}),
),

//OSS
runtime.WithOssFactory(
oss.NewFactory("aws.oss", aws_oss.NewAwsOss),
oss.NewFactory("aliyun.oss", aliyun_oss.NewAliyunOss),
),

// Sequencer
runtime.WithSequencerFactory(
runtime_sequencer.NewFactory("etcd", func() sequencer.Store {
Expand Down
Loading

0 comments on commit 4503b6c

Please sign in to comment.