Skip to content

Commit

Permalink
升级初始化脚本
Browse files Browse the repository at this point in the history
  • Loading branch information
chendile committed Sep 3, 2023
1 parent 1fcd661 commit e2578ec
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 14 deletions.
4 changes: 0 additions & 4 deletions install/docker/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,7 @@
## deploy mysql

```
linux
docker run -p 3306:3306 --restart always --name mysql -e MYSQL_ROOT_PASSWORD=admin -e MYSQL_ALLOW_EMPTY_PASSWORD=true -v $PWD/docker-add-file/mysqld.cnf:/etc/mysql/mysql.conf.d/mysqld.cnf -d mysql:8.0.32
mac
docker run -p 3306:3306 --restart always --name mysql -e MYSQL_ROOT_PASSWORD=admin -e MYSQL_ALLOW_EMPTY_PASSWORD=true -v $PWD/docker-add-file/mysqld.cnf:/etc/mysql/mysql.conf.d/mysqld.cnf -d mysql:8.0.32
```
进入mysql,创建kubeflow数据库
```
Expand Down
17 changes: 11 additions & 6 deletions install/docker/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version: '3'
version: '3.1'
services:
redis:
image: bitnami/redis:6.2.12
Expand All @@ -10,7 +10,7 @@ services:

# mysql:
# image: mysql:8.0.32
# restart: always
# restart: unless-stopped
# environment:
# MYSQL_ROOT_PASSWORD: admin
# MYSQL_DATABASE: kubeflow
Expand All @@ -20,6 +20,11 @@ services:
# volumes:
# - ./data/mysql:/var/lib/mysql
# - ./docker-add-file/mysqld.cnf:/etc/mysql/mysql.conf.d/mysqld.cnf
# healthcheck:
# test: "/usr/bin/mysql --user=root --password=admin --execute \"SHOW DATABASES;\""
# timeout: 45s
# interval: 10s
# retries: 10

frontend:
image: ccr.ccs.tencentyun.com/cube-studio/kubeflow-dashboard-frontend:2023.08.01
Expand All @@ -32,9 +37,9 @@ services:
- ../../install/docker/dockerFrontend/nginx.80.conf:/etc/nginx/conf.d/default.conf

myapp:
image: ccr.ccs.tencentyun.com/cube-studio/kubeflow-dashboard:2023.08.01
image: ccr.ccs.tencentyun.com/cube-studio/kubeflow-dashboard:2023.08.01
restart: unless-stopped
command: ['bash','-c','sleep 10000000 && /entrypoint.sh']
command: [ 'bash','-c','/entrypoint.sh' ]
environment:
STAGE: 'dev'
REDIS_HOST: 'redis'
Expand All @@ -43,8 +48,6 @@ services:
MYSQL_SERVICE: 'mysql+pymysql://root:[email protected]:3306/kubeflow?charset=utf8'
ENVIRONMENT: DEV
GPU_TYPE: NVIDIA
# ports:
# - "8080:80"
depends_on:
- redis
# - mysql
Expand All @@ -71,6 +74,7 @@ services:
# ENVIRONMENT: DEV
# depends_on:
# - redis
# - mysql
# volumes:
# - ../../myapp/:/home/myapp/myapp/
# - ./file:/pvc
Expand All @@ -92,6 +96,7 @@ services:
# ENVIRONMENT: DEV
# depends_on:
# - redis
# - mysql
# volumes:
# - ../../myapp/:/home/myapp/myapp/
# - ./file:/data/k8s/kubeflow
Expand Down
11 changes: 9 additions & 2 deletions myapp/create_db.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/usr/bin/env python
import os
import os,time
import pysnooper

# @pysnooper.snoop()
Expand All @@ -11,7 +11,14 @@ def init_db():
"""Inits the Myapp application"""
import pymysql
# 创建连接
conn = pymysql.connect(host=uri.host, port=uri.port, user=uri.username, password=uri.password, charset='utf8')
while True:
try:
# 创建连接
conn = pymysql.connect(host=uri.host, port=uri.port, user=uri.username, password=uri.password, charset='utf8')
break
except:
print('链接数据库失败,5s后重连', flush=True)
time.sleep(5)
# 创建游标
cursor = conn.cursor()

Expand Down
4 changes: 2 additions & 2 deletions myapp/views/view_nni.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,9 @@ class NNI_ModelView_Base():
show_columns = ['created_by','changed_by','created_on','changed_on','job_type','name','namespace','describe',
'parallel_trial_count','max_trial_count','objective_type',
'objective_goal','objective_metric_name','objective_additional_metric_names','algorithm_name',
'algorithm_setting','parameters_html','trial_spec_html',
'algorithm_setting','parameters','trial_spec',
'working_dir','volume_mount','node_selector','image_pull_policy','resource_memory','resource_cpu','resource_gpu',
'experiment_html','alert_status']
'experiment','alert_status']

add_form_query_rel_fields = {
"project": [["name", Project_Join_Filter, 'org']]
Expand Down

0 comments on commit e2578ec

Please sign in to comment.