laminhub-rest: Cross-instance management
Note: For more extensive documentation & testing, see docs.
Summary
- Installation
- CLI
- Run server
- Run tests
- Launch Jupyter lab
- Migrate
- Deployment
- Usage
- Release process
1. Installation
-
Clone this repository
-
Navigate to the repository and run:
pip install .
2. Dependencies
-
Supabase CLI
To use lnhub CLI on local environment you will first have to install and configure Supabase CLI.
-
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.
⚠️ 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:
-
Set
LAMIN_ENV=localprior to runninglnhub. This will ensure that a local Supabase instance is started and that the connection strings are properly configured. -
If you want to connect to an external Supabase (either in the cloud or managed by another process), you can customize
LAMIN_ENV=foobar(orprodorstaging) and place a corresponding .env file in the root folder. In this case it would belaminhub-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
Metadata
Release files for laminhub_rest 0.14.11
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| laminhub_rest-0.14.11.tar.gz | 65.0 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| laminhub_rest-0.14.11-py2.py3-none-any.whl | Python 2, Python 3 | none | any | Details |
Total release size: 138.0 kB
Release files / laminhub_rest-0.14.11.tar.gz
| Download URL | laminhub_rest-0.14.11.tar.gz |
|---|---|
| Size | 65.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
bad43d5214f19fb763daffbc623fec2cdaf5ef50daf206414bf6a26c71337ca5
|
|
BLAKE2b-256 checksum How to use checksums |
8aab1c360008d49e4455b6459c6beb6f2052fb2d6ecf77ccdd2fb14a5e5cc1fb
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
python-requests/2.28.1
|
Release files / laminhub_rest-0.14.11-py2.py3-none-any.whl
| Download URL | laminhub_rest-0.14.11-py2.py3-none-any.whl |
|---|---|
| Size | 73.0 kB |
| Tags | Python 2 Python 3 |
|
SHA-256 checksum How to use checksums |
471c4cc9f901ae644fcc7eba719849575f4eb35b2ac222b6434dc73ad82d0eec
|
|
BLAKE2b-256 checksum How to use checksums |
09ab61e6350e7df0393bbdd44502825dccb42d63466c23476d28aaf66a71628b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
python-requests/2.28.1
|