Skip to content

Commit 77c4f8d

Browse files
committed
Merge branch 'develop'
2 parents 4b7ecb5 + 3e7c4e8 commit 77c4f8d

File tree

168 files changed

+24415
-1307
lines changed

Some content is hidden

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

168 files changed

+24415
-1307
lines changed

.travis.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ services:
1111
- docker
1212

1313
before_install:
14+
- "/sbin/start-stop-daemon --start --quiet --pidfile /tmp/custom_xvfb_99.pid --make-pidfile --background --exec /usr/bin/Xvfb -- :99 -ac -screen 0 1280x1024x16"
1415
- ./.travis/download.sh
1516

1617
script:

CONTRIBUTING.md

Lines changed: 100 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,14 @@ You need these to get started
2525

2626
- Java 8 JDK
2727
- Gradle (3.4 or greater)
28-
- Node JS 6.5 or newer
29-
- Typings `npm -g install typings`
3028
- A decent IDE. IntelliJ is nice.
3129

3230
#### Building from the command line
3331
**First, a warning.** _The DHF has a ton of tests and they take a very long time to run. Considering you might not want to invest 30 minutes to wait for tests these instructions will show you how to skip the tests._
3432

35-
To build the entire DHF (marklogic-data-hub.jar, quickstart.war, and ml-data-hub-plugin for gradle) simply run this command:
33+
**Do you need to do this?** - only if you are wanting to build the entire DHF final products (marklogic-data-hub.jar, quickstart.war, and ml-data-hub-plugin for gradle)
34+
35+
Simply run this command:
3636

