Setting Up the Site - AndersenLab/CAENDR GitHub Wiki
This page outlines how to configure the site, once all the data is in place.
Setup tasks that can be performed on a running version of the site, local or public.
Task | Notes | Read More |
---|---|---|
Create a new admin user | You'll have some trouble using the site unless you do this one... | link |
Load containers | Pull the available tool container versions. Must be performed for tools to be usable. | link |
Build SQL tables | Build the SQL database tables required by the site. | link |
External (non-GCP) data sources & service integrations.
Service | Notes | Read More |
---|---|---|
Google Sheets | Tracking strain orders, lab strains, etc. | link |
Google Analytics | Monitoring site usage. | link |
Sentry | Monitoring service to track errors, crashes, etc. | link |
This section outlines setup tasks that can be performed on a running version of the site, local or public.
To gain admin access to the site, you must first create a new user, then bump this user object to the admin role:
- Create a new user by logging in to the site.
- Once the account has been created, navigate to Google Cloud Datastore and select the correct database.
- Query by the kind
user
and locate the entity you just created. NOTE: Make sure you've got the right user! - Manually edit this
user
entity to promote your new account to the admin role. This can be accomplished by adding"admin"
to theroles
field list.
Before the containerized tools (Nemascan, Heritability, Indel Primer) can be used for the first time, the available container versions must be loaded from docker hub. Visiting the 'Tool Versions' page in the 'Admin' portal will import this data automatically:
- Log in to the site as an admin user. If you don't have an admin account, perform the steps above.
- Navigate to the Admin portal. This can be accessed through the profile button in the top right-hand corner, or by navigating directly to the URL
/admin
. - Under the "Tool & Database Administration" section, navigate to "Manage Tool Containers". (This might also be titled "Tool Container Versions", or even just "Tool Versions".)
- The container versions will be imported automatically on page load. Double-check the table values to confirm the tool sources, versions, etc.
Before you can use many of the site features, you must build the tables in the site's SQL database. In particular, the strains
table is used on many pages across the site.
To build the tables, perform the following steps:
-
Upload all required data files for the tables you want to build. Consult Data Dependencies: SQL Database Source Files for more information.
-
Build all desired tables. Consult Managing the SQL Database: Building SQL Tables for instructions.
This section outlines external data sources & service integrations (i.e. separate from GCP) that are involved in CaeNDR functionality.
To allow the website to write to the Google Sheet where orders are recorded, you must add the Google Sheets service account as an editor for the sheet specified by the environment variable ANDERSEN_LAB_ORDER_SHEET
. The service account will be constructed from the following environment variables:
{ GOOGLE_SHEETS_SERVICE_ACCOUNT_NAME }@{ GOOGLE_CLOUD_PROJECT_ID }.iam.gserviceaccount.com
For more information on these variables, see the Tokens & Variables page.
The lab collection data for each strain are also hosted in species-specific Google Sheet documents. The document IDs are specified with the GCP secret values:
ANDERSEN_LAB_STRAIN_SHEET_{ SPECIES }
The data in these sheets is compiled into the strains
SQL table. For more information on loading this data, please consult the section SQL Database Source Files. For more information on how this table is used and how to (re)build it, please consult the page Managing the SQL Database.
To view the about/statistics
page, you must add the Google Analytics service account user to the Google Analytics account:
{ GOOGLE_ANALYTICS_SERVICE_ACCOUNT_NAME }@{ GOOGLE_CLOUD_PROJECT_ID }.iam.gserviceaccount.com
For more information on these variables, see the Tokens & Variables page.
...