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
698454ae
Commit
698454ae
authored
May 12, 2017
by
Spiros Koulouzis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed msg bug.
parent
724dcf64
Changes
14
Show whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
201 additions
and
7 deletions
+201
-7
.gitignore
.gitignore
+2
-1
egi-level-0.yml
docs/plans/egi-level-0.yml
+13
-0
egi-level-1.yml
docs/plans/egi-level-1.yml
+13
-0
euroArgo_conf_playbook.yml
docs/playbooks/euroArgo_conf_playbook.yml
+5
-2
euroago_run.yml
docs/playbooks/euroago_run.yml
+3
-1
playbook.yml
docs/playbooks/playbook.yml
+0
-0
playbook1.yml
docs/playbooks/playbook1.yml
+0
-0
playbook2.yml
docs/playbooks/playbook2.yml
+0
-0
playbook3yml
docs/playbooks/playbook3yml
+0
-0
DeployService.java
.../main/java/nl/uva/sne/drip/api/service/DeployService.java
+59
-2
uploadfile.jsp
drip-api/src/main/webapp/uploadfile.jsp
+61
-0
uploadfilesuccess.jsp
drip-api/src/main/webapp/uploadfilesuccess.jsp
+38
-0
Converter.java
...rc/main/java/nl/uva/sne/drip/commons/utils/Converter.java
+7
-0
Consumer.java
...in/java/nl/uva/sne/drip/drip/provisioner/v1/Consumer.java
+0
-1
No files found.
.gitignore
View file @
698454ae
...
@@ -11,3 +11,4 @@
...
@@ -11,3 +11,4 @@
/drip-api/nbproject/
/drip-api/nbproject/
/drip-tests/nbproject/
/drip-tests/nbproject/
/drip-tests/target/
/drip-tests/target/
/docs/playbooks/euroArgo_conf_playbook2.yml
\ No newline at end of file
docs/plans/egi-level-0.yml
0 → 100644
View file @
698454ae
---
publicKeyPath
:
"
name@id_rsa.pub"
userName
:
"
vm_user"
topologies
:
-
topology
:
"
egi-level-1"
cloudProvider
:
"
EGI"
domain
:
"
CESNET"
status
:
"
fresh"
tag
:
"
fixed"
statusInfo
:
null
copyOf
:
null
sshKeyPairId
:
null
connections
:
null
docs/plans/egi-level-1.yml
0 → 100644
View file @
698454ae
---
subnets
:
null
components
:
-
name
:
"
nodeA"
type
:
"
switch/compute"
nodeType
:
"
medium"
OStype
:
"
Ubuntu
14.04"
script
:
null
role
:
null
dockers
:
null
publicAddress
:
null
ethernetPort
:
null
VMResourceID
:
null
\ No newline at end of file
d
rip-deployer/playbooks/euroago_cong
.yml
→
d
ocs/playbooks/euroArgo_conf_playbook
.yml
View file @
698454ae
...
@@ -12,14 +12,17 @@
...
@@ -12,14 +12,17 @@
-
{
name
:
Copy scripts
,
copy
:
src=/tmp/scripts/ArgoDiffusion/scripts dest=/tmp/scripts owner=vm_user group=vm_user mode=755
}
-
{
name
:
Copy scripts
,
copy
:
src=/tmp/scripts/ArgoDiffusion/scripts dest=/tmp/scripts owner=vm_user group=vm_user mode=755
}
-
{
name
:
create dir
,
file
:
path=/home/vm_user/.irods/ state=directory owner=vm_user group=vm_user
}
-
{
name
:
create dir
,
file
:
path=/home/vm_user/.irods/ state=directory owner=vm_user group=vm_user
}
-
{
name
:
Copy irods_environment
,
copy
:
src=/tmp/conf/irods_environment.json dest=/home/vm_user/.irods/ owner=vm_user group=vm_user mode=755
}
-
{
name
:
Copy irods_environment
,
copy
:
src=/tmp/conf/irods_environment.json dest=/home/vm_user/.irods/ owner=vm_user group=vm_user mode=755
}
-
{
name
:
Run iinit
,
command
:
expect -c "spawn iinit; expect \"Enter your current iRODS password\"; send \"PASSWORD\n\";interact;"
,
register
:
streamoutput
,
become
:
yes
,
become_user
:
vm_user
}
-
{
name
:
Copy iint
,
copy
:
src=/tmp/conf/iint_euroargo.exp dest=/tmp/iint_euroargo.exp owner=vm_user group=vm_user mode=755
}
-
{
name
:
Run iinit
,
command
:
expect /tmp/iint_euroargo.exp
,
register
:
streamoutput
,
become
:
yes
,
become_user
:
vm_user
}
-
debug
:
msg="{{ streamoutput.stdout }}"
-
debug
:
msg="{{ streamoutput.stdout }}"
-
debug
:
msg="{{ streamoutput.stderr }}"
-
{
name
:
create dir
,
file
:
path=/mnt/data/ state=directory owner=vm_user group=vm_user
}
-
{
name
:
create dir
,
file
:
path=/mnt/data/ state=directory owner=vm_user group=vm_user
}
-
{
name
:
create dir
,
file
:
path=/mnt/data/source/ state=directory owner=vm_user group=vm_user
}
-
{
name
:
create dir
,
file
:
path=/mnt/data/source/ state=directory owner=vm_user group=vm_user
}
-
{
name
:
create dir
,
file
:
path=/mnt/data/source/output state=directory owner=vm_user group=vm_user
}
-
{
name
:
create dir
,
file
:
path=/mnt/data/source/output state=directory owner=vm_user group=vm_user
}
-
{
name
:
create dir
,
file
:
path=/mnt/data/irods/ state=directory owner=vm_user group=vm_user
}
-
{
name
:
create dir
,
file
:
path=/mnt/data/irods/ state=directory owner=vm_user group=vm_user
}
-
{
name
:
Run irodsFs
,
command
:
irodsFs /mnt/data/irods/
,
register
:
streamoutput
,
become
:
yes
,
become_user
:
vm_user
}
-
{
name
:
Run irodsFs
,
command
:
irodsFs /mnt/data/irods/
,
register
:
streamoutput
,
become
:
yes
,
become_user
:
vm_user
}
-
debug
:
msg="{{ streamoutput.stdout }}"
-
debug
:
msg="{{ streamoutput.stdout }}"
-
debug
:
msg="{{ streamoutput.stderr }}"
-
{
name
:
Copy from tmp
,
command
:
cp /tmp/scripts/scripts/ar_bigmetadata.json /mnt/data/source/
,
become
:
yes
,
become_user
:
vm_user
}
-
{
name
:
Copy from tmp
,
command
:
cp /tmp/scripts/scripts/ar_bigmetadata.json /mnt/data/source/
,
become
:
yes
,
become_user
:
vm_user
}
-
{
name
:
Copy from irods
,
command
:
ln -s /mnt/data/irods/monthly /mnt/data/source/input
,
become
:
yes
,
become_user
:
vm_user
}
-
{
name
:
Copy from irods
,
command
:
ln -s /mnt/data/irods/monthly /mnt/data/source/input
,
become
:
yes
,
become_user
:
vm_user
}
-
{
name
:
Copy from irods
,
command
:
cp /mnt/data/irods/action/argo_model.py /mnt/data/source/
,
become
:
yes
,
become_user
:
vm_user
}
-
{
name
:
Copy from irods
,
command
:
cp /mnt/data/irods/action/argo_model.py /mnt/data/source/
,
become
:
yes
,
become_user
:
vm_user
}
...
...
d
rip-deployer
/playbooks/euroago_run.yml
→
d
ocs
/playbooks/euroago_run.yml
View file @
698454ae
...
@@ -3,3 +3,5 @@
...
@@ -3,3 +3,5 @@
tasks
:
tasks
:
-
{
name
:
Run generation_argo_big_data
,
command
:
/usr/bin/python /mnt/data/source/generation_argo_big_data.py /mnt/data/source/configuration.json
,
register
:
streamoutput
,
become
:
yes
,
become_user
:
vm_user
}
-
{
name
:
Run generation_argo_big_data
,
command
:
/usr/bin/python /mnt/data/source/generation_argo_big_data.py /mnt/data/source/configuration.json
,
register
:
streamoutput
,
become
:
yes
,
become_user
:
vm_user
}
-
debug
:
msg="{{ streamoutput.stdout }}"
-
debug
:
msg="{{ streamoutput.stdout }}"
-
{
name
:
Copy output to irods
,
command
:
cp /mnt/data/source/output/data_argo.txt /mnt/data/irods/result
,
become
:
yes
,
become_user
:
vm_user
}
\ No newline at end of file
d
rip-deployer
/playbooks/playbook.yml
→
d
ocs
/playbooks/playbook.yml
View file @
698454ae
File moved
d
rip-deployer
/playbooks/playbook1.yml
→
d
ocs
/playbooks/playbook1.yml
View file @
698454ae
File moved
d
rip-deployer
/playbooks/playbook2.yml
→
d
ocs
/playbooks/playbook2.yml
View file @
698454ae
File moved
d
rip-deployer
/playbooks/playbook3yml
→
d
ocs
/playbooks/playbook3yml
View file @
698454ae
File moved
drip-api/src/main/java/nl/uva/sne/drip/api/service/DeployService.java
View file @
698454ae
...
@@ -26,6 +26,7 @@ import java.util.Map;
...
@@ -26,6 +26,7 @@ import java.util.Map;
import
java.util.concurrent.TimeoutException
;
import
java.util.concurrent.TimeoutException
;
import
java.util.logging.Level
;
import
java.util.logging.Level
;
import
java.util.logging.Logger
;
import
java.util.logging.Logger
;
import
java.util.regex.Matcher
;
import
nl.uva.sne.drip.api.dao.DeployDao
;
import
nl.uva.sne.drip.api.dao.DeployDao
;
import
nl.uva.sne.drip.api.exception.NotFoundException
;
import
nl.uva.sne.drip.api.exception.NotFoundException
;
import
nl.uva.sne.drip.api.rpc.DRIPCaller
;
import
nl.uva.sne.drip.api.rpc.DRIPCaller
;
...
@@ -50,11 +51,14 @@ import org.springframework.security.core.context.SecurityContextHolder;
...
@@ -50,11 +51,14 @@ import org.springframework.security.core.context.SecurityContextHolder;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
nl.uva.sne.drip.api.dao.KeyPairDao
;
import
nl.uva.sne.drip.api.dao.KeyPairDao
;
import
nl.uva.sne.drip.api.exception.KeyException
;
import
nl.uva.sne.drip.api.exception.KeyException
;
import
nl.uva.sne.drip.commons.utils.Converter
;
import
nl.uva.sne.drip.drip.commons.data.v1.external.KeyPair
;
import
nl.uva.sne.drip.drip.commons.data.v1.external.KeyPair
;
import
nl.uva.sne.drip.drip.commons.data.v1.external.ansible.AnsibleOutput
;
import
nl.uva.sne.drip.drip.commons.data.v1.external.ansible.AnsibleOutput
;
import
nl.uva.sne.drip.drip.commons.data.v1.external.ansible.AnsibleResult
;
import
nl.uva.sne.drip.drip.commons.data.v1.external.ansible.AnsibleResult
;
import
nl.uva.sne.drip.drip.commons.data.v1.external.ansible.BenchmarkResult
;
import
nl.uva.sne.drip.drip.commons.data.v1.external.ansible.BenchmarkResult
;
import
nl.uva.sne.drip.drip.commons.data.v1.external.ansible.SysbenchCPUBenchmark
;
import
nl.uva.sne.drip.drip.commons.data.v1.external.ansible.SysbenchCPUBenchmark
;
import
org.json.JSONArray
;
import
org.json.JSONObject
;
/**
/**
*
*
...
@@ -162,7 +166,6 @@ public class DeployService {
...
@@ -162,7 +166,6 @@ public class DeployService {
// CloudCredentials cCred = cloudCredentialsService.findOne(cloudConfIDs.get(0));
// CloudCredentials cCred = cloudCredentialsService.findOne(cloudConfIDs.get(0));
// loginKeysIDs = cCred.getkeyPairIDs();
// loginKeysIDs = cCred.getkeyPairIDs();
// }
// }
List
<
KeyPair
>
loginKeys
=
new
ArrayList
<>();
List
<
KeyPair
>
loginKeys
=
new
ArrayList
<>();
for
(
String
keyID
:
loginKeysIDs
)
{
for
(
String
keyID
:
loginKeysIDs
)
{
KeyPair
key
=
keyDao
.
findOne
(
keyID
);
KeyPair
key
=
keyDao
.
findOne
(
keyID
);
...
@@ -258,6 +261,9 @@ public class DeployService {
...
@@ -258,6 +261,9 @@ public class DeployService {
String
value
=
p
.
getValue
();
String
value
=
p
.
getValue
();
ObjectMapper
mapper
=
new
ObjectMapper
();
ObjectMapper
mapper
=
new
ObjectMapper
();
mapper
.
configure
(
DeserializationFeature
.
FAIL_ON_UNKNOWN_PROPERTIES
,
false
);
mapper
.
configure
(
DeserializationFeature
.
FAIL_ON_UNKNOWN_PROPERTIES
,
false
);
value
=
parseValue
(
value
);
List
<
AnsibleOutput
>
outputList
=
mapper
.
readValue
(
value
,
new
TypeReference
<
List
<
AnsibleOutput
>>()
{
List
<
AnsibleOutput
>
outputList
=
mapper
.
readValue
(
value
,
new
TypeReference
<
List
<
AnsibleOutput
>>()
{
});
});
...
@@ -444,4 +450,55 @@ public class DeployService {
...
@@ -444,4 +450,55 @@ public class DeployService {
return
Double
.
valueOf
(
string
.
replaceAll
(
"approx. 95 percentile:"
,
""
).
replaceAll
(
"ms"
,
""
).
trim
());
return
Double
.
valueOf
(
string
.
replaceAll
(
"approx. 95 percentile:"
,
""
).
replaceAll
(
"ms"
,
""
).
trim
());
}
}
private
String
parseValue
(
String
value
)
throws
JSONException
{
JSONArray
ja
=
new
JSONArray
(
value
);
JSONArray
newJa
=
new
JSONArray
();
for
(
int
i
=
0
;
i
<
ja
.
length
();
i
++)
{
JSONObject
jo
=
ja
.
getJSONObject
(
i
);
JSONObject
result
=
((
JSONObject
)
jo
.
get
(
"result"
));
if
(
result
.
has
(
"msg"
))
{
String
msg
;
try
{
msg
=
(
String
)
result
.
get
(
"msg"
);
}
catch
(
java
.
lang
.
ClassCastException
ex
)
{
JSONObject
message
=
(
JSONObject
)
result
.
get
(
"msg"
);
msg
=
Converter
.
jsonObject2String
(
message
.
toString
());
result
.
put
(
"msg"
,
msg
);
jo
.
put
(
"result"
,
result
);
}
}
JSONObject
invocation
=
((
JSONObject
)
(
result
).
get
(
"invocation"
));
if
(
invocation
.
has
(
"module_args"
))
{
JSONObject
module_args
=
(
JSONObject
)
invocation
.
get
(
"module_args"
);
if
(
module_args
.
has
(
"msg"
))
{
String
msg
;
try
{
msg
=
(
String
)
module_args
.
get
(
"msg"
);
}
catch
(
java
.
lang
.
ClassCastException
ex
)
{
JSONObject
message
=
(
JSONObject
)
module_args
.
get
(
"msg"
);
msg
=
Converter
.
jsonObject2String
(
message
.
toString
());
module_args
.
put
(
"msg"
,
msg
);
invocation
.
put
(
"module_args"
,
module_args
);
}
}
}
if
(
invocation
.
has
(
"msg"
))
{
String
msg
;
try
{
msg
=
(
String
)
invocation
.
get
(
"msg"
);
}
catch
(
java
.
lang
.
ClassCastException
ex
)
{
JSONObject
message
=
(
JSONObject
)
invocation
.
get
(
"msg"
);
msg
=
Converter
.
jsonObject2String
(
message
.
toString
());
invocation
.
put
(
"msg"
,
msg
);
result
.
put
(
"invocation"
,
invocation
);
}
}
newJa
.
put
(
jo
);
}
return
newJa
.
toString
();
}
}
}
drip-api/src/main/webapp/uploadfile.jsp
0 → 100644
View file @
698454ae
<%@taglib
uri=
"http://www.springframework.org/tags/form"
prefix=
"form"
%>
<html>
<head>
<title>
Crunchify - Spring MVC Upload Multiple Files Example
</title>
<script
src=
"http://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"
></script>
<script>
$
(
document
)
.
ready
(
function
()
{
//add more file components if Add is clicked
$
(
'#addFile'
)
.
click
(
function
()
{
var
fileIndex
=
$
(
'#fileTable tr'
)
.
children
().
length
-
1
;
$
(
'#fileTable'
)
.
append
(
'<tr><td>'
+
' <input type="file" name="files['
+
fileIndex
+
']" />'
+
'</td></tr>'
);
});
});
</script>
<style
type=
"text/css"
>
body
{
background-image
:
url('https://cdn.crunchify.com/wp-content/uploads/2013/03/Crunchify.bg_.300.png')
;
}
</style>
</head>
<body>
<br>
<br>
<div
align=
"center"
>
<h1>
Crunchify - Spring MVC Upload Multiple Files Example
</h1>
<form:form
method=
"post"
action=
"savefiles.html"
modelAttribute=
"uploadForm"
enctype=
"multipart/form-data"
>
<p>
Select files to upload. Press Add button to add more file
inputs.
</p>
<table
id=
"fileTable"
>
<tr>
<td><input
name=
"files[0]"
type=
"file"
/></td>
</tr>
<tr>
<td><input
name=
"files[1]"
type=
"file"
/></td>
</tr>
</table>
<br
/>
<input
type=
"submit"
value=
"Upload"
/>
<input
id=
"addFile"
type=
"button"
value=
"Add File"
/>
</form:form>
<br
/>
</div>
</body>
</html>
\ No newline at end of file
drip-api/src/main/webapp/uploadfilesuccess.jsp
0 → 100644
View file @
698454ae
<%@taglib
uri=
"http://java.sun.com/jsp/jstl/core"
prefix=
"c"
%>
<html>
<head>
<title>
Crunchify - Upload Multiple Files Example
</title>
<style
type=
"text/css"
>
body
{
background-image
:
url('https://cdn.crunchify.com/wp-content/uploads/2013/03/Crunchify.bg_.300.png')
;
}
</style>
</head>
<body>
<br>
<br>
<div
align=
"center"
>
<h1>
Crunchify - Spring MVC Upload Multiple Files Example
</h1>
<p>
Awesome.. Following files are uploaded successfully.
</p>
<ol>
<c:forEach
items=
"
${
files
}
"
var=
"file"
>
- ${file}
<br>
</c:forEach>
</ol>
<a
href=
"http://localhost:8080/CrunchifySpringMVC3.2.1/upload.html"
><input
type=
"button"
value=
"Go Back"
/></a>
<br
/>
<br
/>
<br
/>
<div
style=
"font-family: verdana; line-height: 25px; padding: 5px 10px; border-radius: 10px; border: 1px dotted #A4A4A4; width: 50%; font-size: 12px;"
>
Spring MVC Upload Multiple Files Example by
<a
href=
'https://crunchify.com'
>
Crunchify
</a>
. Click
<a
href=
'https://crunchify.com/category/java-web-development-tutorial/'
>
here
</a>
for all Java, Spring MVC, Web Development examples.
<br>
</div>
</div>
</body>
</html>
\ No newline at end of file
drip-commons/src/main/java/nl/uva/sne/drip/commons/utils/Converter.java
View file @
698454ae
...
@@ -26,6 +26,7 @@ import java.util.Iterator;
...
@@ -26,6 +26,7 @@ import java.util.Iterator;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Map
;
import
java.util.Properties
;
import
java.util.Properties
;
import
java.util.regex.Matcher
;
import
nl.uva.sne.drip.drip.commons.data.v1.external.CloudCredentials
;
import
nl.uva.sne.drip.drip.commons.data.v1.external.CloudCredentials
;
import
org.apache.commons.io.FilenameUtils
;
import
org.apache.commons.io.FilenameUtils
;
import
org.json.JSONArray
;
import
org.json.JSONArray
;
...
@@ -241,4 +242,10 @@ public class Converter {
...
@@ -241,4 +242,10 @@ public class Converter {
return
map
;
return
map
;
}
}
public
static
String
jsonObject2String
(
String
msg
)
{
msg
=
msg
.
replaceAll
(
"\""
,
Matcher
.
quoteReplacement
(
"\\\""
));
msg
=
"\""
+
msg
+
"\""
;
return
msg
;
}
}
}
drip-provisioner/src/main/java/nl/uva/sne/drip/drip/provisioner/v1/Consumer.java
View file @
698454ae
...
@@ -163,7 +163,6 @@ public class Consumer extends DefaultConsumer {
...
@@ -163,7 +163,6 @@ public class Consumer extends DefaultConsumer {
File
mainTopologyFile
=
new
File
(
tempInputDirPath
+
"topology_main.yml"
);
File
mainTopologyFile
=
new
File
(
tempInputDirPath
+
"topology_main.yml"
);
FileUtils
.
moveFile
(
topologyFile
,
mainTopologyFile
);
FileUtils
.
moveFile
(
topologyFile
,
mainTopologyFile
);
String
topTopologyLoadingPath
=
mainTopologyFile
.
getAbsolutePath
();
String
topTopologyLoadingPath
=
mainTopologyFile
.
getAbsolutePath
();
List
<
File
>
topologyFiles
=
MessageParsing
.
getTopologies
(
parameters
,
tempInputDirPath
,
1
);
List
<
File
>
topologyFiles
=
MessageParsing
.
getTopologies
(
parameters
,
tempInputDirPath
,
1
);
// for (File lowLevelTopologyFile : topologyFiles) {
// for (File lowLevelTopologyFile : topologyFiles) {
// File secondaryTopologyFile = new File(tempInputDirPath + File.separator + lowLevelTopologyFile.getName() + ".yml");
// File secondaryTopologyFile = new File(tempInputDirPath + File.separator + lowLevelTopologyFile.getName() + ".yml");
...
...
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