|
@@ -129,7 +129,11 @@ func RunWaitingCluster() {
|
|
algorithmImageName = infra.ApplicationYaml.K8s.RegistryUri + "/cicvdcl_" + util.MD5HashShort(algorithmTarName)
|
|
algorithmImageName = infra.ApplicationYaml.K8s.RegistryUri + "/cicvdcl_" + util.MD5HashShort(algorithmTarName)
|
|
newAlgorithm = util.ImageExists(infra.GlobalDockerClient, algorithmImageName)
|
|
newAlgorithm = util.ImageExists(infra.GlobalDockerClient, algorithmImageName)
|
|
if newAlgorithm {
|
|
if newAlgorithm {
|
|
- _ = infra.GlobalOssBucket.GetObjectToFile(firstTaskCache.AlgorithmObjectKey, algorithmTarPath)
|
|
|
|
|
|
+ if firstTaskCache.EquipmentType == "JIN_LONG_BA_SHI" || firstTaskCache.EquipmentType == "PU_JIN_DUO_GONG_NENG_CHE" {
|
|
|
|
+ err = infra.GlobalOssBucketCicv.GetObjectToFile(firstTaskCache.AlgorithmObjectKey, algorithmTarPath)
|
|
|
|
+ } else {
|
|
|
|
+ err = infra.GlobalOssBucketPji.GetObjectToFile(firstTaskCache.AlgorithmObjectKey, algorithmTarPath)
|
|
|
|
+ }
|
|
if err != nil {
|
|
if err != nil {
|
|
infra.GlobalLogger.Error("下载oss上的算法镜像 "+firstTaskCache.AlgorithmObjectKey+" 失败,错误信息为:", err)
|
|
infra.GlobalLogger.Error("下载oss上的算法镜像 "+firstTaskCache.AlgorithmObjectKey+" 失败,错误信息为:", err)
|
|
time.Sleep(time.Duration(2) * time.Second)
|
|
time.Sleep(time.Duration(2) * time.Second)
|
|
@@ -270,11 +274,20 @@ func RunWaitingCluster() {
|
|
podString = strings.Replace(podString, "platform-ip", infra.ApplicationYaml.Web.IpPrivate+":"+infra.ApplicationYaml.Web.Port, -1)
|
|
podString = strings.Replace(podString, "platform-ip", infra.ApplicationYaml.Web.IpPrivate+":"+infra.ApplicationYaml.Web.Port, -1)
|
|
podString = strings.Replace(podString, "simulation-cloud-ip", infra.ApplicationYaml.Web.IpPrivate+":"+infra.ApplicationYaml.Web.Port, -1)
|
|
podString = strings.Replace(podString, "simulation-cloud-ip", infra.ApplicationYaml.Web.IpPrivate+":"+infra.ApplicationYaml.Web.Port, -1)
|
|
podString = strings.Replace(podString, "platform-type", "\""+infra.ApplicationYaml.K8s.PlatformType+"\"", -1)
|
|
podString = strings.Replace(podString, "platform-type", "\""+infra.ApplicationYaml.K8s.PlatformType+"\"", -1)
|
|
- podString = strings.Replace(podString, "oss-type", infra.ApplicationYaml.Oss.Type, -1)
|
|
|
|
- podString = strings.Replace(podString, "oss-ip", infra.ApplicationYaml.Oss.Endpoint, -1) // 不带http://前缀
|
|
|
|
- podString = strings.Replace(podString, "oss-access-key", infra.ApplicationYaml.Oss.AccessKeyId, -1)
|
|
|
|
- podString = strings.Replace(podString, "oss-secret-key", infra.ApplicationYaml.Oss.AccessKeySecret, -1)
|
|
|
|
- podString = strings.Replace(podString, "oss-bucket", infra.ApplicationYaml.Oss.BucketName, -1)
|
|
|
|
|
|
+ if firstTaskCache.EquipmentType == "JIN_LONG_BA_SHI" || firstTaskCache.EquipmentType == "PU_JIN_DUO_GONG_NENG_CHE" {
|
|
|
|
+ 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 {
|
|
|
|
+ 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)
|
|
|
|
+ }
|
|
|
|
+
|
|
podString = strings.Replace(podString, "kafka-ip", infra.ApplicationYaml.Kafka.Broker, -1)
|
|
podString = strings.Replace(podString, "kafka-ip", infra.ApplicationYaml.Kafka.Broker, -1)
|
|
podString = strings.Replace(podString, "kafka-topic", projectId, -1)
|
|
podString = strings.Replace(podString, "kafka-topic", projectId, -1)
|
|
podString = strings.Replace(podString, "kafka-partition", "\""+util.ToString(infra.ApplicationYaml.Kafka.Partition)+"\"", -1)
|
|
podString = strings.Replace(podString, "kafka-partition", "\""+util.ToString(infra.ApplicationYaml.Kafka.Partition)+"\"", -1)
|
|
@@ -286,7 +299,12 @@ func RunWaitingCluster() {
|
|
tempDir := "/mnt/disk001/dcl_dispatch_server/temp/"
|
|
tempDir := "/mnt/disk001/dcl_dispatch_server/temp/"
|
|
util.CreateDir(tempDir)
|
|
util.CreateDir(tempDir)
|
|
xoscLocalPath := tempDir + util.NewShortUUID() + ".xosc"
|
|
xoscLocalPath := tempDir + util.NewShortUUID() + ".xosc"
|
|
- err = infra.GlobalOssBucket.GetObjectToFile(firstTaskCache.Task.Scenario.ScenarioOsc, xoscLocalPath)
|
|
|
|
|
|
+ if firstTaskCache.EquipmentType == "JIN_LONG_BA_SHI" || firstTaskCache.EquipmentType == "PU_JIN_DUO_GONG_NENG_CHE" {
|
|
|
|
+ err = infra.GlobalOssBucketCicv.GetObjectToFile(firstTaskCache.Task.Scenario.ScenarioOsc, xoscLocalPath)
|
|
|
|
+ } else {
|
|
|
|
+ err = infra.GlobalOssBucketPji.GetObjectToFile(firstTaskCache.Task.Scenario.ScenarioOsc, xoscLocalPath)
|
|
|
|
+ }
|
|
|
|
+
|
|
if err != nil {
|
|
if err != nil {
|
|
infra.GlobalLogger.Errorf("下载xosc文件【%v】失败,错误信息为:%v", xoscOssPath, err)
|
|
infra.GlobalLogger.Errorf("下载xosc文件【%v】失败,错误信息为:%v", xoscOssPath, err)
|
|
continue
|
|
continue
|