Skip to content

Commit

Permalink
feature: PaaS 部署适配(#19)
Browse files Browse the repository at this point in the history
  • Loading branch information
ZhuoZhuoCrayon committed Sep 14, 2021
1 parent 343e87f commit 6fea2c7
Show file tree
Hide file tree
Showing 2 changed files with 72 additions and 5 deletions.
69 changes: 69 additions & 0 deletions app_desc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
spec_version: 2
app_version: "{{APP_VERSION}}"
app:
region: default
bk_app_code: "bk_gsekit"
bk_app_name: 进程配置管理
market:
category: 运维工具
introduction: 进程配置管理
display_options:
width: 1300
height: 720
is_win_maximize: True
open_mode: "new_tab"
modules:
default:
is_default: True
source_dir: src
language: Python
services:
- name: mysql
- name: redis
- name: rabbitmq
env_variables:
- key: ENGINE_REGION
value: "open"
description: 暂时避开开发框架的问题,新版PaaS该值设置为default
- key: PIP_VERSION
value: "20.2.3"
description: 固化pip版本

svc_discovery:
bk_saas:
- bk_app_code: "bk_iam"
- bk_app_code: "bk_gsekit"

processes:
web:
command: gunicorn --timeout 600 --max-requests 100 --max-requests-jitter 10 wsgi -w 8 -b :5000 --access-logfile - --error-logfile - --access-logformat '[%(h)s] %({request_id}i)s %(u)s %(t)s "%(r)s" %(s)s %(D)s %(b)s "%(f)s" "%(a)s"'
plan: 4C2G5R
replicas: 5
dworker:
command: celery -A blueapps.core.celery worker -Q default -n default@%h -c 5 -l info --maxtasksperchild=50
plan: 4C2G5R
replicas: 5
pworker:
command: celery -A blueapps.core.celery worker -Q pipeline,pipeline_priority -n pipeline_worker@%h -c 5 -l info --maxtasksperchild=50
plan: 4C2G5R
replicas: 5
sworker:
command: celery -A blueapps.core.celery worker -A blueapps.core.celery -Q service_schedule,service_schedule_priority -c 5 -l info -n schedule_worker@%h --maxtasksperchild=50
plan: 4C2G5R
replicas: 5
cworker:
command: celery -A blueapps.core.celery worker -Q pipeline_additional_task,pipeline_additional_task_priority -n common_worker@%h -c 5 -l info --maxtasksperchild=50
plan: 4C2G5R
replicas: 5
erworker:
command: celery -A blueapps.core.celery worker -Q er_execute,er_schedule -n ri_worker@%h -l info -c 10 -l info --maxtasksperchild=50
plan: 4C2G5R
replicas: 5
beat:
command: celery -A blueapps.core.celery beat -l info
plan: 4C2G5R
replicas: 1
pwatch:
command: python manage.py watch_process
plan: 4C2G5R
replicas: 1
8 changes: 3 additions & 5 deletions config/default.py
Original file line number Diff line number Diff line change
Expand Up @@ -209,18 +209,16 @@
# ==============================================================================
# IAM
# ==============================================================================
BK_IAM_SYSTEM_ID = "bk_gsekit"
BK_IAM_SKIP = False
BK_IAM_SYSTEM_NAME = "GSEKIT"
BK_IAM_MIGRATION_APP_NAME = "iam"
BK_IAM_SKIP = False

BK_IAM_INNER_HOST = os.getenv("BK_IAM_V3_INNER_HOST", "http://bkiam.service.consul")

# BK_IAM_RESOURCE_API_HOST = os.getenv("BKAPP_IAM_RESOURCE_API_HOST", f"{BK_PAAS_HOST}/o/{APP_CODE}/")
BK_IAM_SYSTEM_ID = os.getenv("BKAPP_IAM_SYSTEM_ID", "bk_gsekit")
BK_IAM_RESOURCE_API_HOST = os.getenv("BKAPP_IAM_RESOURCE_API_HOST", f"{BK_PAAS_INNER_HOST}/o/{APP_CODE}/")

# 权限中心 SaaS host
BK_IAM_APP_CODE = os.getenv("BK_IAM_V3_APP_CODE", "bk_iam")
BK_IAM_INNER_HOST = os.getenv("BK_IAM_V3_INNER_HOST", "http://bkiam.service.consul")
BK_IAM_SAAS_HOST = os.environ.get("BK_IAM_V3_SAAS_HOST", f"{BK_PAAS_HOST}/o/{BK_IAM_APP_CODE}/")

# TAM
Expand Down

0 comments on commit 6fea2c7

Please sign in to comment.