сборка сапфора через гит. если версия собралась с ошибками, больше не будет попыток ее автоматической сборки.( но возможна ручная)

This commit is contained in:
2025-03-12 21:04:22 +03:00
parent b1740da1f1
commit 8aea85a009
9 changed files with 66 additions and 62 deletions

8
.idea/workspace.xml generated
View File

@@ -9,9 +9,13 @@
<list default="true" id="e42177c3-2328-4b27-8a01-35779b2beb99" name="Default Changelist" comment=""> <list default="true" id="e42177c3-2328-4b27-8a01-35779b2beb99" name="Default Changelist" comment="">
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" /> <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/properties" beforeDir="false" afterPath="$PROJECT_DIR$/properties" afterDir="false" /> <change beforePath="$PROJECT_DIR$/properties" beforeDir="false" afterPath="$PROJECT_DIR$/properties" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/Repository/Server/BackUpsChecker.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/Repository/Server/BackUpsChecker.java" afterDir="false" /> <change beforePath="$PROJECT_DIR$/src/_VisualDVM/Constants.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/Constants.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/Repository/Server/RepositoryServer.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/Repository/Server/RepositoryServer.java" afterDir="false" /> <change beforePath="$PROJECT_DIR$/src/_VisualDVM/Passes/All/DownloadRepository.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/Passes/All/DownloadRepository.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/Passes/All/SPF_GetGraphLoops.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/Passes/All/SPF_GetGraphLoops.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/Repository/Server/ServerCode.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/Repository/Server/ServerCode.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/TestingSystem/Common/TestingServer.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/TestingSystem/Common/TestingServer.java" afterDir="false" /> <change beforePath="$PROJECT_DIR$/src/_VisualDVM/TestingSystem/Common/TestingServer.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/TestingSystem/Common/TestingServer.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/TestingSystem/Common/TestsDatabase.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/TestingSystem/Common/TestsDatabase.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/TestingSystem/SAPFOR/SapforTestingPlanner.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/TestingSystem/SAPFOR/SapforTestingPlanner.java" afterDir="false" />
</list> </list>
<option name="SHOW_DIALOG" value="false" /> <option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" /> <option name="HIGHLIGHT_CONFLICTS" value="true" />

View File

@@ -30,9 +30,9 @@
"EmailOnTestingProgress": true, "EmailOnTestingProgress": true,
"CompleteCompilationOptions": false, "CompleteCompilationOptions": false,
"CompleteRunEnvironments": false, "CompleteRunEnvironments": false,
"lastMachineId": 28, "lastMachineId": 1,
"lastUserId": 36, "lastUserId": 17,
"lastCompilerId": 110, "lastCompilerId": 15,
"RegisterOn": false, "RegisterOn": false,
"SpacesOn": false, "SpacesOn": false,
"EmptyLinesOn": false, "EmptyLinesOn": false,

View File

@@ -26,11 +26,9 @@ public class Constants {
public static final String PerformanceAnalyzerDirectoryName = "PerformanceAnalyzer"; public static final String PerformanceAnalyzerDirectoryName = "PerformanceAnalyzer";
public static final String KeyDirectoryName = "Keys"; public static final String KeyDirectoryName = "Keys";
//-- //--
//SVN vmk-post@yandex.ru //GIT
public static final String REPOSITORY_AUTHENTICATION = "--username dvmhuser --password dvmh2013 --non-interactive"; public static final String SAPFOR_REPOSITORY = "http://dvmh-server.ddns.net:3000/Alexander_KS/SAPFOR.git";
public static final String DVM_REPOSITORY = "http://svn.dvm-system.org/svn/dvmhrepo/dvm"; public static final String SAPFOR_VERSION_URL= "http://dvmh-server.ddns.net:3000/Alexander_KS/SAPFOR/raw/branch/master/src/Utils/version.h";
public static final String SAPFOR_REPOSITORY = "http://svn.dvm-system.org/svn/dvmhrepo/sapfor";
public static final String SAPFOR_REPOSITORY_BIN = "/sapfor/experts/Sapfor_2017/_bin";
//-вывод задач //-вывод задач
public final static String parse_out_file = "parse_out.txt"; public final static String parse_out_file = "parse_out.txt";
public final static String parse_err_file = "parse_err.txt"; public final static String parse_err_file = "parse_err.txt";
@@ -49,7 +47,7 @@ public class Constants {
// //
//7998 отладочный порт. теперь. //7998 отладочный порт. теперь.
public static final int ComponentsServerPort = 7995; //7795 public static final int ComponentsServerPort = 7995; //7795
public static final int TestingServerPort = 7996; //7996 public static final int TestingServerPort = 7998; //7996
public static final int SocketTimeout = 0; public static final int SocketTimeout = 0;
//- //-
public static final String ServerAddress = "alex-freenas.ddns.net"; public static final String ServerAddress = "alex-freenas.ddns.net";
@@ -469,8 +467,8 @@ public class Constants {
//</editor-fold> //</editor-fold>
}; };
public static Vector<String> admins_mails = new Vector_<>( public static Vector<String> admins_mails = new Vector_<>(
"sapfor.tracker@internet.ru", // "sapfor.tracker@internet.ru",
"vmk-post@yandex.ru", "vmk-post@yandex.ru"
"79854210702@ya.ru" // "79854210702@ya.ru"
); );
} }

