Skip to content

Commit d0d6d9c

Browse files
authored
Merge pull request #386 from marklogic/release/2.5.0
Merge release/2.5.0 into master
2 parents 0c3fc03 + 8111336 commit d0d6d9c

File tree

494 files changed

+6502
-1404
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

494 files changed

+6502
-1404
lines changed

.env

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
# Defines environment variables for docker-compose.
22
# Can be overridden via e.g. `MARKLOGIC_TAG=latest-10.0 docker-compose up -d --build`.
3-
MARKLOGIC_TAG=11.3.0-ubi
3+
MARKLOGIC_TAG=ml-docker-db-dev-tierpoint.bed-artifactory.bedford.progress.com/marklogic/marklogic-server-ubi:latest-12

CONTRIBUTING.md

Lines changed: 13 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,6 @@ If you wish to use `docker compose`, perform the following steps before deployin
2121

2222
The above will result in a new MarkLogic instance with a single node.
2323

24-
Alternatively, if you would like to test against a 3-node MarkLogic cluster with a load balancer in front of it,
25-
run `docker compose -f docker-compose-3nodes.yaml up -d --build`.
26-
2724
## Deploying the test application
2825

2926
To deploy the test application, first create `./gradle-local.properties` and add the following to it:
@@ -59,18 +56,18 @@ To configure the SonarQube service, perform the following steps:
5956
7. Click on "Use the global setting" and then "Create project".
6057
8. On the "Analysis Method" page, click on "Locally".
6158
9. In the "Provide a token" panel, click on "Generate". Copy the token.
62-
10. Add `systemProp.sonar.token=your token pasted here` to `gradle-local.properties` in the root of your project, creating
59+
10. Add `systemProp.sonar.login=your token pasted here` to `gradle-local.properties` in the root of your project, creating
6360
that file if it does not exist yet.
6461

6562
To run SonarQube, run the following Gradle tasks using Java 17, which will run all the tests with code coverage and
6663
then generate a quality report with SonarQube:
6764

6865
./gradlew test sonar
6966

70-
If you do not add `systemProp.sonar.token` to your `gradle-local.properties` file, you can specify the token via the
67+
If you do not add `systemProp.sonar.login` to your `gradle-local.properties` file, you can specify the token via the
7168
following:
7269

73-
./gradlew test sonar -Dsonar.token=paste your token here
70+
./gradlew test sonar -Dsonar.login=paste your token here
7471

7572
When that completes, you will see a line like this near the end of the logging:
7673

@@ -87,25 +84,6 @@ You can also force Gradle to run `sonar` if any tests fail:
8784

8885
./gradlew clean test sonar --continue
8986

