- Notifications
You must be signed in to change notification settings - Fork 89
Compare Models #601
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Compare Models #601
Changes from 1 commit
Commits
Show all changes
56 commits Select commit Hold shift + click to select a range
bf23126 add support of model diff tool
8eefe36 Merge branch 'master' into model_diff
a9b50f1 update parameter
1cda1de Fix various delete problem
9bf66f0 add message properties and command file for windows
1c4b54f update exception
15db52b add topology section
a720e77 Merge branch 'master' into model_diff
5c84886 merge from master
9d7ab02 grab from master
009d666 fix script name
767398b Fix command line parameter
356b197 Fix merging problems
586e03f correct spellings
a86b642 Experiment to use alias tree to figure out folder or attribute
96364f0 add validation
6c5751c add message for validation
fe911e6 Use alias methods to check for folder or attributes
a383a5c use for loop to prevent infinite loop
1903478 correct logic
e549d31 update method and add CompareException
e5b36ed copyrights update
98a42fd change wordings
81bf16a removed operator specific logic
7ed9eeb Add documentations
f412d72 Fix file writing issues
8574498 Fix file writing for results
a76b31b remove unused var
7f39a51 add support of variable substitution
4e60c98 update doc
8749ba6 fix script error
402487f update wordings and script
088c208 handle deleting top level tree
63eac89 fix code error
5ba6071 Add unit test for model diff
3b51492 Add parsing to catch error
d38ad40 Add translate error check
40c4e47 Add more tests for model_diff
22f25db Add CreateException
15d27a1 minor refactor
fe0584a update exception handling
d68eee5 update exception in test
49f1521 change to use true or false for dictionary check
c99fd03 update doc
7d285ad rename model_diff to compare_model
9fd4957 renamed file and update test
9c15a87 change test to use new temporary directory each time
b68e3dd update unit test
e87e991 doc updates
5087ee8 doc edit
8fd738c adding messages for identical model
ed093a1 doc update
860ec84 doc update
41e4f9d Merge branch 'master' into model_diff
ddsharpe 1020256 Merge branch 'master' into model_diff
ddsharpe 7fb4eea Merge branch 'master' into model_diff
ddsharpe File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Add documentations
- Loading branch information
There are no files selected for viewing
This file contains hidden or 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
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,284 @@ | ||
| ## The Compare Model Tool | ||
| | ||
| When working with a domain model, sometimes it is useful to know the differences between the model used in previous deployment and a new proposed deployment. | ||
| | ||
| The compare model tool compare the two fully resolved models, the new against the old and generate a model that shows only the difference between the two. | ||
| | ||
| To use the Compare Model Tool, simply run the `compareModel` shell script with the correct arguments. To see the list of valid arguments for any tool in the Oracle WebLogic Server Deploy Tooling installation, simply run the shell script with the `-help` option (or with no arguments) to see the shell script usage information. | ||
| | ||
| For example, comparing the following models. | ||
| | ||
| New Model | ||
| | ||
| ```yaml | ||
| domainInfo: | ||
| AdminUserName: 'weblogic' | ||
| AdminPassword: 'welcome2' | ||
| ServerStartMode: 'prod' | ||
| topology: | ||
| Name: domain1 | ||
| AdminServerName: "admin-server" | ||
| SecurityConfiguration: | ||
| NodeManagerUsername : 'weblogic' | ||
| NodeManagerPasswordEncrypted : 'welcome1' | ||
| Cluster: | ||
| "cluster-1": | ||
| DynamicServers: | ||
| ServerTemplate: "cluster-1-template" | ||
| ServerNamePrefix: "managed-server" | ||
| DynamicClusterSize: 5 | ||
| MaxDynamicClusterSize: 5 | ||
| CalculatedListenPorts: false | ||
| "cluster-2": | ||
| DynamicServers: | ||
| ServerTemplate: "cluster-2-template" | ||
| ServerNamePrefix: "managed-server" | ||
| DynamicClusterSize: 2 | ||
| MaxDynamicClusterSize: 3 | ||
| CalculatedListenPorts: false | ||
| Server: | ||
| "admin-server": | ||
| ListenPort: 10011 | ||
| ServerTemplate: | ||
| "cluster-1-template": | ||
| Cluster: "cluster-1" | ||
| ListenPort : '5001' | ||
| JTAMigratableTarget: | ||
| StrictOwnershipCheck: true | ||
| Cluster: "cluster-1" | ||
| "cluster-2-template": | ||
| Cluster: "cluster-2" | ||
| ListenPort : '8001' | ||
| ServerStart: | ||
| Arguments: ['-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=6006'] | ||
| JTAMigratableTarget: | ||
| StrictOwnershipCheck: true | ||
| Cluster: "cluster-2" | ||
| appDeployments: | ||
| Application: | ||
| myear: | ||
| SourcePath: /home/johnny/dimtemp23/sample_app_stage/wlsdeploy/applications/sample_app.ear | ||
| Target: ['cluster-2','cluster-1'] | ||
| yourear: | ||
| SourcePath: /home/johnny/dimtemp23/sample_app_stage/wlsdeploy/applications/sample_app2.ear | ||
| ModuleType: ear | ||
| Target: ['cluster-2','cluster-1'] | ||
| resources: | ||
| JMSServer: | ||
| JMSServer1: | ||
| Target: m1 | ||
| JMSServer2: | ||
| Target: m2 | ||
| JMSSystemResource: | ||
| MyJmsModule: | ||
| Target: mycluster | ||
| SubDeployment: | ||
| JMSServer1Subdeployment: | ||
| Target: JMSServer1 | ||
| JMSServer2Subdeployment: | ||
| Target: JMSServer2 | ||
| JmsResource: | ||
| ConnectionFactory: | ||
| WebAppConnectionFactory: | ||
| DefaultTargetingEnabled: true | ||
| JNDIName: jms/WebCF | ||
| ClientParams: | ||
| AllowCloseInOnMessage: true | ||
| MessagesMaximum: 1 | ||
| DefaultDeliveryParams: | ||
| DefaultTimeToDeliver: 3 | ||
| DefaultTimeToLive: 3600 | ||
| FlowControlParams: | ||
| FlowControlEnabled: false | ||
| LoadBalancingParams: | ||
| LoadBalancingEnabled: false | ||
| SecurityParams: | ||
| AttachJMSXUserId: true | ||
| TransactionParams: | ||
| XAConnectionFactoryEnabled: true | ||
| UniformDistributedQueue: | ||
| MyUniformDistributedQueue: | ||
| DefaultTargetingEnabled: true | ||
| JNDIName: jms/myUDQ | ||
| ``` | ||
| | ||
| Old Model | ||
| | ||
| ```yaml | ||
| domainInfo: | ||
| AdminUserName: 'weblogic' | ||
| AdminPassword: 'welcome2' | ||
| ServerStartMode: 'prod' | ||
| topology: | ||
| Name: domain1 | ||
| AdminServerName: "admin-server" | ||
| SecurityConfiguration: | ||
| NodeManagerUsername : 'weblogic' | ||
| NodeManagerPasswordEncrypted : 'welcome1' | ||
| Cluster: | ||
| "cluster-1": | ||
| DynamicServers: | ||
| ServerTemplate: "cluster-1-template" | ||
| ServerNamePrefix: "managed-server" | ||
| DynamicClusterSize: 5 | ||
| MaxDynamicClusterSize: 5 | ||
| CalculatedListenPorts: false | ||
| Server: | ||
| "admin-server": | ||
| ListenPort: 10011 | ||
| ServerTemplate: | ||
| "cluster-1-template": | ||
| Cluster: "cluster-1" | ||
| ListenPort : '5001' | ||
| ServerStart: | ||
| Arguments: ['-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=6006'] | ||
| JTAMigratableTarget: | ||
| StrictOwnershipCheck: true | ||
| Cluster: "cluster-1" | ||
| appDeployments: | ||
| Application: | ||
| myear: | ||
| SourcePath: /home/johnny/dimtemp23/sample_app_stage/wlsdeploy/applications/sample_app.ear | ||
| ModuleType: ear | ||
| Target: ['cluster-1','cluster-2'] | ||
| myear2: | ||
| SourcePath: /home/johnny/dimtemp23/sample_app_stage/wlsdeploy/applications/sample_app2.ear | ||
| ModuleType: ear | ||
| Target: ['cluster-1','cluster-2'] | ||
| resources: | ||
| WebAppContainer: | ||
| WAPEnabled: '@@PROP:WAPENABLED@@' | ||
| FilterDispatchedRequestsEnabled: true | ||
| AllowAllRoles: true | ||
| XPoweredByHeaderLevel: NONE | ||
| ServletAuthenticationFormURL: true | ||
| ServletReloadCheckSecs: 1 | ||
| ChangeSessionIDOnAuthentication: true | ||
| MimeMappingFile: wlsdeploy/config/amimemappings.properties | ||
| AuthCookieEnabled: true | ||
| WorkContextPropagationEnabled: true | ||
| ReloginEnabled: true | ||
| GzipCompression: | ||
| GzipCompressionContentType: [ text/html, text/xml, text/plain ] | ||
| GzipCompressionEnabled: true | ||
| JMSServer: | ||
| JMSServer1: | ||
| Target: m1 | ||
| JMSServer2: | ||
| Target: m2 | ||
| JMSSystemResource: | ||
| MyJmsModule: | ||
| Target: mycluster | ||
| SubDeployment: | ||
| JMSServer1Subdeployment: | ||
| Target: JMSServer1 | ||
| JMSServer2Subdeployment: | ||
| Target: JMSServer2 | ||
| JmsResource: | ||
| ConnectionFactory: | ||
| WebAppConnectionFactory: | ||
| DefaultTargetingEnabled: true | ||
| JNDIName: jms/WebCF | ||
| ClientParams: | ||
| AllowCloseInOnMessage: true | ||
| MessagesMaximum: 1 | ||
| DefaultDeliveryParams: | ||
| DefaultTimeToDeliver: 3 | ||
| DefaultTimeToLive: 3600 | ||
| FlowControlParams: | ||
| FlowControlEnabled: false | ||
| LoadBalancingParams: | ||
| LoadBalancingEnabled: false | ||
| SecurityParams: | ||
| AttachJMSXUserId: true | ||
| TransactionParams: | ||
| XAConnectionFactoryEnabled: true | ||
| MDBConnectionFactory: | ||
| DefaultTargetingEnabled: true | ||
| JNDIName: jms/mdbCF | ||
| TransactionParams: | ||
| XAConnectionFactoryEnabled: true | ||
| UniformDistributedQueue: | ||
| MyUniformDistributedQueue: | ||
| DefaultTargetingEnabled: true | ||
| JNDIName: jms/myUDQ | ||
| ResetDeliveryCountOnForward: true | ||
| ``` | ||
| To compare the two model files, run the tool as follows: | ||
| | ||
| weblogic-deploy\bin\compareModel.cmd -oracle_home c:\wls12213 new_model.yaml old_model.yaml | ||
| | ||
| The output of the tool will look something like this: | ||
| | ||
| ``` | ||
| Comparing Models: new=/tmp/model2.yaml vs old=/tmp/model1.yaml | ||
| | ||
| Differences between new model and old model: | ||
| | ||
| resources: | ||
| JMSSystemResource: | ||
| MyJmsModule: | ||
| JmsResource: | ||
| ConnectionFactory: | ||
| '!MDBConnectionFactory': | ||
| '!WebAppContainer': | ||
| appDeployments: | ||
| Application: | ||
| '!myear2': | ||
| yourear: | ||
| SourcePath: /home/johnny/dimtemp23/sample_app_stage/wlsdeploy/applications/sample_app2.ear | ||
| ModuleType: ear | ||
| Target: [ 'cluster-2', 'cluster-1' ] | ||
| myear: | ||
| Target: [ 'cluster-2', 'cluster-1' ] | ||
| topology: | ||
| ServerTemplate: | ||
| 'cluster-1-template': | ||
| '!ServerStart': | ||
| 'cluster-2-template': | ||
| Cluster: 'cluster-2' | ||
| ListenPort: 8001 | ||
| ServerStart: | ||
| Arguments: [ '-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=6006' ] | ||
| JTAMigratableTarget: | ||
| StrictOwnershipCheck: True | ||
| Cluster: 'cluster-2' | ||
| Cluster: | ||
| 'cluster-2': | ||
| DynamicServers: | ||
| ServerTemplate: 'cluster-2-template' | ||
| ServerNamePrefix: 'managed-server' | ||
| DynamicClusterSize: 2 | ||
| MaxDynamicClusterSize: 3 | ||
| CalculatedListenPorts: False | ||
| | ||
| | ||
| 1. Model Path: resources-->JMSSystemResource-->MyJmsModule-->JmsResource-->UniformDistributedQueue-->MyUniformDistributedQueue-->ResetDeliveryCountOnForward does not exist in new model but exists in previous model | ||
| | ||
| 2. Model Path: appDeployments-->Application-->myear-->ModuleType does not exist in new model but exists in previous model | ||
| | ||
| ``` | ||
| | ||
| Comparing the new and old models: | ||
| | ||
| 1. Added 'cluster-2' and 'cluster-2-template' in the topology section | ||
| ||
| 2. Removed 'ServerStart' of 'cluster-1-template' in the topology section | ||
| 3. Deployed two application 'yourear' and 'myear' but removed application 'myear' | ||
| 4. Removed 'MDBConnectionFactory' from the `MyJmsModule` JMS Module | ||
| 5. Removed 'WebAppContainer' from the resource section | ||
| 6. Removed the attribute 'ResetDeliveryCountOnForward' from 'MyUniformDistributedQueue' | ||
| 7. Changed deployment targets for application `myear` | ||
| 8. Removed the attribute 'ModuleType' for application `myear` | ||
| | ||
| Note: The `!` is a notation fo deletion of a non-attribute element from the model and any missing attribute will not | ||
| be omitted from the model but shown at the end as `info` level messages. | ||
| | ||
| To compare the two model files and generate the output to files, run the tool as follows: | ||
| | ||
| weblogic-deploy\bin\compareModel.cmd -oracle_home c:\wls12213 -output_dir c:\cm-output ew_model.yaml old_model.yaml | ||
| | ||
| The following files will be written to the directory: | ||
| | ||
| diffed_model.json | ||
| diffed_model.yaml | ||
| model_diff_stdout | ||
Add this suggestion to a batch that can be applied as a single commit. This suggestion is invalid because no changes were made to the code. Suggestions cannot be applied while the pull request is closed. Suggestions cannot be applied while viewing a subset of changes. Only one suggestion per line can be applied in a batch. Add this suggestion to a batch that can be applied as a single commit. Applying suggestions on deleted lines is not supported. You must change the existing code in this line in order to create a valid suggestion. Outdated suggestions cannot be applied. This suggestion has been applied or marked resolved. Suggestions cannot be applied from pending reviews. Suggestions cannot be applied on multi-line comments. Suggestions cannot be applied while the pull request is queued to merge. Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggested rewording of this sentence, "To see the list of valid arguments, simply run the shell script with the
-helpoption (or with no arguments), which displays the shell script usage information."