Commit c04ca632 authored by Spiros Koulouzis's avatar Spiros Koulouzis

add exogeni support

parent 57a8fd69
......@@ -18,7 +18,7 @@ RUN pip install numpy
RUN pip install networkx==1.10
RUN pip install flask
RUN pip install tosca-parser
RUN pip install pika
RUN pip install pika==0.11.2
RUN export LC_ALL="en_US.UTF-8"
RUN pip install paramiko
......
---
publicKeyPath: "name@id_rsa.pub"
userName: "vm_user"
topologies:
- topology: "exogeni-level-1"
cloudProvider: "ExoGENI"
domain: "RENCI (Chapel Hill, NC USA) XO Rack"
status: "fresh"
tag: "fixed"
statusInfo: null
copyOf: null
sshKeyPairId: null
connections: null
---
subnets: null
components:
- name: "nodeA"
type: "switch/compute"
nodeType: "XOMedium"
OStype: "Ubuntu 14.04"
script: null
role: null
dockers: null
publicAddress: null
ethernetPort: null
VMResourceID: null
......@@ -295,6 +295,8 @@ public class PlannerService {
return "Frankfurt";
case "egi":
return "CESNET";
case "exogeni":
return "RENCI (Chapel Hill, NC USA) XO Rack";
}
return null;
}
......
......@@ -36,7 +36,12 @@
<artifactId>drip-commons</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>nl.uva.sne.drip</groupId>
<artifactId>drip-provisioning-agent</artifactId>
<version>1.0-SNAPSHOT</version>
<type>jar</type>
</dependency>
</dependencies>
<build>
......
......@@ -18,6 +18,9 @@ import nl.uva.sne.drip.commons.utils.Converter;
import nl.uva.sne.drip.drip.converter.provisionerIn.*;
import nl.uva.sne.drip.drip.converter.provisionerIn.EC2.*;
import nl.uva.sne.drip.drip.converter.provisionerIn.provisionerIn.EGI.*;
import nl.uva.sne.drip.drip.converter.provisionerIn.provisionerIn.ExoGeni.ExoGeniSubTopology;
import nl.uva.sne.drip.drip.converter.provisionerIn.provisionerIn.ExoGeni.ExoGeniVM;
import org.json.JSONException;
public class P2PConverter {
......@@ -163,6 +166,16 @@ public class P2PConverter {
if (size > 5 && size <= 10) {
return "mammoth";
}
case "exogeni":
if (size <= 1) {
return "XOSmall";
}
if (size > 1 && size <= 5) {
return "XOMedium";
}
if (size > 5 && size <= 10) {
return "XOLarge";
}
default:
Logger.getLogger(P2PConverter.class.getName()).log(Level.WARNING, "The {0} is not supported yet!", cloudProvider);
return null;
......@@ -179,6 +192,9 @@ public class P2PConverter {
case "egi":
curVM = new EGIVM();
break;
case "exogeni":
curVM = new ExoGeniVM();
break;
default:
Logger.getLogger(P2PConverter.class.getName()).log(Level.WARNING, "The {0} is not supported yet!", cloudProvider);
return null;
......@@ -227,6 +243,10 @@ public class P2PConverter {
subTopology = new EGISubTopology();
((EGISubTopology) subTopology).components = new ArrayList<>();
break;
case "exogeni":
subTopology = new ExoGeniSubTopology();
((ExoGeniSubTopology) subTopology).components = new ArrayList<>();
break;
default:
Logger.getLogger(P2PConverter.class.getName()).log(Level.WARNING, "The {0} is not supported yet!", cloudProvider);
return null;
......@@ -242,6 +262,9 @@ public class P2PConverter {
case "egi":
((EGISubTopology) subTopology).components.add((EGIVM) vm);
break;
case "exogeni":
((ExoGeniSubTopology) subTopology).components.add((ExoGeniVM) vm);
break;
default:
Logger.getLogger(P2PConverter.class.getName()).log(Level.WARNING, "The {0} is not supported yet!", cloudProvider);
// return null;
......
package nl.uva.sne.drip.drip.converter.provisionerIn.provisionerIn.ExoGeni;
import java.util.ArrayList;
import nl.uva.sne.drip.drip.converter.provisionerIn.SubTopology;
public class ExoGeniSubTopology extends SubTopology {
//Indicate different VMs.
public ArrayList<ExoGeniVM> components;
}
package nl.uva.sne.drip.drip.converter.provisionerIn.provisionerIn.ExoGeni;
import nl.uva.sne.drip.drip.converter.provisionerIn.VM;
public class ExoGeniVM extends VM {
public String OSurl;
public String OSguid;
}
This diff is collapsed.
......@@ -26,6 +26,7 @@ import java.net.URL;
import java.security.cert.CertificateEncodingException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Base64;
import java.util.List;
import java.util.Map;
import nl.uva.sne.drip.commons.utils.AAUtils;
......@@ -33,6 +34,7 @@ import nl.uva.sne.drip.commons.utils.AAUtils.SOURCE;
import static nl.uva.sne.drip.commons.utils.AAUtils.downloadCACertificates;
import nl.uva.sne.drip.drip.commons.data.internal.MessageParameter;
import nl.uva.sne.drip.drip.commons.data.v1.external.CloudCredentials;
import org.apache.commons.io.FileUtils;
//import org.globus.myproxy.MyProxyException;
import org.ietf.jgss.GSSException;
import org.json.JSONArray;
......@@ -42,6 +44,7 @@ import org.yaml.snakeyaml.Yaml;
import provisioning.credential.Credential;
import provisioning.credential.EC2Credential;
import provisioning.credential.EGICredential;
import provisioning.credential.ExoGENICredential;
/**
*
......@@ -135,11 +138,11 @@ public class MessageParsing {
MessageParameter messageParam = mapper.readValue(param.toString(), MessageParameter.class);
String name = messageParam.getName();
String value = messageParam.getValue();
if(name.equals("scale_topology_name")){
if (name.equals("scale_topology_name")) {
return messageParam;
}
}
return null;
}
......@@ -200,6 +203,18 @@ public class MessageParsing {
egi.trustedCertPath = PropertyValues.TRUSTED_CERTIFICATE_FOLDER;
credential = egi;
}
if (cred.getCloudProviderName().toLowerCase().equals("exogeni")) {
ExoGENICredential exoGeniCredential = new ExoGENICredential();
exoGeniCredential.keyAlias = cred.getAccessKeyId();
exoGeniCredential.keyPassword = cred.getSecretKey();
Map<String, Object> att = cred.getAttributes();
if (att != null && att.containsKey("keystore")) {
String javaKeyStoreEncoded = (String) att.get("keystore");
byte[] decoded = Base64.getDecoder().decode(javaKeyStoreEncoded);
FileUtils.writeByteArrayToFile(new File(tempInputDirPath + File.separator + "user.jks"), decoded);
}
credential = exoGeniCredential;
}
// for (KeyPair pair : cred.getKeyPairs()) {
// if (pair != null) {
......
......@@ -53,6 +53,7 @@ import org.json.JSONObject;
import provisioning.credential.Credential;
import provisioning.credential.EC2Credential;
import provisioning.credential.EGICredential;
import provisioning.credential.ExoGENICredential;
import provisioning.credential.SSHKeyPair;
import provisioning.credential.UserCredential;
import provisioning.database.EC2.EC2Database;
......@@ -499,6 +500,9 @@ public class Consumer extends DefaultConsumer {
if (cred instanceof EGICredential) {
userCredential.cloudAccess.put("egi", cred);
}
if (cred instanceof ExoGENICredential) {
userCredential.cloudAccess.put("egi", cred);
}
}
return userCredential;
}
......
java.lib.path=
main.file=rpc_server.py
platform.active=Python_2.7.12
platform.active=Python_2.7.15
python.lib.path=
src.dir=src
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