TremblingV5 / DouTok

DouTok is a backend server for a simple Douyin/TikTok 字节跳动青训营项目
Apache License 2.0
169 stars 54 forks source link

use `make` to startup DouTok services #112

Open BaiZe1998 opened 8 months ago

BaiZe1998 commented 8 months ago

The local startup method for DouTok services is very poor, it needs to be optimized using make.

TremblingV5 commented 8 months ago

Just proposal

We may need some make ... command to do following operations:

  1. Use make start all to start all services in ./applications
  2. Use make start xxx to start a clarify service named xxx in ./applications/xxx
  3. Use make stop all to stop all services
  4. Use make stop xxx to stop a clarify service
BaiZe1998 commented 8 months ago

I think that the current method of launching all services by reading environment variables is not suitable, because modifying environment variables is not convenient. I would prefer to launch services by reading a local yml configuration file, or after the successful deployment of /env/dependences.yml, import the configuration of each service into etcd and get configuration from it.

BaiZe1998 commented 8 months ago

@TremblingV5 cc

BaiZe1998 commented 8 months ago

At present, the startup of services depends on environment variables and .yml files. I think it's better not to introduce too much complexity.

TremblingV5 commented 8 months ago

I think that the current method of launching all services by reading environment variables is not suitable, because modifying environment variables is not convenient. I would prefer to launch services by reading a local yml configuration file, or after the successful deployment of /env/dependences.yml, import the configuration of each service into etcd and get configuration from it.

Yes, I also feel not suitable in running DouTok.

Using env variables becuase I assumed that we may use k8s to manage services. If we use k8s, it's good for using env variables. But now we not using k8s so it's redundant.

I think we may use 2 - 3 launch layout:

  1. Load configuration files
  2. Load from etcd
  3. Load env variables

DouTok can select a suitable method to load configurations. Now I think load files or load from etcd is better than env variables.

AbigailJixiangyuyu commented 8 months ago

May I directly comment the code related to Otel? such as this one image

TremblingV5 commented 8 months ago

May I directly comment the code related to Otel? such as this one image

Yes, but these code only log lines for can't achieve otel , it not affect run services.

lightjw commented 3 months ago

hi, can I try to do this?

TremblingV5 commented 2 months ago

hi, can I try to do this?

Sure, but I prefer you to look this repo: https://github.com/cloudzenith/DouTok

It's the next version of this repo