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
513a8129
Commit
513a8129
authored
Feb 06, 2020
by
Spiros Koulouzis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added simple compose
parent
655ee3e4
Changes
23
Show whitespace changes
Inline
Side-by-side
Showing
23 changed files
with
149 additions
and
102 deletions
+149
-102
mongo.yaml
K8s/mongo.yaml
+11
-11
rabbitmq.yml
K8s/rabbitmq.yml
+1
-1
swagger-spring-example-deployment.yaml
K8s/swagger-spring-example-deployment.yaml
+0
-25
swagger-spring-example-service.yaml
K8s/swagger-spring-example-service.yaml
+0
-13
application_example_updated.yaml
TOSCA/application_example_updated.yaml
+1
-1
interfaces.yml
TOSCA/types/interfaces.yml
+1
-1
nodes.yaml
TOSCA/types/nodes.yaml
+2
-2
dashboard.yaml
ansible_playbooks/dashboard.yaml
+22
-0
build.sh
build.sh
+2
-1
ToscaHelper.java
.../main/java/nl/uva/sne/drip/commons/utils/ToscaHelper.java
+2
-1
Dockerfile
deployer/Dockerfile
+2
-0
__main__.py
deployer/__main__.py
+1
-2
requirements.txt
deployer/requirements.txt
+1
-1
k8s_service.py
deployer/service/k8s_service.py
+2
-2
docker-compose.yml
docker-compose.yml
+74
-0
docker_push.sh
docker_push.sh
+4
-3
dockerize.sh
dockerize.sh
+9
-6
Dockerfile
manager/Dockerfile
+7
-7
pom.xml
manager/pom.xml
+0
-1
DRIPService.java
...er/src/main/java/nl/uva/sne/drip/service/DRIPService.java
+0
-1
application.properties
manager/src/main/resources/application.properties
+1
-1
Dockerfile
provisioner/Dockerfile
+6
-6
simple_start_dockers.sh
simple_start_dockers.sh
+0
-16
No files found.
K8s/mongo.yaml
View file @
513a8129
...
...
@@ -14,14 +14,14 @@ spec:
env
:
-
name
:
VAR
value
:
VAL
#ports:
#- containerPort: 27017
#name: mongo
volumeMounts
:
-
name
:
mongo-persistent-storage
mountPath
:
/var/lib/mongo
volumes
:
-
name
:
mongo-persistent-storage
gcePersistentDisk
:
pdName
:
mongo-disk
fsType
:
ext4
#
#
ports:
#
#
- containerPort: 27017
#
#
name: mongo
#
volumeMounts:
#
- name: mongo-persistent-storage
#
mountPath: /var/lib/mongo
#
volumes:
#
- name: mongo-persistent-storage
#
gcePersistentDisk:
#
pdName: mongo-disk
#
fsType: ext4
K8s/rabbitmq.yml
View file @
513a8129
...
...
@@ -9,7 +9,7 @@ spec:
-
resources
:
limits
:
cpu
:
0.5
image
:
rabbitmq:3-management
image
:
rabbitmq:3
.8
-management
name
:
rabbitmq
env
:
-
name
:
VAR
...
...
K8s/swagger-spring-example-deployment.yaml
deleted
100644 → 0
View file @
655ee3e4
apiVersion
:
apps/v1
kind
:
Deployment
metadata
:
labels
:
app
:
swagger-spring-example
name
:
swagger-spring-example
spec
:
selector
:
matchLabels
:
app
:
swagger-spring-example
replicas
:
1
strategy
:
{}
template
:
metadata
:
labels
:
app
:
swagger-spring-example
spec
:
containers
:
-
image
:
alogo53/swagger-spring-example:1.0.0
name
:
swagger-spring-example
ports
:
-
containerPort
:
8080
resources
:
{}
restartPolicy
:
Always
status
:
{}
K8s/swagger-spring-example-service.yaml
deleted
100644 → 0
View file @
655ee3e4
apiVersion
:
v1
kind
:
Service
metadata
:
labels
:
app
:
swagger-spring-example
name
:
swagger-spring-example
spec
:
type
:
NodePort
ports
:
-
port
:
8080
nodePort
:
30000
selector
:
app
:
swagger-spring-example
TOSCA/application_example_updated.yaml
View file @
513a8129
...
...
@@ -25,7 +25,7 @@ topology_template:
volumes
:
-
db-data:/data/db
environment
:
ROOT_PASSWORD
:
somewordpress
ROOT_PASSWORD
:
root_passwd
DATABASE
:
db
USER
:
user
PASSWORD
:
passwd
...
...
TOSCA/types/interfaces.yml
View file @
513a8129
TOSCA/types/nodes.yaml
View file @
513a8129
...
...
@@ -90,7 +90,7 @@ node_types:
playbook
:
https://raw.githubusercontent.com/skoulouzis/CONF/DRIP_3.0/ansible_playbooks/create_k8s.yml
configure
:
inputs
:
playbook
:
https://raw.githubusercontent.com/skoulouzis/CONF/DRIP_3.0/ansible_playbooks/
create_k8s.yml
playbook
:
https://raw.githubusercontent.com/skoulouzis/CONF/DRIP_3.0/ansible_playbooks/
dashboard.yaml
#tosca.nodes.ARTICONF.Orchestrator.Swarm:
...
...
ansible_playbooks/dashboard.yaml
View file @
513a8129
...
...
@@ -302,3 +302,25 @@ spec:
volumes
:
-
name
:
tmp-volume
emptyDir
:
{}
---
apiVersion
:
v1
kind
:
ServiceAccount
metadata
:
name
:
admin-user
#namespace: kubernetes-dashboard
namespace
:
default
#kube-system
---
apiVersion
:
rbac.authorization.k8s.io/v1
kind
:
ClusterRoleBinding
metadata
:
name
:
admin-user
roleRef
:
apiGroup
:
rbac.authorization.k8s.io
kind
:
ClusterRole
name
:
cluster-admin
subjects
:
-
kind
:
ServiceAccount
name
:
admin-user
#namespace: kubernetes-dashboard
namespace
:
default
build.sh
View file @
513a8129
...
...
@@ -2,7 +2,8 @@
mvn
-Dmaven
.test.skip
=
true install
cd
drip-
planner
&&
rm
-rf
venv
&&
python3
-m
venv venv
&&
venv/bin/pip3
install
-r
requirements.txt
cd
planner
&&
rm
-rf
venv
&&
python3
-m
venv venv
&&
venv/bin/pip3
install
-r
requirements.txt
cd
../
cd
sure_tosca-flask-server
&&
rm
-rf
venv
&&
python3
-m
venv venv
&&
venv/bin/pip3
install
-r
requirements.txt
&&
venv/bin/pip3
install
-r
test-requirements.txt
cd
../
cd
deployer
&&
rm
-rf
venv
&&
python3
-m
venv venv
&&
venv/bin/pip3
install
-r
requirements.txt
commons/src/main/java/nl/uva/sne/drip/commons/utils/ToscaHelper.java
View file @
513a8129
...
...
@@ -72,6 +72,7 @@ public class ToscaHelper {
private
void
init
(
String
sureToscaBasePath
)
{
Configuration
.
getDefaultApiClient
().
setBasePath
(
sureToscaBasePath
);
Configuration
.
getDefaultApiClient
().
setConnectTimeout
(
1200000
);
Logger
.
getLogger
(
ToscaHelper
.
class
.
getName
()).
log
(
Level
.
FINE
,
"sureToscaBasePath: {0}"
,
Configuration
.
getDefaultApiClient
().
getBasePath
());
api
=
new
DefaultApi
(
Configuration
.
getDefaultApiClient
());
this
.
objectMapper
=
new
ObjectMapper
(
new
YAMLFactory
().
disable
(
YAMLGenerator
.
Feature
.
WRITE_DOC_START_MARKER
));
objectMapper
.
disable
(
SerializationFeature
.
WRITE_DATES_AS_TIMESTAMPS
);
...
...
deployer/Dockerfile
View file @
513a8129
FROM
python:3.7-buster
RUN
apt-get
install
ansible
RUN
mkdir
-p
/usr/src/app
WORKDIR
/usr/src/app
...
...
deployer/__main__.py
View file @
513a8129
...
...
@@ -98,8 +98,7 @@ def handle_delivery(message):
response
=
{
'toscaTemplate'
:
tosca_template_dict
}
output_current_milli_time
=
int
(
round
(
time
.
time
()
*
1000
))
response
[
"creationDate"
]
=
output_current_milli_time
response
[
"parameters"
]
=
[]
logger
.
info
(
"Returning plan"
)
logger
.
info
(
"Returning Deployment"
)
logger
.
info
(
"Output message:"
+
json
.
dumps
(
response
))
return
json
.
dumps
(
response
)
...
...
deployer/requirements.txt
View file @
513a8129
pika==1.1.0
names==0.3.0
networkx==2.4
requests=2.22.0
requests=
=
2.22.0
ansible==2.9.2
\ No newline at end of file
deployer/service/k8s_service.py
View file @
513a8129
...
...
@@ -210,11 +210,11 @@ def write_ansible_k8s_files(tosca_template_json, tmp_path):
def
get_dashboard_url
(
vms
):
dashboard_tasks_path
=
get_templates_directory_path
(
'dashboard.yaml'
)
with
open
(
dashboard_tasks_path
,
'r'
)
as
stream
:
tasks
=
yaml
.
load_all
(
stream
)
tasks
=
list
(
yaml
.
load_all
(
stream
)
)
for
task
in
tasks
:
if
task
[
'kind'
]
==
'Service'
and
'name'
in
task
[
'metadata'
]
and
task
[
'metadata'
][
'name'
]
and
task
[
'metadata'
][
'name'
]
==
'kubernetes-dashboard'
:
dashboard_port
=
task
[
'
port
'
][
'ports'
][
0
][
'nodePort'
]
dashboard_port
=
task
[
'
spec
'
][
'ports'
][
0
][
'nodePort'
]
for
vm_name
in
vms
:
attributes
=
vms
[
vm_name
][
'attributes'
]
role
=
attributes
[
'role'
]
...
...
docker-compose.yml
0 → 100644
View file @
513a8129
version
:
'
3'
services
:
mongo
:
image
:
mongo:4
ports
:
-
"
27017:27017"
rabbit
:
image
:
rabbitmq:3.8-management
ports
:
-
"
5671-5672:5671-5672"
-
"
15672:15672"
-
"
4369:4369"
-
"
15671:15671"
planner
:
depends_on
:
-
rabbit
-
sure-tosca
image
:
alogo53/planner:3.0.0
environment
:
RABBITMQ_HOST
:
rabbit
provisioner
:
depends_on
:
-
rabbit
-
sure-tosca
image
:
alogo53/provisioner:3.0.0
environment
:
RABBITMQ_HOST
:
rabbit
SURE_TOSCA_BASE_PATH
:
http://sure-tosca:8081/tosca-sure/1.0.0
deployer
:
depends_on
:
-
rabbit
-
sure-tosca
image
:
alogo53/deployer:3.0.0
environment
:
RABBITMQ_HOST
:
rabbit
manager
:
depends_on
:
-
rabbit
-
mongo
-
sure-tosca
image
:
alogo53/manager:3.0.0
environment
:
RABBITMQ_HOST
:
rabbit
MONGO_HOST
:
mongo
SURE_TOSCA_BASE_PATH
:
http://sure-tosca:8081/tosca-sure/1.0.0
ports
:
-
"
30001:8080"
sure-tosca
:
image
:
alogo53/sure-tosca:3.0.0
ports
:
-
"
8081:8081"
logspout
:
ports
:
-
"
30002:80"
volumes
:
-
/etc/hostname:/etc/host_hostname:ro
-
/var/run/docker.sock:/var/run/docker.sock
environment
:
publish
:
"
127.0.0.1:30002:80"
image
:
gliderlabs/logspout:latest
#docker-compose build
#docker-compose up -d
docker_push.sh
View file @
513a8129
#!/bin/bash
docker push alogo53/
drip-
manager:3.0.0
docker push alogo53/
drip-
provisioner:3.0.0
docker push alogo53/manager:3.0.0
docker push alogo53/provisioner:3.0.0
docker push alogo53/sure-tosca:3.0.0
docker push alogo53/drip-planner:3.0.0
docker push alogo53/planner:3.0.0
docker push alogo53/deployer:3.0.0
dockerize.sh
View file @
513a8129
#!/bin/bash
echo
"----------Building
drip-
manager Docker--------------"
cd
drip-
manager
&&
mvn
-Dmaven
.test.skip
=
true
dockerfile:build
echo
"----------Building manager Docker--------------"
cd
manager
&&
mvn
-Dmaven
.test.skip
=
true
dockerfile:build
cd
../
echo
"----------Building
drip-
provisioner Docker--------------"
cd
drip-
provisioner
&&
mvn
-Dmaven
.test.skip
=
true
dockerfile:build
echo
"----------Building provisioner Docker--------------"
cd
provisioner
&&
mvn
-Dmaven
.test.skip
=
true
dockerfile:build
cd
../
echo
"----------Building sure_tosca-flask-server Docker--------------"
cd
sure_tosca-flask-server
&&
docker build
-t
alogo53/sure-tosca:3.0.0
.
echo
"----------Building
drip-
planner Docker--------------"
echo
"----------Building planner Docker--------------"
cd
../
cd
drip-planner
&&
docker build
-t
alogo53/drip-planner:3.0.0
.
cd
planner
&&
docker build
-t
alogo53/planner:3.0.0
.
echo
"----------Building deployer Docker--------------"
cd
../
cd
planner
&&
docker build
-t
alogo53/deployer:3.0.0
.
manager/Dockerfile
View file @
513a8129
FROM
openjdk:11
COPY
target/
drip-manager-3.0.0.jar drip-
manager-3.0.0.jar
COPY
target/
manager-3.0.0.jar
manager-3.0.0.jar
CMD
jar -xf
drip-
manager-3.0.0.jar BOOT-INF/classes/application.properties && \
sed -ie "s
/^message.broker.host=.*/message.broker.host=$RABBITMQ_HOST/
" BOOT-INF/classes/application.properties && \
sed -ie "s
/^db.host=.*/db.host=$MONGO_HOST/
" BOOT-INF/classes/application.properties && \
sed -ie "s
/^sure_tosca.base.path=.*/sure_tosca.base.path=$SURE_TOSCA_BASE_PATH/
" BOOT-INF/classes/application.properties && \
CMD
jar -xf manager-3.0.0.jar BOOT-INF/classes/application.properties && \
sed -ie "s
#^message.broker.host=.*#message.broker.host=$RABBITMQ_HOST#
" BOOT-INF/classes/application.properties && \
sed -ie "s
#^db.host=.*#db.host=$MONGO_HOST#
" BOOT-INF/classes/application.properties && \
sed -ie "s
#^sure_tosca.base.path=.*#sure_tosca.base.path=$SURE_TOSCA_BASE_PATH#
" BOOT-INF/classes/application.properties && \
cat BOOT-INF/classes/application.properties && \
jar -uf
drip-
manager-3.0.0.jar BOOT-INF/classes/application.properties && \
java -jar
drip-
manager-3.0.0.jar
jar -uf manager-3.0.0.jar BOOT-INF/classes/application.properties && \
java -jar manager-3.0.0.jar
manager/pom.xml
View file @
513a8129
...
...
@@ -78,7 +78,6 @@
<dependency>
<groupId>
javax.xml.bind
</groupId>
<artifactId>
jaxb-api
</artifactId>
<version>
2.3.1
</version>
</dependency>
<dependency>
<groupId>
com.sun.xml.bind
</groupId>
...
...
manager/src/main/java/nl/uva/sne/drip/service/DRIPService.java
View file @
513a8129
...
...
@@ -155,7 +155,6 @@ public class DRIPService {
Logger
.
getLogger
(
DRIPService
.
class
.
getName
()).
log
(
Level
.
FINE
,
"Found ToscaTemplate with id: {0}"
,
id
);
ToscaTemplate
toscaTemplate
=
toscaTemplateService
.
getYaml2ToscaTemplate
(
ymlToscaTemplate
);
helper
.
uploadToscaTemplate
(
toscaTemplate
);
return
toscaTemplate
;
}
...
...
manager/src/main/resources/application.properties
View file @
513a8129
provisioner/Dockerfile
View file @
513a8129
FROM
openjdk:11
COPY
target/
drip-provisioner-3.0.0-jar-with-dependencies.jar drip-
provisioner-3.0.0-jar-with-dependencies.jar
COPY
target/
provisioner-3.0.0-jar-with-dependencies.jar
provisioner-3.0.0-jar-with-dependencies.jar
COPY
etc/ etc
CMD
jar -xf
drip-
provisioner-3.0.0-jar-with-dependencies.jar application.properties && \
sed -ie "s
/^message.broker.host=.*/message.broker.host=$RABBITMQ_HOST/
" application.properties && \
sed -ie "s
/^sure_tosca.base.path=.*/sure-tosca.base.path=$SURE_TOSCA_BASE_PATH/
" application.properties && \
CMD
jar -xf provisioner-3.0.0-jar-with-dependencies.jar application.properties && \
sed -ie "s
#^message.broker.host=.*#message.broker.host=$RABBITMQ_HOST#
" application.properties && \
sed -ie "s
#^sure_tosca.base.path=.*#sure-tosca.base.path=$SURE_TOSCA_BASE_PATH#
" application.properties && \
cat application.properties && \
jar -uf
drip-
provisioner-3.0.0-jar-with-dependencies.jar application.properties && \
java -jar
drip-
provisioner-3.0.0-jar-with-dependencies.jar
jar -uf provisioner-3.0.0-jar-with-dependencies.jar application.properties && \
java -jar provisioner-3.0.0-jar-with-dependencies.jar
simple_start_dockers.sh
deleted
100755 → 0
View file @
655ee3e4
#!/bin/bash
sudo
docker stop
$(
sudo
docker ps
-q
)
sudo
docker start mongo-inst
sleep
2
sudo
docker start some-rabbit
sleep
2
sudo
docker run
-d
alogo53/sure-tosca:3.0.0
sleep
6
sudo
docker run
-e
MONGO_HOST
=
172.17.0.2
-e
RABBITMQ_HOST
=
172.17.0.3
-e
SURE_TOSCA_BASE_PATH
=
'http\:\/\/172.17.0.4\/8081\/tosca-sure\/1.0.0\/'
-p
8085:8080
-d
alogo53/drip-manager:3.0.0
sudo
docker run
-e
RABBITMQ_HOST
=
172.17.0.3
-e
SURE_TOSCA_BASE_PATH
=
'http\:\/\/172.17.0.4\/8081\/tosca-sure\/1.0.0\/'
-d
alogo53/drip-planner:3.0.0
sudo
docker run
-e
RABBITMQ_HOST
=
172.17.0.3
-e
SURE_TOSCA_BASE_PATH
=
'http\:\/\/172.17.0.4\/8081\/tosca-sure\/1.0.0\/'
-d
alogo53/drip-provisioner:3.0.0
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