Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make shared default admin demo user for GraphKB/IPR #57

Closed
3 tasks done
creisle opened this issue May 17, 2022 · 9 comments
Closed
3 tasks done

Make shared default admin demo user for GraphKB/IPR #57

creisle opened this issue May 17, 2022 · 9 comments
Assignees
Labels
devops To do with setup of testing and deployment

Comments

@creisle
Copy link
Member

creisle commented May 17, 2022

To simplify the setup it would be great to add the same admin user for both IPR and GraphKB. This will require the following tasks

  • @mathieulemieux to change the default "graphkb_admin" user in the graphkb api repo to be "pori_admin"
  • @brayden-bcgsc to add a new "pori_admin" user to the IPR default db dump with admin access to IPR
  • @mathieulemieux or @brayden-bcgsc to rename the user "graphkb_admin" in the keycloak dump json to pori_admin and update the accompanying docs
@creisle creisle added the devops To do with setup of testing and deployment label May 17, 2022
@creisle
Copy link
Member Author

creisle commented May 19, 2022

@brayden-bcgsc and @mathieulemieux when the tasks above are done can you post the applicable release version of the API container back here

@mathieulemieux
Copy link
Member

mathieulemieux commented Jun 1, 2022

In order to test these changes, I did the following on dockerdev server:

  • strop and remove all pori containers
  • clone a new copy of pori, pori_ipr_api and pori_grapgkb_api repos
  • in pori_ipr_api:
    • checkout develop branch (includes changes to demo/ipr_demodb.postgres.dump)
  • in pori_graphkb_api:
    • checkout feature/KBDEV-977-make-shared-default-admin-demo-user-for-graphkb-ipr-57 branch (includes changes to src/repo/schema.js)
  • in pori:
    • checkout feature/make-shared-default-admin-demo-user-for-graphkb-ipr-57 branch (includes changes to demo/kc_realmexport.json)
    • made these changes to docker-compose.dev.yml
    • mkdir -p databases/{postgres,orientdb}/{backup,data} && mkdir keys
    • docker-compose -f docker-compose.dev.yml up -d --build
    • exported 3000, 5000, 8080, 8081 & 8888.

Here are the Keycloak users:
image

Here are the GraphKb users:
image

Errors I got:

  • I can't log into IPR using pori_admin; only iprdemo will work
  • Going from IPR to GraphKB while logged to IPR with iprdemo isn't possible without relogging with pori_admin user

@mathieulemieux
Copy link
Member

mathieulemieux commented Jun 3, 2022

Ok, in order to make it work, we need to update the ipr_demodb image too.
It's look like this: before starting the containers with docker-compose,

  • in pori_ipr_api repo, run the following command: "docker build -f Dockerfile.db -t bcgsc/pori-ipr-demodb:pori_admin ." (Ty @brayden-bcgsc !)
  • in pori repo, make an additional change to the docker-compose.dev.yml to make the ipr_db container based on image bcgsc/pori-ipr-demodb:pori_admin instead of bcgsc/pori-ipr-demodb:latest

Everything went well.
The pori_admin user allows to switch from IPR to GraphKB without the need to logout.

@mathieulemieux
Copy link
Member

On pori_graphkb_api, replace feature/KBDEV-977-make-shared-default-admin-demo-user-for-graphkb-ipr-57 from develop by bugfix/KBDEV-977-make-shared-default-admin-demo-user-for-graphkb-ipr-57 from master. Commit the same changes as before and re-tested everything on dockerdev. Ready to PR.

@mathieulemieux
Copy link
Member

mathieulemieux commented Jun 13, 2022

For info, here is the previous PR for default db dump made by @RaphaelPletz to pori_ipr_api: bcgsc/pori_ipr_api#160.

@mathieulemieux
Copy link
Member

Here are the different users in ipr, graphkb and keycloak:
image
Should we get rid of colab_demo and iprdemo?

@creisle
Copy link
Member Author

creisle commented Jul 20, 2022

Here are the different users in ipr, graphkb and keycloak: image Should we get rid of colab_demo and iprdemo?

we should only remove the users that were replaced with the new account (pori_admin) or that are no longer created

  • colab_demo should still be being created, it is used for the colab/jupyter notebooks in the docs
  • please double check that iprdemo still exists in IPR, if it does it can be left as well

@mathieulemieux
Copy link
Member

Looks like we are still using the iprdemo user in IPR so I'll let it there: https://github.com/bcgsc/pori_ipr_api/blob/b5038f806e183f0432a25078ed682b68ad9081f6/demo/clean_db_for_demo.js#L167-L206

@mathieulemieux
Copy link
Member

Closed by PR #59

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
devops To do with setup of testing and deployment
Projects
None yet
Development

No branches or pull requests

3 participants