Skip to content

Commit e27c9aa

Browse files
HeGaoYuangaoyuanhe
authored andcommitted
di模块增加api_v2接口
1 parent 8bac2f0 commit e27c9aa

File tree

280 files changed

+38916
-57
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

280 files changed

+38916
-57
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
.idea/

cc/config/application.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ spring:
55
driverClassName: com.mysql.jdbc.Driver
66
# url: jdbc:mysql://127.0.0.1:3306/mlss_gzpc_bdap_dev_01?useUnicode=true&characterEncoding=utf-8
77
url: jdbc:mysql://localhost:3306/mlss_local_db?useUnicode=true&characterEncoding=utf-8
8-
# url: jdbc:mysql://127.0.0.1:3306/mlss_local_db?useUnicode=true&characterEncoding=utf-8
8+
# url: jdbc:mysql://127.0.0.1/db?useUnicode=true&characterEncoding=utf-8
99
# username: root
1010
# password: 123456
1111
username: mlss_gzpc_bdap_dev

di/commons/constants/constants.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,4 +92,6 @@ const (
9292
LOG_STORING_KEY = "store_status"
9393
LOG_STORING_COMPLETED = "completed"
9494
LOG_STORING_STORING = "storing"
95+
96+
GoDefaultTimeFormat = "2006-01-02 15:04:05"
9597
)

