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.2-dev3
    • Release candidate (test release): vX.Y.ZrcW, for example v1.10.9-tst2
    • 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.2.tar.gz (8.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.2-py3-none-any.whl (10.2 kB view details)

Uploaded Python 3

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

Hashes for bodc_seam-0.0.2.tar.gz
Algorithm Hash digest
SHA256 7fff78d1de2495c4630f77ff7657d43c190e0ca43fe54f2fd73ad5b03a09bb84
MD5 d89054d12a89e1513b937350e9639dd4
BLAKE2b-256 28570184d9ea7300e44b8a30f0d25845b23261f654ecdfa34c07fa6775f6c08c

See more details on using hashes here.

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

Hashes for bodc_seam-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 555ce0f803b315df42ed6ea85daba3722190866fcb1993d94e2cb1b45157b28f
MD5 4e170efb2967516562a58959bc6f9f48
BLAKE2b-256 204e1393be13195b77de262bab20060d532a3bd2ed8ef8b316ded9ec5c74c14a

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