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 10, 2021
1 parent 343e87f commit 17ec5c2
Show file tree
Hide file tree
Showing 4 changed files with 69 additions and 4 deletions.
63 changes: 63 additions & 0 deletions app_desc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
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版本
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
4 changes: 3 additions & 1 deletion config/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,9 @@ def get_env_or_raise(key):
ENVIRONMENT = {"development": "dev", "testing": "stag", "production": "prod"}.get(PAAS_V2_ENVIRONMENT)

# SaaS运行版本,如非必要请勿修改
RUN_VER = os.environ.get("BKPAAS_ENGINE_REGION", "open")
# 暂时避开开发框架的问题,新版PaaS该值设置为default
# 在开发框架中根据该值导入config,config仅提供open可选
RUN_VER = os.environ.get("ENGINE_REGION", "open")

APP_ID = APP_CODE = os.environ.get("APP_ID", "bk_gsekit")
APP_TOKEN = SECRET_KEY = os.environ.get("APP_TOKEN", "28b7b410-c7b7-4537-9a65-8ce55738170e")
Expand Down
4 changes: 2 additions & 2 deletions config/default.py
Original file line number Diff line number Diff line change
Expand Up @@ -209,15 +209,15 @@
# ==============================================================================
# IAM
# ==============================================================================
BK_IAM_SYSTEM_ID = "bk_gsekit"
BK_IAM_SYSTEM_ID = os.getenv("BK_IAM_SYSTEM_ID", "bk_gsekit")
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_RESOURCE_API_HOST = os.getenv("BKAPP_IAM_RESOURCE_API_HOST", f"{BK_PAAS_INNER_HOST}/o/{APP_CODE}/")
BK_IAM_RESOURCE_API_HOST = os.getenv("BK_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")
Expand Down
2 changes: 1 addition & 1 deletion runtime.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
python-3.7.4
python-3.6.8

0 comments on commit 17ec5c2

Please sign in to comment.