File tree Expand file tree Collapse file tree 6 files changed +51
-6
lines changed
metadata-ingestion-examples/mce-cli Expand file tree Collapse file tree 6 files changed +51
-6
lines changed Original file line number Diff line number Diff line change 1
- FROM openjdk:8 as builder
1
+ # Defining environment
2
+ ARG APP_ENV=prod
3
+
4
+ FROM openjdk:8-jre-alpine as base
5
+
6
+ FROM openjdk:8 as prod-build
2
7
COPY . datahub-src
3
8
RUN cd datahub-src && ./gradlew :metadata-ingestion-examples:mce-cli:build
4
9
5
- FROM openjdk:8-jre-alpine
6
- COPY --from=builder datahub-src/metadata-ingestion-examples/mce-cli/build/libs/mce-cli.jar ./
7
- COPY --from=builder datahub-src/metadata-ingestion-examples/mce-cli/example-bootstrap.json ./
8
- CMD java -jar mce-cli.jar -m produce example-bootstrap.json
10
+ FROM base as prod-install
11
+ COPY --from=prod-build datahub-src/metadata-ingestion-examples/mce-cli/build/libs/mce-cli.jar /datahub/ingestion/bin/mce-cli.jar
12
+ COPY --from=prod-build datahub-src/metadata-ingestion-examples/mce-cli/example-bootstrap.json /datahub/ingestion/example-bootstrap.json
13
+
14
+ FROM base as dev-install
15
+ # Dummy stage for development. Assumes code is built on your machine and mounted to this image.
16
+ # See this excellent thread https://github.com/docker/cli/issues/1134
17
+
18
+ FROM ${APP_ENV}-install as final
19
+ CMD java -jar /datahub/ingestion/bin/mce-cli.jar -m produce /datahub/ingestion/example-bootstrap.json
Original file line number Diff line number Diff line change
1
+ ---
2
+ version : ' 3.5'
3
+ services :
4
+ ingestion :
5
+ image : datahub-ingestion:debug
6
+ env_file : env/docker.env
7
+ build :
8
+ context : .
9
+ dockerfile : Dockerfile
10
+ args :
11
+ APP_ENV : dev
12
+ volumes :
13
+ - ../../metadata-ingestion-examples/mce-cli/build/libs/:/datahub/ingestion/bin
14
+ - ../../metadata-ingestion-examples/mce-cli/example-bootstrap.json:/datahub/ingestion/example-bootstrap.json
15
+
16
+ networks :
17
+ default :
18
+ name : datahub_network
Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ version: '3.5'
3
3
services :
4
4
ingestion :
5
5
image : datahub-ingestion
6
+ env_file : env/docker.env
6
7
build :
7
8
context : ../../
8
9
dockerfile : docker/ingestion/Dockerfile
Original file line number Diff line number Diff line change
1
+ KAFKA_BOOTSTRAP_SERVER = broker:29092
2
+ KAFKA_SCHEMAREGISTRY_URL = http://schema-registry:8081
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+
3
+ # Runs the ingestion image using your locally built mce-cli. Gradle build must have been run before this script.
4
+
5
+ DIR=" $( cd " $( dirname " ${BASH_SOURCE[0]} " ) " > /dev/null 2>&1 && pwd ) "
6
+ cd $DIR && COMPOSE_DOCKER_CLI_BUILD=1 DOCKER_BUILDKIT=1 docker-compose -f docker-compose.dev.yml -p datahub up
Original file line number Diff line number Diff line change @@ -48,4 +48,11 @@ java -jar metadata-ingestion-examples/mce-cli/build/libs/mce-cli.jar -m produce
48
48
```
49
49
50
50
Where ` my-file.json ` is some file that contains a
51
- [ MetadataChangEvents] ( ./src/main/pegasus/com/linkedin/metadata/examples/cli/MetadataChangeEvents.pdl ) JSON object.
51
+ [ MetadataChangEvents] ( ./src/main/pegasus/com/linkedin/metadata/examples/cli/MetadataChangeEvents.pdl ) JSON object.
52
+
53
+ ### Producing the Example Events with Docker
54
+
55
+ We have some example events in the ` example-bootstrap.json ` file, which can be invoked via the above example or in a
56
+ docker environment using ` docker/ingestion/ingestion.sh ` . We also have a developer image
57
+ (` docker/ingestion/ingestion-dev.sh ` ) which uses your locally built jar rather than building on the docker image itself,
58
+ which may be faster if you have already built code locally.
You can’t perform that action at this time.
0 commit comments