Skip to content

Commit

Permalink
bugfix: 修复单个进程实例下发配置时一直提示需要生成新版本的问题 (fixed #121)
Browse files Browse the repository at this point in the history
  • Loading branch information
zhangzhw8 committed Jan 11, 2022
1 parent 68b4915 commit 8be1cb0
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 15 deletions.
2 changes: 1 addition & 1 deletion Procfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
web: gunicorn --timeout 600 --max-requests 200 --max-requests-jitter 20 wsgi -w 8 -b :$PORT --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"'
web: gunicorn --timeout 600 --max-requests 500 --max-requests-jitter 100 wsgi -w 8 -b :$PORT --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"'
dworker: celery -A blueapps.core.celery worker -Q default -n default@%h -c 5 -l info --maxtasksperchild=50
cworker: celery -A blueapps.core.celery worker -Q pipeline_additional_task,pipeline_additional_task_priority -n common_worker@%h -c 5 -l info --maxtasksperchild=50
ereworker: celery -A blueapps.core.celery worker -Q er_execute -n ri_worker@%h -l info -c 10 -l info --maxtasksperchild=100
Expand Down
6 changes: 5 additions & 1 deletion apps/gsekit/configfile/handlers/config_instance.py
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,11 @@ def latest_config_instance(cls, bk_process_id: int, config_template_id: int, ins

result = {"generated_config": first_latest_config, "released_config": first_released_config, "is_latest": True}
if first_latest_released_config:
result = {"generated_config": first_latest_released_config, "released_config": first_latest_released_config}
result = {
"generated_config": first_latest_released_config,
"released_config": first_latest_released_config,
"is_latest": True,
}

if not result["generated_config"]:
return result
Expand Down
7 changes: 1 addition & 6 deletions apps/gsekit/configfile/views/config_instance.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,7 @@ def get_instance_ids_getter(self) -> Union[Callable, None]:
return None

def get_permissions(self):
# TODO 待确认是否需要细粒度控制配置实例的查看权限
# if self.action in ["retrieve", "latest_config_instance", "list_config_instances"]:
# return [
# InstanceActionPermission([ActionEnum.EDIT_CONFIG_TEMPLATE], ResourceEnum.CONFIG_TEMPLATE),
# self.get_instance_ids_getter,
# ]
# 权限控制无需细到配置实例,仅需业务查看权限即可
return [ViewBusinessPermission()]

def get_serializer_class(self, *args, **kwargs):
Expand Down
11 changes: 4 additions & 7 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ django-dbconn-retry==0.1.5
# django
django==3.2.4
django-celery-beat==2.2.0
django-celery-results==2.1.0
#django-celery-results==2.0.0
django-filter==2.4.0
django-cors-headers==3.7.0
djangorestframework==3.12.4
Expand All @@ -33,8 +33,7 @@ cryptography==3.2
bk-iam==1.1.19

# pipeline
bamboo-pipeline==3.5.4
bamboo-engine==1.2.1
bamboo-pipeline==3.12.0

# for sentry
raven==6.1.0
Expand All @@ -44,16 +43,14 @@ ddtrace==0.14.1

# others
mock==2.0.0
urllib3==1.26.6
pytz==2020.4
urllib3==1.25.11
greenlet==0.4.17
jsonschema==3.2.0
botocore==1.12.253

gunicorn==19.6.0
gevent==1.2.2
celery==4.4.7
mako==1.1.3
mako==1.1.4
lxml==4.6.3
ruamel.yaml==0.17.16
packaging==20.9

0 comments on commit 8be1cb0

Please sign in to comment.