90-
## Accessing MarkLogic logs in Grafana
91-
92-
This project's `docker-compose-3nodes.yaml` file includes
93-
[Grafana, Loki, and promtail services](https://grafana.com/docs/loki/latest/clients/promtail/) for the primary reason of
94-
collecting MarkLogic log files and allowing them to be viewed and searched via Grafana.
95-
96-
Once you have run `docker compose`, you can access Grafana at http://localhost:3000 . Follow these instructions to
97-
access MarkLogic logging data:
98-
99-
1. Click on the hamburger in the upper left hand corner and select "Explore", or simply go to
100-
http://localhost:3000/explore .
101-
2. Verify that "Loki" is the default data source - you should see it selected in the upper left hand corner below
102-
the "Home" link.
103-
3. Click on the "Select label" dropdown and choose `job`. Click on the "Select value" label for this filter and
104-
select `marklogic` as the value.
105-
4. Click on the blue "Run query" button in the upper right hand corner.
106-
107-
You should now see logs from all 3 nodes in the MarkLogic cluster.
108-
10987
# Testing with PySpark
11088

11189
The documentation for this project
@@ -120,7 +98,7 @@ This will produce a single jar file for the connector in the `./build/libs` dire
12098

12199
You can then launch PySpark with the connector available via:
122100

123-
pyspark --jars build/libs/marklogic-spark-connector-2.4-SNAPSHOT.jar
101+
pyspark --jars marklogic-spark-connector/build/libs/marklogic-spark-connector-2.5-SNAPSHOT.jar
124102

125103
The below command is an example of loading data from the test application deployed via the instructions at the top of
126104
this page.
@@ -164,7 +142,7 @@ For a quick test of writing documents, use the following:
164142

165143
```
166144
167-
spark.read.option("header", True).csv("src/test/resources/data.csv")\
145+
spark.read.option("header", True).csv("marklogic-spark-connector/src/test/resources/data.csv")\
168146
.repartition(2)\
169147
.write.format("marklogic")\
170148
.option("spark.marklogic.client.uri", "spark-test-user:spark@localhost:8000")\
@@ -196,7 +174,7 @@ The Spark master GUI is at <http://localhost:8080>. You can use this to view det
196174

197175
Now that you have a Spark cluster running, you just need to tell PySpark to connect to it:
198176

199-
pyspark --master spark://NYWHYC3G0W:7077 --jars build/libs/marklogic-spark-connector-2.4-SNAPSHOT.jar
177+
pyspark --master spark://NYWHYC3G0W:7077 --jars marklogic-spark-connector/build/libs/marklogic-spark-connector-2.5-SNAPSHOT.jar
200178

201179
You can then run the same commands as shown in the PySpark section above. The Spark master GUI will allow you to
202180
examine details of each of the commands that you run.
@@ -215,12 +193,16 @@ You will need the connector jar available, so run `./gradlew clean shadowJar` if
215193
You can then run a test Python program in this repository via the following (again, change the master address as
216194
needed); note that you run this outside of PySpark, and `spark-submit` is available after having installed PySpark:
217195

218-
spark-submit --master spark://NYWHYC3G0W:7077 --jars build/libs/marklogic-spark-connector-2.4-SNAPSHOT.jar src/test/python/test_program.py
196+
spark-submit --master spark://NYWHYC3G0W:7077 --jars marklogic-spark-connector/build/libs/marklogic-spark-connector-2.5-SNAPSHOT.jar marklogic-spark-connector/src/test/python/test_program.py
219197

220198
You can also test a Java program. To do so, first move the `com.marklogic.spark.TestProgram` class from `src/test/java`
221-
to `src/main/java`. Then run `./gradlew clean shadowJar` to rebuild the connector jar. Then run the following:
199+
to `src/main/java`. Then run the following:
222200

223-
spark-submit --master spark://NYWHYC3G0W:7077 --class com.marklogic.spark.TestProgram build/libs/marklogic-spark-connector-2.4-SNAPSHOT.jar
201+
```
202+
./gradlew clean shadowJar
203+
cd marklogic-spark-connector
204+
spark-submit --master spark://NYWHYC3G0W:7077 --class com.marklogic.spark.TestProgram build/libs/marklogic-spark-connector-2.5-SNAPSHOT.jar
205+
```
224206

225207
Be sure to move `TestProgram` back to `src/test/java` when you are done.
226208

Dockerfile

Lines changed: 0 additions & 10 deletions
This file was deleted.

Jenkinsfile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,12 @@ def runtests(String javaVersion){
66
export GRADLE_USER_HOME=$WORKSPACE/$GRADLE_DIR
77
export PATH=$GRADLE_USER_HOME:$JAVA_HOME/bin:$PATH
88
cd marklogic-spark-connector
9-
echo "mlPassword=admin" > gradle-local.properties
109
echo "Waiting for MarkLogic server to initialize."
1110
sleep 30s
1211
./gradlew -i mlDeploy
1312
echo "Loading data a second time to try to avoid Optic bug with duplicate rows being returned."
1413
./gradlew -i mlLoadData
15-
./gradlew test || true
14+
./gradlew clean testCodeCoverageReport || true
1615
'''
1716
junit '**/build/**/*.xml'
1817
}
@@ -55,10 +54,10 @@ pipeline{
5554
sh label:'mlsetup', script: '''#!/bin/bash
5655
echo "Removing any running MarkLogic server and clean up MarkLogic data directory"
5756
sudo /usr/local/sbin/mladmin remove
57+
docker-compose down -v || true
5858
sudo /usr/local/sbin/mladmin cleandata
5959
cd marklogic-spark-connector
6060
mkdir -p docker/marklogic/logs
61-
docker-compose down -v || true
6261
docker-compose up -d --build
6362
'''
6463
runtests('JAVA17_HOME_DIR')
@@ -108,7 +107,7 @@ pipeline{
108107
cd marklogic-spark-connector
109108
mkdir -p docker/marklogic/logs
110109
docker-compose down -v || true
111-
MARKLOGIC_TAG=latest-10.0 docker-compose up -d --build
110+
MARKLOGIC_TAG=progressofficial/marklogic-db:latest-11 docker-compose up -d --build
112111
'''
113112
runtests('JAVA17_HOME_DIR')
114113
}
@@ -117,6 +116,7 @@ pipeline{
117116
sh label:'mlcleanup', script: '''#!/bin/bash
118117
cd marklogic-spark-connector
119118
docker-compose down -v || true
119+
sudo /usr/local/sbin/mladmin delete $WORKSPACE/marklogic-spark-connector/docker/caddy/
120120
sudo /usr/local/sbin/mladmin delete $WORKSPACE/marklogic-spark-connector/docker/marklogic/logs/
121121
'''
122122
}

NOTICE.txt

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ Third Party Notices
1313
jackson-dataformat-xml 2.15.2 (Apache-2.0)
1414
jdom2 2.0.6.1 (Apache-2.0)
1515
jena-arq 4.10.0 (Apache-2.0)
16+
langchain4j 0.35.0 (Apache-2.0)
1617
marklogic-client-api 7.0.0 (Apache-2.0)
1718
okhttp 4.12.0 (Apache-2.0)
1819

@@ -22,7 +23,7 @@ Apache License 2.0 (Apache-2.0)
2223

2324
Third-Party Components
2425

25-
The following is a list of the third-party components used by the MarkLogic® Spark connector 2.4.2 (last updated October 17, 2024):
26+
The following is a list of the third-party components used by the MarkLogic® Spark connector 2.5.0 (last updated December 17, 2024):
2627

2728
jackson-dataformat-xml 2.15.2 (Apache-2.0)
2829
https://repo1.maven.org/maven2/com/fasterxml/jackson/dataformat/jackson-dataformat-xml/
@@ -36,6 +37,10 @@ jena-arq 4.10.0 (Apache-2.0)
3637
https://repo1.maven.org/maven2/org/apache/jena/jena-arq/
3738
For the full text of the Apache-2.0 license, see Apache License 2.0 (Apache-2.0)
3839

40+
langchain4j 0.35.0 (Apache-2.0)
41+
https://repo1.maven.org/maven2/dev/langchain4j/langchain4j/
42+
For the full text of the Apache-2.0 license, see Apache License 2.0 (Apache-2.0)
43+
3944
marklogic-client-api 7.0.0 (Apache-2.0)
4045
https://repo1.maven.org/maven2/com/marklogic/marklogic-client-api/
4146
For the full text of the Apache-2.0 license, see Apache License 2.0 (Apache-2.0)

0 commit comments

Comments
 (0)