Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compatibility with moteurlite #481

Merged
merged 3 commits into from
Jul 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,49 @@
*/
package fr.insalyon.creatis.vip.application.server.business;

import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Collections;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.Random;

import org.apache.commons.io.FileUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Lookup;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.xml.sax.SAXException;

import fr.insalyon.creatis.grida.client.GRIDAClient;
import fr.insalyon.creatis.grida.client.GRIDAClientException;
import fr.insalyon.creatis.grida.client.GRIDAPoolClient;
import fr.insalyon.creatis.moteur.plugins.workflowsdb.bean.*;
import fr.insalyon.creatis.moteur.plugins.workflowsdb.dao.*;
import fr.insalyon.creatis.moteur.plugins.workflowsdb.bean.Input;
import fr.insalyon.creatis.moteur.plugins.workflowsdb.bean.Output;
import fr.insalyon.creatis.moteur.plugins.workflowsdb.bean.Processor;
import fr.insalyon.creatis.moteur.plugins.workflowsdb.bean.Workflow;
import fr.insalyon.creatis.moteur.plugins.workflowsdb.bean.WorkflowStatus;
import fr.insalyon.creatis.moteur.plugins.workflowsdb.dao.InputDAO;
import fr.insalyon.creatis.moteur.plugins.workflowsdb.dao.OutputDAO;
import fr.insalyon.creatis.moteur.plugins.workflowsdb.dao.ProcessorDAO;
import fr.insalyon.creatis.moteur.plugins.workflowsdb.dao.StatsDAO;
import fr.insalyon.creatis.moteur.plugins.workflowsdb.dao.WorkflowDAO;
import fr.insalyon.creatis.moteur.plugins.workflowsdb.dao.WorkflowsDBDAOException;
import fr.insalyon.creatis.vip.application.client.ApplicationConstants;
import fr.insalyon.creatis.vip.application.client.bean.*;
import fr.insalyon.creatis.vip.application.client.bean.Activity;
import fr.insalyon.creatis.vip.application.client.bean.AppVersion;
import fr.insalyon.creatis.vip.application.client.bean.Descriptor;
import fr.insalyon.creatis.vip.application.client.bean.Engine;
import fr.insalyon.creatis.vip.application.client.bean.InOutData;
import fr.insalyon.creatis.vip.application.client.bean.Simulation;
import static fr.insalyon.creatis.vip.application.client.view.ApplicationException.ApplicationError.PLATFORM_MAX_EXECS;
import static fr.insalyon.creatis.vip.application.client.view.ApplicationException.ApplicationError.USER_MAX_EXECS;
import static fr.insalyon.creatis.vip.application.client.view.ApplicationException.ApplicationError.WRONG_APPLICATION_DESCRIPTOR;
import fr.insalyon.creatis.vip.application.client.view.monitor.SimulationStatus;
import fr.insalyon.creatis.vip.application.client.view.monitor.progress.ProcessorStatus;
import fr.insalyon.creatis.vip.application.server.business.simulation.ParameterSweep;
Expand All @@ -59,21 +95,6 @@
import fr.insalyon.creatis.vip.datamanager.server.business.DataManagerBusiness;
import fr.insalyon.creatis.vip.datamanager.server.business.ExternalPlatformBusiness;
import fr.insalyon.creatis.vip.datamanager.server.business.LfcPathsBusiness;
import org.apache.commons.io.FileUtils;
import org.apache.commons.io.FilenameUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Lookup;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.xml.sax.SAXException;

import java.io.File;
import java.io.IOException;
import java.util.*;

import static fr.insalyon.creatis.vip.application.client.view.ApplicationException.ApplicationError.*;

/**
*
Expand Down Expand Up @@ -271,9 +292,9 @@ public synchronized String launch(

AppVersion version = applicationDAO.getVersion(
applicationName, applicationVersion);
String workflowPath =
dataManagerBusiness.getRemoteFile(user, version.getLfn());

logger.info( " moteurlite status: " + server.useMoteurlite());
String workflowPath = dataManagerBusiness.getRemoteFile(user, server.useMoteurlite() ? version.getJsonLfn() : version.getLfn());
//selectRandomEngine could also be used; TODO: make this choice configurable
Engine engine = selectEngine(applicationClass);
WorkflowExecutionBusiness executionBusiness =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,10 @@
*/
package fr.insalyon.creatis.vip.core.client.view;

import com.google.gwt.user.client.rpc.IsSerializable;
import java.util.Date;

import com.google.gwt.user.client.rpc.IsSerializable;

/**
*
* @author Rafael Ferreira da Silva
Expand Down Expand Up @@ -192,6 +193,8 @@ public class CoreConstants implements IsSerializable {
public static final String API_PARALLEL_DOWNLOAD_NB = "api.downloads.nb";
// ReproVIPfiles";
public static final String REPROVIP_ROOT_DIR = "reprovip.root-dir";
//moteurlite
public static final String USE_MOTEURLITE = "moteurlite.enabled";



Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
package fr.insalyon.creatis.vip.core.server.business;

import org.apache.commons.configuration.ConfigurationException;

import java.util.HashMap;
import java.util.List;

Expand Down Expand Up @@ -113,4 +111,6 @@ public interface Server {
int getApiParallelDownloadNb();

String getReproVIPRootDir();

boolean useMoteurlite();
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,16 @@
package fr.insalyon.creatis.vip.core.server.business;

import fr.insalyon.creatis.vip.core.client.view.CoreConstants;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.nio.file.Paths;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.stream.Stream;

import javax.annotation.PostConstruct;

import org.apache.commons.configuration.ConfigurationException;
import org.apache.commons.configuration.PropertiesConfiguration;
import org.apache.commons.configuration.reloading.FileChangedReloadingStrategy;
Expand All @@ -16,15 +26,7 @@
import org.springframework.stereotype.Component;
import org.springframework.util.Assert;

import javax.annotation.PostConstruct;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.nio.file.Paths;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.stream.Stream;
import fr.insalyon.creatis.vip.core.client.view.CoreConstants;

/**
* Reads the vip.conf property file from the configured vifConfigFolder
Expand Down Expand Up @@ -439,4 +441,9 @@ public int getApiParallelDownloadNb() {
public String getReproVIPRootDir() {
return env.getProperty(CoreConstants.REPROVIP_ROOT_DIR, "/vip/ReproVip/");
}

@Override
public boolean useMoteurlite() {
return env.getProperty(CoreConstants.USE_MOTEURLITE, Boolean.class, false);
}
}
Loading