Skip to main content

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

  1. Install/Update Dependencies

    poetry install
    

    or to update existing dependencies:

    poetry update
    
  2. 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

  1. Build the Image

    docker build -f Containerfile -t bodc-seam:latest .
    
  2. Run the Container

    docker run -p 8000:8000 bodc-seam:latest
    
  3. Verify the Application

    Test the hello-world endpoint:

    curl http://localhost:8000/api/hello-world
    

    Or visit http://localhost:8000/api/hello-world in your browser

    You should see:

    {"message":"Hello, World!"}
    

Running app on Kubernetes

Prerequisites

  • Local kubernetes cluster is running and accessible
  • kubectl is installed and configured
  • Helm is installed (for deployment management)

Deployment Steps

  1. 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
    
  2. Check Deployment Status

    kubectl get deployments -n bodc
    

    You should see the seam deployment listed with the desired and ready replicas.

  3. Check if Pods are Running

    kubectl get pods -n bodc
    

    Verify that the seam pods are in the Running state. You can also get more detailed information with:

    kubectl describe pod <pod-name> -n bodc
    
  4. 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
    
  5. Verify the Application is Running In another terminal, test the hello-world endpoint:

    curl http://localhost:8000/api/hello-world
    

    You 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/docs in 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 report
  • poetry run task lint - Lint code with ruff
  • poetry run task lint-fix - Fix linting issues with ruff
  • poetry run task format - Auto-format code with ruff
  • poetry run task format-check - Check code formatting without fixing
  • poetry 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:

  1. Go the repository tags page

  2. Click New tag

  3. Enter the tag name. There are four options for the format for this tag:

    • Alpha release (development release): vX.Y.ZaW, for example v1.0.2a3
    • Beta release (development release): vX.Y.ZbW, for example v2.3.0b1
    • Release candidate (test release): vX.Y.ZrcW, for example v1.10.9rc2
    • Full release (production release): vX.Y.Z, for example v3.0.11
  4. Select the branch to create the tag from, this will normally be main

  5. Enter a message for the tag, this is required for the CI/CD pipeline to function correctly

  6. Click Create tag

  7. This will trigger a CI/CD pipeline

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

bodc_seam-0.0.1.tar.gz (7.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

bodc_seam-0.0.1-py3-none-any.whl (8.6 kB view details)

Uploaded Python 3

File details

Details for the file bodc_seam-0.0.1.tar.gz.

File metadata

  • Download URL: bodc_seam-0.0.1.tar.gz
  • Upload date:
  • Size: 7.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.2.0 CPython/3.14.4

File hashes

Hashes for bodc_seam-0.0.1.tar.gz
Algorithm Hash digest
SHA256 dcf2616905aa382ab7da5a467cb1d396209ebd785c071c78156b49de748c280c
MD5 32026af859f314125663faa266903ee1
BLAKE2b-256 5d46349c2f08858c3d4e89d5062fdbfd5c10a457583bdb970d2bd13c3b008b80

See more details on using hashes here.

File details

Details for the file bodc_seam-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: bodc_seam-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 8.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.2.0 CPython/3.14.4

File hashes

Hashes for bodc_seam-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 b3bb8bdeed9a2db2bbbb8c005744a9e5ff7da250532861a4913c705866db737d
MD5 7a9ee73b83337b64e83408bd15565a25
BLAKE2b-256 71721b77a92464814e0428ae0560f56e56d9688ce9e00e83ab637a3c96bf7bb6

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page