Skip to content
Snippets Groups Projects
Commit 0166b2c8 authored by Radim Peša's avatar Radim Peša
Browse files

Cleaning

parent 89d4146a
No related branches found
No related tags found
No related merge requests found
# Simple Scipion
# Simple Scipion
Based on https://github.com/vholer/cloudify-occi-puppet-example .
......@@ -55,7 +55,7 @@ inputs:
type: string
# Application params
db_name:
db_name:
type: string
db_user:
type: string
......
############################################
# OCCI authentication options
occi_endpoint: 'https://carach5.ics.muni.cz:11443'
occi_auth: 'x509'
occi_username: ''
occi_password: ''
occi_user_cred: '/tmp/x509up_u0'
occi_ca_path: ''
occi_voms: True
############################################
# Contextualization
# remote user
cc_username: 'cfy'
# SSH public key
cc_public_key: 'ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDAlSZkpfTom8YoUNVpKPhFZz+mBSiX4Lzq5S9siS5mSkJ5JQ7ayscwBPSNJ7HRK2C1uNhX2AGfUlwOeATo9NUUJMzLxoOwfisros+5KtNYQl4GhfJeSEcglsrAe7oTPXGIFU+4RQLV0Wlq576Yei2wnBWXEVnQVfaSUzAwW+Jhqby/fNF2kUigavuM/RUsAlQk8XqkGtztyzxEutnIz4WjDZvEmbtece5nWnkEBzy7aKc+U5OcYGcBObdN6+zD3Mi5SzlI6UV6JKU+Hx65A70zSHnnuo/IGb1zlgH9kND2bA2mxQm4YbE96TfJlTbR0NtlV6xglBLm2L5yToY6MZZP root@localhost.localdomain
'
# SSH private key (filename or inline)
# TODO: better dettect CFM path
cc_private_key_filename: 'resources/ssh/id_rsa'
# Instance template/sizing
os_tpl: 'uuid_enmr_centos_7_fedcloud_warg_152'
#os_tpl: 'uuid_egi_centos_7_fedcloud_warg_149'
#os_tpl: 'uuid_egi_ubuntu_server_16_04_lts_fedcloud_warg_178'
#resource_tpl: 'small'
#resource_tpl: 'extra_large'
resource_tpl: 'mammoth'
############################################
# Application
db_name: myappdb
db_user: myapp
db_password: mypassword
# vim: set syntax=yaml
......@@ -55,14 +55,6 @@ inputs:
resource_tpl:
type: string
# Application params
db_name:
type: string
db_user:
type: string
db_password:
type: string
dsl_definitions:
occi_configuration: &occi_configuration
endpoint: { get_input: occi_endpoint }
......@@ -93,7 +85,7 @@ dsl_definitions:
download: resources/puppet.tar.gz
node_templates:
webNode:
scipionNode:
type: _NODE_SERVER_
properties:
name: 'Cloudify example web node'
......@@ -105,70 +97,31 @@ node_templates:
occi_config: *occi_configuration
fabric_env:
<<: *fabric_env
host_string: { get_attribute: [webNode, ip] } # req. by relationship ref.
host_string: { get_attribute: [scipionNode, ip] } # req. by relationship ref.
dbNode:
type: _NODE_SERVER_
properties:
name: 'Cloudify example db. node'
resource_config:
os_tpl: { get_input: os_tpl }
resource_tpl: { get_input: resource_tpl }
agent_config: *agent_configuration
cloud_config: *cloud_configuration
occi_config: *occi_configuration
fabric_env:
<<: *fabric_env
host_string: { get_attribute: [dbNode, ip] } # req. by relationship ref.
apacik:
scipion:
type: _NODE_WEBSERVER_
instances:
deploy: 1
properties:
fabric_env:
<<: *fabric_env
host_string: { get_attribute: [webNode, ip] }
puppet_config:
<<: *puppet_config
manifests:
start: manifests/apache.pp
relationships:
- type: cloudify.relationships.contained_in
target: webNode
- type: example.relationships.puppet.connected_to
target: db
target_interfaces:
cloudify.interfaces.relationship_lifecycle:
postconfigure:
inputs:
manifest: manifests/db.pp
db:
type: _NODE_DBMS_
properties:
fabric_env:
<<: *fabric_env
host_string: { get_attribute: [dbNode, ip] }
host_string: { get_attribute: [scipionNode, ip] }
puppet_config:
<<: *puppet_config
manifests:
start: manifests/db.pp
hiera:
mydb::name: { get_input: db_name }
mydb::user: { get_input: db_user }
mydb::password: { get_input: db_password}
postgresql::server::listen_addresses: '*'
postgresql::server::ipv4acls:
- 'host all all 0.0.0.0/0 md5'
start: manifests/scipion.pp
relationships:
- type: cloudify.relationships.contained_in
target: dbNode
target: scipionNode
outputs:
endpoint:
description: Web application endpoint
value:
url: { concat: ['http://', { get_attribute: [webNode, ip] }] }
url: { concat: ['http://', { get_attribute: [scipionNode, ip] }] }
# vim: set syntax=yaml
......@@ -5,7 +5,7 @@ occi_endpoint: 'https://carach5.ics.muni.cz:11443'
occi_auth: 'x509'
occi_username: ''
occi_password: ''
occi_user_cred: '/tmp/x509up_u1000'
occi_user_cred: '/tmp/x509up_u0'
occi_ca_path: ''
occi_voms: True
......@@ -24,15 +24,9 @@ cc_public_key: 'include(`resources/ssh/id_rsa.pub')'
cc_private_key_filename: 'ifdef(`_CFM_',`/opt/manager/resources/blueprints/_CFM_BLUEPRINT_/resources/ssh/id_rsa',`resources/ssh/id_rsa')'
# Instance template/sizing
os_tpl: 'uuid_egi_centos_7_fedcloud_warg_149'
resource_tpl: 'small'
############################################
# Application
db_name: myappdb
db_user: myapp
db_password: mypassword
#os_tpl: 'uuid_egi_centos_7_fedcloud_warg_149'
os_tpl: 'uuid_enmr_centos_7_fedcloud_warg_152'
#resource_tpl: 'small'
resource_tpl: 'extra_large'
# vim: set syntax=yaml
......@@ -25,7 +25,7 @@ package { ['openmpi-devel.x86_64','gsl-devel.x86_64','libX11.x86_64','gcc-gfortr
# Download binary version
wget::fetch { 'Download binary':
source => 'http://dior.ics.muni.cz/~cuda/scipion_web_bin.tgz',
destination =>'/tmp/',
destination =>'/opt/',
timeout => 0,
verbose => false,
before => Exec['unpack_scipion'],
......@@ -34,9 +34,9 @@ wget::fetch { 'Download binary':
#############################################################
# Extract binary version
exec {'unpack_scipion':
unless => '/usr/bin/test -f /tmp/scipion/scipion',
cwd => '/tmp',
command => 'tar xvzf /tmp/scipion_web_bin.tgz',
unless => '/usr/bin/test -f /opt/scipion-web/scipion',
cwd => '/opt',
command => 'tar xvzf /opt/scipion_web_bin.tgz',
path => '/bin/',
before => Exec['configure_o'],
}
......@@ -45,7 +45,7 @@ exec {'unpack_scipion':
# Configure Scipion --overwrite
exec {'configure_o':
command => 'python /tmp/scipion/scipion config --overwrite',
command => 'python /opt/scipion-web/scipion config --overwrite',
path => '/usr/bin/',
before => File_line['change mpi_libdir', 'change mpi_incdir','change mpi_bindir'],
}
......@@ -53,19 +53,19 @@ exec {'configure_o':
##############################################################
#Change scipion.conf
file_line { 'change mpi_libdir':
path => '/tmp/scipion/config/scipion.conf',
path => '/opt/scipion-web/config/scipion.conf',
line => 'MPI_LIBDIR = /usr/lib64/openmpi/lib',
match => '^MPI_LIBDIR',
}
file_line { 'change mpi_incdir':
path => '/tmp/scipion/config/scipion.conf',
path => '/opt/scipion-web/config/scipion.conf',
line => 'MPI_INCLUDE = /usr/include/openmpi-x86_64',
match => '^MPI_INCLUDE',
}
file_line { 'change mpi_bindir':
path => '/tmp/scipion/config/scipion.conf',
path => '/opt/scipion-web/config/scipion.conf',
line => 'MPI_BINDIR = /usr/lib64/openmpi/bin',
match => '^MPI_BINDIR',
before => Exec['configure'],
......@@ -75,7 +75,7 @@ file_line { 'change mpi_bindir':
# Configure Scipion
exec {'configure':
command => 'python /tmp/scipion/scipion config 2> /tmp/sciconf.log',
command => 'python /opt/scipion-web/scipion config 2> /tmp/sciconf.log',
path => '/usr/bin/',
user => 'cfy',
environment => 'HOME=/home/cfy',
......@@ -89,7 +89,7 @@ file { 'own_scipion':
ensure => directory,
owner => 'cfy',
group => 'cfy',
path => '/tmp/scipion',
path => '/opt/scipion-web',
recurse => true,
before => File['create_service'],
}
......@@ -110,18 +110,16 @@ file { 'create_service':
file { 'delete_binary':
ensure => absent,
path => '/tmp/scipion_web_bin.tgz',
before => Exec['RWebserver'],
path => '/opt/scipion_web_bin.tgz',
# before => Exec['RWebserver'],
}
##############################################################
#run server
exec {'RWebserver':
command => 'python /tmp/scipion/scipion webserver 2> /tmp/scipion.log',
path => '/usr/bin/',
user => 'cfy',
environment => 'HOME=/home/cfy',
}
#exec {'RWebserver':
# command => 'python /opt/scipion-web/scipion webserver 2> /tmp/scipion.log',
# path => '/usr/bin/',
# user => 'cfy',
# environment => 'HOME=/home/cfy',
#}
-----BEGIN RSA PRIVATE KEY-----
MIIEpAIBAAKCAQEAwJUmZKX06JvGKFDVaSj4RWc/pgUol+C86uUvbI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4KB92m810GDMWPOLFMd9H67f20o02GbfaRZXdsm5j3gxxuXRT
Sx7BBBq857L8cyrhhdOgUpj9VbnfXix1rjWrkshQxs7c9Fk1uBeXKGcjaGCdGKE6
n/SU5I4ptYDJRzKh03BanmUCgYEAtrYPvUKnLg1ioy3g7hXh5rHgLNRh7abrre6F
DsE0bf9c4369fWFSpqBFZ+oZAU5PaFGaH+1PD5slJgj4dzeI1ij95paz20tsr76Z
b0YK3Gwcg+x0XumzQqC1+3FcUHLEF7me98+QIgbzQtvhtTxsVi7bJ6uAcPmW4grs
6o5jisECgYACbqHZVidQnhPX5VK3eGgeW1JJVeIvXCBsVziGREcMFh3Ar399VfES
S7JwvnvKrBRnTcbuXvTfrsBO7t6S2XiKrmUGGyD6kJZ6EMhiRoFj+40vKjSN0y7n
Tn0xzzXz+15cULz+gZuaIOPZA566cf0W9kVIE3zf/IX6RCjJXX9uoQ==
-----END RSA PRIVATE KEY-----
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDAlSZkpfTom8YoUNVpKPhFZz+mBSiX4Lzq5S9siS5mSkJ5JQ7ayscwBPSNJ7HRK2C1uNhX2AGfUlwOeATo9NUUJMzLxoOwfisros+5KtNYQl4GhfJeSEcglsrAe7oTPXGIFU+4RQLV0Wlq576Yei2wnBWXEVnQVfaSUzAwW+Jhqby/fNF2kUigavuM/RUsAlQk8XqkGtztyzxEutnIz4WjDZvEmbtece5nWnkEBzy7aKc+U5OcYGcBObdN6+zD3Mi5SzlI6UV6JKU+Hx65A70zSHnnuo/IGb1zlgH9kND2bA2mxQm4YbE96TfJlTbR0NtlV6xglBLm2L5yToY6MZZP root@localhost.localdomain
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment