Hot Software Config Dependencies
Two or more software configs defined in hot, if they are hosted on same server, the sequence in config set can be used to handle their dependencies. This blueprint is for cross server dependencies handling.
Send signal and receive signal mechanism will be introduced, key points:
1. One wait Condition generated,
2. One wait condition handle generated,
3. Send signal via cfn-signal,
4. Receive signal via cfn-get-metadata -r WaitConditionHandle
5. For software config B depends on software config A:
Send signal when a software A config done, wait signal when a software B config begin,
6. Send signal when the last software configuration done.
7. Wait condition count is same with the software config number
8. Make sure wait condition handle created first and wait condition created last
Send signal and receive signal via native in instance tools.
Blueprint information
- Status:
- Complete
- Approver:
- Steven Hardy
- Priority:
- Undefined
- Drafter:
- JunJie Nan
- Direction:
- Needs approval
- Assignee:
- JunJie Nan
- Definition:
- Obsolete
- Series goal:
- None
- Implementation:
- Good progress
- Milestone target:
- None
- Started by
- JunJie Nan
- Completed by
- Steve Baker
Related branches
Related bugs
Sprints
Whiteboard
Discussion at: https:/
-----DEPRECATED
A software component, for example:
...
components:
config_mysql:
type: OS::Heat:
properties:
- dbname: wordpress
scripts:
init: /tmp/config_
files:
- target: /tmp/config_
source:http://
requires:
hosted_on: mysql
config_wordpress:
type: OS::Heat:
properties:
- dbname: wordpress
scripts:
init: /tmp/config_
files:
- target: /tmp/config_
source:http://
requires:
hosted_on: wordpress
depends_on: config_mysql
resources:
wordpress:
type: AWS::EC2::Instance
mysql:
type: AWS::EC2::Instance
...
will be translated into(in yaml format):
...
Resources:
wordpress:
Type: AWS::EC2::Instance
DependsOn: mysql
Metadata:
AWS:
configSets:
default: [config_mysql, config_wordpress]
commands:
config:
env:
- dbname: wordpress
- while true; do
- cfn-get-template -r WaitHandle -s StackName --credential-file /etc/cfn/
- read signal.txt and check
- if get it, break
- sleep 10;
- done
...
- |
mode: '000400'
commands:
config:
env:
- dbname: wordpress
- chmod u+x /tmp/config_
- /tmp/config_
- cfn-signal to complete stack creation
- /tmp/config_
UserData:
......
mysql:
Type: AWS::EC2::Instance
Metadata:
AWS:
configSets:
default: [config_mysql]
commands:
config:
env:
- dbname: wordpress
- chmod u+x /tmp/config_
- /tmp/config_
- cfn-signal ...
- /tmp/config_
UserData:
......
CfnUser:
Type: 'AWS::IAM::User'
DependsOn:
ServerKeys:
Type: 'AWS::IAM:
DependsOn:
Properties:
UserName:
Ref: CfnUser
WaitHandle
Type: 'AWS::CloudForm
WaitCondition:
Type: 'AWS::CloudForm
DependsOn: wordpress
Properties:
Handle: {Ref: WaitHandle}
Count: '2'
Timeout: '600'
...
More software configs will be translated into more configSets and added into default.
Gerrit topic: https:/
Addressed by: https:/
Handle cross instance depends on
(stevebaker) I think blueprint hot-software-config covers this. It is not obvious yet that this blueprint is a standalone task, it might be too integrated with core hot-software-config to break out into its own blueprint.