View File

@@ -9,7 +9,6 @@ import org.apache.commons.io.FileUtils;
import java.io.File; import java.io.File;
import java.nio.file.Paths; import java.nio.file.Paths;
public class DownloadRepository extends ProcessPass { public class DownloadRepository extends ProcessPass {
File dvmHome;
File sapforHome; File sapforHome;
@Override @Override
public String getDescription() { public String getDescription() {
@@ -17,10 +16,8 @@ public class DownloadRepository extends ProcessPass {
} }
@Override @Override
protected boolean canStart(Object... args) throws Exception { protected boolean canStart(Object... args) throws Exception {
dvmHome = Paths.get(Global.RepoDirectory.getAbsolutePath(),
"dvm").toFile();
sapforHome = Paths.get(Global.RepoDirectory.getAbsolutePath(), sapforHome = Paths.get(Global.RepoDirectory.getAbsolutePath(),
"sapfor").toFile(); "SAPFOR").toFile();
return true; return true;
} }
private void synchronize(String src, File dst) throws Exception { private void synchronize(String src, File dst) throws Exception {
@@ -28,19 +25,17 @@ public class DownloadRepository extends ProcessPass {
if (loadedFile.exists()) { if (loadedFile.exists()) {
PerformScript("cd " + PerformScript("cd " +
dst.getAbsolutePath() + dst.getAbsolutePath() +
"\nsvn update " + Constants.REPOSITORY_AUTHENTICATION + "\n"); "\ngit pull ");
} else { } else {
Utils.CleanDirectory(dst); Utils.CleanDirectory(dst);
PerformScript("cd Repo\nsvn checkout " + Constants.REPOSITORY_AUTHENTICATION + " " + src + "\n"); //export PerformScript("cd Repo\ngit clone " + src + "\n"); //export
FileUtils.write(loadedFile, ""); FileUtils.write(loadedFile, "");
} }
} }
@Override @Override
protected void body() throws Exception { protected void body() throws Exception {
ShowProgress(2, 0, true); ShowProgress(1, 0, true);
synchronize(Constants.DVM_REPOSITORY, dvmHome);
ShowProgress(2, 1, true);
synchronize(Constants.SAPFOR_REPOSITORY, sapforHome); synchronize(Constants.SAPFOR_REPOSITORY, sapforHome);
ShowProgress(2, 2, true); ShowProgress(1, 1, true);
} }
} }

View File

@@ -37,6 +37,7 @@ public class SPF_GetGraphLoops extends SapforAnalysis {
} }
@Override @Override
protected void unpack(String packed) throws Exception { protected void unpack(String packed) throws Exception {
System.out.println(Utils_.Brackets(packed));
Vector<String> done_programs = new Vector<>(); Vector<String> done_programs = new Vector<>();
String[] splitedPackedGraph = packed.split("\\|"); String[] splitedPackedGraph = packed.split("\\|");
for (int i = 0; i < splitedPackedGraph.length; i += 2) { for (int i = 0; i < splitedPackedGraph.length; i += 2) {

View File

@@ -70,9 +70,12 @@ public enum ServerCode {
DeleteUserAccount, DeleteUserAccount,
GetDVMPackageCredentials, GetDVMPackageCredentials,
CreateBackUp, CreateBackUp,
GetFirstEmailToSend; GetFirstEmailToSend,
SynchronizeSapforRepoitory;
public String getDescription(){ public String getDescription(){
switch (this){ switch (this){
case SynchronizeSapforRepoitory:
return "Синхронизация репозитория SAPFOR на сервере";
case Email: case Email:
return "Создать сообщение электронной почты на сервере"; return "Создать сообщение электронной почты на сервере";
case GetFirstEmailToSend: case GetFirstEmailToSend:

View File

@@ -576,9 +576,9 @@ public class TestingServer extends RepositoryServer<TestsDatabase> {
Utils.startScript(Global.TempDirectory, Utils.startScript(Global.TempDirectory,
Global.TempDirectory, Global.TempDirectory,
"get_version", "get_version",
"wget --user dvmhuser --password dvmh2013 -P " + "wget -P " +
Utils_.DQuotes(Global.TempDirectory.getAbsolutePath()) + Utils_.DQuotes(Global.TempDirectory.getAbsolutePath()) +
" http://svn.dvm-system.org/svn/dvmhrepo/sapfor/experts/Sapfor_2017/_src/Utils/version.h" " " + Utils_.DQuotes(Constants.SAPFOR_VERSION_URL)
).waitFor(); ).waitFor();
if (!versionFile.exists()) if (!versionFile.exists())
throw new RepositoryRefuseException("Не удалось загрузить текущую версию SAPFOR из репозитория!"); throw new RepositoryRefuseException("Не удалось загрузить текущую версию SAPFOR из репозитория!");
@@ -592,11 +592,14 @@ public class TestingServer extends RepositoryServer<TestsDatabase> {
int max_version = db.getInstalledSapforMaxVersion(); int max_version = db.getInstalledSapforMaxVersion();
int current_version = getSapforActualVersion(); int current_version = getSapforActualVersion();
if (current_version > max_version) { if (current_version > max_version) {
serverSapfor = new ServerSapfor(); ServerSapfor versionSapfor = db.getSapforForVersion(String.valueOf(current_version));
serverSapfor.sender_name = "server"; if (versionSapfor == null || !versionSapfor.state.equals(ServerSapforState.DoneWithErrors)) {
serverSapfor.sender_address = Constants.MailAddress; serverSapfor = new ServerSapfor();
serverSapfor.state = ServerSapforState.Queued; serverSapfor.sender_name = "server";
db.Insert(serverSapfor); serverSapfor.sender_address = Constants.MailAddress;
serverSapfor.state = ServerSapforState.Queued;
db.Insert(serverSapfor);
}
} }
} }
response.object = serverSapfor; response.object = serverSapfor;

View File

@@ -282,6 +282,13 @@ public class TestsDatabase extends SQLiteDatabase {
} }
return null; return null;
} }
public ServerSapfor getSapforForVersion(String version_in){
for (ServerSapfor serverSapfor: serverSapfors.Data.values()){
if (serverSapfor.version.equals(version_in))
return serverSapfor;
}
return null;
}
public Integer getInstalledSapforMaxVersion() { public Integer getInstalledSapforMaxVersion() {
int max_version = CommonConstants.Nan; int max_version = CommonConstants.Nan;
for (ServerSapfor sapfor : serverSapfors.Data.values()) { for (ServerSapfor sapfor : serverSapfors.Data.values()) {

View File

@@ -30,20 +30,23 @@ public class SapforTestingPlanner extends TestingPlanner<SapforPackage> {
ServerSapfor sapfor; ServerSapfor sapfor;
//-- //--
File repo; File repo;
File repoSapforHome; File repo_sapfor;
File repo_sapfor_installation_directory;
int max_version; int max_version;
int current_version; int current_version;
//-- //--
File repo_bin; File repo_sapfor_assembly; //бинарник собранный в репозитории.
File repo_out; File repo_out;
File repo_err; File repo_err;
//-- //--
public SapforTestingPlanner() { public SapforTestingPlanner() {
repo = new File(Utils_.getHomeDirectory(), "Repo"); repo = new File(Utils_.getHomeDirectory(), "Repo");
repoSapforHome = Paths.get(Utils_.getHomePath(), "Repo", Constants.SAPFOR_REPOSITORY_BIN).toFile(); repo_sapfor = new File(repo, "SAPFOR");
repo_bin = new File(repoSapforHome, "Sapfor_F"); //-
repo_out = new File(repoSapforHome, Constants.out_file); repo_sapfor_installation_directory =new File(repo_sapfor, "install");
repo_err = new File(repoSapforHome, Constants.err_file); repo_out = new File(repo_sapfor_installation_directory, Constants.out_file);
repo_err = new File(repo_sapfor_installation_directory, Constants.err_file);
repo_sapfor_assembly = new File(repo_sapfor_installation_directory, "Sapfor_F");
} }
@Override @Override
public String packageDescription() { public String packageDescription() {
@@ -231,32 +234,20 @@ public class SapforTestingPlanner extends TestingPlanner<SapforPackage> {
ServerCommand(ServerCode.EditObject, sapfor); ServerCommand(ServerCode.EditObject, sapfor);
} }
void SyncronizeRepository() throws Exception { void SyncronizeRepository() throws Exception {
UpdateSapforState(ServerSapforState.DVMRepositorySynchronization);
Utils.startScript(repo, repo, "dvm_checkout",
"svn checkout " +
Constants.REPOSITORY_AUTHENTICATION +
" " + Constants.DVM_REPOSITORY + " 1>dvm_out.txt 2>dvm_err.txt\n").waitFor();
UpdateSapforState(ServerSapforState.SAPFORRepositorySynchronization); UpdateSapforState(ServerSapforState.SAPFORRepositorySynchronization);
Utils.startScript(repo, repo, "spf_checkout", Utils.CleanDirectory(repo);
"svn checkout " + Utils.startScript(repo, repo, "git_clone",
Constants.REPOSITORY_AUTHENTICATION + "git clone " + Constants.SAPFOR_REPOSITORY + " " +
" " + Constants.SAPFOR_REPOSITORY + " 1>spf_out.txt 2>spf_err.txt\n").waitFor(); Utils_.DQuotes(repo_sapfor)+
" 1>spf_out.txt 2>spf_err.txt\n").waitFor();
} }
void CompileSapfor() throws Exception { void CompileSapfor() throws Exception {
UpdateSapforState(ServerSapforState.Compilation); UpdateSapforState(ServerSapforState.Compilation);
//- //-
if (repo_bin.exists()) Utils_.CheckAndCleanDirectory(repo_sapfor_installation_directory);
FileUtils.forceDelete(repo_bin);
if (repo_out.exists())
FileUtils.forceDelete(repo_out);
if (repo_err.exists())
FileUtils.forceDelete(repo_err);
//-- //--
Utils.startScript(repoSapforHome, repoSapforHome, "build_sapfor", Utils.startScript(repo_sapfor_installation_directory, repo_sapfor_installation_directory, "build_sapfor",
"cmake ../ 1>" + "cmake .. 1>" + Constants.out_file + " 2>" + Constants.err_file +
Constants.out_file +
" 2>" +
Constants.err_file +
"\nmake -j 14 1>>" + "\nmake -j 14 1>>" +
Constants.out_file + Constants.out_file +
" 2>>" + " 2>>" +
@@ -274,7 +265,8 @@ public class SapforTestingPlanner extends TestingPlanner<SapforPackage> {
//-- //--
SyncronizeRepository(); SyncronizeRepository();
max_version = (int) ServerCommand(ServerCode.GetMaxSapforVersion); max_version = (int) ServerCommand(ServerCode.GetMaxSapforVersion);
current_version = Sapfor.readVersionFromCode(Paths.get(repo.getAbsolutePath(), "/sapfor/experts/Sapfor_2017/_src/Utils/version.h").toFile()); current_version = Sapfor.readVersionFromCode(Paths.get(repo.getAbsolutePath(),
"/SAPFOR/src/Utils/version.h").toFile());
if (current_version == max_version) { if (current_version == max_version) {
ServerCommand(ServerCode.DeleteObjectByPK, new Pair(ServerSapfor.class, sapfor.id)); ServerCommand(ServerCode.DeleteObjectByPK, new Pair(ServerSapfor.class, sapfor.id));
return; return;
@@ -284,6 +276,7 @@ public class SapforTestingPlanner extends TestingPlanner<SapforPackage> {
//-- //--
sapfor.home_path = sapforHome.getAbsolutePath(); sapfor.home_path = sapforHome.getAbsolutePath();
sapfor.languageName = LanguageName.fortran; sapfor.languageName = LanguageName.fortran;
sapfor.version = String.valueOf(current_version);
//-- //--
File sapforBin = new File(sapforHome, "Sapfor_F"); File sapforBin = new File(sapforHome, "Sapfor_F");
File sapforOut = new File(sapforHome, Constants.out_file); File sapforOut = new File(sapforHome, Constants.out_file);
@@ -296,11 +289,11 @@ public class SapforTestingPlanner extends TestingPlanner<SapforPackage> {
FileUtils.copyFile(repo_out, sapforOut); FileUtils.copyFile(repo_out, sapforOut);
if (repo_err.exists()) if (repo_err.exists())
FileUtils.copyFile(repo_err, sapforErr); FileUtils.copyFile(repo_err, sapforErr);
if (repo_bin.exists()) { if (repo_sapfor_assembly.exists()) {
FileUtils.copyFile(repo_bin, sapforBin); FileUtils.copyFile(repo_sapfor_assembly, sapforBin);
sapforBin.setExecutable(true, false); sapforBin.setExecutable(true, false);
//-- //--
sapfor.version = String.valueOf(current_version);
sapfor.call_command = sapforBin.getAbsolutePath(); sapfor.call_command = sapforBin.getAbsolutePath();
sapfor.buildDate = new Date().getTime(); sapfor.buildDate = new Date().getTime();
//-- //--