Skip to content

Instantly share code, notes, and snippets.

@Johnetordoff
Created September 13, 2024 12:56
Show Gist options
  • Save Johnetordoff/c8e46110361ab8e9e2c0e7117a9745a6 to your computer and use it in GitHub Desktop.
Save Johnetordoff/c8e46110361ab8e9e2c0e7117a9745a6 to your computer and use it in GitHub Desktop.
Testing instituional dashboard from no volume
How to test institutional dashboard locally from no volumes.
0. First ensure you have no pre-existing images or volumes, remove any you have, then pull images appropreaiate for
arm/amd, override elasticsearch6 if necesarry
1. Change Postgres env `POSTGRES_HOST_AUTH_METHOD: trust`
2. Start the postgres container `docker compose up -d postgres` and then enter bash inside of it. `docker compose exec postgres bash`
once in bash open postgres and create a new database for the OSF using `psql` to edit postgres.
```bash
root@14a01cd0126a:/# psql -Upostgres
postgres=# create database osf;
```
3. Once your done with that you still have to migrate into the database so enter bash for the web `docker compose exec web bash` and
Then run `python3 manage.py migrate` to run migrations.
4. Run script: `python3 -m scripts.populate_institutions` to create test institutions.
5. Now you can open the shell `python3 manage.py osf_shell` and create/edit test users and senarios to setup for the dashboard
and commit the changes. Remember to set the feature flag:
```shell
Flag.objects.filter(name='institutional_dashboard_2024').update(everyone=True)
commmit()
```
6. run `python3 manage.py sync_databases` to generate the es6 metrics indexes.
7. run `python3 manage.py monthly_reporters_go yyyy-mm ` to record for the present month.
8. run `python3 manage.py update_institution_project_counts`
9. See changes on `http://localhost:5000/institutions/<inst_id>/dashboard/`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment