Skip to content

Commit

Permalink
fix(publisher): fix config struct tag for worker component (#181)
Browse files Browse the repository at this point in the history
Signed-off-by: wuhuizuo <[email protected]>

Signed-off-by: wuhuizuo <[email protected]>
  • Loading branch information
wuhuizuo authored Oct 14, 2024
1 parent 9da2287 commit 3db9c25
Show file tree
Hide file tree
Showing 8 changed files with 17 additions and 10 deletions.
11 changes: 9 additions & 2 deletions publisher/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# TiPublisher server
# Publisher server

It provide the publisher functions:
- Publish TiUP pacakge from OCI artifact or http file url.
Expand All @@ -23,6 +23,13 @@ goa example github.com/PingCAP-QE/ee-apps/publisher/design


### Start the API server

```bash
go run ./cmd/publisher -config=config-publisher.yaml --debug --domain 0.0.0.0:8080
```

### Start the worker instance.

```bash
go run ./cmd/service
go run ./cmd/worker --config=config-worker.yaml --debug
```
4 changes: 2 additions & 2 deletions publisher/cmd/publisher/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import (
"goa.design/clue/log"
"gopkg.in/yaml.v3"

tipublisher "github.com/PingCAP-QE/ee-apps/publisher"
"github.com/PingCAP-QE/ee-apps/publisher"
tiup "github.com/PingCAP-QE/ee-apps/publisher/gen/tiup"
"github.com/PingCAP-QE/ee-apps/publisher/pkg/config"
)
Expand Down Expand Up @@ -159,5 +159,5 @@ func initService(configFile string) (tiup.Service, error) {
DB: config.Redis.DB,
})

return tipublisher.NewTiup(&logger, kafkaWriter, redisClient, config.EventSource), nil
return publisher.NewTiup(&logger, kafkaWriter, redisClient, config.EventSource), nil
}
2 changes: 1 addition & 1 deletion publisher/design/design.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ var _ = API("publisher", func() {
})

