GithubHelp home page GithubHelp logo

stack-labs / starter-kit Goto Github PK

View Code? Open in Web Editor NEW
382.0 382.0 55.0 2.38 MB

stack-rpc 快速开发包

License: Apache License 2.0

Dockerfile 0.41% Makefile 3.75% Go 88.77% Shell 0.71% Mustache 6.35%

starter-kit's People

Contributors

crazybber avatar hb-chen avatar leonlau avatar nonovv avatar printfcoder avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

starter-kit's Issues

service name change

I want to rename some services for test I am working on in Linkerd, so instead of using adservice in services.yaml, I will have adservice-east. so the frontend will send request to adservice-east instead of adservice

I am not a GO programmer, I would be grateful if anybody can point me where this can be done in the frontservice source code

rancher 配置文件自动生成 配合k8s 使用

Rancher是开源软件,它结合了组织需要采用的所有组件,并在生产环境中运行容器。Rancher基于Kubernetes构建,使DevOps团队可以轻松测试、部署和管理他们的应用程序。运维团队使用Rancher来部署、管理和维护各个Kubernetes集群,而不需关心它运行在何处。

参考yaml 文件

  • 支持流水线
  • 基于 k8s yaml 文件
stages:
# 依赖 redis 部署 
- name: Redis
  steps:
  - applyAppConfig:
      catalogTemplate: cattle-global-data:library-redis
      version: 3.0.2
      answers:
        master.persistence.enabled: "true"
        cluster.slaveCount: "2"
      name: redis
      targetNamespace: api
# 配置部署
- name: Config
  steps:
  - applyYamlConfig:
      path: ./config.yaml
# rpc 接口部署
- name: Micro
  steps:
  - applyYamlConfig:
      path: ./app/micro-api.yaml
# user 用户数据库
- name: UserMariadb
  steps:
  - applyAppConfig:
      catalogTemplate: cattle-global-data:library-mariadb
      version: 5.0.9
      answers:
        db.name: user
        db.user: user
        service.type: ClusterIP
        slave.replicas: "2"
      name: user
      targetNamespace: srv
# user 用户服务
- name: User
  steps:
  - applyYamlConfig:
      path: ./app/user.yaml
# user-api 用户 API 服务
- name: UserApi
  steps:
  - applyYamlConfig:
      path: ./app/user-api.yaml

k8s 部分例子

# 负载均衡
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  name: micro-ingress
  namespace: api
spec:
  rules:
  - host: xip.io
    http:
      paths:
        - backend:
            serviceName: micro
            servicePort: http
---
apiVersion: v1
kind: Service
metadata:
  name: micro
  namespace: api
spec:
  selector:
    app: micro
  type: ClusterIP
  ports:
    - name: http
      port: 8080
      protocol: TCP
      targetPort: 8080
---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: micro
  namespace: api
  labels:
    app: micro
spec:
  replicas: 3
  selector:
    matchLabels:
      app: micro
  template:
    metadata:
      labels:
        app: micro
    spec:
      serviceAccountName: micro-services
      containers:
        - name: micro
          image: microhq/micro:kubernetes
          args:
            - "api"
            - "--handler=rpc"
            - "--address=0.0.0.0:8080"
          env:
          - name: MICRO_SERVER_NAME
            value: micro
          - name: MICRO_SERVER_ADDRESS
            value: 0.0.0.0:8989
          ports:
          - containerPort: 8080
            name: http
            protocol: TCP
        - name: health
          command: [
            "/health",
            "--health_address=0.0.0.0:8081",
            "--server_name=micro",
            "--server_address=0.0.0.0:8989"
	        ]
          image: microhq/health:kubernetes
          livenessProbe:
            httpGet:
              path: /health
              port: 8081
            initialDelaySeconds: 3
            periodSeconds: 3





kind: Service
apiVersion: v1
metadata:
  name: user
  namespace: srv
spec:
  selector:
    app: user
  type: ClusterIP
  ports:
    - protocol: TCP
      port: 8080
      name: micro
      targetPort: 8080
---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: user
  namespace: srv
  labels:
    app: user
