-
Notifications
You must be signed in to change notification settings - Fork 124
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
Faster amps install #1280
Merged
Merged
Faster amps install #1280
Changes from all commits
Commits
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
There are no files selected for viewing
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
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
64 changes: 64 additions & 0 deletions
64
marklogic-data-hub/src/main/resources/installer-util/install-amps.xqy
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
xquery version "1.0-ml"; | ||
|
||
import module namespace sec="http://marklogic.com/xdmp/security" | ||
at "/MarkLogic/security.xqy"; | ||
|
||
declare variable $modules-db-name := xdmp:database("data-hub-staging-MODULES"); | ||
|
||
sec:create-amp("", "addResponseHeader", "/data-hub/4/rest-api/lib/endpoint-util.sjs", $modules-db-name, ("rest-reader-internal")), | ||
sec:create-amp("http://marklogic.com/rest-api/lib/db-util", "access-config", "/data-hub/4/rest-api/lib/db-util.xqy", $modules-db-name, ("rest-reader-internal")), | ||
sec:create-amp("http://marklogic.com/rest-api/lib/db-util", "update-config", "/data-hub/4/rest-api/lib/db-util.xqy", $modules-db-name, ("rest-admin-internal")), | ||
sec:create-amp("http://marklogic.com/rest-api/lib/db-util", "rest-modules-database", "/data-hub/4/rest-api/lib/db-util.xqy", $modules-db-name, ("rest-admin-internal")), | ||
sec:create-amp("http://marklogic.com/rest-api/lib/db-util", "do-set-transaction-time-limit", "/data-hub/4/rest-api/lib/db-util.xqy", $modules-db-name, ("rest-writer-internal")), | ||
sec:create-amp("http://marklogic.com/rest-api/lib/endpoint-util", "add-cookie", "/data-hub/4/rest-api/lib/endpoint-util.xqy", $modules-db-name, ("rest-reader-internal")), | ||
sec:create-amp("http://marklogic.com/rest-api/lib/endpoint-util", "add-response-header", "/data-hub/4/rest-api/lib/endpoint-util.xqy", $modules-db-name, ("rest-reader-internal")), | ||
sec:create-amp("http://marklogic.com/rest-api/lib/endpoint-util", "default-page-with-transform", "/data-hub/4/rest-api/lib/endpoint-util.xqy", $modules-db-name, ("rest-reader-internal")), | ||
sec:create-amp("http://marklogic.com/rest-api/lib/endpoint-util", "delete-cookie", "/data-hub/4/rest-api/lib/endpoint-util.xqy", $modules-db-name, ("rest-reader-internal")), | ||
sec:create-amp("http://marklogic.com/rest-api/lib/endpoint-util", "get-mimetypes", "/data-hub/4/rest-api/lib/endpoint-util.xqy", $modules-db-name, ("rest-reader-internal")), | ||
sec:create-amp("http://marklogic.com/rest-api/lib/endpoint-util", "get-server-field", "/data-hub/4/rest-api/lib/endpoint-util.xqy", $modules-db-name, ("rest-reader-internal")), | ||
sec:create-amp("http://marklogic.com/rest-api/lib/endpoint-util", "invoke-module", "/data-hub/4/rest-api/lib/endpoint-util.xqy", $modules-db-name, ("rest-reader-internal")), | ||
sec:create-amp("http://marklogic.com/rest-api/lib/endpoint-util", "set-server-field", "/data-hub/4/rest-api/lib/endpoint-util.xqy", $modules-db-name, ("rest-reader-internal")), | ||
sec:create-amp("http://marklogic.com/rest-api/lib/endpoint-util", "xslt-invoke", "/data-hub/4/rest-api/lib/endpoint-util.xqy", $modules-db-name, ("rest-reader-internal")), | ||
sec:create-amp("http://marklogic.com/rest-api/lib/endpoint-util", "lookup-role-ids", "/data-hub/4/rest-api/lib/endpoint-util.xqy", $modules-db-name, ("rest-reader-internal")), | ||
sec:create-amp("http://marklogic.com/rest-api/models/document-model-common", "read-collections", "/data-hub/4/rest-api/models/document-model-common.xqy", $modules-db-name, ("rest-reader-internal")), | ||
sec:create-amp("http://marklogic.com/rest-api/models/document-model-common", "read-permissions", "/data-hub/4/rest-api/models/document-model-common.xqy", $modules-db-name, ("rest-reader-internal")), | ||
sec:create-amp("http://marklogic.com/rest-api/models/document-model-common", "read-properties", "/data-hub/4/rest-api/models/document-model-common.xqy", $modules-db-name, ("rest-reader-internal")), | ||
sec:create-amp("http://marklogic.com/rest-api/models/document-model-common", "read-quality", "/data-hub/4/rest-api/models/document-model-common.xqy", $modules-db-name, ("rest-reader-internal")), | ||
sec:create-amp("http://marklogic.com/rest-api/models/document-model-common", "lookup-role-names", "/data-hub/4/rest-api/models/document-model-common.xqy", $modules-db-name, ("rest-reader-internal")), | ||
sec:create-amp("http://marklogic.com/rest-api/models/document-model-query", "get", "/data-hub/4/rest-api/models/document-model-query.xqy", $modules-db-name, ("rest-reader-internal")), | ||
sec:create-amp("http://marklogic.com/rest-api/models/document-model-query-get", "get", "/data-hub/4/rest-api/models/document-model-query-get.xqy", $modules-db-name, ("rest-reader-internal")), | ||
sec:create-amp("http://marklogic.com/rest-api/models/document-model-query-head", "head", "/data-hub/4/rest-api/models/document-model-query-head.xqy", $modules-db-name, ("rest-reader-internal")), | ||
sec:create-amp("http://marklogic.com/rest-api/models/document-model-query", "read-content", "/data-hub/4/rest-api/models/document-model-query.xqy", $modules-db-name, ("rest-reader-internal")), | ||
sec:create-amp("http://marklogic.com/rest-api/models/document-model-query", "check-document-exists", "/data-hub/4/rest-api/models/document-model-query.xqy", $modules-db-name, ("rest-reader-internal")), | ||
sec:create-amp("http://marklogic.com/rest-api/models/document-model-update", "put", "/data-hub/4/rest-api/models/document-model-update.xqy", $modules-db-name, ("rest-writer-internal")), | ||
sec:create-amp("http://marklogic.com/rest-api/models/document-model-update-put", "put", "/data-hub/4/rest-api/models/document-model-update-put.xqy", $modules-db-name, ("rest-writer-internal")), | ||
sec:create-amp("http://marklogic.com/rest-api/models/document-model-update-delete", "delete", "/data-hub/4/rest-api/models/document-model-update-delete.xqy", $modules-db-name, ("rest-writer-internal")), | ||
sec:create-amp("http://marklogic.com/rest-api/models/document-model-update", "patch", "/data-hub/4/rest-api/models/document-model-update.xqy", $modules-db-name, ("rest-writer-internal")), | ||
sec:create-amp("http://marklogic.com/rest-api/models/document-model-update", "delete", "/data-hub/4/rest-api/models/document-model-update.xqy", $modules-db-name, ("rest-writer-internal")), | ||
sec:create-amp("http://marklogic.com/rest-api/models/document-model-update", "apply-content-patch", "/data-hub/4/rest-api/models/document-model-update.xqy", $modules-db-name, ("rest-writer-internal")), | ||
sec:create-amp("http://marklogic.com/rest-api/models/document-model-update", "apply-metadata-patch", "/data-hub/4/rest-api/models/document-model-update.xqy", $modules-db-name, ("rest-writer-internal")), | ||
sec:create-amp("http://marklogic.com/rest-api/models/document-model-update", "delete-document", "/data-hub/4/rest-api/models/document-model-update.xqy", $modules-db-name, ("rest-writer-internal")), | ||
sec:create-amp("http://marklogic.com/rest-api/models/document-model-update", "write-content", "/data-hub/4/rest-api/models/document-model-update.xqy", $modules-db-name, ("rest-writer-internal")), | ||
sec:create-amp("http://marklogic.com/rest-api/models/document-model-update", "load-content", "/data-hub/4/rest-api/models/document-model-update.xqy", $modules-db-name, ("rest-writer-internal")), | ||
sec:create-amp("http://marklogic.com/rest-api/models/document-model-update", "write-collections", "/data-hub/4/rest-api/models/document-model-update.xqy", $modules-db-name, ("rest-writer-internal")), | ||
sec:create-amp("http://marklogic.com/rest-api/models/document-model-update", "write-permissions", "/data-hub/4/rest-api/models/document-model-update.xqy", $modules-db-name, ("rest-writer-internal")), | ||
sec:create-amp("http://marklogic.com/rest-api/models/document-model-update", "write-properties", "/data-hub/4/rest-api/models/document-model-update.xqy", $modules-db-name, ("rest-writer-internal")), | ||
sec:create-amp("http://marklogic.com/rest-api/models/document-model-update", "write-quality", "/data-hub/4/rest-api/models/document-model-update.xqy", $modules-db-name, ("rest-writer-internal")), | ||
sec:create-amp("http://marklogic.com/rest-api/models/document-model-update", "replace-role-permissions", "/data-hub/4/rest-api/models/document-model-update.xqy", $modules-db-name, ("rest-writer-internal")), | ||
sec:create-amp("http://marklogic.com/rest-api/models/document-model-update", "replace-named-properties", "/data-hub/4/rest-api/models/document-model-update.xqy", $modules-db-name, ("rest-writer-internal")), | ||
sec:create-amp("http://marklogic.com/rest-api/models/document-model-update", "remove-collections", "/data-hub/4/rest-api/models/document-model-update.xqy", $modules-db-name, ("rest-writer-internal")), | ||
sec:create-amp("http://marklogic.com/rest-api/models/document-model-update", "reset-permissions", "/data-hub/4/rest-api/models/document-model-update.xqy", $modules-db-name, ("rest-writer-internal")), | ||
sec:create-amp("http://marklogic.com/rest-api/models/document-model-update", "remove-properties", "/data-hub/4/rest-api/models/document-model-update.xqy", $modules-db-name, ("rest-writer-internal")), | ||
sec:create-amp("http://marklogic.com/rest-api/models/document-model-update", "reset-quality", "/data-hub/4/rest-api/models/document-model-update.xqy", $modules-db-name, ("rest-writer-internal")), | ||
sec:create-amp("http://marklogic.com/rest-api/models/document-model-update", "cpf-config", "/data-hub/4/rest-api/models/document-model-update.xqy", $modules-db-name, ("manage-internal")), | ||
sec:create-amp("http://marklogic.com/rest-api/forestinfo", "get-forest-info", "/data-hub/4/rest-api/models/forest-info-model.xqy", $modules-db-name, ("rest-reader-internal")), | ||
sec:create-amp("http://marklogic.com/rest-api/models/search-model-update", "delete", "/data-hub/4/rest-api/models/search-model-update.xqy", $modules-db-name, ("rest-writer-internal")), | ||
sec:create-amp("http://marklogic.com/rest-api/models/search-model-update", "clear", "/data-hub/4/rest-api/models/search-model-update.xqy", $modules-db-name, ("rest-admin-internal")), | ||
sec:create-amp("http://marklogic.com/rest-api/lib/extensions-util", "do-directory-delete", "/data-hub/4/rest-api/lib/extensions-util.xqy", $modules-db-name, ("rest-admin-internal")), | ||
sec:create-amp("http://marklogic.com/rest-api/lib/extensions-util", "do-document-delete", "/data-hub/4/rest-api/lib/extensions-util.xqy", $modules-db-name, ("rest-admin-internal")), | ||
sec:create-amp("http://marklogic.com/rest-api/lib/extensions-util", "do-document-insert", "/data-hub/4/rest-api/lib/extensions-util.xqy", $modules-db-name, ("rest-admin-internal")), | ||
sec:create-amp("http://marklogic.com/rest-api/lib/extensions-util", "do-eval", "/data-hub/4/rest-api/lib/extensions-util.xqy", $modules-db-name, ("rest-admin-internal")), | ||
sec:create-amp("http://marklogic.com/rest-api/lib/extensions-util", "do-js-eval", "/data-hub/4/rest-api/lib/extensions-util.xqy", $modules-db-name, ("rest-admin-internal")), | ||
sec:create-amp("http://marklogic.com/rest-api/lib/extensions-util", "do-list-extension-metadata", "/data-hub/4/rest-api/lib/extensions-util.xqy", $modules-db-name, ("rest-admin-internal")), | ||
sec:create-amp("http://marklogic.com/rest-api/lib/extensions-util", "execute-transform", "/data-hub/4/rest-api/lib/extensions-util.xqy", $modules-db-name, ("rest-admin-internal")), | ||
sec:create-amp("http://marklogic.com/rest-api/lib/extensions-util", "invoke-service", "/data-hub/4/rest-api/lib/extensions-util.xqy", $modules-db-name, ("rest-reader-internal")) |
Oops, something went wrong.
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.
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.
@grechaw ,
I think here it is assumed that "App-Services" is set to "digest" auth. In case if all servers were set to cert-auth, digest with ssl or other authentication type, this may not work. I see the same in undo() method as well
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.
Yes, I know -- I was hoping I could ask you how to generalize.
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.
I think we can use a method like newInstallerClient() in DeployHubAmpsCommand but that would mean that 'sslContext' for stagingAppConfig has to be set to the one obtained using 'admin' certificate (cert whose common name is 'admin' or the security user , user will be logged as the security user). Is that an acceptable change ?
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.
thanks @srinathgit that's exactly what i needed. I'll take it for a spin
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.
Ok ... One thing I noticed with using this newInstallerClient() method is that, if all the servers (App-Services, Manage and Admin) are set to cert-auth, setting stagingAppConfig 's 'sslContext' to the one obtained from certificate whose common name matches 'securityUser' results in LoadModulesCommand, DeleteModulesCommand, GenerateModelArtifactsCommand and LoadSchemasCommand (and maybe some other command ?)running as 'securityUser' and not as 'hub-admin-user' as intended.