3737
```bash
3838
cd /path/to/data-hub-project/
@@ -41,9 +41,11 @@ cd /path/to/data-hub-project/
4141

4242
#### Making Changes to the Hub Gradle Plugin
4343

44-
This is for when you are making changes to the ml-data-hub-plugin. This is a gradle plugin that enables Hub Capabilities. Most likely you won't find yourself doing this. You can safely ignore this section.
44+
This is for when you really want to use a local copy of the Gradle Plugin in your Data Hub Framework Project. Perhaps you are testing out a change to the ml-data-hub Gradle plugin or you have a cutting edge development version. There are very few valid reasons for you to do this.
45+
46+
Still here? Seems you really want to use a local copy of the Gradle Plugin in your Data Hub Framework Project. Here's how to tell Gradle to use your local copy instead of the one living up on the Cloud.
4547

46-
Still here? Seems you really want to modify the Gradle Plugin. Here's how to tell Gradle to use your local copy instead of the one living up on the Cloud.
48+
First you must publish your Data Hub Plugin to the local maven repository.
4749

4850
```bash
4951
cd /path/to/data-hub-project/
@@ -52,7 +54,7 @@ cd /path/to/data-hub-project/ml-data-hub-plugin
5254
./gradlew publishToMavenLocal
5355
```
5456

55-
Then in your build.gradle file you will need to use the local version:
57+
Then in your DHF project's build.gradle file you will need to use the local version:
5658
```groovy
5759
5860
// this goes at the top above the plugins section
@@ -78,6 +80,20 @@ plugins {
7880
apply plugin: "com.marklogic.ml-data-hub"
7981
```
8082

83+
To run the plugin's unit tests, cd to the ml-data-hub-plugin directory, then:
84+
85+
Run all unit tests
86+
87+
../gradlew test
88+
89+
90+
Run one unit test
91+
92+
../gradlew -Dtest.single=CreateEntityTask test
93+
94+
95+
**Note**: This change goes in a DHF project's build.gradle. Not the DHF source code's build.gradle.
96+
8197
#### Running the QuickStart UI from source
8298
Make sure you have the prerequisites installed.
8399

@@ -89,6 +105,12 @@ cd /path/to/data-hub-project
89105
./gradlew bootrun
90106
```
91107

108+
**BE AWARE** There will be a progress indicator that stops around 90%. This is normal. In gradle land, 100% means it finished running. This stays running indefinitely and thus shows 90%.
109+
110+
```
111+
> Building 90% > :quick-start:bootRun
112+
```
113+
92114
**Terminal window 2** - This runs the Quickstart UI
93115
```
94116
cd /path/to/data-hub-project
@@ -97,6 +119,65 @@ cd /path/to/data-hub-project
97119

98120
Now open your browser to [http://localhost:4200](http://localhost:4200) to use the debug version of the Quickstart UI.
99121

122+
### Troubleshooting
123+
Did the `gradle runui` command fail for you? Here's a quick checklist to troubleshoot.
124+
125+
#### Do you have Gradle 3.4 or newer?
126+
Using straight up gradle:
127+
```
128+
gradle -v
129+
```
130+
or if you are using the wrapper:
131+
```
132+
./gradlew -v
133+
```
134+
If your gradle wrapper is older than `3.4` then do this:
135+
```
136+
gradle wrapper --gradle-version 3.4
137+
```
138+
#### Are you on the develop branch?
139+
_hint: you should be_
140+
Check like so:
141+
```bash
142+
git branch
143+
```
144+
145+
To switch to the develop branch:
146+
```bash
147+
git checkout develop
148+
```
149+
150+
#### Do you have the latest code?
151+
Better make sure...
152+
153+
##### You clone from the github.com/marklogic-community/marklogic-data-hub repo
154+
155+
```bash
156+
git pull origin develop
157+
```
158+
##### Your forked then cloned your fork
159+
Make sure you have the upstream set:
160+
```bash
161+
$ git remote add upstream git://github.com/marklogic-community/marklogic-data-hub.git
162+
```
163+
164+
Then fetch the upstream:
165+
```bash
166+
git fetch upstream develop
167+
```
168+
169+
Now merge it in:
170+
```bash
171+
git rebase upstream/develop
172+
```
173+
174+
#### Try removing the `quick-start/node_modules` directory.
175+
If you are seeing a bunch of javascript errors you might have a messed up node_modules directory. Try to remove it then run again.
176+
177+
```bash
178+
rm -rf quick-start/node_modules
179+
```
180+
100181
## Submission Guidelines
101182

102183
### Submitting an Issue
@@ -193,6 +274,19 @@ Make sure the JUnit tests pass.
193274
$ ./gradlew test
194275
```
195276

277+
If you want to run a single test:
278+
279+
```sh
280+
$ ./gradlew -Dtest.single=TestName test
281+
```
282+
283+
for best results don't include the final word Test. Example:
284+
Say you want to run FlowRunnerTest.
285+
286+
```sh
287+
$ ./gradlew -Dtest.single=FlowRunner test
288+
```
289+
196290
Make sure that all tests pass. Please, do not submit patches that fail.
197291

198292
#### Push your changes

examples/README.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Data Hub Framework Examples
2+
3+
This folder contains working examples of various DHF usage scenarios.
4+
5+
1. [barebones](https://github.com/marklogic-community/marklogic-data-hub/tree/master/examples/barebones) - an example of the minimum configuration necessary to run a Gradle based Data Hub
6+
1. [healthcare](https://github.com/marklogic-community/marklogic-data-hub/tree/master/examples/healthcare) - an example of a Healthcare 360 Data Hub
7+
1. [hr-hub](https://github.com/marklogic-community/marklogic-data-hub/tree/master/examples/hr-hub) - an example used for our 1.x tutorial. This example harmonizes data from various HR systems
8+
1. [load-binaries](https://github.com/marklogic-community/marklogic-data-hub/tree/master/examples/load-binaries) - an example of how to ingest binaries via an MLCP Input Flow
9+
1. [online-store](https://github.com/marklogic-community/marklogic-data-hub/tree/master/examples/online-store) - the example we use for our [Tutorial](https://marklogic-community.github.io/marklogic-data-hub/tutorial/)
10+
1. [spring-batch](https://github.com/marklogic-community/marklogic-data-hub/tree/master/examples/spring-batch) - an example of how to load relational data into a Data Hub using Spring Batch
11+
1. [ssl](https://github.com/marklogic-community/marklogic-data-hub/tree/master/examples/ssl) - an example of how to configure your Data Hub to use SSL for added security

examples/ssl/README.md

Lines changed: 108 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
1+
# SSL Example
2+
This example demonstrates how to enable SSL for your entire MarkLogic instance. This includes the builtin AppServers and your Data Hub Appservers.
3+
4+
For additional information on SSL and Appservers see [Chapter 8 of the Security Guide](http://docs.marklogic.com/guide/security/SSL).
5+
6+
# What's required
7+
### A certificate template
8+
We provide one for you in `user-config/security/certificate-templates/my-template.xml`
9+
```xml
10+
<certificate-template-properties xmlns="http://marklogic.com/manage">
11+
<template-name>dhf-cert</template-name>
12+
<template-description>Sample description</template-description>
13+
<key-type>rsa</key-type>
14+
<key-options />
15+
<req>
16+
<version>0</version>
17+
<subject>
18+
<countryName>US</countryName>
19+
<stateOrProvinceName>VA</stateOrProvinceName>
20+
<localityName>McLean</localityName>
21+
<organizationName>MarkLogic</organizationName>
22+
<organizationalUnitName>Consulting</organizationalUnitName>
23+
<emailAddress>[email protected]</emailAddress>
24+
</subject>
25+
</req>
26+
</certificate-template-properties>
27+
```
28+
29+
### Set the certificate Template for each appserver
30+
We do this for you in
31+
`user-config/servers/*-server.json`
32+
33+
```json
34+
{
35+
"ssl-certificate-template": "dhf-cert"
36+
}
37+
```
38+
39+
### Enable SSL properties
40+
We do this for you in `gradle.properties`
41+
42+
```
43+
# To use SSL on port 8001
44+
mlAdminScheme=https
45+
mlAdminSimpleSsl=true
46+
47+
# To use SSL on port 8002
48+
mlManageScheme=https
49+
mlManageSimpleSsl=true
50+
51+
# To use SSL on port 8000
52+
mlAppServicesSimpleSsl=true
53+
54+
# Set these to true to use SSL for you Hub App Servers
55+
mlStagingSimpleSsl=true
56+
mlFinalSimpleSsl=true
57+
mlTraceSimpleSsl=true
58+
mlJobSimpleSsl=true
59+
```
60+
61+
# TLDR; How do I run it?
62+
63+
### Step 1: Configure the `gradle.properties` files
64+
Open `gradle.properties` and put in your username and password
65+
next to:
66+
67+
```properties
68+
mlUsername=
69+
mlPassword=
70+
```
71+
72+
### Step 2: Enable SSL for builtin AppServers
73+
First you should enable SSL for the builtin Appservers. You can do this manually via the instructions in [Chapter 8 of the Security Guide](http://docs.marklogic.com/guide/security/SSL) or you can use the shortcut we provide in this example.
74+
75+
To use the shortcut simply run:
76+
77+
```bash
78+
gradle enableSSL
79+
```
80+
81+
### Step 3: Initialize your Hub Project
82+
To initialize the Hub project simply type:
83+
84+
```bash
85+
gradle hubInit
86+
```
87+
88+
### Step 4: Deploy the Data Hub into MarkLogic
89+
To deploy your Data Hub into MarkLogic simply type:
90+
91+
```bash
92+
gradle mlDeploy
93+
```
94+
95+
### Step 5: Deploy your custom modules
96+
```bash
97+
gradle mlLoadModules
98+
```
99+
100+
### Scaffolding Commands
101+
You can use scaffolding commands to configure flows.
102+
103+
```bash
104+
gradle hubCreateInputFlow
105+
gradle hubCreateHarmonizeFlow
106+
```
107+
108+
For a complete list of gradle tasks, check here: [https://github.com/marklogic-community/marklogic-data-hub/wiki/Gradle-Tasks](https://github.com/marklogic-community/marklogic-data-hub/wiki/Gradle-Tasks)

0 commit comments

Comments
 (0)