Skip to content

Commit

Permalink
update to README.
Browse files Browse the repository at this point in the history
Pushed to both deploy branches.
  • Loading branch information
magnulei committed Oct 23, 2024
1 parent 167e5f6 commit 8e8c18c
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 5 deletions.
20 changes: 16 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
### Shinylims

A Python Shiny app for LIMS reporting hosted on Posit Connect.

The app displays metadata stored in pins. The pinning of data to Posit Connect is done using scripts running on the Illumina LIMS Clarity server:
https://github.com/NorwegianVeterinaryInstitute/nvi_lims_epps/tree/main/shiny_app

This python package is managed with uv (https://docs.astral.sh/uv). To run it, clone the repository and install the package with:

```
Expand All @@ -13,8 +17,16 @@ Then, run the shiny app with:
uv run uvicorn shinylims.app:app
```

For development:
Any pushes to main is automatically deployed on Posit Connect. Here we have two instances running; one test instance with admin-only access and one main production instance where everyone can gain access if needed. Each instance is associated with its own deploybranch on git. The value given in ```deploy_mode.txt``` specifies which deploy branch you are working on.

| Posit instance name | Git deploy branch name | Value for deploy_mode.txt | Access |
| ------------------- | --------------------- | ------------------------- | ------ |
| shinylims-uv-test-deploy | test-deploy | test | admin access only |
| shinylims-uv-deploy | deploy | prod | open for everyone by request |


The idea here is to first implement any changes on an instance running on your local computer. After confirmed running as expected locally, push to the test Posit instance to confirm that everything also functions on Posit. Then change mode to 'prod' and push again to implement changes to the production instance of the app. You can also choose to deploy from both branches at the same time by using the mode ```both```.

For doing code development locally, the api-key and Posit Connect URL must be provided in an .env file. Variables for the credentials are named ```POSIT_API_KEY``` and ```POSIT_SERVER_URL```.

* Set the deploy mode in deploy_mode.yaml. If set to 'test', any pushes to main will be deployed to the test-deploy shiny app instance on posit connect. Else set the mode to 'prod' to deploy on the production instance or 'both' to update both instances. The idea here is to first implement changes on an instance running on ypu local computer. When confirmed running as expected locally, first push to the test posit instance to confirm that everything also functions on posit. Then change to 'prod' and push again to implement changes to the production instance of the app.
* For local development, the apikey and posit connect url must be provided in a .env file.
* When pushing to main a Github actions pipeline will ensure that manifest and requirement files are created for posit deployment. These files along with any updates to the code are forced pushed to either the production deploy branch or the test_deploy branch depending on the mode set (see above)
The deployment is handled by the github actions workflow stored in .github\workflows\deploy.yml. This action will create the manifest and requirement files for posit deployment.
2 changes: 1 addition & 1 deletion deploy_mode.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
test
both

0 comments on commit 8e8c18c

Please sign in to comment.