4.2 KiB
Build the code & run tests
Prerequisites
-
Make sure you have a local instance of MySQL and ElasticSearch.
- For an easy install of MySQL and ES, just install Docker on your local machine and run the following commands from the top-level directory
docker compose -f docker/local-metadata/docker-compose-dev.yml up
- See notes for linux users here
-
Bootstrap MySQL with tables
- Create a distribution as explained here
- Extract the distribution tar.gz file and run the following command
cd open-metadata-<version>/bootstrap sh bootstrap_storage.sh drop-create-all
-
Bootstrap ES with indexes and load sample data into MySQL
- Run OpenMetadata service instances through IntelliJ IDEA following the instructions here
- Once the logs indicate that the instance is up, run the following commands from the top-level directory
python3 -m venv venv source venv/bin/activate make install_dev generate cd ingestion pip install -e '.[sample-data, elasticsearch]' metadata ingest -c ./pipelines/sample_data.json metadata ingest -c ./pipelines/sample_usage.json metadata ingest -c ./pipelines/metadata_to_es.json
-
You are now ready to explore the app by going to http://localhost:8585 *If the web page doesn't work as intended, please take a look at the troubleshooting steps here
Building
The following commands must be run from the top-level directory.
mvn clean install
If you wish to skip the unit tests you can do this by adding -DskipTests
to the command line.
Create a distribution (packaging)
You can create a distribution as follows.
$ mvn clean install
The binaries will be created at:
openmetadata-dist/target/open-metadata-<version>.pom
openmetadata-dist/target/open-metadata-<version>.tar.gz
Run instance through IntelliJ IDEA
Add a new Run/Debug configuration like the below screenshot.
- Click on Intellij - Run menu
- Click on "Edit Configurations"
- Click + sign and Select Application and make sure your config looks similar to the below image
Troubleshooting
- If you see blank page at http://localhost:8585 , please check the logs at
logs/openmetadata.log
. You might be encountering one of the following errors:connection refused
orunreachable
- please confirm that MySQL and ES are reachable outside of docker by runningdocker ps
and checking that ports 3306 and 9200 are listening on 0.0.0.0- If ElasticSearch in Docker on Mac is crashing, try changing Preferences -> Resources -> Memory to 4GB
- If ElasticSearch logs show
high disk watermark [90%] exceeded
, try changing Preferences -> Resources -> Disk Image Size to at least 16GB
Public Key Retrieval is not allowed
- verify that the JDBC connect URL inconf/openmetadata.yaml
is configured with the parameterallowPublicKeyRetrieval=true
- Browser console shows javascript errors, try doing a clean build. Some npm packages may not have been built properly.
Linux Install Notes
If you are installing docker for the first time on linux you may run into a known issue with docker compose
.
To get around this follow the workaround here issue to ensure that docker-compose v2 is installed as a plugin under $HOME/.docker/cli-plugins
Also be sure to follow the docker post install steps so that you can run docker without sudo
.
Coding Style
-
Configure IntelliJ to disable the [wild-card imports]
(https://www.jetbrains.com/help/idea/creating-and-optimizing-imports.html#disable-wildcard-imports)