API service to perform data mutation and format conversion.
Project description
SEAM
API service to perform data mutation.
The purpose of this repo is to facilitate the API service to perform mutation on data and do required processing. It provides endpoint to perform mutation on data passed.
Documentation
PROVIDE A LINK TO THE DOCUMENTATION HERE
Development
PROVIDE A LINK TO ANY DEVELOPMENT INFORMATION HERE
Running Locally
Installation and Setup
-
Install/Update Dependencies
poetry installor to update existing dependencies:
poetry update -
Run the Application
poetry run uvicorn seam_api.app:app --reload
or by poetry task :
poetry run task start-app
The API will be available at
http://localhost:8000
Running app using Container
-
Build the Image
docker build -f Containerfile -t bodc-seam:latest .
-
Run the Container
docker run -p 8000:8000 bodc-seam:latest
-
Verify the Application
Test the hello-world endpoint:
curl http://localhost:8000/api/hello-worldOr visit
http://localhost:8000/api/hello-worldin your browserYou should see:
{"message":"Hello, World!"}
Running app on Kubernetes
Prerequisites
- Local kubernetes cluster is running and accessible
kubectlis installed and configured- Helm is installed (for deployment management)
Deployment Steps
-
Deploy seam-api using Helm
helm install seam ./helm/ -n bodc --create-namespace
Or to upgrade an existing deployment:
helm upgrade seam ./helm/ -n bodc
-
Check Deployment Status
kubectl get deployments -n bodc
You should see the seam deployment listed with the desired and ready replicas.
-
Check if Pods are Running
kubectl get pods -n bodc
Verify that the seam pods are in the
Runningstate. You can also get more detailed information with:kubectl describe pod <pod-name> -n bodc
-
Port Forwarding (in a separate terminal)
kubectl port-forward svc/seam 8000:80 -n bodc
This forwards local port 8000 to the service port 80. The command will display:
Forwarding from 127.0.0.1:8000 -> 8000 Forwarding from [::1]:8000 -> 8000 -
Verify the Application is Running In another terminal, test the hello-world endpoint:
curl http://localhost:8000/api/hello-worldYou should see:
{"message":"Hello, World!"}
Additional Kubernetes Commands
-
View Logs
kubectl logs -f deployment/seam -n bodc
-
Access API Documentation After port-forwarding, visit
http://localhost:8000/docsin your browser for Swagger UI -
Delete the Deployment
helm uninstall seam -n bodc
-
Check Service
kubectl get svc -n bodc
Development Notes
- The interactive API documentation is available at
http://localhost:8000/docs(Swagger UI)
Package Installation
Poetry is used to manage the building of this package (.whl & .tar.gz files), and Poetry can be used to install the package dependencies for you. The dependencies are in the pyproject.toml file, to install them run:
poetry install
To update your installed dependencies, run:
poetry update
To install a new dependency and add it to the projects pyproject.toml file, run:
poetry add package_name
To view your projects dependencies, run:
poetry show
To view the specific dependencies for a particular package, run:
poetry show package_name
Code Testing
Run the following commands to test and validate your code:
poetry run task tests- Run all unit tests with coverage reportpoetry run task lint- Lint code with ruffpoetry run task lint-fix- Fix linting issues with ruffpoetry run task format- Auto-format code with ruffpoetry run task format-check- Check code formatting without fixingpoetry run task build- Build the package
Releasing a new version
Versions of the package are denoted by tags in git. To create a new tag, you can use the GitLab UI by following these steps:
-
Go the repository tags page
-
Click New tag
-
Enter the tag name. There are four options for the format for this tag:
- Alpha release (development release):
vX.Y.ZaW, for examplev1.0.2-dev3 - Release candidate (test release):
vX.Y.ZrcW, for examplev1.10.9-tst2 - Full release (production release):
vX.Y.Z, for examplev3.0.11
- Alpha release (development release):
-
Select the branch to create the tag from, this will normally be
main -
Enter a message for the tag, this is required for the CI/CD pipeline to function correctly
-
Click Create tag
-
This will trigger a CI/CD pipeline
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file bodc_seam-0.0.2.tar.gz.
File metadata
- Download URL: bodc_seam-0.0.2.tar.gz
- Upload date:
- Size: 8.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.2.0 CPython/3.14.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7fff78d1de2495c4630f77ff7657d43c190e0ca43fe54f2fd73ad5b03a09bb84
|
|
| MD5 |
d89054d12a89e1513b937350e9639dd4
|
|
| BLAKE2b-256 |
28570184d9ea7300e44b8a30f0d25845b23261f654ecdfa34c07fa6775f6c08c
|
File details
Details for the file bodc_seam-0.0.2-py3-none-any.whl.
File metadata
- Download URL: bodc_seam-0.0.2-py3-none-any.whl
- Upload date:
- Size: 10.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.2.0 CPython/3.14.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
555ce0f803b315df42ed6ea85daba3722190866fcb1993d94e2cb1b45157b28f
|
|
| MD5 |
4e170efb2967516562a58959bc6f9f48
|
|
| BLAKE2b-256 |
204e1393be13195b77de262bab20060d532a3bd2ed8ef8b316ded9ec5c74c14a
|