How to Build from Source#
Build the Model Registry from source to customize, debug, or extend its functionality. In this guide, you will:
Set up your development environment.
Compile the source code and resolve dependencies.
Generate a runnable build for local testing or deployment.
This guide is ideal for developers who want to work directly with the source code.
Prerequisites#
Before you begin, ensure the following:
System Requirements: Verify your system meets the minimum requirements.
Dependencies Installed:
Git: Install Git
Python 3.8 or higher: Python Installation Guide
Permissions: Confirm you have permissions to install software and modify environment configurations.
This guide assumes basic familiarity with Git commands, Python virtual environments, and terminal usage. If you are new to these concepts, see:
Steps to Build#
Clone the Repository:
# Clone the latest on mainline git clone https://github.com/open-edge-platform/edge-ai-libraries.git edge-ai-libraries # Alternatively, Clone a specific release branch git clone https://github.com/open-edge-platform/edge-ai-libraries.git edge-ai-libraries -b <release-tag> cd edge-ai-libraries/microservices/model-registry
Install Python 3.10
sudo apt-get install python3.10
Rename the
.env.templatefile to.envcd docker mv .env.template .env
Create the directories to be used as persistent storage for the
PostgreSQLandMinIOcontainerscd ../scripts sudo ./init_mr_data_dirs.sh
Define the desired values for the REQUIRED environment variables in the
.envfile in thedockerdirectory:MR_MINIO_ACCESS_KEYMR_MINIO_SECRET_KEYMR_PSQL_PASSWORD
cd ../docker vi .env
For more information about the supported the environment variables, refer to the Environment Variables documentation.
Optional: Enter values for the
http_proxyandhttps_proxyvariables in the.envfile if you are behind a proxy.http_proxy= # example: http_proxy=http://proxy.example.com:891 https_proxy= # example: https_proxy=http://proxy.example.com:891
Load the environment variables defined in the
.envfile into the current Terminal sessionsource .env
Build the model registry and start the containers
docker compose build docker compose up -d
Validation#
Verify Build Success:
Check the logs. Look for confirmation messages indicating the microservice started successfully.
Access the Microservice:
Open a browser and go to:
http://localhost:{{port}}/docs
Expected result: The microservice’s API documentation page loads successfully.
For more example requests and their responses, refer to the Get Started Guide.
Troubleshooting#
Dependency Installation Errors:
Reinstall dependencies:
pip install -r requirements.txt
Environment Configuration Issues:
Verify environment variables:
echo $VARIABLE_NAME