var _ = Service("tiup", func() {
Description("The TiPublisher service")
Description("TiUP Publisher service")
HTTP(func() {
Path("/tiup")
})
Expand Down
2 changes: 1 addition & 1 deletion publisher/gen/http/cli/publisher/cli.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion publisher/gen/http/openapi3.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"openapi":"3.0.3","info":{"title":"Publish API","description":"Publish API","contact":{"name":"WuHui Zuo","url":"https://github.com/wuhuizuo","email":"[email protected]"},"version":"1.0.0"},"servers":[{"url":"http://0.0.0.0:80"}],"paths":{"/tiup/publish-request":{"post":{"tags":["tiup"],"summary":"request-to-publish tiup","operationId":"tiup#request-to-publish","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RequestToPublishRequestBody"},"example":{"artifact_url":"A facilis.","request_id":"Sequi placeat blanditiis est iusto quia eum.","tiup-mirror":"Sunt voluptates.","version":"Rerum consectetur deleniti."}}}},"responses":{"200":{"description":"OK response.","content":{"application/json":{"schema":{"type":"array","items":{"type":"string","example":"Distinctio voluptates voluptatem accusamus nisi omnis quia."},"description":"request track ids","example":["Voluptates possimus pariatur consequuntur itaque est dignissimos.","Atque amet optio et aliquam ut.","Nulla at error qui dolores et ipsa.","Rem nisi non."]},"example":["Molestiae vitae ut commodi voluptatem consectetur.","Magnam aut et labore."]}}}}}},"/tiup/publish-request/{request_id}":{"get":{"tags":["tiup"],"summary":"query-publishing-status tiup","operationId":"tiup#query-publishing-status","parameters":[{"name":"request_id","in":"path","description":"request track id","required":true,"schema":{"type":"string","description":"request track id","example":"Facere maiores tenetur mollitia consequatur perferendis sint."},"example":"Nisi earum earum pariatur et animi."}],"responses":{"200":{"description":"OK response.","content":{"application/json":{"schema":{"type":"string","description":"request state","example":"Necessitatibus officia distinctio officia voluptas laudantium iure."},"example":"Aperiam consequatur consequatur."}}}}}}},"components":{"schemas":{"RequestToPublishRequestBody":{"type":"object","properties":{"artifact_url":{"type":"string","description":"The full url of the pushed image, contain the tag part. It will parse the repo from it.","example":"Voluptas ratione hic libero nisi."},"request_id":{"type":"string","description":"The request id","example":"Quibusdam nisi quam."},"tiup-mirror":{"type":"string","description":"Staging is http://tiup.pingcap.net:8988, product is http://tiup.pingcap.net:8987.","default":"http://tiup.pingcap.net:8988","example":"Magni quia adipisci excepturi."},"version":{"type":"string","description":"Force set the version. Default is the artifact version read from `org.opencontainers.image.version` of the manifest config.","example":"Rerum voluptate accusantium optio."}},"example":{"artifact_url":"Atque vero in molestiae odit consequatur.","request_id":"Eos eveniet vero.","tiup-mirror":"Nemo rerum voluptas.","version":"Eum saepe nihil omnis dolorem eveniet."},"required":["artifact_url","tiup-mirror"]}}},"tags":[{"name":"tiup","description":"The TiPublisher service"}]}
{"openapi":"3.0.3","info":{"title":"Publish API","description":"Publish API","contact":{"name":"WuHui Zuo","url":"https://github.com/wuhuizuo","email":"[email protected]"},"version":"1.0.0"},"servers":[{"url":"http://0.0.0.0:80"}],"paths":{"/tiup/publish-request":{"post":{"tags":["tiup"],"summary":"request-to-publish tiup","operationId":"tiup#request-to-publish","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RequestToPublishRequestBody"},"example":{"artifact_url":"A facilis.","request_id":"Sequi placeat blanditiis est iusto quia eum.","tiup-mirror":"Sunt voluptates.","version":"Rerum consectetur deleniti."}}}},"responses":{"200":{"description":"OK response.","content":{"application/json":{"schema":{"type":"array","items":{"type":"string","example":"Distinctio voluptates voluptatem accusamus nisi omnis quia."},"description":"request track ids","example":["Voluptates possimus pariatur consequuntur itaque est dignissimos.","Atque amet optio et aliquam ut.","Nulla at error qui dolores et ipsa.","Rem nisi non."]},"example":["Molestiae vitae ut commodi voluptatem consectetur.","Magnam aut et labore."]}}}}}},"/tiup/publish-request/{request_id}":{"get":{"tags":["tiup"],"summary":"query-publishing-status tiup","operationId":"tiup#query-publishing-status","parameters":[{"name":"request_id","in":"path","description":"request track id","required":true,"schema":{"type":"string","description":"request track id","example":"Facere maiores tenetur mollitia consequatur perferendis sint."},"example":"Nisi earum earum pariatur et animi."}],"responses":{"200":{"description":"OK response.","content":{"application/json":{"schema":{"type":"string","description":"request state","example":"Necessitatibus officia distinctio officia voluptas laudantium iure."},"example":"Aperiam consequatur consequatur."}}}}}}},"components":{"schemas":{"RequestToPublishRequestBody":{"type":"object","properties":{"artifact_url":{"type":"string","description":"The full url of the pushed image, contain the tag part. It will parse the repo from it.","example":"Voluptas ratione hic libero nisi."},"request_id":{"type":"string","description":"The request id","example":"Quibusdam nisi quam."},"tiup-mirror":{"type":"string","description":"Staging is http://tiup.pingcap.net:8988, product is http://tiup.pingcap.net:8987.","default":"http://tiup.pingcap.net:8988","example":"Magni quia adipisci excepturi."},"version":{"type":"string","description":"Force set the version. Default is the artifact version read from `org.opencontainers.image.version` of the manifest config.","example":"Rerum voluptate accusantium optio."}},"example":{"artifact_url":"Atque vero in molestiae odit consequatur.","request_id":"Eos eveniet vero.","tiup-mirror":"Nemo rerum voluptas.","version":"Eum saepe nihil omnis dolorem eveniet."},"required":["artifact_url","tiup-mirror"]}}},"tags":[{"name":"tiup","description":"TiUP Publisher service"}]}
2 changes: 1 addition & 1 deletion publisher/gen/http/openapi3.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -104,4 +104,4 @@ components:
- tiup-mirror
tags:
- name: tiup
description: The TiPublisher service
description: TiUP Publisher service
2 changes: 1 addition & 1 deletion publisher/gen/tiup/service.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion publisher/pkg/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ type Worker struct {
Kafka struct {
KafkaBasic `yaml:",inline" json:",inline"`
ConsumerGroup string `yaml:"consumer_group" json:"consumer_group,omitempty"`
} `yaml:"credentials" json:"credentials,omitempty"`
} `yaml:"kafka" json:"kafka,omitempty"`
MirrorUrl string `yaml:"mirror_url" json:"mirror_url,omitempty"`
LarkWebhookURL string `yaml:"lark_webhook_url" json:"lark_webhook_url,omitempty"`
}
Expand Down

0 comments on commit 3db9c25

Please sign in to comment.