|
@@ -162,7 +162,7 @@ func RunWaitingCluster() {
|
|
|
// 根据项目ID获取偏移量
|
|
|
val, err := infra.GlobalRedisClient.Get(offsetKey).Result()
|
|
|
if err != nil {
|
|
|
- infra.GlobalLogger.Infof("偏移量键 %v 不存在,初始化设置为 0。", offsetKey)
|
|
|
+ //infra.GlobalLogger.Infof("偏移量键 %v 不存在,初始化设置为 0。", offsetKey)
|
|
|
err = infra.GlobalRedisClient.Set(offsetKey, 0, 0).Err()
|
|
|
if err != nil {
|
|
|
infra.GlobalLogger.Infof("偏移量键值对 %v 初始化失败,错误信息为: %v", offsetKey, err)
|
|
@@ -182,7 +182,7 @@ func RunWaitingCluster() {
|
|
|
infra.GlobalLogger.Infof("偏移量 %v 加一失败,错误信息为: %v", offsetKey, err)
|
|
|
continue
|
|
|
}
|
|
|
- infra.GlobalLogger.Infof("偏移量【%v】加一给下个任务使用。", offsetKey)
|
|
|
+ //infra.GlobalLogger.Infof("偏移量【%v】加一给下个任务使用。", offsetKey)
|
|
|
|
|
|
// ------- 解析 xosc ,从xosc中解析起终点位置&修改 xodr 和 osgb ---------------
|
|
|
xoscOssPath := firstTaskCache.Task.Scenario.ScenarioOsc
|
|
@@ -206,11 +206,14 @@ func RunWaitingCluster() {
|
|
|
destinationCsvLocalPath := tempDir + util.NewShortUUID() + ".xosc"
|
|
|
err = tempOss.GetObjectToFile(destinationCsvOssKey, destinationCsvLocalPath)
|
|
|
endPoints, _ = util.ParseCsv(destinationCsvLocalPath)
|
|
|
+ infra.GlobalLogger.Infof("终点文件【%v】的解析结果为:【%v】", destinationCsvLocalPath, endPoints)
|
|
|
} else {
|
|
|
endPositionX, endPositionY, endPositionZ, endPositionH := global.DefaultEndPositionX, global.DefaultEndPositionY, global.DefaultEndPositionZ, global.DefaultEndPositionH
|
|
|
tempEndPoint := util.DataPoint{X: endPositionX, Y: endPositionY, Z: endPositionZ, H: endPositionH}
|
|
|
endPoints = append(endPoints, tempEndPoint)
|
|
|
+ infra.GlobalLogger.Infof("终点文件不存在,使用默认终点。")
|
|
|
}
|
|
|
+
|
|
|
var endPosition string // export END_POSITION="x1,y1,z1,h1;x2,y2,z2,h2;x3,y3,z3,h3;x4,y4,z4,h4"
|
|
|
// 遍历生成字符串
|
|
|
var endPositionBuilder strings.Builder
|
|
@@ -283,9 +286,9 @@ func RunWaitingCluster() {
|
|
|
// 4 模板yaml备份路径
|
|
|
yamlPathBak := infra.ApplicationYaml.K8s.PodYamlDir + "bak/" + podYaml
|
|
|
fmt.Println(yamlPath, yamlPathBak)
|
|
|
- // 5
|
|
|
+ // 5 不同设备类型用不同的模板文件
|
|
|
podString := ""
|
|
|
- if firstTaskCache.EquipmentType == "JIN_LONG_BA_SHI" || firstTaskCache.EquipmentType == "PU_JIN_DUO_GONG_NENG_CHE" { // 多功能车仿真
|
|
|
+ if firstTaskCache.EquipmentType == global.EquipmentTypeKinglong || firstTaskCache.EquipmentType == global.EquipmentTypePjisuv { // 多功能车仿真
|
|
|
if podString, err = util.ReadFile(infra.ApplicationYaml.K8s.VtdPodTemplateYamlPjisuv); err != nil {
|
|
|
infra.GlobalLogger.Error(err)
|
|
|
continue
|
|
@@ -298,18 +301,18 @@ func RunWaitingCluster() {
|
|
|
}
|
|
|
podString = strings.Replace(podString, "vtd-command", infra.ApplicationYaml.K8s.VtdCommandPjibot, -1)
|
|
|
}
|
|
|
- if firstTaskCache.Env == "cicv" {
|
|
|
- podString = strings.Replace(podString, "oss-type", infra.ApplicationYaml.OssCicv.Type, -1)
|
|
|
- podString = strings.Replace(podString, "oss-ip", infra.ApplicationYaml.OssCicv.Endpoint, -1) // 不带http://前缀
|
|
|
- podString = strings.Replace(podString, "oss-access-key", infra.ApplicationYaml.OssCicv.AccessKeyId, -1)
|
|
|
- podString = strings.Replace(podString, "oss-secret-key", infra.ApplicationYaml.OssCicv.AccessKeySecret, -1)
|
|
|
- podString = strings.Replace(podString, "oss-bucket", infra.ApplicationYaml.OssCicv.BucketName, -1)
|
|
|
- } else {
|
|
|
+ if firstTaskCache.Env == global.EnvPji {
|
|
|
podString = strings.Replace(podString, "oss-type", infra.ApplicationYaml.OssPji.Type, -1)
|
|
|
podString = strings.Replace(podString, "oss-ip", infra.ApplicationYaml.OssPji.Endpoint, -1) // 不带http://前缀
|
|
|
podString = strings.Replace(podString, "oss-access-key", infra.ApplicationYaml.OssPji.AccessKeyId, -1)
|
|
|
podString = strings.Replace(podString, "oss-secret-key", infra.ApplicationYaml.OssPji.AccessKeySecret, -1)
|
|
|
podString = strings.Replace(podString, "oss-bucket", infra.ApplicationYaml.OssPji.BucketName, -1)
|
|
|
+ } else {
|
|
|
+ podString = strings.Replace(podString, "oss-type", infra.ApplicationYaml.OssCicv.Type, -1)
|
|
|
+ podString = strings.Replace(podString, "oss-ip", infra.ApplicationYaml.OssCicv.Endpoint, -1) // 不带http://前缀
|
|
|
+ podString = strings.Replace(podString, "oss-access-key", infra.ApplicationYaml.OssCicv.AccessKeyId, -1)
|
|
|
+ podString = strings.Replace(podString, "oss-secret-key", infra.ApplicationYaml.OssCicv.AccessKeySecret, -1)
|
|
|
+ podString = strings.Replace(podString, "oss-bucket", infra.ApplicationYaml.OssCicv.BucketName, -1)
|
|
|
}
|
|
|
podString = strings.Replace(podString, "pod-name", podName, -1)
|
|
|
podString = strings.Replace(podString, "namespace-name", namespaceName, -1)
|