Merge branch 'feat/split-project-in-chunk' into 'master'

Feat: split project zip in chunks

See merge request sheepitrenderfarm/client!239
This commit is contained in:
Sheepit Renderfarm
2023-09-19 17:14:49 +00:00
7 changed files with 139 additions and 48 deletions

View File

@@ -21,6 +21,7 @@ package com.sheepit.client;
import com.sheepit.client.Configuration.ComputeType;
import com.sheepit.client.Error.Type;
import com.sheepit.client.datamodel.Chunk;
import com.sheepit.client.os.OS;
import lombok.Data;
import lombok.Getter;
@@ -62,7 +63,7 @@ import java.util.regex.Pattern;
public static final int SHOW_BASE_ICON = -1;
private String frameNumber;
private String sceneMD5;
private List<Chunk> archiveChunks;
private String rendererMD5;
private String id;
private String outputImagePath;
@@ -90,7 +91,7 @@ import java.util.regex.Pattern;
private Log log;
public Job(Configuration config_, Gui gui_, Log log_, String id_, String frame_, String path_, boolean use_gpu, String command_, String validationUrl_,
String script_, String sceneMd5_, String rendererMd5_, String name_, char[] password_, boolean synchronous_upload_,
String script_, List<Chunk> archiveChunks_, String rendererMd5_, String name_, char[] password_, boolean synchronous_upload_,
String update_method_) {
configuration = config_;
id = id_;
@@ -99,7 +100,7 @@ import java.util.regex.Pattern;
useGPU = use_gpu;
rendererCommand = command_;
validationUrl = validationUrl_;
sceneMD5 = sceneMd5_;
archiveChunks = archiveChunks_;
rendererMD5 = rendererMd5_;
name = name_;
password = password_;
@@ -134,8 +135,8 @@ import java.util.regex.Pattern;
public String toString() {
return String
.format("Job (numFrame '%s' sceneMD5 '%s' rendererMD5 '%s' ID '%s' pictureFilename '%s' jobPath '%s' gpu %s name '%s' updateRenderingStatusMethod '%s' render %s)",
frameNumber, sceneMD5, rendererMD5, id, outputImagePath, path, useGPU, name, updateRenderingStatusMethod, render);
.format("Job (numFrame '%s' archiveChunks %s rendererMD5 '%s' ID '%s' pictureFilename '%s' jobPath '%s' gpu %s name '%s' updateRenderingStatusMethod '%s' render %s)",
frameNumber, archiveChunks, rendererMD5, id, outputImagePath, path, useGPU, name, updateRenderingStatusMethod, render);
}
public String getPrefixOutputImage() {
@@ -163,25 +164,25 @@ import java.util.regex.Pattern;
return configuration.getStorageDir().getAbsolutePath() + File.separator + rendererMD5 + ".zip";
}
public String getRequiredSceneArchivePath() {
public String getRequiredProjectChunkPath(String chunk) {
if (configuration.getSharedDownloadsDirectory() != null) {
return configuration.getSharedDownloadsDirectory().getAbsolutePath() + File.separator + sceneMD5 + ".zip";
return configuration.getSharedDownloadsDirectory().getAbsolutePath() + File.separator + chunk + ".wool";
}
else {
return getSceneArchivePath();
return getSceneArchiveChunkPath(chunk);
}
}
public String getSceneDirectory() {
return configuration.getWorkingDirectory().getAbsolutePath() + File.separator + sceneMD5;
return configuration.getWorkingDirectory().getAbsolutePath() + File.separator + this.id;
}
public String getScenePath() {
return getSceneDirectory() + File.separator + this.path;
}
public String getSceneArchivePath() {
return configuration.getWorkingDirectory().getAbsolutePath() + File.separator + sceneMD5 + ".zip";
public String getSceneArchiveChunkPath(String chunk) {
return configuration.getWorkingDirectory().getAbsolutePath() + File.separator + chunk + ".wool";
}
public Error.Type render(Observer renderStarted) {