Last active
December 25, 2015 01:59
-
-
Save jollyrojer/6899098 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
application: | |
configuration: | |
input.stats-user: admin | |
input.stats-pass: pa55w0rd | |
input.stats-port: "1926" | |
input.stats-url: /admin?stats | |
interfaces: | |
input: | |
stats-user: "bind(workflow#input.stats-user)" | |
stats-pass: "bind(workflow#input.stats-pass)" | |
stats-port: "bind(workflow#input.stats-port)" | |
stats-url: "bind(workflow#input.stats-url)" | |
lb-management: | |
add-server: "bind(workflow#actions.add-server)" | |
del-server: "bind(workflow#actions.del-server)" | |
output: | |
lb-host: "bind(workflow#result.lb-host)" | |
lb-url: "bind(workflow#result.lb-statistics-url)" | |
stats-user: "bind(workflow#result.stats-user)" | |
stats-pass: "bind(workflow#result.stats-pass)" | |
lb-stats: "bind(workflow#result.lb-stats)" | |
bindings: | |
- [workflow, wfService] | |
- [workflow, secureStore] | |
components: | |
wfService: | |
type: reference.Service | |
interfaces: | |
executor: | |
execute-workflow: receive-command(object request => object status => object status) | |
secureStore: | |
type: reference.Service | |
interfaces: | |
keypair-store: | |
get-keypair: receive-command(string id => object privateKey) | |
workflow: | |
type: workflow.Instance | |
interfaces: | |
input: | |
stats-user: configuration(string) | |
stats-pass: configuration(string) | |
stats-port: configuration(string) | |
stats-url: configuration(string) | |
actions: | |
add-server: receive-command(string app-host, string app-port , string lb-bucket ) | |
del-server: receive-command(string app-host, string app-port , string lb-bucket ) | |
result: | |
lb-stats: publish-signal(object) | |
# for ui | |
lb-host: publish-signal(string) | |
lb-statistics-url: publish-signal(string) | |
stats-user: publish-signal(string) | |
stats-pass: publish-signal(string) | |
keypair-store: | |
get-keypair: send-command(string id => object privateKey) | |
required: [keypair-store] | |
configuration: | |
configuration.workflows: | |
launch: | |
parameters: | |
- stats-user: &stats-user | |
description: haproxy statistics user | |
- stats-pass: &stats-pass | |
description: haproxy statistics user pass | |
- stats-port: &stats-port | |
description: haproxy statistics port | |
- stats-url: &stats-url | |
description: haproxy statistics url | |
steps: | |
- provision-vm: | |
action: provisionAmazonVm | |
phase: provision | |
parameters: | |
roleName: default | |
hardwareId: m1.small | |
retryCount: 1 | |
jcloudsProvider: aws-ec2 | |
jcloudsEndpoint: https://ec2.us-east-1.amazonaws.com | |
jcloudsRegions: us-east-1 | |
jcloudsNodeNamePrefix: component | |
jcloudsIdentity: "{$.identity}" | |
jcloudsCredential: "{$.credential}" | |
vmIdentity: ubuntu | |
imageId: us-east-1/ami-e50b5d8c | |
ec2SecurityGroup: default | |
output: | |
lb-host: ips | |
- lb-install: | |
action: "chefsolo" | |
precedingPhases: [ provision ] | |
phase: lb-install | |
parameters: | |
roles: [ default ] | |
runList: ["recipe[haproxy]"] | |
recipeUrl: "https://s3.amazonaws.com/ab-comp/haproxy/cookbooks.tar.gz" | |
jattrs: | |
haproxy: | |
stats_user: "{$.stats-user}" | |
stats_pass: "{$.stats-pass}" | |
stats_port: "{$.stats-port}" | |
stats_url: "{$.stats-url}" | |
return: | |
lb-stats: | |
value: | |
lb-host: "{$.lb-host}" | |
lb-statistics-url: "https://{$.lb-host}:{$.stats-port}{$.stats-url}" | |
stats-user: "{$.stats-user}" | |
stats-pass: "{$.stats-pass}" | |
add-server: | |
parameters: | |
- app-server: | |
description: "server:port add to lb" | |
- lb-bucket: | |
description: "lb bucket (proto://lb-type:port)for app-server" | |
steps: | |
- add-server: | |
action: "chefsolo" | |
parameters: | |
roles: [ default ] | |
runList: [ "recipe[haproxy::add_server]" ] | |
recipeUrl: "https://s3.amazonaws.com/ab-comp/haproxy/cookbooks.tar.gz" | |
jattrs: | |
haproxy: | |
server: "{$.app-host}:{$.app-port}" | |
bucket: "{$.lb-bucket}" | |
del-server: | |
parameters: | |
- app-server: | |
description: "server:port add to lb" | |
- lb-bucket: | |
description: "lb bucket (proto://lb-type:port)for app-server" | |
steps: | |
- del-server: | |
action: "chefsolo" | |
parameters: | |
roles: [ default ] | |
runList: [ "recipe[haproxy::del_server]" ] | |
recipeUrl: "https://s3.amazonaws.com/ab-comp/haproxy/cookbooks.tar.gz" | |
jattrs: | |
haproxy: | |
server: "{$.app-host}:{$.app-port}" | |
bucket: "{$.lb-bucket}" | |
destroy: | |
steps: | |
- destroy: | |
action: undeployEnv |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
application: | |
configuration: | |
input.db-name: petclinic | |
input.lb-bucket: http://roundrobin:80 | |
input.git-fork: qubell | |
input.git-branch: HEAD #red, master | |
bindings: | |
- [main.workflow, db] | |
- [main.workflow, app] | |
- [main.workflow, lb] | |
interfaces: | |
input: | |
db-name: "bind(main.workflow#input.db-name)" | |
git-fork: "bind(main.workflow#input.git-app-fork)" | |
git-branch: "bind(main.workflow#input.git-app-branch)" | |
lb-bucket: "bind(main.workflow#input.lb-bucket)" | |
components: | |
main: | |
bindings: | |
- [wfService, workflow] | |
components: | |
wfService: | |
type: reference.Service | |
interfaces: | |
executor: | |
execute-workflow: receive-command(object request => object status => object status) | |
workflow: | |
type: workflow.Instance | |
#todo: think on env properties | |
#configuration: | |
# input.db-sql-url: "" #const | |
# input.db-user: petclinic #const | |
# input.db-password: petclinic #const | |
# input.privileges: "" #const | |
# input.stats-user: admin | |
# input.stats-pass: pa55w0rd | |
# input.stats-port: "1926" | |
# input.stats-url: /admin?stats | |
interfaces: | |
input: | |
db-name: configuration(string) | |
git-app-fork: configuration(string) | |
git-app-branch: configuration(string) | |
lb-bucket: configuration(string) | |
#as constants | |
db-sql-url: configuration(string) | |
db-user: configuration(string) | |
db-password: configuration(string) | |
privileges: configuration(string) | |
lbstats-stats-user: configuration(string) | |
lbstats-stats-pass: configuration(string) | |
lbstats-stats-port: configuration(string) | |
lbstats-stats-url: configuration(string) | |
db-info: | |
dbms: consume-signal(object) | |
db-manage: | |
create-db: send-command(string db-name => object db) | |
change-grants: send-command(list<string> app-hosts, object db, object user, string privileges) | |
run-sql: send-command(object db, string sql-url) | |
app-manage: | |
deploy-app: send-command(string git-app-fork, string git-app-branch) | |
configure-dbconnection: send-command(string db-host, string db-port, string db-name, string db-user, string db-pass) | |
app-output: | |
app-host: consume-signal(list<string>) | |
app-port: consume-signal(string) | |
lb-manage: | |
add-server: send-command(string app-server, string lb-bucket) | |
required: [db-manage, app-manage, lb-manage] | |
configuration: | |
input.db-sql-url: "" #const | |
input.db-user: petclinic #const | |
input.db-password: petclinic #const | |
input.privileges: "" #const | |
input.lbstats-stats-user: admin | |
input.lbstats-stats-pass: pa55w0rd | |
input.lbstats-stats-port: "1926" | |
input.lbstats-stats-url: /admin?stats | |
configuration.triggers: {} | |
configuration.workflows: | |
launch: | |
parameters: | |
- db-name: | |
description: primary db name | |
- db-sql-url: &db-sql | |
description: sql url | |
- db-user: &db-user | |
description: user for new database | |
- db-password: &db-password | |
description: user password for new database | |
- priveleges: &priveleges | |
description: user priveleges for new database | |
- git-app-fork: &git-app-fork | |
description: git fork | |
- git-app-branch: &git-app-branch | |
description: git branch | |
- lbstats-stats-user: &lbstats-stats-user | |
description: lb statistic user | |
- lbstats-stats-pass: &lbstats-stats-pass | |
description: lb statistic user's password | |
- lbstats-stats-port: &lbstats-stats-port | |
description: lb statistic port | |
- lbstats-stats-url: &lbstats-stats-url | |
description: lb statistic's url | |
steps: | |
- create-db: | |
action: serviceCall | |
phase: create-db | |
parameters: | |
service: db-manage | |
command: create-db | |
arguments: | |
db-name: "{$.db-name}" | |
- grant-db: | |
action: serviceCall | |
precedingPhases: [ create-db ] | |
phase: grant-db | |
parameters: | |
service: db-manage | |
command: change-grants | |
arguments: | |
app-hosts: [] | |
db-name: "{$.db-name}" | |
db-user: "{$.db-user}" | |
db-pass: "{$.db-password}" | |
priveleges: "{$.privileges}" | |
- run-sql: | |
action: serviceCall | |
precedingPhases: [ grant-db ] | |
phase: run-sql | |
parameters: | |
service: db-manage | |
command: run-sql | |
arguments: | |
db-name: "{$.db-name}" | |
sql-url: "{$.db-sql}" | |
- deploy-app: | |
action: serviceCall | |
phase: deploy-app | |
parameters: | |
service: app-manage | |
command: deploy-app | |
arguments: | |
git-app-fork: "{$.git-app-fork}" | |
git-app-branch: "{$.git-app-branch}" | |
- get-env-props: | |
action: getEnvironmentProperties | |
phase: get-env-props | |
output: | |
props: result | |
- configure-dbconnection: | |
action: serviceCall | |
precedingPhases: [ get-env-props, deploy-app ] | |
phase: configure-dbconnection | |
parameters: | |
service: app-manage | |
command: configure-dbconnection | |
arguments: | |
db-host: "{$.props.db-info.dbms.host}" | |
db-port: "{$.props.db-info.dbms.port}" | |
db-name: "{$.db-name}" | |
db-user: "{$.db-user}" | |
db-pass: "{$.db-password}" | |
- lb-add-server: | |
action: serviceCall | |
precedingPhases: [ configure-dbconnection ] | |
phase: lb-add-server | |
parameters: | |
service: lb-manage | |
command: add-server | |
arguments: | |
app-server: "{$.props.app-output.app-host}:{$.props.app-output.app-port}" | |
lb-bucket: "http://roundrobin:80/" | |
#todo move lb-bucket to launch param | |
#todo: enpoint | |
destroy: | |
steps: [] | |
db: | |
type: reference.Submodule | |
configuration: | |
__locator.application-id: "524d3c35e4b0a49c99bce659" | |
interfaces: | |
input: | |
db-version: configuration(string) | |
db-root-password: configuration(string) | |
management: | |
create-db: receive-command(string db-name => object db) | |
change-grants: receive-command(list<string> app-hosts, object db, object user, string privileges) | |
run-sql: receive-command(object db, string sql-url) | |
output: | |
dbms: publish-signal(object) | |
app: | |
type: reference.Submodule | |
configuration: | |
__locator.application-id: "52541baae4b0d1f365e542ef" | |
interfaces: | |
management: | |
deploy-app: receive-command(string git-app-fork, string git-app-branch) | |
configure-dbconnection: receive-command(string db-host, string db-port, string db-name, string db-user, string db-pass) | |
output: | |
app-host: publish-signal(list<string>) | |
app-port: publish-signal(string) | |
lb: | |
type: reference.Submodule | |
configuration: | |
__locator.application-id: "52543586e4b0d1f365e5431b" | |
interfaces: | |
input: | |
stats-user: configuration(string) | |
stats-pass: configuration(string) | |
stats-port: configuration(string) | |
stats-url: configuration(string) | |
management: | |
add-server: receive-command(string app-server, string lb-bucket) | |
output: | |
lb-url: publish-signal(string) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
application: | |
configuration: | |
input.db-version: "5.0" | |
input.db-root-password: uR1zaebah0Qu | |
interfaces: | |
input: | |
db-version: "bind(workflow#input.db-version)" | |
db-root-password: "bind(workflow#input.db-root-password)" | |
management: | |
create-db: "bind(workflow#actions.create-db)" | |
run-sql: "bind(workflow#actions.run-sql)" | |
change-grants: "bind(workflow#actions.change-grants)" | |
#todo: set sql | |
nice-screen: | |
host: "bind(workflow#result.host)" | |
port: "bind(workflow#result.db-port)" | |
output: | |
dbms: "bind(workflow#result.dbms)" | |
bindings: | |
- [workflow, wfService] | |
- [workflow, secureStore] | |
components: | |
wfService: | |
type: reference.Service | |
interfaces: | |
executor: | |
execute-workflow: receive-command(object request => object status => object status) | |
secureStore: | |
type: reference.Service | |
interfaces: | |
keypair-store: | |
get-keypair: receive-command(string id => object privateKey) | |
workflow: | |
type: workflow.Instance | |
interfaces: | |
input: | |
db-version: configuration(string) | |
db-root-password: configuration(string) | |
actions: | |
create-db: receive-command(string db-name => object db) | |
run-sql: receive-command(object db, string sql-url) | |
change-grants: receive-command(list<string> app-hosts, object db, object user, string privileges) | |
result: | |
dbms: publish-signal(object) | |
#for ui only | |
db-port: publish-signal(string) | |
host: publish-signal(string) | |
keypair-store: | |
get-keypair: send-command(string id => object privateKey) | |
required: [keypair-store] | |
configuration: | |
configuration.workflows: | |
launch: | |
parameters: | |
- db-version: &db-version | |
description: MySQL Server version | |
- db-root-password: | |
description: Root Password | |
default: uR1zaebah0Qu | |
steps: | |
- provision-vm: | |
action: provisionAmazonVm | |
phase: provision | |
parameters: | |
roleName: default | |
hardwareId: m1.small | |
retryCount: 1 | |
jcloudsProvider: aws-ec2 | |
jcloudsEndpoint: https://ec2.us-east-1.amazonaws.com | |
jcloudsRegions: us-east-1 | |
jcloudsNodeNamePrefix: component | |
jcloudsIdentity: "{$.identity}" | |
jcloudsCredential: "{$.credential}" | |
vmIdentity: ubuntu | |
imageId: us-east-1/ami-0fac7566 | |
ec2SecurityGroup: default | |
output: | |
db-host: ips | |
- db-install: | |
action: "chefsolo" | |
precedingPhases: [ provision ] | |
phase: db-install | |
parameters: | |
roles: [ default ] | |
runList: ["recipe[mysql::server]"] | |
recipeUrl: "https://s3.amazonaws.com/ab-comp/mysql/cookbooks.tar.gz" | |
jattrs: | |
mysql: | |
server_root_password: "{$.db-root-password}" | |
server_repl_password: "{$.db-root-password}" | |
server_debian_password: "{$.db-root-password}" | |
return: | |
#jdbc: | |
# value: "mysql://{$.db-user}:{$.db-pass}@{$.db-host}:3306/{$.db-name}" | |
host: | |
value: "{$.db-host}" | |
db-port: | |
value: 3306 | |
#db-user: | |
# value: "{$.db-user}" | |
#db-pass: | |
# value: "{$.db-pass}" | |
#db-name: | |
# value: "{$.db-name}" | |
dbms: | |
value: | |
host: "{$.db-host}" | |
port: "3306" | |
root-password: "{$.db-root-password}" | |
create-db: | |
parameters: | |
- db-name: | |
description: Create database name | |
steps: | |
- db-deploy: | |
action: "chefsolo" | |
parameters: | |
roles: [ default ] | |
runList: [ "recipe[mysql-component::db_create]" ] | |
recipeUrl: "https://s3.amazonaws.com/ab-comp/mysql/cookbooks.tar.gz" | |
jattrs: | |
mysql: | |
server_root_password: "{$.db-root-password}" | |
mysql-component: | |
db_name: "{$.db-name}" | |
return: | |
db: | |
value: | |
name: "{$.db-name}" | |
run-sql: | |
parameters: | |
- db: | |
description: Database | |
- sql-url: | |
description: SQL query url | |
steps: | |
- db-deploy: | |
action: "chefsolo" | |
parameters: | |
roles: [ default ] | |
runList: [ "recipe[mysql-component::sql_query]" ] | |
recipeUrl: "https://s3.amazonaws.com/ab-comp/mysql/cookbooks.tar.gz" | |
jattrs: | |
mysql: | |
server_root_password: "{$.db-root-password}" | |
mysql-component: | |
db_name: "{$.db.name}" | |
sql_url: "{$.sql_url}" | |
change-grants: | |
parameters: | |
- app-hosts: | |
description: Host allow in MySQL | |
default: ["1.1.1.1", "2.2.2.2", "3.3.3.3"] | |
#- db-name: | |
# description: Grant access to database | |
#- db-user: | |
# description: Grant user | |
#- db-pass: | |
# description: "User's password" | |
- db: | |
description: "Database (json with name)" | |
- user: | |
description: "User (json with name and password)" | |
- privileges: | |
description: Grant priveleges | |
default: "" | |
steps: | |
- change-grants: | |
action: "chefsolo" | |
parameters: | |
roles: [ default ] | |
runList: [ "recipe[mysql-component:user_modify]" ] | |
recipeUrl: "https://s3.amazonaws.com/ab-comp/cookbooks.tar.gz" | |
jattrs: | |
mysql: | |
server_root_password: "{$.db-root-password}" | |
mysql-component: | |
#todo: allow processing hosts array | |
host: "%" | |
db_name: "{$.db.name}" | |
db_user: "{$.user.name}" | |
db_pass: "{$.user.password}" | |
priveleges: "{$.privileges}" | |
destroy: | |
steps: | |
- destroy: | |
action: undeployEnv |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
application: | |
interfaces: | |
management: | |
configure-dbconnection: "bind(workflow#actions.configure-dbconnection)" | |
deploy-app: "bind(workflow#actions.deploy-app)" | |
output: | |
app-host: "bind(workflow#result.app-host)" | |
app-port: "bind(workflow#result.app-port)" | |
bindings: | |
- [workflow, wfService] | |
- [workflow, secureStore] | |
components: | |
wfService: | |
type: reference.Service | |
interfaces: | |
executor: | |
execute-workflow: receive-command(object request => object status => object status) | |
secureStore: | |
type: reference.Service | |
interfaces: | |
keypair-store: | |
get-keypair: receive-command(string id => object privateKey) | |
workflow: | |
type: workflow.Instance | |
interfaces: | |
#input: | |
# app-fork: configuration(string) | |
# app-branch: configuration(string) | |
actions: | |
configure-dbconnection: receive-command(string db-host, string db-port, string db-name, string db-user, string db-pass) | |
deploy-app: receive-command(string git-app-fork, string git-app-branch) | |
result: | |
app-host: publish-signal(list<string>) | |
app-port: publish-signal(string) | |
keypair-store: | |
get-keypair: send-command(string id => object privateKey) | |
required: [keypair-store] | |
configuration: | |
configuration.workflows: | |
launch: | |
steps: | |
- provision-vm: | |
action: provisionAmazonVm | |
phase: provision | |
parameters: | |
roleName: default | |
hardwareId: m1.small | |
retryCount: 1 | |
jcloudsProvider: aws-ec2 | |
jcloudsEndpoint: https://ec2.us-east-1.amazonaws.com | |
jcloudsRegions: us-east-1 | |
jcloudsNodeNamePrefix: component | |
jcloudsIdentity: "{$.identity}" | |
jcloudsCredential: "{$.credential}" | |
vmIdentity: ubuntu | |
imageId: us-east-1/ami-0fac7566 | |
ec2SecurityGroup: default | |
output: | |
app-host: ips | |
- tomcat-install: | |
action: "chefsolo" | |
precedingPhases: [ provision ] | |
phase: tomcat-install | |
parameters: | |
roles: [ default ] | |
runList: ["recipe[apt]", "recipe[tomcat]"] | |
recipeUrl: "https://s3.amazonaws.com/ab-comp/tomcat/cookbooks.tar.gz" | |
jattrs: | |
java: | |
oracle: | |
accept_oracle_download_terms: true | |
install_flavor: oracle | |
return: | |
app-host: | |
value: "{$.app-host}" | |
app-port: | |
value: "8080" | |
deploy-app: | |
parameters: | |
- git-app-fork: | |
description: git source fork | |
- git-app-branch: | |
description: git source branch | |
steps: | |
- deploy-app: | |
action: "chefsolo" | |
precedingPhases: [ tomcat-install ] | |
phase: deploy-app | |
parameters: | |
roles: [ default ] | |
runList: [ "recipe[tomcat-component]" ] | |
recipeUrl: "https://s3.amazonaws.com/ab-comp/tomcat/cookbooks.tar.gz" | |
jattrs: | |
tomcat-component: | |
deploy: | |
git: | |
url: "git://github.com/{$.git-app-fork}/petclinic.git" | |
revision: "{$.git-app-branch}" | |
configure-dbconnection: | |
parameters: | |
- db-host: | |
description: DBMS host | |
- db-port: | |
description: DBMS port | |
- db-name: | |
description: DB name | |
- db-user: | |
description: DB user | |
- db-pass: | |
description: DB password | |
steps: | |
- configure-dbconnection: | |
action: "chefsolo" | |
parameters: | |
roles: [ default ] | |
runList: ["recipe[tomcat-component::configure-app]"] | |
recipeUrl: "https://s3.amazonaws.com/ab-comp/tomcat/cookbooks.tar.gz" | |
jattrs: | |
mysql: | |
host: "{$.db-host}" | |
port: "{$.db-port}" | |
db_name: "{$.db-name}" | |
db_user: "{$.db-user}" | |
db_pass: "{$.db-pass}" | |
destroy: | |
steps: | |
- destroy: | |
action: undeployEnv |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment