Developer Setupο
Where to Contributeο
Resource Type |
Link |
---|---|
π¨ Bug Reports |
|
π Feature Requests & Ideas |
|
β Questions |
|
π Roadmap |
Getting Startedο
Required Softwareο
The LinuxForHealth connect development environment requires the following:
git for project version control
mkcert for local trusted certificates
Python 3.8 or higher for runtime/coding support
Pipenv for Python dependency management
Docker Compose for a local container runtime
For Windows 10 users, we suggest using Windows Subsystem for Linux
Set Up A Local Environmentο
Confirm Python build tooling is installedο
pip --version
pipenv --version
Install core and dev dependenciesο
pip install --upgrade pip
pipenv sync --dev
Run testsο
pipenv run pytest
Black code formatting integrationο
LinuxForHealth connect utilizes the black library to provide standard code formatting. Code formatting and style are validated as part of the LinuxForHealth connect ci process. LinuxForHealth connect provides developers with an option of formatting using pipenv scripts, or a git pre-commit hook.
Pipenv Scriptsο
Check for formatting errorsο
pipenv run check-format
Format codeο
pipenv run format
Git pre-commit hook integrationο
Install git pre-commit hooks (initial setup)ο
pip run pre-commit install
Commit Output - No Python Source Committedο
black................................................(no files to check)Skipped
[black-formatter 95bb1c6] settings black version to latest release
1 file changed, 1 insertion(+), 1 deletion(-)
Commit Output - Python Source is Correctly Formattedο
black....................................................................Passed
[format-test c3e1b4a] test commit
1 file changed, 1 insertion(+)
Commit Output - Black Updates Python Sourceο
black....................................................................Failed
- hook id: black
- files were modified by this hook
reformatted connect/routes/api.py
All done! β¨ π° β¨
1 file reformatted.
Generate trusted local certs for connect and supporting servicesο
./local-config/install-certificates.sh
For more information on connect and HTTPS/TLS support, please refer to the local cert readme.
Start connect and supporting servicesο
docker-compose up -d
docker-compose ps
pipenv run connect
Browse to https://localhost:5000/docs to view the Open API documentation
Docker Imageο
The connect docker image is an βincubatingβ feature and is subject to change. The image is associated with the βdeploymentβ profile to provide separation from core services.
Build the imageο
The connect image build integrates the applicationβs x509 certificate (PEM encoded) and configurations into the image. In the local, or development environment, certificates and configuration are stored in the ./local-config/connect directory. Deployed environments may use separate directories for certificates and configuration.
Build the image with Docker CLIο
docker build --build-arg CONNECT_CERT_PATH_BUILD_ARG=./local-config/connect \
--build-arg CONNECT_CONFIG_PATH_BUILD_ARG=./local-config/connect \
-t linuxforhealth/connect:0.42.0 .
Build the image with Docker-Composeο
The docker-compose command below parses the build context, arguments, and image tag from the docker-compose.yaml file.:
docker-compose build connect
Run connect and Supporting Servicesο
docker-compose --profile deployment up -d
Links and Resourcesο
Resource Type |
Link |
---|---|
π° Documentation |
|
π° Documentation |