Skip to main content

Rest API for the hub.

Project description

codecov

laminhub-rest: Cross-instance management

Note: For more extensive documentation & testing, see docs.

Summary

  1. Installation
  2. CLI
    1. Run server
    2. Run tests
    3. Launch Jupyter lab
    4. Migrate
  3. Deployment
  4. Usage
  5. Release process

1. Installation

  1. Clone this repository

  2. Navigate to the repository and run:

    pip install .
    

2. Dependencies

  1. Supabase CLI

    To use lnhub CLI on local environment you will first have to install and configure Supabase CLI.

  2. Docker

    You must also have Docker installed to allow Supabase CLI to create and run the relevant containers

3. Local Development

The lnhub script serves as the entrypoint for all actions you need to run for local development.

:warning: It is important that you use this entrypoint as it properly configures the settings.

To ensure that the environment is properly configured you can do one of three things:

  1. Set LAMIN_ENV=local prior to running lnhub. This will ensure that a local Supabase instance is started and that the connection strings are properly configured.

  2. If you want to connect to an external Supabase (either in the cloud or managed by another process), you can customize LAMIN_ENV=foobar (or prod or staging) and place a corresponding .env file in the root folder. In this case it would be laminhub-rest--foobar.env.

    • The .env file must contain values for the following variables:

      POSTGRES_DSN
      SUPABASE_API_URL
      SUPABASE_ANON_KEY
      SUPABASE_SERVICE_KEY
      

Run the server

LAMIN_ENV=local lnhub run

Run tests

LAMIN_ENV=local lnhub test -s test_local

Any parameters after the lnhub test command are passed directly to nox

Launch Jupyter lab

LAMIN_ENV=local lnhub jupyter

Open an IPython shell

LAMIN_ENV=local lnhub shell

Migrate

See Migrations

3. Deployment

Push on the staging branch to deploy in staging.

Push on the main branch to deploy in production.

4. Usage

Access API documentation from these endpoints.

Locally:

http://localhost:8000/docs

On staging server :

https://laminhub-rest-cloud-run-staging-xv4y7p4gqa-uc.a.run.app/docs

On production server:

https://laminhub-rest-cloud-run-main-xv4y7p4gqa-uc.a.run.app/docs

5. Release process

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

laminhub_rest-0.11.0.tar.gz (61.8 kB view details)

Uploaded Source

Built Distribution

laminhub_rest-0.11.0-py2.py3-none-any.whl (61.6 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file laminhub_rest-0.11.0.tar.gz.

File metadata

  • Download URL: laminhub_rest-0.11.0.tar.gz
  • Upload date:
  • Size: 61.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-requests/2.28.1

File hashes

Hashes for laminhub_rest-0.11.0.tar.gz
Algorithm Hash digest
SHA256 9b56e1d20e62ca7e85f674e950b7d00a2650a4e28ab10b41a6c1c1d9177f0a2c
MD5 ee407b4f3c0bf412e62c38acaa8cbf92
BLAKE2b-256 91324c8ad0c9a89ffc4abf5b6aabe079241cd9242ddc9840239fe951af898abe

See more details on using hashes here.

Provenance

File details

Details for the file laminhub_rest-0.11.0-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for laminhub_rest-0.11.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 dbe1339c7ef3b7355700572f35451c413bd54e22d051b7db2395feccba1d17c7
MD5 d11ba4063fd309695bc2be516ab59ab8
BLAKE2b-256 21943f4bfcab2b553899dfd43112801e9346c1d9bf56fb6a47fcc0eae7f438f7

See more details on using hashes here.

Provenance

Supported by

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