Skip to main content

Database for OpenCloning, a web application to generate molecular cloning strategies in json format, and share them with others.

Project description

opencloning-db

opencloning-db is the database/API companion package for the OpenCloning backend. It provides the app and local data workflows used for OpenCloning database features.

Run locally

From the repository root:

# Install or update workspace dependencies
uv sync

# If you are using mac, you may have to stop any local Postgres instances running on port 5432
brew services stop postgresql

# Start local Postgres with dev/test/e2e databases
docker compose -f docker/docker-compose.postgres.yml up -d

# Load required local runtime config
source .env.dev

# Seed the local baseline
uv run opencloning-cli db seed

# Run both the cloning and the database API - this what the OpenCloningDB frontend expects
uv run uvicorn opencloning_db.combined:app --reload --reload-exclude='.venv'

# Run the opencloning-db API (only database, not cloning. This is not used when running with the frontend)
uv run uvicorn opencloning_db.api:app --reload --reload-exclude='.venv'

That will serve the cloning API at http://127.0.0.1:8000/cloning and the database API at http://127.0.0.1:8001/db. That's what the OpenCloningDB frontend expects.

Running tests locally

From the repository root:

# Install or update workspace dependencies
uv sync

# Run the tests
uv run pytest packages/opencloning-db/tests -v -ks

Frontend testing

Frontend testing using the database requires reseting after tests that modify the database. You can do this by calling the /__test/reset-db endpoint with the X-Test-Reset-Token header set to RESET-TOKEN. That endpoint is only available if the OPENCLONING_TESTING environment variable is set to 1.

Building and running the Docker image

The Dockerfile is shared with the cloning app, and the build arg APP_TARGET determines which app to build. So you can build the image by running:

docker build -f docker/opencloning.Dockerfile --build-arg APP_TARGET=db -t manulera/opencloningbackend-db .

Then run it for development:

# Create the file storage directories
mkdir -p docker/file_storage/sequence_files docker/file_storage/sequencing_files

# Run the containers
docker compose \
    -f docker/docker-compose.postgres.yml \
    -f docker/docker-compose.opencloning-db.yml \
    up -d

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

opencloning_db-1.4.0.tar.gz (235.4 kB view details)

Uploaded Source

Built Distribution

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

opencloning_db-1.4.0-py3-none-any.whl (221.4 kB view details)

Uploaded Python 3

File details

Details for the file opencloning_db-1.4.0.tar.gz.

File metadata

  • Download URL: opencloning_db-1.4.0.tar.gz
  • Upload date:
  • Size: 235.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for opencloning_db-1.4.0.tar.gz
Algorithm Hash digest
SHA256 d1bfd40c79f727a4b35ec9454f87ad57da0e68c013de6d055ce4ebe9a3d2c1ac
MD5 3562a16abdbbb93f402c659d9684c227
BLAKE2b-256 b607835c52a8508b4ae58d37fb30878a43236d5c21134e2891a4be8636a4bc6b

See more details on using hashes here.

Provenance

The following attestation bundles were made for opencloning_db-1.4.0.tar.gz:

Publisher: release-please.yml on OpenCloning/OpenCloning_backend

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file opencloning_db-1.4.0-py3-none-any.whl.

File metadata

  • Download URL: opencloning_db-1.4.0-py3-none-any.whl
  • Upload date:
  • Size: 221.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for opencloning_db-1.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e7208eb3986494f428a99ecdd76df28bfc9b11416d7fb507c8b5788dd2a6a164
MD5 c4cf1f594b04bd4514b6be6e78fe2606
BLAKE2b-256 ae13457f83f044dc600a91940bed322cb214b9326ae585483272bd5d35cfeb18

See more details on using hashes here.

Provenance

The following attestation bundles were made for opencloning_db-1.4.0-py3-none-any.whl:

Publisher: release-please.yml on OpenCloning/OpenCloning_backend

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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