Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
CONF
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
UvA
CONF
Commits
f2a98adf
Commit
f2a98adf
authored
7 years ago
by
Spiros Koulouzis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix conflict with org.bouncycastle
parent
486005b2
Changes
10
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
73 additions
and
55 deletions
+73
-55
Dockerfile
Dockerfiles/manager/Dockerfile
+1
-2
NOTES
docs/NOTES
+1
-1
pom.xml
drip-commons/pom.xml
+2
-2
AAUtils.java
.../src/main/java/nl/uva/sne/drip/commons/utils/AAUtils.java
+41
-31
docker_swarm.pyc
drip-deployer/docker_swarm.pyc
+0
-0
rpc_server.py
drip-deployer/rpc_server.py
+3
-3
pom.xml
drip-provisioner/pom.xml
+10
-2
MessageParsing.java
...l/uva/sne/drip/drip/provisioner/utils/MessageParsing.java
+8
-7
PropertyValues.java
...l/uva/sne/drip/drip/provisioner/utils/PropertyValues.java
+2
-3
Consumer.java
...in/java/nl/uva/sne/drip/drip/provisioner/v1/Consumer.java
+5
-4
No files found.
Dockerfiles/manager/Dockerfile
View file @
f2a98adf
...
...
@@ -13,7 +13,7 @@ ARG CERTS=/etc/grid-security/certificates
ENV
DEBIAN_FRONTEND=noninteractive
RUN
apt-get update
&&
DEBIAN_FRONTEND
=
noninteractive apt-get
install
-y
--no-install-recommends
RUN
apt-get upgrade
-y
RUN
apt-get
install
-y
wget software-properties-common mongodb-clients
RUN
apt-get
install
-y
wget software-properties-common mongodb-clients
openssh-client
# RUN apt-get install -y python-software-properties debconf-utils apt-utils
RUN
add-apt-repository
-y
ppa:webupd8team/java
RUN
apt-get update
...
...
@@ -22,7 +22,6 @@ RUN echo debconf shared/accepted-oracle-license-v1-1 select true | debconf-set-s
RUN
echo
debconf shared/accepted-oracle-license-v1-1 seen
true
| debconf-set-selections
RUN
apt-get
install
-y
oracle-java8-installer
##install drip-manager
WORKDIR
/root
# RUN wget http://www-eu.apache.org/dist/tomcat/tomcat-7/v7.0.75/bin/apache-tomcat-7.0.75.tar.gz
...
...
This diff is collapsed.
Click to expand it.
docs/NOTES
View file @
f2a98adf
...
...
@@ -2,7 +2,7 @@
docker run --hostname my-rabbit --name some-rabbit -p 127.0.0.1:15672:15672 -p 127.0.0.1:4369:4369 -p 127.0.0.1:5671-5672:5671-5672 -p 127.0.0.1:15671:15671 -d rabbitmq:3-management
docker run --name mongo-inst -p 127.0.0.1:27017:27017 -d mongo:3
docker run --name drip-inst -p 127.0.0.1:8080:8080 -d drip-manager
sudo
docker run --hostname my-proxy --name some-myproxy -p 7512:7512 -p 7513:7513 -p 10022:22 agaveapi/myproxy
docker run --hostname my-proxy --name some-myproxy -p 7512:7512 -p 7513:7513 -p 10022:22 agaveapi/myproxy
#--------Add admin-----------------
docker exec -t mongo-inst mongo -eval 'db.user.insert({"password":"$2a$10$QdysFgsH0sl6Y4BD84UhGO7yyNfoDPXjjEHkDJ3pX6cRfHDj2Q0BO","roles":["ADMIN"],"username":"admin","accountNonExpired":true,"accountNonLocked":true,"credentialsNonExpired":true,"enabled":true})' localhost/drip
This diff is collapsed.
Click to expand it.
drip-commons/pom.xml
View file @
f2a98adf
...
...
@@ -74,7 +74,7 @@
<version>
4.2.1.RELEASE
</version>
<type>
jar
</type>
</dependency>
<dependency>
<!--
<dependency>
<groupId>org.jglobus</groupId>
<artifactId>ssl-proxies</artifactId>
<version>2.1.0</version>
...
...
@@ -85,7 +85,7 @@
<artifactId>myproxy</artifactId>
<version>2.1.0</version>
<type>jar</type>
</dependency>
</dependency>
-->
</dependencies>
<properties>
<maven.compiler.source>
1.8
</maven.compiler.source>
...
...
This diff is collapsed.
Click to expand it.
drip-commons/src/main/java/nl/uva/sne/drip/commons/utils/AAUtils.java
View file @
f2a98adf
...
...
@@ -24,18 +24,20 @@ import java.net.MalformedURLException;
import
java.net.URL
;
import
java.nio.channels.Channels
;
import
java.nio.channels.ReadableByteChannel
;
import
java.nio.file.Files
;
import
java.nio.file.Paths
;
import
java.security.cert.CertificateEncodingException
;
import
java.util.List
;
import
static
nl
.
uva
.
sne
.
drip
.
commons
.
utils
.
FileUtils
.
untar
;
import
org.globus.common.CoGProperties
;
import
org.globus.myproxy.GetParams
;
import
org.globus.myproxy.MyProxyException
;
import
org.globus.util.Util
;
import
org.gridforum.jgss.ExtendedGSSCredential
;
import
org.gridforum.jgss.ExtendedGSSManager
;
import
org.ietf.jgss.GSSCredential
;
import
org.ietf.jgss.GSSException
;
import
org.ietf.jgss.GSSManager
;
//
import org.globus.common.CoGProperties;
//
import org.globus.myproxy.GetParams;
//
import org.globus.myproxy.MyProxyException;
//
import org.globus.util.Util;
//
import org.gridforum.jgss.ExtendedGSSCredential;
//
import org.gridforum.jgss.ExtendedGSSManager;
//
import org.ietf.jgss.GSSCredential;
//
import org.ietf.jgss.GSSException;
//
import org.ietf.jgss.GSSManager;
/**
*
...
...
@@ -48,32 +50,40 @@ public class AAUtils {
CERTIFICATE
,
PROXY_FILE
}
public
static
String
generateProxy
(
String
accessKeyId
,
String
secretKey
,
SOURCE
source
,
String
myProxyEndpoint
,
List
voname
)
throws
IOException
,
CertificateEncodingException
,
GSSException
,
MyProxyException
{
public
static
String
generateProxy
(
String
accessKeyId
,
String
secretKey
,
SOURCE
source
,
String
myProxyEndpoint
,
List
voname
)
throws
IOException
,
CertificateEncodingException
{
File
proxy_file
=
null
;
switch
(
source
)
{
case
MY_PROXY:
GetParams
getRequest
=
new
GetParams
();
getRequest
.
setUserName
(
accessKeyId
);
getRequest
.
setCredentialName
(
null
);
getRequest
.
setLifetime
(
43200
);
getRequest
.
setWantTrustroots
(
false
);
getRequest
.
setPassphrase
(
secretKey
);
getRequest
.
setVoname
(
voname
);
GSSManager
manager
=
ExtendedGSSManager
.
getInstance
();
GSSCredential
credential
=
manager
.
createCredential
(
GSSCredential
.
INITIATE_ONLY
);
org
.
globus
.
myproxy
.
MyProxy
myProxy
=
new
org
.
globus
.
myproxy
.
MyProxy
(
myProxyEndpoint
,
7512
);
GSSCredential
newCred
=
myProxy
.
get
(
credential
,
getRequest
);
CoGProperties
properties
=
CoGProperties
.
getDefault
();
String
outputFile
=
properties
.
getProxyFile
();
proxy_file
=
new
File
(
outputFile
);
String
path
=
proxy_file
.
getPath
();
try
(
FileOutputStream
out
=
new
FileOutputStream
(
path
);)
{
Util
.
setOwnerAccessOnly
(
path
);
byte
[]
data
=
((
ExtendedGSSCredential
)
newCred
).
export
(
ExtendedGSSCredential
.
IMPEXP_OPAQUE
);
out
.
write
(
data
);
}
break
;
// GetParams getRequest = new GetParams();
// getRequest.setUserName(accessKeyId);
// getRequest.setCredentialName(null);
// getRequest.setLifetime(43200);
// getRequest.setWantTrustroots(false);
// getRequest.setPassphrase(secretKey);
// getRequest.setVoname(voname);
// GSSManager manager = ExtendedGSSManager.getInstance();
// GSSCredential credential = manager.createCredential(GSSCredential.INITIATE_ONLY);
// org.globus.myproxy.MyProxy myProxy = new org.globus.myproxy.MyProxy(myProxyEndpoint, 7512);
// GSSCredential newCred = myProxy.get(credential, getRequest);
// CoGProperties properties = CoGProperties.getDefault();
// String outputFile = properties.getProxyFile();
// proxy_file = new File(outputFile);
// String path = proxy_file.getPath();
// byte[] data
// = ((ExtendedGSSCredential) newCred).export(ExtendedGSSCredential.IMPEXP_OPAQUE);
// Util.setOwnerAccessOnly(path);
// Files.write(Paths.get(path), data);
//// try (FileOutputStream out = new FileOutputStream(path);) {
//// Util.setOwnerAccessOnly(path);
//// byte[] data
//// = ((ExtendedGSSCredential) newCred).export(ExtendedGSSCredential.IMPEXP_OPAQUE);
//// out.write(data);
//// }
break
;
case
PROXY_FILE:
secretKey
+=
"\n"
;
Files
.
write
(
Paths
.
get
(
"/tmp/x509up_u1000"
),
secretKey
.
getBytes
());
proxy_file
=
new
File
(
"/tmp/x509up_u1000"
);
break
;
case
CERTIFICATE:
break
;
...
...
This diff is collapsed.
Click to expand it.
drip-deployer/docker_swarm.pyc
View file @
f2a98adf
No preview for this file type
This diff is collapsed.
Click to expand it.
drip-deployer/rpc_server.py
View file @
f2a98adf
...
...
@@ -69,8 +69,8 @@ def handleDelivery(message):
fo
.
close
()
elif
name
==
"composer"
:
value
=
param
[
"value"
]
docker
-
composer
=
path
+
"docker-composer.yml"
fo
=
open
(
docker
-
composer
,
"w"
)
docker
_
composer
=
path
+
"docker-composer.yml"
fo
=
open
(
docker
_
composer
,
"w"
)
fo
.
write
(
value
)
fo
.
close
()
...
...
@@ -83,7 +83,7 @@ def handleDelivery(message):
ret
=
docker_swarm
.
run
(
vm_list
)
if
"ERROR"
in
ret
:
return
ret
ret1
=
control_agent
.
run
(
vm_list
)
#deploy_composer.run(vm_list,docker
-
composer)
#deploy_composer.run(vm_list,docker
_
composer)
if
"ERROR"
in
ret1
:
ret
=
ret1
return
ret
elif
manager_type
==
"ansible"
:
...
...
This diff is collapsed.
Click to expand it.
drip-provisioner/pom.xml
View file @
f2a98adf
...
...
@@ -22,6 +22,12 @@
<groupId>
nl.uva.sne.drip
</groupId>
<artifactId>
drip-commons
</artifactId>
<version>
1.0-SNAPSHOT
</version>
<exclusions>
<exclusion>
<groupId>
org.bouncycastle
</groupId>
<artifactId>
bcprov-jdk15on
</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
...
...
@@ -63,12 +69,14 @@
</dependency>
<dependency>
<!--bcprov-jdk16-1.46-->
<!-- <dependency>
<groupId>org.jglobus</groupId>
<artifactId>myproxy</artifactId>
<version>2.0.6</version>
</dependency>
-->
<dependency>
<groupId>
org.apache.commons
</groupId>
<artifactId>
commons-compress
</artifactId>
...
...
This diff is collapsed.
Click to expand it.
drip-provisioner/src/main/java/nl/uva/sne/drip/drip/provisioner/utils/MessageParsing.java
View file @
f2a98adf
...
...
@@ -39,7 +39,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.globus.myproxy.MyProxyException
;
//
import org.globus.myproxy.MyProxyException;
import
org.ietf.jgss.GSSException
;
import
org.json.JSONArray
;
import
org.json.JSONException
;
...
...
@@ -138,7 +138,7 @@ public class MessageParsing {
return
map
;
}
public
static
List
<
Credential
>
getCloudCredentials
(
JSONArray
parameters
,
String
tempInputDirPath
)
throws
JSONException
,
FileNotFoundException
,
IOException
,
MyProxyException
,
CertificateEncodingException
,
GSSException
{
public
static
List
<
Credential
>
getCloudCredentials
(
JSONArray
parameters
,
String
tempInputDirPath
)
throws
JSONException
,
FileNotFoundException
,
IOException
,
CertificateEncodingException
,
GSSException
{
List
<
Credential
>
credentials
=
new
ArrayList
<>();
for
(
int
i
=
0
;
i
<
parameters
.
length
();
i
++)
{
JSONObject
param
=
(
JSONObject
)
parameters
.
get
(
i
);
...
...
@@ -175,12 +175,13 @@ public class MessageParsing {
if
(
att
!=
null
&&
att
.
containsKey
(
"myProxyEndpoint"
))
{
myProxyEndpoint
=
(
String
)
att
.
get
(
"myProxyEndpoint"
);
}
if
(
myProxyEndpoint
==
null
&&
PropertyValues
.
MY_PROXY_ENDPOINT
!=
null
)
{
myProxyEndpoint
=
PropertyValues
.
MY_PROXY_ENDPOINT
;
}
if
(
myProxyEndpoint
!=
null
)
{
String
[]
myVOs
=
((
String
)
att
.
get
(
"vo_names"
)).
split
(
","
);
List
voNames
=
(
List
)
Arrays
.
asList
(
myVOs
);
String
[]
myVOs
=
null
;
List
voNames
=
null
;
if
(
att
!=
null
&&
att
.
containsKey
(
"voms"
))
{
myVOs
=
((
String
)
att
.
get
(
"voms"
)).
split
(
","
);
voNames
=
(
List
)
Arrays
.
asList
(
myVOs
);
}
egi
.
proxyFilePath
=
AAUtils
.
generateProxy
(
cred
.
getAccessKeyId
(),
cred
.
getSecretKey
(),
SOURCE
.
MY_PROXY
,
myProxyEndpoint
,
voNames
);
}
else
{
egi
.
proxyFilePath
=
AAUtils
.
generateProxy
(
cred
.
getAccessKeyId
(),
cred
.
getSecretKey
(),
SOURCE
.
PROXY_FILE
,
myProxyEndpoint
,
null
);
...
...
This diff is collapsed.
Click to expand it.
drip-provisioner/src/main/java/nl/uva/sne/drip/drip/provisioner/utils/PropertyValues.java
View file @
f2a98adf
...
...
@@ -34,7 +34,7 @@ public class PropertyValues {
public
static
String
HOST
=
"127.0.0.1"
;
public
static
String
TRUSTED_CERTIFICATE_FOLDER
;
public
static
URL
CA_BUNDLE_URL
;
public
static
String
MY_PROXY_ENDPOINT
=
"myproxy1.egee.cesnet.cz"
;
// public static String MY_PROXY_ENDPOINT
;
public
static
String
DOMAIN_INFO_PATH
=
"etc"
;
public
static
void
setPropertyValues
(
Properties
prop
)
throws
MalformedURLException
{
...
...
@@ -45,8 +45,7 @@ public class PropertyValues {
CA_BUNDLE_URL
=
new
URL
(
prop
.
getProperty
(
"ca.bundle.url"
,
"https://dist.eugridpma.info/distribution/igtf/current/accredited/igtf-preinstalled-bundle-classic.tar.gz"
));
MY_PROXY_ENDPOINT
=
prop
.
getProperty
(
"my.proxy.endpoint"
,
"myproxy1.egee.cesnet.cz"
);
// MY_PROXY_ENDPOINT = prop.getProperty("my.proxy.endpoint");
DOMAIN_INFO_PATH
=
prop
.
getProperty
(
"domain.info.path"
,
"etc"
);
...
...
This diff is collapsed.
Click to expand it.
drip-provisioner/src/main/java/nl/uva/sne/drip/drip/provisioner/v1/Consumer.java
View file @
f2a98adf
...
...
@@ -43,7 +43,7 @@ import nl.uva.sne.drip.drip.provisioner.utils.MessageParsing;
import
nl.uva.sne.drip.drip.provisioner.utils.PropertyValues
;
import
org.apache.commons.io.FileUtils
;
import
org.apache.commons.io.FilenameUtils
;
import
org.globus.myproxy.MyProxyException
;
//
import org.globus.myproxy.MyProxyException;
import
org.ietf.jgss.GSSException
;
import
org.json.JSONArray
;
import
org.json.JSONException
;
...
...
@@ -57,6 +57,7 @@ import provisioning.database.EC2.EC2Database;
import
provisioning.database.EGI.EGIDatabase
;
import
provisioning.database.UserDatabase
;
import
provisioning.engine.TEngine.TEngine
;
import
provisioning.engine.VEngine.EGI.EGIAgent
;
import
topologyAnalysis.TopologyAnalysisMain
;
import
topologyAnalysis.dataStructure.SubTopologyInfo
;
import
topologyAnalysis.dataStructure.VM
;
...
...
@@ -100,7 +101,7 @@ public class Consumer extends DefaultConsumer {
String
response
=
""
;
try
{
//The queue only moves bytes so we need to convert them to st
t
ing
//The queue only moves bytes so we need to convert them to st
r
ing
String
message
=
new
String
(
body
,
"UTF-8"
);
String
tempInputDirPath
=
System
.
getProperty
(
"java.io.tmpdir"
)
+
File
.
separator
+
"Input-"
+
Long
.
toString
(
System
.
nanoTime
())
+
File
.
separator
;
...
...
@@ -467,7 +468,7 @@ public class Consumer extends DefaultConsumer {
return
userDatabase
;
}
private
UserCredential
getUserCredential
(
JSONArray
parameters
,
String
tempInputDirPath
)
throws
JSONException
,
IOException
,
FileNotFoundException
,
MyProxyException
,
CertificateEncodingException
,
GSSException
{
private
UserCredential
getUserCredential
(
JSONArray
parameters
,
String
tempInputDirPath
)
throws
JSONException
,
IOException
,
FileNotFoundException
,
CertificateEncodingException
,
GSSException
{
UserCredential
userCredential
=
new
UserCredential
();
List
<
Credential
>
credentials
=
MessageParsing
.
getCloudCredentials
(
parameters
,
tempInputDirPath
);
for
(
Credential
cred
:
credentials
)
{
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment