Commit ead15d9c by tingweiwang

Update sed-config.sh

1 parent e4cc9891
Showing with 59 additions and 40 deletions
#!/bin/bash
######################项目所在路径#################################
#workspace=/home/wangtingwei/workspace
config_workspace=/root/configmap-kpl/ #configmap base path 模板所在的路径
#目前没有配置的有金山云的国际化翻译、oidc、fake模拟假数据暂时注释
workspace=/workspace/seetaas
config_workspace=/root/configmap-kpl
################kpl组件变量信息##########################
kpl_backend=http://106.38.203.204:30180 #kpl backend api
kpl_back_socket=ws://106.38.203.204:30180 # 如果kpl backend对应的前缀是https,则此处websocket前缀应wss。
kpl_stream=106.38.203.204:30205 # kpl stream ssh 连接容器服务,tcp类型服务。
kpl_backend=http://106.38.203.205:30180
kpl_back_socket=ws://106.38.203.205:30180 # 30200 https对应wss
kpl_edu_backend=http://106.38.203.205:30181
kpl_edu_back_socket=ws://106.38.203.205:30181 # 30200 https对应wss
kpl_stream=106.38.203.205:30205
##################功能开关#####################################
iot_boolean=false
grafana_boolean=false
notebook_grafana_url_string=
node_grafana_url_string=
mqtt_host= #192.168.1.32:1883
#use_fake_metric_string=CPU,GPU
###############其他依赖服务变量信息#########################################
mysql_host=192.168.1.53:3306
mysql_host=192.168.1.32:3306
mysql_user=root
mysql_password=seetatech
redis_host=192.168.1.53:6379
kpl_db_name=seetaas #kpl服务数据库名字
quota_db_name=quota #新增quota 数据库
redis_host=192.168.1.32:6379
redis_password=seetatech
mongo_host='mongodb://admin:admin@192.168.1.51:27017,192.168.1.14:27017/kpl?replicaSet=my-mongodb\&authSource=admin' #&号前记得加转义,此处为mongo副本集客户端配置
#mongo_host='mongodb://admin:admin@192.168.1.51:27017/kpl?authSource=admin' 这里为单节点mongodb客户端配置
harbor_host=192.168.1.53:5000 #内部镜像仓库
hb_host=hub.kce.ksyun.com #外部镜像仓库(算法镜像仓库)
#################################kpl关键字################################
kpl_db_name=kpl #平台数据库名字,默认不更改
quota_db_name=quota #平台quota数据库,默认不更改
kpl_service_id=kpl3 #默认不更改
kpl_realy_path=kpl #默认不更改
###############功能开关####################
iot_boolean=false
grafana_boolean=false #金山环境需要开启为true
mqtt_host= #192.168.1.32:1883 ,如果iot功能关闭,此处可以不做配置
notebook_grafana_url_string=
node_grafana_url_string=
###############################修改后端app.yaml################################
sudo sed -i s#redis_host#$redis_host#g `find $config_workspace -type f -name "*.yaml"`
sudo sed -i s#mysql_host#$mysql_host#g `find $config_workspace -type f -name "*.yaml"`
sudo sed -i s#mysql_user#$mysql_user#g `find $config_workspace -type f -name "*.yaml"`
mongo_host='mongodb://admin:admin@192.168.1.32:27017/seetaas?authSource=admin' #&号前记得加转义
harbor_host=192.168.1.32:5000
hb_host=192.168.1.32:5000 #如果是私有部署则共用一个私有harbor,如果是 公用部署则改成hub.kce.ksyun.com
############################kpl关键字整改#################################################
kpl_service_id=seetaas3
kpl_realy_path=seetaas
kpl_db_name=seetaas #kpl服务数据库名字
####################################公共##################################################
sudo sed -i s/redis_host/$redis_host/g `find $config_workspace -type f -name "*.yaml"`
sudo sed -i s/mysql_host/$mysql_host/g `find $config_workspace -type f -name "*.yaml"`
sudo sed -i s/mysql_user/$mysql_user/g `find $config_workspace -type f -name "*.yaml"`
sudo sed -i s#mongo_host#$mongo_host#g `find $config_workspace -type f -name "*.yaml"`
sudo sed -i s#harbor_host#$harbor_host#g `find $config_workspace -type f -name "*.yaml"`
sudo sed -i s#redis_password#$redis_password#g `find $config_workspace -type f -name "*.yaml"`
sudo sed -i s#mysql_password#$mysql_password#g `find $config_workspace -type f -name "*.yaml"`
###################################################################################
sudo sed -i s#kpl_stream#$kpl_stream#g `find $config_workspace -type f -name "*.yaml"`
###############################修改前端app.yaml#######################################
sudo sed -i s/harbor_host/$harbor_host/g `find $config_workspace -type f -name "*.yaml"`
sudo sed -i s/hb_host/$hb_host/g `find $config_workspace -type f -name "*.yaml"`
sudo sed -i s/redis_password/$redis_password/g `find $config_workspace -type f -name "*.yaml"`
sudo sed -i s/mysql_password/$mysql_password/g `find $config_workspace -type f -name "*.yaml"`
sudo sed -i s/kpl_db_name/$kpl_db_name/g `find $config_workspace -type f -name "*.yaml"`
sudo sed -i s/quota_db_name/$quota_db_name/g `find $config_workspace -type f -name "*.yaml"`
#############################kpl修改前端app.yaml#######################################
sudo sed -i s#kpl_backend#$kpl_backend#g `find $config_workspace -type f -name "*.yaml"`
sudo sed -i s#kpl_back_socket#$kpl_back_socket#g `find $config_workspace -type f -name "*.yaml"`
sudo sed -i s#hb_host#$hb_host#g `find $config_workspace -type f -name "*.yaml"`
#######################################kpl################################
sudo sed -i s#kpl_db_name#$kpl_db_name#g `find $config_workspace -type f -name "*.yaml"`
sudo sed -i s#quota_db_name#$quota_db_name#g `find $config_workspace -type f -name "*.yaml"`
sudo sed -i s#kpl_service_id#$kpl_service_id#g `find $config_workspace -type f -name "*.yaml"`
sudo sed -i s#kpl_realy_path#$kpl_realy_path#g `find $config_workspace -type f -name "*.yaml"`
###########################功能开关配置####################################
sudo sed -i s#kpl_edu_backend#$kpl_edu_backend#g `find $config_workspace -type f -name "*.yaml"`
sudo sed -i s#kpl_edu_back_socket#$kpl_edu_back_socket#g `find $config_workspace -type f -name "*.yaml"`
sudo sed -i s#kpl_stream#$kpl_stream#g `find $config_workspace -type f -name "*.yaml"`
########################功能开关#######################################
sudo sed -i s#iot_boolean#$iot_boolean#g `find $config_workspace -type f -name "*.yaml"`
sudo sed -i s#mqtt_host#$mqtt_host#g `find $config_workspace -type f -name "*.yaml"`
sudo sed -i s#grafana_boolean#$grafana_boolean#g `find $config_workspace -type f -name "*.yaml"`
sudo sed -i s#notebook_grafana_url_string#$notebook_grafana_url_string#g `find $config_workspace -type f -name "*.yaml"`
sudo sed -i s#node_grafana_url_string#$node_grafana_url_string#g `find $config_workspace -type f -name "*.yaml"`
#sudo sed -i s#use_fake_metric_string#$use_fake_metric_string#g `find $config_workspace -type f -name "*.yaml"`
###################################################################################################
sudo sed -i s#kpl_service_id#$kpl_service_id#g `find $config_workspace -type f -name "*.yaml"`
sudo sed -i s#kpl_realy_path#$kpl_realy_path#g `find $config_workspace -type f -name "*.yaml"`
########################################修改Makefile与########################################################
sudo sed -i s/harbor_host/$harbor_host/g `find $workspace -maxdepth 3 -type f -name Makefile`
cp ~/.docker/config.json $workspace/src/autodl-core/conf/ #用于生产环境以及私有部署autodl-core服务向镜像仓库推送镜像所添加的认证文件。
cp ~/.docker/config.json $workspace/src/seetaas-backend/conf/ #用于生产环境以及私有部署autodl-core服务向镜像仓库推送镜像所添加的认证文件。
##################################修改Dockerfile#######################################################
sed -i s#hub.kce.ksyun.com/kpl_k8s/ubuntu-basic:16.04#$harbor_host/k8s/ubuntu-basic:16.04#g `find $workspace -maxdepth 5 -name Dockerfile -type f`
sed -i s#hub.kce.ksyun.com/kpl_k8s/image-proxy:v0.9.2#$harbor_host/k8s/image-proxy:v0.9.2#g `find $workspace -maxdepth 5 -name Dockerfile -type f`
sed -i s#hub.kce.ksyun.com/kpl_k8s/nginx:latest#$harbor_host/k8s/nginx#g `find $workspace -maxdepth 5 -name Dockerfile -type f`
sed -i s#hub.kce.ksyun.com/kpl_k8s/cuda:10.0-base-ubuntu16.04#$harbor_host/k8s/cuda:10.0-base-ubuntu16.04#g `find $workspace -maxdepth 5 -name Dockerfile -type f`
sed -i s#hub.kce.ksyun.com/kpl_k8s/core_gpu_base:cuda-10.0-base-neuware-mlu270-1.3.0-ubuntu18.04#$harbor_host/k8s/core_gpu_base:cuda-10.0-base-neuware-mlu270-1.3.0-ubuntu18.04#g `find $workspace -maxdepth 5 -name Dockerfile -type f`
###################################修改launcher部署的harbor_host模板#######################################
sed -i s#harbor_host#$harbor_host#g $workspace/src/kpl-launcher/deploy.sh
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!