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
bab2b8a9
Commit
bab2b8a9
authored
Sep 17, 2019
by
Spiros Koulouzis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
set correct key for all VMs
parent
a059b890
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
17 additions
and
41 deletions
+17
-41
DeployService.java
.../main/java/nl/uva/sne/drip/api/service/DeployService.java
+7
-11
TOSCAUtils.java
...c/main/java/nl/uva/sne/drip/commons/utils/TOSCAUtils.java
+7
-7
Consumer.java
...in/java/nl/uva/sne/drip/drip/provisioner/v1/Consumer.java
+3
-3
workspace.xml
drip_planner2/.idea/workspace.xml
+0
-20
No files found.
drip-api/src/main/java/nl/uva/sne/drip/api/service/DeployService.java
View file @
bab2b8a9
...
...
@@ -207,7 +207,7 @@ public class DeployService {
Map
<
String
,
Object
>
toscaProvisonMap
=
pro
.
getKeyValue
();
List
<
String
>
vmNames
=
TOSCAUtils
.
getVMsNodeNamesFromTopology
(
toscaProvisonMap
);
for
(
String
name
:
vmNames
)
{
Map
<
String
,
Object
>
outputs
=
TOSCAUtils
.
getOutputsForNode
(
toscaProvisonMap
,
name
);
Map
<
String
,
String
>
outputs
=
TOSCAUtils
.
getOutputsForNode
(
toscaProvisonMap
,
name
);
MessageParameter
messageParameter
=
createCredentialPartameter
(
outputs
);
parameters
.
add
(
messageParameter
);
}
...
...
@@ -235,20 +235,16 @@ public class DeployService {
deployDao
.
deleteAll
();
}
private
MessageParameter
createCredentialPartameter
(
Map
<
String
,
Object
>
outputs
)
{
private
MessageParameter
createCredentialPartameter
(
Map
<
String
,
String
>
outputs
)
{
MessageParameter
messageParameter
=
new
MessageParameter
();
messageParameter
.
setName
(
"credential"
);
messageParameter
.
setEncoding
(
"UTF-8"
);
String
key
=
TOSCAUtils
.
getOutputPair
(
outputs
,
"private_deployer_key"
).
get
(
1
);
messageParameter
.
setValue
(
key
);
// This key is configured on all vms fo the 'user_name'
messageParameter
.
setValue
(
outputs
.
get
(
"private_user_key"
));
Map
<
String
,
String
>
attributes
=
new
HashMap
<>();
String
ip
=
TOSCAUtils
.
getOutputPair
(
outputs
,
"ip"
).
get
(
1
);
attributes
.
put
(
"IP"
,
ip
);
String
role
=
TOSCAUtils
.
getOutputPair
(
outputs
,
"role"
).
get
(
1
);
attributes
.
put
(
"role"
,
role
);
String
user
=
TOSCAUtils
.
getOutputPair
(
outputs
,
"user_name"
).
get
(
1
);
attributes
.
put
(
"user"
,
user
);
attributes
.
put
(
"IP"
,
outputs
.
get
(
"ip"
));
attributes
.
put
(
"role"
,
outputs
.
get
(
"role"
));
attributes
.
put
(
"user"
,
outputs
.
get
(
"user_name"
));
messageParameter
.
setAttributes
(
attributes
);
return
messageParameter
;
}
...
...
drip-commons/src/main/java/nl/uva/sne/drip/commons/utils/TOSCAUtils.java
View file @
bab2b8a9
...
...
@@ -78,18 +78,18 @@ public class TOSCAUtils {
return
outputs
;
}
public
static
Map
<
String
,
Object
>
getOutputsForNode
(
Map
<
String
,
Object
>
toscaProvisonMap
,
String
nodeName
)
{
public
static
Map
<
String
,
String
>
getOutputsForNode
(
Map
<
String
,
Object
>
toscaProvisonMap
,
String
nodeName
)
{
Map
<
String
,
Object
>
topologyTemplate
=
(
Map
<
String
,
Object
>)
((
Map
<
String
,
Object
>)
toscaProvisonMap
.
get
(
"topology_template"
));
Map
<
String
,
Object
>
outputs
=
(
Map
<
String
,
Object
>)
topologyTemplate
.
get
(
"outputs"
);
Map
<
String
,
Object
>
matchedOutputs
=
new
HashMap
<>();
Map
<
String
,
String
>
matchedOutputs
=
new
HashMap
<>();
Iterator
it
=
outputs
.
entrySet
().
iterator
();
while
(
it
.
hasNext
())
{
Map
.
Entry
output
=
(
Map
.
Entry
)
it
.
next
();
Map
<
String
,
Object
>
outputValue
=
(
Map
<
String
,
Object
>)
output
.
getValue
();
Map
<
String
,
Object
>
val
=
(
Map
<
String
,
Object
>)
outputValue
.
get
(
"value"
);
List
<
String
>
attribute
=
(
List
<
String
>)
val
.
get
(
"get_attribute"
);
if
(
attribute
.
get
(
0
).
equals
(
nodeName
))
{
matchedOutputs
.
put
((
String
)
output
.
getKey
(),
outputValue
);
List
<
Map
<
String
,
String
>>
val
=
(
List
<
Map
<
String
,
String
>
>)
output
.
getValue
();
for
(
Map
<
String
,
String
>
map
:
val
)
{
if
(
map
.
containsKey
(
nodeName
))
{
matchedOutputs
.
put
((
String
)
output
.
getKey
(),
map
.
get
(
nodeName
));
}
}
}
return
matchedOutputs
;
...
...
drip-provisioner/src/main/java/nl/uva/sne/drip/drip/provisioner/v1/Consumer.java
View file @
bab2b8a9
...
...
@@ -282,7 +282,6 @@ public class Consumer extends DefaultConsumer {
// List<File> public_cloud_key = MessageParsing.getSSHKeys(parameters, tempInputDirPath + File.separator, "name.pub", "public_cloud_key");
// List<File> private_cloud_key = MessageParsing.getSSHKeys(parameters, tempInputDirPath + File.separator, "id_rsa", "private_cloud_key");
UserCredential
userCredential
=
getUserCredential
(
parameters
,
tempInputDirPath
);
UserDatabase
userDatabase
=
getUserDB
();
...
...
@@ -563,6 +562,7 @@ public class Consumer extends DefaultConsumer {
if
(
userPrivateName
!=
null
)
{
param
=
new
MessageParameter
();
param
.
setEncoding
(
charset
);
// This key is configured on all vms fo the 'user_name'
param
.
setName
(
"private_user_key"
);
byte
[]
bytes
=
Files
.
readAllBytes
(
Paths
.
get
(
tempInputDirPath
+
File
.
separator
+
userPrivateName
));
param
.
setValue
(
new
String
(
bytes
,
charset
));
...
...
drip_planner2/.idea/workspace.xml
View file @
bab2b8a9
...
...
@@ -2,28 +2,8 @@
<project
version=
"4"
>
<component
name=
"ChangeListManager"
>
<list
default=
"true"
id=
"462ede19-adfe-472b-975e-fefefa973fe0"
name=
"Default Changelist"
comment=
"slolved cap error"
>
<change
beforePath=
"$PROJECT_DIR$/../Dockerfiles/deployer/Dockerfile"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/../Dockerfiles/deployer/Dockerfile"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/../drip-api/nb-configuration.xml"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/../drip-api/nb-configuration.xml"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/../drip-api/src/main/java/nl/uva/sne/drip/api/service/DeployService.java"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/../drip-api/src/main/java/nl/uva/sne/drip/api/service/DeployService.java"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/../drip-api/src/main/java/nl/uva/sne/drip/api/service/ProvisionService.java"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/../drip-api/src/main/java/nl/uva/sne/drip/api/service/ProvisionService.java"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/../drip-api/src/main/java/nl/uva/sne/drip/api/v1/rest/DeployController.java"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/../drip-api/src/main/java/nl/uva/sne/drip/api/v1/rest/DeployController.java"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/../drip-api/src/main/java/nl/uva/sne/drip/api/v1/rest/RootController.java"
beforeDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/../drip-commons/src/main/java/nl/uva/sne/drip/commons/utils/TOSCAUtils.java"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/../drip-commons/src/main/java/nl/uva/sne/drip/commons/utils/TOSCAUtils.java"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/../drip-commons/src/main/java/nl/uva/sne/drip/drip/commons/data/v1/external/DeployParameter.java"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/../drip-commons/src/main/java/nl/uva/sne/drip/drip/commons/data/v1/external/DeployParameter.java"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/../drip-commons/src/main/java/nl/uva/sne/drip/drip/commons/data/v1/external/DeployRequest.java"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/../drip-commons/src/main/java/nl/uva/sne/drip/drip/commons/data/v1/external/DeployRequest.java"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/../drip-deployer/.idea/drip-deployer.iml"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/../drip-deployer/.idea/drip-deployer.iml"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/../drip-deployer/.idea/misc.xml"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/../drip-deployer/.idea/misc.xml"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/../drip-deployer/control_agent.py"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/../drip-deployer/control_agent.py"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/../drip-deployer/docker_check.py"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/../drip-deployer/docker_check.py"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/../drip-deployer/docker_compose.py"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/../drip-deployer/docker_compose.py"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/../drip-deployer/docker_engine.py"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/../drip-deployer/docker_engine.py"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/../drip-deployer/docker_kubernetes.py"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/../drip-deployer/docker_kubernetes.py"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/../drip-deployer/docker_service.py"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/../drip-deployer/docker_service.py"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/../drip-deployer/docker_swarm.py"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/../drip-deployer/docker_swarm.py"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/../drip-deployer/rpc_server.py"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/../drip-deployer/rpc_server.py"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/../drip-provisioner/src/main/java/nl/uva/sne/drip/drip/provisioner/v1/Consumer.java"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/../drip-provisioner/src/main/java/nl/uva/sne/drip/drip/provisioner/v1/Consumer.java"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/.idea/workspace.xml"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/.idea/workspace.xml"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/src/planner/basic_planner.py"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/src/planner/basic_planner.py"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/venv/lib/python3.6/site-packages/easy-install.pth"
beforeDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/venv/lib/python3.6/site-packages/prettytable.py"
beforeDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/venv/lib/python3.6/site-packages/pyparsing.py"
beforeDir=
"false"
/>
...
...
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