初始化

This commit is contained in:
pengluan 2022-07-27 19:28:33 +08:00
parent 01eac65f1e
commit abee8ef551

View File

@ -178,7 +178,7 @@ def init():
# 添加demo 服务
def create_service(project_name,service_name,service_describe,image_name,command,env,resource_mem='2G',resource_cpu='2',ports='80',volume_mount='kubeflow-user-workspace(pvc):/mnt'):
def create_service(project_name,service_name,service_describe,image_name,command,env,resource_memory='2G',resource_cpu='2',resource_gpu='0',ports='80',volume_mount='kubeflow-user-workspace(pvc):/mnt'):
service = db.session.query(Service).filter_by(name=service_name).first()
project = db.session.query(Project).filter_by(name=project_name).filter_by(type='org').first()
if service is None and project:
@ -191,6 +191,9 @@ def init():
service.project_id=project.id
service.images=image_name
service.command = command
service.resource_memory=resource_memory,
service.resource_cpu=resource_cpu,
service.resource_gpu=resource_gpu,
service.env='\n'.join([x.strip() for x in env.split('\n') if x.split()])
service.ports = ports
service.volume_mount=volume_mount