Personal code to showcase my abilities, such as:
-
Software Engineering in Python:
-
Code (e.g. design patterns)
-
Tests (unit and integration)
-
Project tooling (pre-commit, Ruff)
-
-
Docker
-
Terraform
-
Cloud Engineering
-
DevOps
- Python 3.12 and Pip/Poetry
- Pyenv
- Docker
- Terraform
- Azure subscription
- Pre-commit
- Hadolint binary (when using pre-commit)
Ansible can be used to install prerequisites: ansible-playbook ansible.yaml --ask-become-pass
Install correct Python version using Pyenv:
pyenv install 3.12
poetry env use $(pyenv which python)
poetry install
To run the project locally using Python, run:
poetry run fastapi run app/main.py --host 0.0.0.0 --port 8080
Go to e.g.: http://0.0.0.0:8080/docs
poetry run pytest tests/
First navigate to the function_app folder and then build the container:
docker build -t functionapp:latest .
Then run the container:
docker run -p 80:80 -it functionapp:latest
Redis can be used as a backend to cache FastAPI requests.
Start the FastAPI and Redis database using: docker compose up
To rebuild, run: docker compose up --build
Use the function app to Go to e.g.: http://*.azurewebsites.com.
Although unadvised, setting PYTHONHTTPSVERIFY to false circumpasses SSL certificate verification when behind proxy firewall. Installing the required certificates in certifi, local truststore or poetry configuration is preferred.
- fix infra bug: [DEBUG] POST https://management.azure.com/subscriptions//resourceGroups/rg20embedding001/providers/Microsoft.App/containerApps/ca20embedding001/listSecrets?api-version=2023-05-01 (status: 500): retrying in 1s (9 left)
I do have the correct role set for the principal.
- make Redis asynchronous
- create interface for Redis and Pinecone database
- devops pipeline
- integration test
- create package from model and handler so that I can use it in Docker image
- caching requests for FastAPI using external database
- try uv instead of Poetry.