Commit 9b1891f4 authored by Daniel Seybold's avatar Daniel Seybold

added script download endpoint configuration

parent 6feed289
Pipeline #19409 passed with stage
in 7 minutes and 6 seconds
......@@ -7,4 +7,4 @@ appFolder = /opt/application-catalogue/input/applications/
#TODO: implement usage of the wildcard
scriptServiceWildcard = SCRIPT_SERVICE_ENDPOINT
\ No newline at end of file
scriptServiceEndpoint = https://omi-gitlab.e-technik.uni-ulm.de/dbms-jungle-explorer/dbms-catalogue-scripts/raw/master
\ No newline at end of file
......@@ -12,12 +12,12 @@ components :
number : 9042
lifecycleActions :
init : ""
download : "sudo apt-get -y update && sudo apt-get install wget -y
&& wget -O install.sh 'https://omi-gitlab.e-technik.uni-ulm.de/dbms-jungle-explorer/dbms-catalogue-scripts/raw/master/scripts/database/cassandra/install.sh'
&& wget -O init.sh 'https://omi-gitlab.e-technik.uni-ulm.de/dbms-jungle-explorer/dbms-catalogue-scripts/raw/master/scripts/database/cassandra/init.sh'
&& wget -O seed.sh 'https://omi-gitlab.e-technik.uni-ulm.de/dbms-jungle-explorer/dbms-catalogue-scripts/raw/master/scripts/database/cassandra/seed.sh'
&& wget -O telegraf.sh 'https://omi-gitlab.e-technik.uni-ulm.de/dbms-jungle-explorer/dbms-catalogue-scripts/raw/master/scripts/database/cassandra/telegraf.sh'
&& wget -O maki-manager.sh 'https://omi-gitlab.e-technik.uni-ulm.de/dbms-jungle-explorer/dbms-catalogue-scripts/raw/master/scripts/maki-manager/install_maki_manager.sh' "
download : "
wget -O install.sh '#SERVICE_ENDPOINT#/scripts/database/cassandra/install.sh'
&& wget -O init.sh '#SERVICE_ENDPOINT#/scripts/database/cassandra/init.sh'
&& wget -O seed.sh '#SERVICE_ENDPOINT#/scripts/database/cassandra/seed.sh'
&& wget -O telegraf.sh '#SERVICE_ENDPOINT#/scripts/database/cassandra/telegraf.sh'
&& wget -O maki-manager.sh '#SERVICE_ENDPOINT#/scripts/maki-manager/install_maki_manager.sh' "
install : "sudo -E chmod +x install.sh && sudo -E ./install.sh"
configure : " source /etc/environment && sudo -E chmod +x init.sh && sudo -E chmod +x seed.sh && sudo -E ./init.sh"
start : "source /etc/environment && sudo -E ./seed.sh && sudo -E chmod +x telegraf.sh && sudo -E ./telegraf.sh && chmod +x maki-manager.sh && sudo -E ./maki-manager.sh"
......@@ -34,13 +34,13 @@ components :
script : ""
lifecycleActions :
init : ""
download : "sudo apt-get -y update && sudo apt-get install wget -y
&& wget -O install.sh 'https://omi-gitlab.e-technik.uni-ulm.de/dbms-jungle-explorer/dbms-catalogue-scripts/raw/master/scripts/database/cassandra/install.sh'
&& wget -O init.sh 'https://omi-gitlab.e-technik.uni-ulm.de/dbms-jungle-explorer/dbms-catalogue-scripts/raw/master/scripts/database/cassandra/init.sh'
&& wget -O data.sh 'https://omi-gitlab.e-technik.uni-ulm.de/dbms-jungle-explorer/dbms-catalogue-scripts/raw/master/scripts/database/cassandra/data.sh'
&& wget -O telegraf.sh 'https://omi-gitlab.e-technik.uni-ulm.de/dbms-jungle-explorer/dbms-catalogue-scripts/raw/master/scripts/database/cassandra/telegraf.sh'
&& wget -O stop.sh 'https://omi-gitlab.e-technik.uni-ulm.de/dbms-jungle-explorer/dbms-catalogue-scripts/raw/master/scripts/database/cassandra/stop_data.sh'
&& wget -O maki-manager.sh 'https://omi-gitlab.e-technik.uni-ulm.de/dbms-jungle-explorer/dbms-catalogue-scripts/raw/master/scripts/maki-manager/install_maki_manager.sh' "
download : "
wget -O install.sh '#SERVICE_ENDPOINT#/scripts/database/cassandra/install.sh'
&& wget -O init.sh '#SERVICE_ENDPOINT#/scripts/database/cassandra/init.sh'
&& wget -O data.sh '#SERVICE_ENDPOINT#/scripts/database/cassandra/data.sh'
&& wget -O telegraf.sh '#SERVICE_ENDPOINT#/raw/master/scripts/database/cassandra/telegraf.sh'
&& wget -O stop.sh '#SERVICE_ENDPOINT#/scripts/database/cassandra/stop_data.sh'
&& wget -O maki-manager.sh '#SERVICE_ENDPOINT#/scripts/maki-manager/install_maki_manager.sh' "
install : "sudo -E chmod +x install.sh && sudo -E ./install.sh"
configure : " source /etc/environment && sudo -E chmod +x init.sh && sudo -E chmod +x data.sh && sudo -E ./init.sh "
start : "source /etc/environment && sudo -E ./data.sh && sudo -E chmod +x telegraf.sh && sudo -E ./telegraf.sh && chmod +x maki-manager.sh && sudo -E ./maki-manager.sh"
......
......@@ -33,8 +33,8 @@ components :
number : 11210
lifecycleActions :
init : ""
download : "sudo apt-get -y update && sudo apt-get install wget -y
&& wget -O install.sh 'https://omi-gitlab.e-technik.uni-ulm.de/dbms-jungle-explorer/dbms-catalogue-scripts/raw/master/scripts/database/couchbase/install.sh'
download : "
wget -O install.sh 'https://omi-gitlab.e-technik.uni-ulm.de/dbms-jungle-explorer/dbms-catalogue-scripts/raw/master/scripts/database/couchbase/install.sh'
&& wget -O init.sh 'https://omi-gitlab.e-technik.uni-ulm.de/dbms-jungle-explorer/dbms-catalogue-scripts/raw/master/scripts/database/couchbase/init.sh'
&& wget -O seed.sh 'https://omi-gitlab.e-technik.uni-ulm.de/dbms-jungle-explorer/dbms-catalogue-scripts/raw/master/scripts/database/couchbase/seed.sh'
&& wget -O telegraf.sh 'https://omi-gitlab.e-technik.uni-ulm.de/dbms-jungle-explorer/dbms-catalogue-scripts/raw/master/scripts/database/couchbase/telegraf.sh'
......@@ -54,8 +54,8 @@ components :
script : ""
lifecycleActions :
init : ""
download : "sudo apt-get -y update && sudo apt-get install wget -y
&& wget -O install.sh 'https://omi-gitlab.e-technik.uni-ulm.de/dbms-jungle-explorer/dbms-catalogue-scripts/raw/master/scripts/database/couchbase/install.sh'
download : "
wget -O install.sh 'https://omi-gitlab.e-technik.uni-ulm.de/dbms-jungle-explorer/dbms-catalogue-scripts/raw/master/scripts/database/couchbase/install.sh'
&& wget -O init.sh 'https://omi-gitlab.e-technik.uni-ulm.de/dbms-jungle-explorer/dbms-catalogue-scripts/raw/master/scripts/database/couchbase/init.sh'
&& wget -O data.sh 'https://omi-gitlab.e-technik.uni-ulm.de/dbms-jungle-explorer/dbms-catalogue-scripts/raw/master/scripts/database/couchbase/data.sh'
&& wget -O telegraf.sh 'https://omi-gitlab.e-technik.uni-ulm.de/dbms-jungle-explorer/dbms-catalogue-scripts/raw/master/scripts/database/couchbase/telegraf.sh'
......
......@@ -18,6 +18,7 @@ import java.util.Map.Entry;
final class ColosseumHelper {
private static final Logger LOGGER = LoggerFactory.getLogger(ColosseumHelper.class.getName());
private ColosseumHelper() {
//
......@@ -42,6 +43,7 @@ final class ColosseumHelper {
return lifecycleComponent;
}
private static String prepareInitLifecycle(String initLifecycle, Map<String, String> environmentVariables){
String preparedInitLifecycle = initLifecycle;
......
......@@ -62,6 +62,8 @@ public class ColosseumStaticHandler {
//get respective componentDeploymentSpec
ComponentDeploymentSpec componentDeploymentSpec = appSpec.componentAvailable(compName);
//adding the runtime env variables to the init lifecycle action
final LifecycleComponent lifecycleComponent = ColosseumHelper.createLifecycle(compName, compDesc, user, componentDeploymentSpec.environmentVariables);
......
......@@ -60,7 +60,7 @@ public final class ApplicationDeployment {
// third: (re-)init colosseum and deploy application instances
LOGGER.debug("STEP 3: reinit Colosseum connection and deploy application...");
final ColosseumPackage colPack = ApplicationDescriptionRegistrator.registerApplication(appDesc, appSpec);
ApplicationDeployer.deploy(appDesc.getUser(), appSpec, colPack);
final DeploymentStoreService deploymentStoreService = DeploymentStore.getInstance();
......
package de.uulm.omi.runtime.application.description;
import static com.google.common.base.Preconditions.checkNotNull;
import static de.uulm.omi.cloudiator.yaml.ParserHelper.validateMapEntry;
import static de.uulm.omi.utils.ApplicationCatalogueProperties.SCRIPT_SERVICE_ENDPOINT;
import de.uulm.omi.cloudiator.yaml.ParserHelper;
import de.uulm.omi.utils.PropertiesWrapper;
import de.uulm.omi.utils.PropertiesWrapperService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.yaml.snakeyaml.Yaml;
import java.io.FileNotFoundException;
import java.io.InputStream;
import java.util.HashMap;
......@@ -16,12 +16,9 @@ import java.util.Map;
import java.util.Map.Entry;
import java.util.concurrent.TimeUnit;
import java.util.zip.DataFormatException;
import static com.google.common.base.Preconditions.checkNotNull;
import static de.uulm.omi.cloudiator.yaml.ParserHelper.validateMapEntry;
import static de.uulm.omi.utils.ApplicationCatalogueProperties.SCRIPT_SERVICE_IP;
import static de.uulm.omi.utils.ApplicationCatalogueProperties.SCRIPT_SERVICE_PORT;
import static de.uulm.omi.utils.ApplicationCatalogueProperties.SCRIPT_SERVICE_WILDCARD;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.yaml.snakeyaml.Yaml;
final class ApplicationDescriptionParser {
......@@ -56,6 +53,9 @@ final class ApplicationDescriptionParser {
public static String COMPONENT_SENSOR_DESCRIPTION_ISPUSH_KEY = "isPush";
public static String COMPONENT_SENSOR_CONFIGURATION_KEY = "configuration";
private static final String SCRIPT_DOWNLOAD_ENDPOINT_WILDCARD = "#SERVICE_ENDPOINT#";
private static final Logger LOGGER = LoggerFactory.getLogger(ApplicationDescriptionParser.class.getName());
public static AppDescriptor parseIt(InputStream input) throws FileNotFoundException {
......@@ -172,9 +172,9 @@ final class ApplicationDescriptionParser {
PropertiesWrapperService propertiesWrapperService = PropertiesWrapper.getInstance();
String replacement = propertiesWrapperService.getProperty(SCRIPT_SERVICE_IP.getPropertyName()) + ":" + propertiesWrapperService.getProperty(SCRIPT_SERVICE_PORT.getPropertyName());
//String replacement = propertiesWrapperService.getProperty(SCRIPT_SERVICE_IP.getPropertyName()) + ":" + propertiesWrapperService.getProperty(SCRIPT_SERVICE_PORT.getPropertyName());
String result = lifecycleAction.replace(propertiesWrapperService.getProperty(SCRIPT_SERVICE_WILDCARD.getPropertyName()), replacement);
String result = lifecycleAction.replace(SCRIPT_DOWNLOAD_ENDPOINT_WILDCARD, propertiesWrapperService.getProperty(SCRIPT_SERVICE_ENDPOINT.getPropertyName()));
return result;
......
......@@ -12,9 +12,7 @@ public enum ApplicationCatalogueProperties {
SCRIPT_FOLDER("scriptsFolder"),
SCRIPT_FILE_EXTENSION("scriptsFileExtension"),
SCRIPT_SERVICE_WILDCARD("scriptServiceWildcard"),
SCRIPT_SERVICE_IP("scriptServiceIp"),
SCRIPT_SERVICE_PORT("scriptServicePort"),
SCRIPT_SERVICE_ENDPOINT("scriptServiceEndpoint"),
COLOSSEUM_URI("colosseumUri");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment