Skip to content

Commit

Permalink
Merge branch 'main' into zhenjunMa-patch-1
Browse files Browse the repository at this point in the history
  • Loading branch information
zhenjunMa authored Feb 26, 2024
2 parents f90d603 + 94fc2ed commit a3307a2
Show file tree
Hide file tree
Showing 203 changed files with 14,258 additions and 1,795 deletions.
12 changes: 7 additions & 5 deletions .github/dead_link_check_config.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@
{
"pattern": "^https://docs.buf.build/"
},
{
"pattern":"^https://techhenzy.com/proxy-webassembly-architecture/"
},
{
"pattern": "^#"
}
Expand All @@ -33,13 +36,12 @@
"replacement": "http://localhost:3000/#/en/"
}
],
"timeout": "3s",
"timeout": "10s",
"retryOn429": true,
"retryCount": 2,
"fallbackRetryDelay": "1s",
"fallbackRetryDelay": "10s",
"aliveStatusCodes": [
200,
401,
403
200,
401
]
}
24 changes: 24 additions & 0 deletions .github/workflows/cloud_code_scan.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Alipay Cloud Devops Codescan
on:
pull_request_target:
jobs:
stc: #安全扫描
runs-on: ubuntu-latest
steps:
- name: codeScan
uses: layotto/alipay-cloud-devops-codescan@main
with:
parent_uid: ${{ secrets.ALI_PID }}
private_key: ${{ secrets.ALI_PK }}
scan_type: stc
tips: '可以加入钉钉群:31912621 来申请查看权限'
sca: # 开源合规
runs-on: ubuntu-latest
steps:
- name: codeScan
uses: layotto/alipay-cloud-devops-codescan@main
with:
parent_uid: ${{ secrets.ALI_PID }}
private_key: ${{ secrets.ALI_PK }}
scan_type: sca
tips: '可以加入钉钉群:31912621 来申请查看权限'
31 changes: 30 additions & 1 deletion .github/workflows/layotto-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,12 @@ jobs:
- name: Push Image to DockerHub
run: |
make image.push.linux_amd64.layotto VERSION=latest
- name: Build layotto/layotto_injector:latest Image
run: |
make image.build.linux_amd64.layotto_injector VERSION=latest
- name: Push layotto/layotto_injector:latest Image to DockerHub
run: |
make image.push.linux_amd64.layotto_injector VERSION=latest
- name: Build layotto/proxyv2:latest Image
run: |
make image.proxyv2.build VERSION=latest
Expand All @@ -280,7 +286,7 @@ jobs:
make image.proxyv2.push VERSION=latest
build-push-linux-arm64-image:
name: "Linux ARMD64 Image"
name: "Linux ARM64 Image"
needs: [build-wasm-binary-linux-amd64-artifact,build-binary-linux-arm64-artifact,build-binary-linux-amd64-artifact,build-binary-darwin-amd64-artifact,build-binary-darwin-arm64-artifact]
if: github.ref_name == 'main'
runs-on: ubuntu-latest
Expand All @@ -302,3 +308,26 @@ jobs:
- name: Push Image to DockerHub
run: |
make image.push.linux_arm64.layotto VERSION=latest
- name: Build layotto/layotto_injector:latest Image
run: |
make image.build.linux_arm64.layotto_injector VERSION=latest
- name: Push layotto/layotto_injector:latest Image to DockerHub
run: |
make image.push.linux_arm64.layotto_injector VERSION=latest
package-push-injector-helm-chart:
name: "Layotto Injector Helm Chart"
if: github.ref_name == 'main'
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Package and Push Layotto Injector Latest Helm Chart
run: |
CHART_VERSION=v0.0.0-latest APP_VERSION=latest make helm-package
CHART_VERSION=v0.0.0-latest APP_VERSION=latest make helm-push
30 changes: 29 additions & 1 deletion .github/workflows/layotto-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -305,9 +305,15 @@ jobs:
- name: Push Image to DockerHub
run: |
make image.push.linux_amd64.layotto
- name: Build Layotto Injector Latest Image
run: |
make image.build.linux_amd64.layotto_injector
- name: Push Layotto Injector Latest Image to DockerHub
run: |
make image.push.linux_amd64.layotto_injector
build-push-linux-arm64-image:
name: "Linux ARMD64 Image"
name: "Linux ARM64 Image"
needs: [build-wasm-binary-linux-amd64-artifact,build-binary-linux-arm64-artifact,build-binary-linux-amd64-artifact,build-binary-darwin-amd64-artifact,build-binary-darwin-arm64-artifact]
runs-on: ubuntu-latest
steps:
Expand All @@ -328,3 +334,25 @@ jobs:
- name: Push Image to DockerHub
run: |
make image.push.linux_arm64.layotto
- name: Build Layotto Injector Latest Image
run: |
make image.build.linux_arm64.layotto_injector
- name: Push Layotto Injector Latest Image to DockerHub
run: |
make image.push.linux_arm64.layotto_injector
package-push-injector-helm-chart:
name: "Layotto Injector Helm Chart"
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Package and Push Injector Latest Helm Chart
run: |
make helm-package
make helm-push
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,4 @@
_run:
@$(MAKE) --warn-undefined-variables -f make/common.mk $(MAKECMDGOALS)
.PHONY: _run
$(if $(MAKECMDGOALS),$(MAKECMDGOALS): %: _run)
$(if $(MAKECMDGOALS),$(MAKECMDGOALS): %: _run)
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,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://gw.alipayobjects.com/mdn/rms_5891a1/afts/img/A*HUKsSrFthtUAAAAAAAAAAAAAARQnAQ" height="200px"> |
| 💬 [DingTalk](https://www.dingtalk.com/en) (preferred) | Search the group number: 31912621 or scan the QR code below <br> <img src="https://img.alicdn.com/imgextra/i2/O1CN01SjbQiK21NgcAxArxq_!!6000000006973-0-tps-900-912.jpg" 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
27 changes: 27 additions & 0 deletions cmd/layotto/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,12 @@ import (
"strconv"
"time"

"mosn.io/layotto/components/sms"

"mosn.io/layotto/components/cryption"

"mosn.io/layotto/components/email"

"mosn.io/layotto/pkg/grpc/lifecycle"

"mosn.io/layotto/components/oss"
Expand All @@ -37,8 +43,13 @@ import (

"mosn.io/mosn/pkg/istio"

aliyun_cryption "mosn.io/layotto/components/cryption/aliyun"
aws_cryption "mosn.io/layotto/components/cryption/aws"
aliyun_file "mosn.io/layotto/components/file/aliyun"

aliyun_email "mosn.io/layotto/components/email/aliyun"
tencentcloud_sms "mosn.io/layotto/components/sms/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 @@ -65,6 +76,7 @@ import (
"mosn.io/pkg/log"

"mosn.io/layotto/components/configstores/etcdv3"
"mosn.io/layotto/components/configstores/nacos"
"mosn.io/layotto/components/file"
"mosn.io/layotto/components/sequencer"
"mosn.io/layotto/pkg/runtime/bindings"
Expand Down Expand Up @@ -278,6 +290,7 @@ func NewRuntimeGrpcServer(data json.RawMessage, opts ...grpc.ServerOption) (mgrp
runtime.WithConfigStoresFactory(
configstores.NewStoreFactory("apollo", apollo.NewStore),
configstores.NewStoreFactory("etcd", etcdv3.NewStore),
configstores.NewStoreFactory("nacos", nacos.NewStore),
),

// RPC
Expand All @@ -300,6 +313,20 @@ func NewRuntimeGrpcServer(data json.RawMessage, opts ...grpc.ServerOption) (mgrp
oss.NewFactory("ceph", ceph_oss.NewCephOss),
oss.NewFactory("huaweicloud.oss", huaweicloud_oss.NewHuaweicloudOSS),
),
// Cryption
runtime.WithCryptionServiceFactory(
cryption.NewFactory("aliyun.kms", aliyun_cryption.NewCryption),
cryption.NewFactory("aws.kms", aws_cryption.NewCryption),
),

// Email
runtime.WithEmailServiceFactory(
email.NewFactory("aliyun.email", aliyun_email.NewAliyunEmail),
),
// Sms
runtime.WithSmsServiceFactory(
sms.NewFactory("tencentcloud.sms", tencentcloud_sms.NewSms),
),
// PubSub
runtime.WithPubSubFactory(
pubsub.NewFactory("redis", func() dapr_comp_pubsub.PubSub {
Expand Down
23 changes: 23 additions & 0 deletions cmd/layotto_injector/main.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
package main

import (
log "github.com/sirupsen/logrus"

"mosn.io/layotto/pkg/injector/service"
)

func main() {
cfg, err := service.GetConfig()
if err != nil {
log.Fatalf("Error getting config: %v", err)
}
inj, err := service.NewInjector(cfg)
if err != nil {
log.Fatalf("Error creating layotto-injector: %v", err)
}
err = inj.Run()
if err != nil {
log.Fatalf("Error running layotto-injector: %v", err)
}
log.Info("Layotto sidecar injector shutdown gracefully")
}
18 changes: 18 additions & 0 deletions cmd/layotto_multiple_api/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,13 @@ import (
"strconv"
"time"

"mosn.io/layotto/components/sms"

"mosn.io/layotto/components/cryption"
aliyun_cryption "mosn.io/layotto/components/cryption/aliyun"
aws_cryption "mosn.io/layotto/components/cryption/aws"
tencentcloud_sms "mosn.io/layotto/components/sms/tencentcloud"

"mosn.io/layotto/pkg/grpc/lifecycle"

huaweicloud_oss "mosn.io/layotto/components/oss/huaweicloud"
Expand Down Expand Up @@ -85,6 +92,7 @@ import (
// Configuration
"mosn.io/layotto/components/configstores"
"mosn.io/layotto/components/configstores/apollo"
"mosn.io/layotto/components/configstores/nacos"

// Pub/Sub
dapr_comp_pubsub "github.com/dapr/components-contrib/pubsub"
Expand Down Expand Up @@ -288,6 +296,7 @@ func NewRuntimeGrpcServer(data json.RawMessage, opts ...grpc.ServerOption) (mgrp
runtime.WithConfigStoresFactory(
configstores.NewStoreFactory("apollo", apollo.NewStore),
configstores.NewStoreFactory("etcd", etcdv3.NewStore),
configstores.NewStoreFactory("nacos", nacos.NewStore),
),

// RPC
Expand Down Expand Up @@ -413,6 +422,15 @@ func NewRuntimeGrpcServer(data json.RawMessage, opts ...grpc.ServerOption) (mgrp
return state_mysql.NewMySQLStateStore(loggerForDaprComp)
}),
),
// Cryption
runtime.WithCryptionServiceFactory(
cryption.NewFactory("aliyun.kms", aliyun_cryption.NewCryption),
cryption.NewFactory("aws.kms", aws_cryption.NewCryption),
),
// Sms
runtime.WithSmsServiceFactory(
sms.NewFactory("tencentcloud.sms", tencentcloud_sms.NewSms),
),
// Lock
runtime.WithLockFactory(
runtime_lock.NewFactory("redis_cluster", func() lock.LockStore {
Expand Down
19 changes: 18 additions & 1 deletion cmd/layotto_without_xds/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,13 @@ import (
"strconv"
"time"

"mosn.io/layotto/components/sms"

"mosn.io/layotto/components/cryption"
aliyun_cryption "mosn.io/layotto/components/cryption/aliyun"
aws_cryption "mosn.io/layotto/components/cryption/aws"
tencentcloud_sms "mosn.io/layotto/components/sms/tencentcloud"

"mosn.io/layotto/pkg/grpc/lifecycle"

"mosn.io/layotto/components/oss"
Expand Down Expand Up @@ -63,6 +70,7 @@ import (
"mosn.io/pkg/log"

"mosn.io/layotto/components/configstores/etcdv3"
"mosn.io/layotto/components/configstores/nacos"
"mosn.io/layotto/components/file"
"mosn.io/layotto/components/sequencer"
"mosn.io/layotto/pkg/runtime/bindings"
Expand Down Expand Up @@ -261,6 +269,7 @@ func NewRuntimeGrpcServer(data json.RawMessage, opts ...grpc.ServerOption) (mgrp
runtime.WithConfigStoresFactory(
configstores.NewStoreFactory("apollo", apollo.NewStore),
configstores.NewStoreFactory("etcd", etcdv3.NewStore),
configstores.NewStoreFactory("nacos", nacos.NewStore),
),

// RPC
Expand Down Expand Up @@ -417,7 +426,15 @@ func NewRuntimeGrpcServer(data json.RawMessage, opts ...grpc.ServerOption) (mgrp
oss.NewFactory("ceph", ceph_oss.NewCephOss),
oss.NewFactory("huaweicloud.oss", huaweicloud_oss.NewHuaweicloudOSS),
),

// Cryption
runtime.WithCryptionServiceFactory(
cryption.NewFactory("aliyun.kms", aliyun_cryption.NewCryption),
cryption.NewFactory("aws.kms", aws_cryption.NewCryption),
),
// Sms
runtime.WithSmsServiceFactory(
sms.NewFactory("tencentcloud.sms", tencentcloud_sms.NewSms),
),
// Sequencer
runtime.WithSequencerFactory(
runtime_sequencer.NewFactory("etcd", func() sequencer.Store {
Expand Down
Loading

0 comments on commit a3307a2

Please sign in to comment.