ml-gradle | Gradle plugin for automating everything involving MarkLogic | Plugin library
kandi X-RAY | ml-gradle Summary
kandi X-RAY | ml-gradle Summary
[Known Vulnerabilities] Automate everything involving MarkLogic with Gradle. ml-gradle depends on at least [Java 9] and [MarkLogic 9 or 10] so if you have those installed, you’re just a couple minutes away from using ml-gradle to start a new project and deploy an application from it. If you’re using ml-gradle 2.x or 3.x, you only need Java 8.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of ml-gradle
ml-gradle Key Features
ml-gradle Examples and Code Snippets
Community Discussions
Trending Discussions on ml-gradle
QUESTION
I try to use mlunitTest with ml-gradle 3.17.1 and Marklogic marklogic-unit-test-client:1.0.0
All the tests are OK, I test with my test user on the UI and with ml-gradle.
But when ml-gradle wants to access the results in a directory [build\test-results\marklogic-unit-test\TEST-{test-name}]
, java throws an error because the file isn't there.
Just before there is a comment who precises that it clears the directory.
Does anyone use the mlunitTest without this problem?
it's the same if i give the name of the result directory with the parameter : -PunitTestResultsPath=testML
Here are the traces of this part of execution :
...ANSWER
Answered 2022-Feb-04 at 15:36Try release 4.3.0 - it includes the following fix - https://github.com/marklogic-community/ml-gradle/issues/599
QUESTION
I'm using ml-gradle plugin to deploy the data and modules to a ML10 database. I have used mlModulePermissions property to set permissions for modules.
Is there a similar property to set permissions for the files loaded from ml-data directory?
...ANSWER
Answered 2021-Sep-30 at 13:54There is an equivalent property for data permissions:
mlDataPermissions Comma-delimited list of permissions (role1,capability1,role2,capability2,etc) assigned to each document. No default value (which typically means you'll get rest-reader/read and rest-writer/update as permissions on each document).
https://github.com/marklogic-community/ml-app-deployer/wiki/Loading-data
QUESTION
MarkLogic Visual Studio Code Extension provides a way to dynamically send the Xquery code to different MarkLogic enviroments by changing mlxps:setting in its header comment block.
However, it does not work if the Xquery will need to refer to other Xquery library files stored on the local drive, as there is no option to set which ML Http server that the Xquery should be evaluated at.
In contrast, if we need to run the same Xquery from QConsole,
Here is the screenshot if I try send it to port 8300 which is the used for that http server form visual studio code.
Any solution for that? Does it mean this mlxprs could only work for Module in Module DB? (This is the same problem for sending Xquery form ml-gradle, as one could not specify which App server the XQuery will be sent to.)
...ANSWER
Answered 2021-Sep-05 at 14:25I think there may be an issue that in order to eval code against the appserver, it needs to use the /v1/eval
endpoint, and that appserver needs to be configured as a REST-API server.
However, configuring the modules database to use the filesystem is not supported for REST API appservers.
The path of least resistance would be to use a modules database and deploy your modules, rather than trying to use the filesystem, but it is an inconvenient limitation.
QUESTION
By default, ML HTTP server will use the Module DB inside ML. (It seems all ML training materials refer to that type of configuration.) Any changes in the XQuery programs will need to upload into the Module DB first. That could be accomplished by using mlLoadModules or mlReloadModules ml-gradle commands. CI/CD does not access the ML cluster directly. Everything is via ml-gradle from a machine dedicated from code deployment to different ML enviroments like dev/uat/prod etc.
However it is also possible to configure the ML app server to use the XQuery program from physical disk location like below screenshot. With that configuration, it is not required to reload the programs into ML Module DB. The changes in the program have to be in the ML server itself. CI/CD will need to access to the ML cluster directly. One advantage of this way is that developer will easily see whether the changes in the program have been indeed deployed, as all changes are sitting as physical readable text files in the disk.
Questions:
- Which way is better? Why?
- Any ML query perforemance difference between these two different approaches?
- For the physical file approach, does it mean that CI/CD will need to deploy the program changes to all the ML hosts in the ML cluster? (I guess it is not a concern if HTTP server refers XQuery programs from Module DB inside ML. ML cluster will auto sync the code among different hosts.)
ANSWER
Answered 2021-Aug-25 at 13:23In general, it's recommended to deploy modules to a database rather than the filesystem.
This makes deployment more simple and easy, as you only have to load the module once into the modules database, rather than putting the file on every single host. If you use the filesystem, then you need to put those files on every host in the cluster.
With a modules database, if you were to add nodes to the cluster, you don't have to also deploy the modules. You can then also take advantage of High Availability, backup and restore, and all the other features of a database.
Once a module is read, it is loaded into caches, so the performance impact should be negligible.
If you plan to use REST extensions, then you would need a modules database so that the configurations can be installed in that database.
Some might look to use filesystem for simple development on a single node, in which changes saved to the filesystem are made available without re-deploying. However, you could use something like the ml-gradle mlWatch
task to auto-deploy modules as they are modified on the filesystem and achieve effectively the same thing using a modules database.
QUESTION
mlDeploy and mlUndeploy enable to rebuild the ML application from CI/CD. Using ml-gradle is the default way to manage new ML app server. That is great.
How to migrate existing ML app to use ml-gradle to manage? How to automatically rebuild the ML gradle project from an existing ML app servers, particaully different indexes? (We have over 50 different types of indexes on one existing ML app server.) It is really slow and easy to make human mistake by recreating the ml-gradle project manually.
Any suggestions to automate that reverse engineering?
...ANSWER
Answered 2021-Aug-24 at 11:03This is the best approach - https://github.com/marklogic-community/ml-gradle/wiki/Exporting-resources .
The challenge is that MarkLogic doesn't have the concept of an "application" - i.e. once you deploy your resources, they're effectively the same as all the OOTB resources and thus it's difficult to know what you deployed vs what's OOTB.
QUESTION
I am looking for any sample project to create MarkLogic 3 Nodes Cluster directly from ML Docker Hub image (https://hub.docker.com/_/marklogic) via Gradle on a single machine.
The idea is to auto spin off different ML versions for the dev enviroment set up.
Current three node cluster example in gitbub ml-gradle is to install ML from rpm installation package. I would like to directly use the ML docker hub image instead.
...ANSWER
Answered 2021-Aug-23 at 00:41ml-gradle is typically used to deploy an application to an existing ML cluster. To actually create the ML cluster, you use the "docker" executable. You can automate this via Gradle's Exec task if you wish, but doing so is outside the scope of ml-gradle which assumes that you already have an ML cluster setup.
QUESTION
I'm currently working on configuring the resources like databases and app servers for an application using ml-gradle.These configurations would be deployed to ML10 environment.
I have a content database and there are nine hosts in the environment. I have set the ml-gradle property mlContentForestsPerHost=1
,so it is creating 9 forests in total for the content database.
But I need only 5 forests in total for my content database to be created.
Is there a way to do it via any ml-gradle property or this can be achieved using json forest config only?
Please share your thoughts.
...ANSWER
Answered 2021-Jun-02 at 18:09See https://github.com/marklogic-community/ml-gradle/wiki/Creating-forests#properties-driven - specifically mlDatabaseHosts or possibly mlDatabaseGroups.
QUESTION
mlPrintForestPlan
gives an error when I try to use mlDatabasesWithForestsOnOneHost
with replicas in a 3-node cluster.
ANSWER
Answered 2021-May-11 at 17:15If it's not working, it sounds like an untested scenario - just create a new ticket in ml-app-deployer to capture support for creating replicas for databases that are configured to only have forests on one host.
QUESTION
I need to export a project from a 4.x Data Hub. I can use mlhubExportProject command for a 5.x Data Hub, but am unsure of the equivelent command/process for 4.x Data Hub.
( Can I also confirm which version ml-gradle plugin should be used with a combination of Gradle 5.1.1 , Data Hub 4.1.1 and openJDK 1.8.0_262? )
Thanks in advance.
...ANSWER
Answered 2021-Feb-01 at 12:58Note that hubExportProject in DHF 5.x is just creating a zip based on the project directory - it's not exporting anything from MarkLogic. There's not an equivalent task in DHF 4.x, but you can effectively do the same thing by zipping up your project directory. I would first delete the non-version-controlled directories though, like "build" in particular.
QUESTION
How can I add public and private keys for a certificate to a certificate template via ml-gradle
?
I'm trying to configure some new servers entirely via ml-gradle + DHF 5. I can set up the certificate templates by adding a configuration file to ml-config/security/certificate-templates
. I already have an SSL certificate for these servers, but can't figure out how to import them without using the admin web interface.
There is a REST endpoint for performing certificate operations at /manage/v2/certificate-templates/{id|name}, so I guess I just want to invoke that as part of the deployment process in the right order.
...ANSWER
Answered 2021-Jan-14 at 12:49You'd need to do that via a custom task today - https://github.com/marklogic-community/ml-gradle/wiki/Writing-your-own-task .
If you think of a way for how you'd like to store those files in your project directory such that ml-gradle knows what calls to make for them, definitely open a ticket in ml-gradle with your idea.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install ml-gradle
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page