spec:
  replicas: 1
  selector:
    matchLabels:
      app: user
  template:
    metadata:
      labels:
        app: user
    spec:
      serviceAccountName: micro-services
      imagePullSecrets:
      - name: pipeline-docker-registry
      containers:
        - name: user
          image: gmsa/user:latest
          imagePullPolicy: Always
          command: [
            "service",
            "--selector=static",
            "--server_address=:8080",
          ]
          env:
            - name: ADMIN_PASSWORD
              valueFrom:
                secretKeyRef:
                  key: admin-password
                  name: user
            - name: APP_KEY
              valueFrom:
                secretKeyRef:
                  key: app-key
                  name: user
            - name: TOKEN_VALIDITY_PERIOD
              value: "15"
            - name: DB_HOST
              value: "user-mariadb"
            - name: DB_USER
              value: "user"
            - name: DB_NAME
              value: "user"
            - name: DB_PASSWORD
              valueFrom:
                secretKeyRef:
                  key: mariadb-password
                  name: user-mariadb
          ports:
          - containerPort: 8080
            name: micro
            protocol: TCP
        - name: health
          image: microhq/health:kubernetes
          command: [
            "/health",
            "--health_address=0.0.0.0:8081",
            "--server_name=user",
            "--server_address=0.0.0.0:8080"
          ]
          livenessProbe:
            httpGet:
              path: /health
              port: 8081
            initialDelaySeconds: 3
            periodSeconds: 3

网关代理不成功

只开gateway与web,网关应该也是可以代理的吧。但是报找不到服务
curl http://localhost:8080/v1/gin
返回:{"id":"go.micro.api","code":500,"detail":"service not found","status":"Internal Server Error"}

Error to span

It's a way to put errors from example
func (*Account) Login(ctx context.Context, req *pb.LoginRequest, rsp *pb.Response) error {
automaticaly to span ? Maybe some changes in warrper ?

I added

	return func(h server.HandlerFunc) server.HandlerFunc {
		return func(ctx context.Context, req server.Request, rsp interface{}) error {
			if ot == nil {
				ot = opentracing.GlobalTracer()
			}
			name := fmt.Sprintf("%s", req.Endpoint())
			ctx, span, err := SpanFromContext(ctx, ot, name)

			span.LogKV("reg", req)
			span.LogKV("rsp", rsp)

but i don't know how to catch error from Login func

找不到api.proto 文件

protoc --proto_path=/Users/ln/gopath/src:. --micro_out=. --go_out=. proto/*/*.proto


github.com/micro/go-micro/api/proto/api.proto: File not found.
proto/api/account.proto:5:1: Import "github.com/micro/go-micro/api/proto/api.proto" was not found or had errors.
proto/api/account.proto:8:16: "go.api.Request" is not defined.
proto/api/account.proto:8:41: "go.api.Response" is not defined.
proto/api/account.proto:10:17: "go.api.Request" is not defined.
proto/api/account.proto:10:42: "go.api.Response" is not defined.
proto/api/account.proto:12:15: "go.api.Request" is not defined.
proto/api/account.proto:12:40: "go.api.Response" is not defined.

架构问题

第一个问题:现在是gateway ->web/api -> srv ,是不是直接 gateway->srv 就好了
第二个问题:现在gateway api 项目,可以线上使用了吗?

go 1.13.4下启动gateway报找不到字段

错误码

\pkg\mod\github.com\micro\[email protected]\runtime\process\os\os.go:29:41: unknown field 'Setpgid' in struct literal of type syscall.SysProcAttr

我点击进去的时候,发现这个版本下已经没有这些对应的属性值了unknown field 'Setpgid'undefined: syscall.Getpgidundefined: syscall.Kill
想问一下 这个启动的go版本是?

codahale/hdrhistogram repo url has been transferred under the github HdrHstogram umbrella

Problem

The codahale/hdrhistogram repo has been transferred under the github HdrHstogram umbrella with the help from the original author in Sept 2020 (new repo url https://github.com/HdrHistogram/hdrhistogram-go). The main reasons are to group all implementations under the same roof and to provide more active contribution from the community as the original repository was archived several years ago.

The dependency URL should be modified to point to the new repository URL. The tag "v0.9.0" was applied at the point of transfer and will reflect the exact code that was frozen in the original repository.

If you are using Go modules, you can update to the exact point of transfer using the @v0.9.0 tag in your go get command.

go mod edit -replace github.com/codahale/hdrhistogram=github.com/HdrHistogram/[email protected]

Performance Improvements

From the point of transfer, up until now (mon 16 aug 2021), we've released 3 versions that aim support the standard HdrHistogram serialization/exposition formats, and deeply improve READ performance.
We recommend to update to the latest version.

cannot find module statik

starter-kit/app/console/web/statik: cannot find module providing package github.com/micro-in-cn/starter-kit/app/console/web/statik

go:generate statik -src=./vue/dist -dest=./ -f 怎么操作?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.