Amundsen Search Service¶
Amundsen Search service serves a Restful API and is responsible for searching metadata. The service leverages Elasticsearch for most of it’s search capabilites.
For information about Amundsen and our other services, visit the main repository
README.md. Please also see our instructions for a quick start setup of Amundsen with dummy data, and an overview of the architecture.
- Python >= 3.6
- elasticsearch 6.x (currently it doesn’t support 7.x)
Instructions to start the Search service from distribution¶
$ venv_path=[path_for_virtual_environment] $ python3 -m venv $venv_path $ source $venv_path/bin/activate $ pip3 install amundsen-search $ python3 search_service/search_wsgi.py # In a different terminal, verify the service is up by running $ curl -v http://localhost:5001/healthcheck
Instructions to start the Search service from source¶
$ git clone https://github.com/amundsen-io/amundsensearchlibrary.git $ cd amundsensearchlibrary $ venv_path=[path_for_virtual_environment] $ python3 -m venv $venv_path $ source $venv_path/bin/activate $ pip3 install -r requirements.txt $ python3 setup.py install $ python3 search_service/search_wsgi.py # In a different terminal, verify the service is up by running $ curl -v http://localhost:5001/healthcheck
Instructions to start the service from Docker¶
$ docker pull amundsendev/amundsen-search:latest $ docker run -p 5001:5001 amundsendev/amundsen-search # - alternative, for production environment with Gunicorn (see its homepage link below) $ ## docker run -p 5001:5001 amundsendev/amundsen-search gunicorn --bind 0.0.0.0:5001 search_service.search_wsgi # In a different terminal, verify the service is up by running $ curl -v http://localhost:5001/healthcheck
By default, Flask comes with a Werkzeug webserver, which is used for development. For production environments a production grade web server such as Gunicorn should be used.
$ pip3 install gunicorn $ gunicorn search_service.search_wsgi # In a different terminal, verify the service is up by running $ curl -v http://localhost:8000/healthcheck
Configuration outside local environment¶
By default, Search service uses LocalConfig that looks for Elasticsearch running in localhost.
In order to use different end point, you need to create a Config suitable for your use case. Once a config class has been created, it can be referenced by an environment variable:
For example, in order to have different config for production, you can inherit Config class, create Production config and passing production config class into environment variable. Let’s say class name is ProdConfig and it’s in search_service.config module. then you can set as below:
This way Search service will use production config in production environment. For more information on how the configuration is being loaded and used, here’s reference from Flask doc.
- PEP 8: Amundsen Search service follows PEP8 - Style Guide for Python Code.
- Typing hints: Amundsen Search service also utilizes Typing hint for better readability.
We have Swagger documentation setup with OpenApi 3.0.2. This documentation is generated via Flasgger.
When adding or updating an API please make sure to update the documentation. To see the documentation run the application locally and go to
Currently the documentation only works with local configuration.
Amundsen Search service consists of three packages, API, Models, and Proxy.
Statsd utilities module has methods / functions to support statsd to publish metrics. By default, statsd integration is disabled and you can turn in on from Search service configuration. For specific configuration related to statsd, you can configure it through environment variable.
Models package contains many modules where each module has many Python classes in it. These Python classes are being used as a schema and a data holder. All data exchange within Amundsen Search service use classes in Models to ensure validity of itself and improve readability and maintainability.