di/commons/logger/v2/logger.go

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
package v2
2+
3+
import (
4+
"context"
5+
log "github.com/sirupsen/logrus"
6+
"os"
7+
)
8+
9+
const (
10+
RequestIdLogFieldKey string = "X-Request-Id"
11+
OperationLogFieldKey string = "Operation"
12+
)
13+
14+
func GetLogger(context context.Context) *log.Entry {
15+
formatter := new(log.TextFormatter)
16+
17+
l := &log.Logger{
18+
Out: os.Stdout,
19+
Formatter: formatter,
20+
Hooks: make(log.LevelHooks),
21+
Level: log.DebugLevel,
22+
ExitFunc: os.Exit,
23+
// ReportCaller 会把file(调用的具体哪一行)和func(调用的函数)同时打开
24+
ReportCaller: true,
25+
}
26+
entry := log.NewEntry(l)
27+
if v, ok := context.Value(RequestIdLogFieldKey).(string); ok {
28+
entry = entry.WithField(RequestIdLogFieldKey, v)
29+
}
30+
if v, ok := context.Value(OperationLogFieldKey).(string); ok {
31+
entry = entry.WithField(OperationLogFieldKey, v)
32+
}
33+
return entry
34+
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
package v2
2+
3+
import (
4+
"context"
5+
"testing"
6+
)
7+
8+
func Test1(t *testing.T) {
9+
ctx := context.WithValue(context.Background(), "X-Request-Id", "xxxyyy111")
10+
log := GetLogger(ctx)
11+
log.Infof("hello, world")
12+
log.Debugf("hello, world")
13+
}

di/go.mod

Lines changed: 52 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -6,65 +6,80 @@ require (
66
github.com/IBM-Bluemix/bluemix-cli-sdk v0.6.7
77
github.com/IBM-Cloud/ibm-cloud-cli-sdk v0.6.7 // indirect
88
github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d
9-
github.com/aws/aws-sdk-go v1.29.11
9+
github.com/aws/aws-sdk-go v1.42.50
1010
github.com/cenkalti/backoff v2.2.1+incompatible
11-
github.com/coreos/etcd v3.3.10+incompatible
11+
github.com/coreos/etcd v3.3.13+incompatible
1212
github.com/dre1080/recover v0.0.0-20150930082637-1c296bbb3227
1313
github.com/facebookgo/stack v0.0.0-20160209184415-751773369052 // indirect
1414
github.com/fatih/structs v1.1.0 // indirect
1515
github.com/go-kit/kit v0.10.0
16-
github.com/go-openapi/errors v0.19.4
17-
github.com/go-openapi/loads v0.19.5
18-
github.com/go-openapi/runtime v0.19.15
19-
github.com/go-openapi/spec v0.19.7
20-
github.com/go-openapi/strfmt v0.19.5
21-
github.com/go-openapi/swag v0.19.8
22-
github.com/go-openapi/validate v0.19.7
23-
github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b
24-
github.com/golang/mock v1.4.3
25-
github.com/golang/protobuf v1.4.1
26-
github.com/google/uuid v1.1.1
27-
github.com/googleapis/gnostic v0.3.1 // indirect
28-
github.com/gorilla/websocket v1.4.0
16+
github.com/go-openapi/errors v0.20.2
17+
github.com/go-openapi/loads v0.21.0
18+
github.com/go-openapi/runtime v0.21.1
19+
github.com/go-openapi/spec v0.20.4
20+
github.com/go-openapi/strfmt v0.21.1
21+
github.com/go-openapi/swag v0.19.15
22+
github.com/go-openapi/validate v0.20.3
23+
github.com/golang/glog v1.0.0
24+
github.com/golang/mock v1.6.0
25+
github.com/golang/protobuf v1.5.2
26+
github.com/google/uuid v1.3.0
27+
github.com/gorilla/websocket v1.5.0
2928
github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0
30-
github.com/jessevdk/go-flags v1.4.0
29+
github.com/jessevdk/go-flags v1.5.0
3130
github.com/jinzhu/copier v0.0.0-20190924061706-b57f9002281a
31+
github.com/kubeflow/pipelines v0.0.0-20231208180049-c5658f09ec38
3232
github.com/mholt/archiver/v3 v3.3.0
3333
github.com/minio/minio-go/v6 v6.0.57
34-
github.com/modern-go/reflect2 v1.0.1
34+
github.com/modern-go/reflect2 v1.0.2
3535
github.com/ncw/swift v1.0.50
3636
github.com/nicksnyder/go-i18n v1.10.1 // indirect
3737
github.com/nu7hatch/gouuid v0.0.0-20131221200532-179d4d0c4d8d
3838
github.com/pkg/errors v0.9.1
39-
github.com/prometheus/client_golang v1.5.1
40-
github.com/prometheus/common v0.9.1
41-
github.com/sirupsen/logrus v1.5.0
39+
github.com/prometheus/client_golang v1.12.1
40+
github.com/prometheus/common v0.32.1
41+
github.com/sirupsen/logrus v1.8.1
4242
github.com/sony/gobreaker v0.4.1
43-
github.com/spf13/cast v1.3.1
44-
github.com/spf13/cobra v0.0.7
45-
github.com/spf13/viper v1.6.2
46-
github.com/stretchr/testify v1.5.1
43+
github.com/spf13/cast v1.4.1
44+
github.com/spf13/cobra v1.3.0
45+
github.com/spf13/viper v1.10.1
46+
github.com/stretchr/testify v1.8.1
4747
github.com/teris-io/shortid v0.0.0-20171029131806-771a37caa5cf // indirect
4848
github.com/thoas/go-funk v0.6.0
4949
github.com/tylerb/graceful v1.2.15
5050
github.com/urfave/cli v1.22.4
5151
github.com/ventu-io/go-shortid v0.0.0-20171029131806-771a37caa5cf
52-
golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e
53-
google.golang.org/grpc v1.28.1
54-
google.golang.org/protobuf v1.25.0
52+
golang.org/x/net v0.21.0
53+
google.golang.org/grpc v1.44.0
54+
google.golang.org/protobuf v1.30.0
5555
gopkg.in/mgo.v2 v2.0.0-20190816093944-a6b53ec6cb22
5656
gopkg.in/olivere/elastic.v5 v5.0.85
57-
gopkg.in/yaml.v2 v2.2.8
57+
gopkg.in/yaml.v2 v2.4.0
5858
gorm.io/driver/mysql v1.0.2
5959
gorm.io/gorm v1.20.2
60-
k8s.io/api v0.18.0
61-
k8s.io/apimachinery v0.18.0
62-
k8s.io/client-go v0.0.0-00010101000000-000000000000
63-
k8s.io/kube-openapi v0.0.0-20200121204235-bf4fb3bd569c
60+
k8s.io/api v0.24.3
61+
k8s.io/apimachinery v0.24.3
62+
k8s.io/client-go v0.24.3
63+
k8s.io/kube-openapi v0.0.0-20220627174259-011e075b9cb8
64+
sigs.k8s.io/structured-merge-diff/v3 v3.0.0 // indirect
6465
)
6566

66-
replace k8s.io/client-go => github.com/kubernetes/client-go v0.16.8
67-
68-
replace github.com/googleapis/gnostic/OpenAPIv2 => github.com/googleapis/gnostic/OpenAPIv2 v0.3.1
69-
70-
replace github.com/nicksnyder/go-i18n/i18n => github.com/nicksnyder/go-i18n/i18n v1.10.1
67+
replace (
68+
//由于引入kfp后go-openapi/xxx的版本升级了,但是我们的restapi是用的旧版的go-openapi生成的,有很多函数接口发生变化了
69+
github.com/go-openapi/analysis => github.com/go-openapi/analysis v0.19.7
70+
github.com/go-openapi/errors => github.com/go-openapi/errors v0.19.4
71+
github.com/go-openapi/loads => github.com/go-openapi/loads v0.19.5
72+
github.com/go-openapi/runtime => github.com/go-openapi/runtime v0.19.15
73+
github.com/go-openapi/spec => github.com/go-openapi/spec v0.19.7
74+
github.com/go-openapi/strfmt => github.com/go-openapi/strfmt v0.19.5
75+
github.com/go-openapi/swag => github.com/go-openapi/swag v0.19.8
76+
github.com/go-openapi/validate => github.com/go-openapi/validate v0.19.7
77+
github.com/googleapis/gnostic => github.com/googleapis/gnostic v0.3.1
78+
github.com/googleapis/gnostic/OpenAPIv2 => github.com/googleapis/gnostic/OpenAPIv2 v0.3.1
79+
github.com/kubeflow/pipelines v0.0.0-20231208180049-c5658f09ec38 => localhost/MLSS/MLSS-TRAINERDIPIPELINE v0.0.0-20240527134309-ded58d882198
80+
github.com/nicksnyder/go-i18n/i18n => github.com/nicksnyder/go-i18n/i18n v1.10.1
81+
google.golang.org/grpc => google.golang.org/grpc v1.29.0
82+
k8s.io/api => github.com/kubernetes/api v0.16.8
83+
k8s.io/client-go => github.com/kubernetes/client-go v0.16.8
84+
k8s.io/kubernetes => k8s.io/kubernetes v1.11.1
85+
)

0 commit comments

Comments
 (0)