소스 검색

生成视频

root 2 년 전
부모
커밋
7f3a1399e0

+ 1 - 0
pom.xml

@@ -21,6 +21,7 @@
         <module>simulation-resource-common</module>
         <module>simulation-resource-monitor</module>
         <module>simulation-resource-scene</module>
+        <module>simulation-resource-video</module>
     </modules>
 
 

+ 2 - 2
simulation-resource-scheduler/src/main/java/com/css/simulation/resource/scheduler/manager/TaskManager.java

@@ -92,7 +92,7 @@ public class TaskManager {
 
     @SneakyThrows
     @Transactional
-    public boolean isProjectCompleted(PrefixTO redisPrefix, String projectId,String projectType, String taskId, String state, String podName) {
+    public boolean isProjectCompleted(PrefixTO redisPrefix, String projectId, String projectType, String taskId, String state, String podName) {
         String nodeName = projectUtil.getNodeNameOfPod(podName);
         if ("Running".equals(state)) {  // 运行中的 pod 无需删除
             // 将运行中的任务的 pod 名称放入 redis
@@ -220,6 +220,7 @@ public class TaskManager {
                 String task2Id = taskOfLeaf.getId();
                 try {
                     String runState = taskOfLeaf.getRunState();
+                    log.info("TaskManager--score 任务 " + task2Id + " 的运行状态为:" + runState);
                     if (DictConstants.TASK_ANALYSIS.equals(runState)) {
                         taskMapper.updateSuccessStateWithStopTime(task2Id, DictConstants.TASK_ANALYSING, TimeUtil.getNowForMysql());
                         // 计算每个任务的得分
@@ -292,7 +293,6 @@ public class TaskManager {
                 } else if (scoreTemp == 100.0) {
                     standardSceneNumber++;
                 }
-
                 // 计算分数总和
                 leafSum += scoreTemp;
             }

+ 1 - 1
simulation-resource-scheduler/src/main/java/com/css/simulation/resource/scheduler/scheduler/ClusterScheduler.java

@@ -38,7 +38,7 @@ public class ClusterScheduler {
         if (CollectionUtil.isEmpty(podNameList)) {
             for (KubernetesNodeTO kubernetesNodeTO : initialNodeList) {
                 stringRedisTemplate.opsForValue().set("node:" + kubernetesNodeTO.getName() + ":parallelism", kubernetesNodeTO.getMaxParallelism() + "");
-                log.info("ClusterScheduler--initNodeParallelism 重置节点并行度为:" + initialNodeList);
+                log.info("ClusterScheduler--initNodeParallelism 重置节点 " + kubernetesNodeTO.getName() + " 并行度为:" + kubernetesNodeTO.getMaxParallelism());
             }
         }
     }

+ 1 - 1
simulation-resource-scheduler/src/main/java/com/css/simulation/resource/scheduler/service/VideoService.java

@@ -16,8 +16,8 @@ import org.dom4j.Element;
 import org.dom4j.io.OutputFormat;
 import org.dom4j.io.SAXReader;
 import org.dom4j.io.XMLWriter;
-import org.jvnet.hk2.annotations.Service;
 import org.springframework.beans.factory.annotation.Value;
+import org.springframework.stereotype.Service;
 
 import javax.annotation.Resource;
 import java.io.File;

+ 108 - 0
simulation-resource-video/pom.xml

@@ -0,0 +1,108 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <parent>
+        <artifactId>simulation-cloud</artifactId>
+        <groupId>com.css</groupId>
+        <version>1.0</version>
+    </parent>
+    <modelVersion>4.0.0</modelVersion>
+
+    <artifactId>simulation-resource-video</artifactId>
+
+    <properties>
+        <maven.compiler.source>8</maven.compiler.source>
+        <maven.compiler.target>8</maven.compiler.target>
+    </properties>
+
+    <dependencies>
+
+        <!-- minio - 开始 -->
+        <dependency>
+            <groupId>com.squareup.okhttp3</groupId>
+            <artifactId>okhttp</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>io.minio</groupId>
+            <artifactId>minio</artifactId>
+        </dependency>
+        <!-- minio - 结束 -->
+
+        <!-- nacos - 开始 -->
+        <dependency>
+            <groupId>org.springframework.cloud</groupId>
+            <artifactId>spring-cloud-starter-bootstrap</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>com.alibaba.cloud</groupId>
+            <artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>com.alibaba.cloud</groupId>
+            <artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
+        </dependency>
+        <!-- nacos - 结束 -->
+
+        <!-- api-common -->
+        <dependency>
+            <groupId>com.css</groupId>
+            <artifactId>api-common</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+
+        <!-- 基础 -->
+        <dependency>
+            <groupId>org.projectlombok</groupId>
+            <artifactId>lombok</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework.cloud</groupId>
+            <artifactId>spring-cloud-starter-openfeign</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework.cloud</groupId>
+            <artifactId>spring-cloud-loadbalancer</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-web</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-validation</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-configuration-processor</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-actuator</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-test</artifactId>
+            <scope>test</scope>
+        </dependency>
+    </dependencies>
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.springframework.boot</groupId>
+                <artifactId>spring-boot-maven-plugin</artifactId>
+                <configuration>
+                    <fork>true</fork>
+                    <addResources>true</addResources>
+                </configuration>
+                <executions>
+                    <execution>
+                        <goals>
+                            <goal>repackage</goal>
+                        </goals>
+                    </execution>
+                </executions>
+            </plugin>
+        </plugins>
+    </build>
+</project>

+ 20 - 0
simulation-resource-video/src/main/java/com/css/simulation/resource/video/SimulationResourceVideoApplication.java

@@ -0,0 +1,20 @@
+package com.css.simulation.resource.video;
+
+import org.springframework.boot.SpringApplication;
+import org.springframework.boot.autoconfigure.SpringBootApplication;
+import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
+import org.springframework.cloud.openfeign.EnableFeignClients;
+import org.springframework.scheduling.annotation.EnableScheduling;
+
+
+@SpringBootApplication
+@EnableFeignClients
+@EnableDiscoveryClient
+@EnableScheduling
+public class SimulationResourceVideoApplication {
+
+    public static void main(String[] args) {
+        SpringApplication.run(SimulationResourceVideoApplication.class, args);
+    }
+
+}

+ 4 - 0
simulation-resource-video/src/main/java/com/css/simulation/resource/video/controller/VideoController.java

@@ -0,0 +1,4 @@
+package com.css.simulation.resource.video.controller;
+
+public class VideoController {
+}