Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: implement oss interface #556

Merged
merged 159 commits into from
Jul 25, 2022
Merged
Show file tree
Hide file tree
Changes from 148 commits
Commits
Show all changes
159 commits
Select commit Hold shift + click to select a range
569a78e
make s3 as extension
wenxuwan Apr 29, 2022
4d9f05a
add pug and get interface
wenxuwan May 9, 2022
36a81c2
add oss implement
wenxuwan May 10, 2022
05926c3
refact init function
wenxuwan May 11, 2022
434228e
fix panic
wenxuwan May 11, 2022
75bdfb7
Merge remote-tracking branch 'upstream/main' into file_s3
wenxuwan May 17, 2022
6d16629
remove unused configure
wenxuwan May 17, 2022
5b406fd
add implements of s3 interface
wenxuwan May 24, 2022
184cb44
add implement
wenxuwan May 25, 2022
b0cc0ec
update part interface
wenxuwan May 27, 2022
95adea1
add implement for s3
wenxuwan May 27, 2022
0599d2d
add implement
wenxuwan May 27, 2022
a51bb17
Merge remote-tracking branch 'upstream/main' into file_s3
wenxuwan May 30, 2022
fccdd5c
add aliyun implement
wenxuwan Jun 9, 2022
6110732
fix compile error
wenxuwan Jun 9, 2022
77d6eb2
Merge branch 'main' into file_s3
wenxuwan Jun 9, 2022
66ce63a
change init request name
wenxuwan Jun 9, 2022
06a3a51
split oss and file configure
wenxuwan Jun 9, 2022
9bbc040
format code
wenxuwan Jun 9, 2022
a6c3f96
Merge remote-tracking branch 'upstream/main' into file_s3
wenxuwan Jun 13, 2022
8f4df40
add implement for fileexist and headobject
wenxuwan Jun 13, 2022
b12f817
add SignURL UpdateDownLoadBandwidthRateLimit UpdateUpLoadBandwidthRat…
wenxuwan Jun 14, 2022
8baea74
fix compile error
wenxuwan Jun 14, 2022
65f29d4
Merge branch 'main' into file_s3
wenxuwan Jun 14, 2022
c8dcacc
Merge remote-tracking branch 'upstream/main' into file_s3
wenxuwan Jun 14, 2022
09b56a2
Merge branch 'file_s3' of github.com:wenxuwan/layotto into file_s3
wenxuwan Jun 14, 2022
78a8eee
fix license validation
wenxuwan Jun 14, 2022
80dfa9d
add liscensed
wenxuwan Jun 14, 2022
d12541f
go mod tidy for spec
wenxuwan Jun 14, 2022
6a9614f
format
wenxuwan Jun 14, 2022
eabaf9e
Merge remote-tracking branch 'upstream/main' into file_s3
wenxuwan Jun 14, 2022
256dac7
fix go-lint
wenxuwan Jun 14, 2022
4136246
fix go lint
wenxuwan Jun 14, 2022
3675dc2
fix client.go
wenxuwan Jun 14, 2022
0e39784
change proto file name
wenxuwan Jun 15, 2022
4aa0a2c
format project
wenxuwan Jun 15, 2022
86e0085
fix demo client
wenxuwan Jun 15, 2022
94c801c
fix mongo sequencer ut
wenxuwan Jun 15, 2022
e7e11d3
add file licensed
wenxuwan Jun 15, 2022
93bf63c
add Notes for pb file and fix wrong message
wenxuwan Jun 16, 2022
df10d48
fix format error
wenxuwan Jun 16, 2022
b42c079
fix s3 demo
wenxuwan Jun 16, 2022
c8a1cd9
Modify the corresponding relationship between bucket and endpoint
wenxuwan Jun 17, 2022
7ec627d
add uid for oss configure
wenxuwan Jun 17, 2022
ad03e92
add range option for getobject
wenxuwan Jun 17, 2022
195f475
Merge branch 'main' into file_s3
seeflood Jun 17, 2022
3763e2c
add option for aws
wenxuwan Jun 21, 2022
d9182a3
Merge branch 'file_s3' of github.com:wenxuwan/layotto into file_s3
wenxuwan Jun 21, 2022
1eddcb6
Merge remote-tracking branch 'upstream/main' into file_s3
wenxuwan Jun 23, 2022
2cf7a82
fix aws implement
wenxuwan Jun 27, 2022
42fd46e
add HeadObject implement
wenxuwan Jun 27, 2022
18cb898
make format
wenxuwan Jun 27, 2022
22f2b34
Merge branch 'main' into file_s3
wenxuwan Jun 27, 2022
6b249a7
add license for file
wenxuwan Jun 27, 2022
99f03f3
chang acl interface to canned acl
wenxuwan Jun 27, 2022
f5368c3
fix client
wenxuwan Jun 27, 2022
f27bf5b
fix exist ut
wenxuwan Jun 27, 2022
d4ee783
fix compile error
wenxuwan Jun 27, 2022
f5422bc
add s3 ut
wenxuwan Jun 27, 2022
1365267
Merge remote-tracking branch 'upstream/main' into file_s3
wenxuwan Jun 27, 2022
8e5fa59
fix conflict
wenxuwan Jun 27, 2022
37cb94a
fix configure ut
wenxuwan Jun 27, 2022
80b02ca
fix ut
wenxuwan Jun 27, 2022
624661b
fix lint
wenxuwan Jun 27, 2022
f51f75b
add ut coverage and fix some bug
wenxuwan Jun 28, 2022
3a8e31f
add licence for ut file
wenxuwan Jun 28, 2022
d1d2d34
fix go lint of ut
wenxuwan Jun 28, 2022
4faca6b
add ut for coverage
wenxuwan Jun 28, 2022
c9ed846
Merge branch 'main' into file_s3
wenxuwan Jun 28, 2022
98e41fd
add PutObject ut
wenxuwan Jun 28, 2022
bf07ae0
add ut for append and uploadpart
wenxuwan Jun 28, 2022
afa97d5
add ut test coverage
wenxuwan Jun 28, 2022
780fa90
add ut coverage
wenxuwan Jun 28, 2022
9086d6b
Merge branch 'main' into file_s3
wenxuwan Jun 29, 2022
0cabc92
add file liscense
wenxuwan Jun 29, 2022
f032c9a
fix wrong tag
wenxuwan Jun 29, 2022
6421d03
add ut
wenxuwan Jun 29, 2022
582ea68
fix go ci linter
wenxuwan Jun 29, 2022
dcd3292
retrigger ut
wenxuwan Jun 29, 2022
adb5dcc
add ut for coverage
wenxuwan Jun 29, 2022
84e03c6
format file
wenxuwan Jun 29, 2022
598ec59
fix ut error
wenxuwan Jun 29, 2022
68559c2
Merge branch 'main' into file_s3
wenxuwan Jun 30, 2022
d606b1d
fix some error after test
wenxuwan Jun 30, 2022
15323f3
Merge branch 'main' into file_s3
wenxuwan Jul 1, 2022
10b9902
add quick start for oss demo
wenxuwan Jul 4, 2022
7cf5a1e
Merge branch 'main' into file_s3
wenxuwan Jul 4, 2022
9b9657e
remove oss config from file
wenxuwan Jul 4, 2022
2df381d
add comments for oss configure
wenxuwan Jul 4, 2022
2b035c6
Merge branch 'main' into file_s3
Xunzhuo Jul 4, 2022
980348d
add uid for user to select client
wenxuwan Jul 6, 2022
90656d0
Merge remote-tracking branch 'upstream/main' into file_s3
wenxuwan Jul 6, 2022
3e55426
change tagging to map for CopyObjectInput CreateMultipartUploadInput
wenxuwan Jul 7, 2022
4f27f70
Merge branch 'main' into file_s3
seeflood Jul 8, 2022
598013c
Merge branch 'main' into file_s3
wenxuwan Jul 11, 2022
ea37504
add explanation for interface to help review code
wenxuwan Jul 12, 2022
edf6a83
add comments
wenxuwan Jul 12, 2022
68b76ab
add design document
wenxuwan Jul 13, 2022
9068a3e
change picture name from chinese to english
wenxuwan Jul 13, 2022
cee61db
fix typo in design document
wenxuwan Jul 13, 2022
e29417f
Merge remote-tracking branch 'upstream/main' into file_s3
wenxuwan Jul 13, 2022
9c2dead
fix oss quickstart file
wenxuwan Jul 13, 2022
7febd07
add oss component in all main
wenxuwan Jul 13, 2022
838dbf0
Merge branch 'main' into file_s3
wenxuwan Jul 13, 2022
d7346f4
seperate oss and file implemet
wenxuwan Jul 13, 2022
34de1d4
fix lint error
wenxuwan Jul 13, 2022
01c249b
fix ut error
wenxuwan Jul 13, 2022
566d193
change UpdateDownLoadBandwidthRateLimit and UpdateUpLoadBandwidthRate…
wenxuwan Jul 13, 2022
c8d4665
fix design doc
wenxuwan Jul 13, 2022
0f0dba8
fix design markdown file
wenxuwan Jul 13, 2022
6b4b5a0
fix protoc version and ut error
wenxuwan Jul 14, 2022
1f12d1e
Merge branch 'main' into file_s3
wenxuwan Jul 14, 2022
9fd98c2
try fix md file
wenxuwan Jul 18, 2022
8ac41b8
fix markdown wrong type
wenxuwan Jul 18, 2022
005e732
fix markdowmn file
wenxuwan Jul 18, 2022
bb7fa72
rename file name
wenxuwan Jul 18, 2022
662a77f
change markdown file name
wenxuwan Jul 18, 2022
dd67f8b
add other markdown file
wenxuwan Jul 18, 2022
ccd0a4e
refresh markdown file
wenxuwan Jul 18, 2022
ba0b1e9
remove wrong type
wenxuwan Jul 18, 2022
9f0ea15
update1
wenxuwan Jul 18, 2022
4944df0
update2
wenxuwan Jul 18, 2022
a133152
update3
wenxuwan Jul 18, 2022
8129b0c
remove typo
wenxuwan Jul 18, 2022
4768fda
remove unused doc
wenxuwan Jul 18, 2022
c99e4a6
fix reference
wenxuwan Jul 18, 2022
230f819
Merge remote-tracking branch 'upstream/main' into file_s3
wenxuwan Jul 18, 2022
1310abd
seperate interface type with blank
wenxuwan Jul 18, 2022
40c7b1e
fix lint error
wenxuwan Jul 18, 2022
098426a
Merge branch 'main' into file_s3
wenxuwan Jul 19, 2022
be2e8b7
remove initclient
wenxuwan Jul 20, 2022
848d217
rename oss configure name
wenxuwan Jul 20, 2022
0927def
fix comments
wenxuwan Jul 20, 2022
2b7ed18
Merge branch 'main' into file_s3
wenxuwan Jul 21, 2022
ee0cd8a
fix comments
wenxuwan Jul 21, 2022
e306277
add comments for acl operation
wenxuwan Jul 21, 2022
d7f9d1e
fix comments
wenxuwan Jul 21, 2022
84f86a2
format pb file
wenxuwan Jul 21, 2022
4e47006
fix md wrong path
wenxuwan Jul 21, 2022
b15085e
add ut for deepcopy and runtime
wenxuwan Jul 21, 2022
55d4203
remove unused option for aws
wenxuwan Jul 21, 2022
b7412e5
Merge branch 'main' into file_s3
seeflood Jul 21, 2022
a023a02
Update docs/zh/start/oss/oss.md
wenxuwan Jul 22, 2022
c5948f5
Update docs/zh/start/oss/oss.md
wenxuwan Jul 22, 2022
50498e8
Update docs/zh/start/oss/oss.md
wenxuwan Jul 22, 2022
6349308
fix package name
wenxuwan Jul 22, 2022
5a86f3d
fix comments and remove unused code
wenxuwan Jul 22, 2022
db3ce03
change function name
wenxuwan Jul 22, 2022
7c90574
Update components/oss/registry.go
wenxuwan Jul 24, 2022
999f761
fix ut
wenxuwan Jul 24, 2022
b635ac4
Merge branch 'main' into file_s3
seeflood Jul 24, 2022
507ea0e
Merge branch 'main' into file_s3
wenxuwan Jul 25, 2022
af73fe5
Merge branch 'main' into file_s3
seeflood Jul 25, 2022
87a0bbc
add timeout for aliyun
wenxuwan Jul 25, 2022
4fc2959
Merge branch 'file_s3' of github.com:wenxuwan/layotto into file_s3
wenxuwan Jul 25, 2022
58bca5b
add comments for pb
wenxuwan Jul 25, 2022
a6b964b
add comments for protobuf
wenxuwan Jul 25, 2022
a15c15d
add comments
wenxuwan Jul 25, 2022
ebfa15f
format pb file comments
wenxuwan Jul 25, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 22 additions & 11 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("aliOSS", aliyun_file.NewAliyunFile),
file.NewFileFactory("minioOSS", minio.NewMinioOss),
file.NewFileFactory("awsOSS", aws.NewAwsOss),
file.NewFileFactory("awsOSS", aws.NewAwsFile),
file.NewFileFactory("tencentCloudOSS", tencentcloud.NewTencentCloudOSS),
file.NewFileFactory("local", local.NewLocalStore),
file.NewFileFactory("qiniuOSS", 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
41 changes: 27 additions & 14 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,14 +287,20 @@ func NewRuntimeGrpcServer(data json.RawMessage, opts ...grpc.ServerOption) (mgrp

// File
runtime.WithFileFactory(
file.NewFileFactory("aliOSS", alicloud.NewAliCloudOSS),
file.NewFileFactory("aliOSS", aliyun_file.NewAliyunFile),
file.NewFileFactory("minioOSS", minio.NewMinioOss),
file.NewFileFactory("awsOSS", aws.NewAwsOss),
file.NewFileFactory("awsOSS", aws_file.NewAwsFile),
file.NewFileFactory("tencentCloudOSS", tencentcloud.NewTencentCloudOSS),
file.NewFileFactory("local", local.NewLocalStore),
file.NewFileFactory("qiniuOSS", qiniu.NewQiniuOSS),
wenxuwan marked this conversation as resolved.
Show resolved Hide resolved
),

//OSS
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
29 changes: 20 additions & 9 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,9 +259,9 @@ func NewRuntimeGrpcServer(data json.RawMessage, opts ...grpc.ServerOption) (mgrp

// File
runtime.WithFileFactory(
file.NewFileFactory("aliOSS", alicloud.NewAliCloudOSS),
file.NewFileFactory("aliOSS", aliyun.NewAliyunFile),
file.NewFileFactory("minioOSS", minio.NewMinioOss),
file.NewFileFactory("awsOSS", aws.NewAwsOss),
file.NewFileFactory("awsOSS", aws_file.NewAwsFile),
file.NewFileFactory("tencentCloudOSS", tencentcloud.NewTencentCloudOSS),
file.NewFileFactory("local", local.NewLocalStore),
file.NewFileFactory("qiniuOSS", qiniu.NewQiniuOSS),
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