openverse icon indicating copy to clipboard operation
openverse copied to clipboard

Add `psql` and `pgcli` to `ov` tooling

Open AetherUnbound opened this issue 1 year ago • 5 comments

Description

We recently encountered a case where it would be useful to have psql and pgcli available in the ov environment for interacting with the stack. It seems like the perfect candidate to add to the list of tooling available in ov!

We'll need to touch the following places for this:

  1. Adding whatever's necessary to install for the psql utility and pipx to the Docker image

https://github.com/WordPress/openverse/blob/e6259b47af51ad2151535142b8674be32d57bfec/docker/dev_env/Dockerfile#L49-L58

  1. Adding psql (or the dependency involved) to the list of dependency explanations

https://github.com/WordPress/openverse/blob/e6259b47af51ad2151535142b8674be32d57bfec/docker/dev_env/Dockerfile#L27

  1. Adding pgcli to the list of pipx dependencies:

https://github.com/WordPress/openverse/blob/e6259b47af51ad2151535142b8674be32d57bfec/docker/dev_env/Dockerfile#L38

  1. Adding documentation for it to the included tools

https://github.com/WordPress/openverse/blob/90f87b8712b50cf05401de91eb5805b067efeb85/documentation/general/general_setup.md#L111-L115

Additional context

Initially came up here: https://github.com/WordPress/openverse/pull/4610#pullrequestreview-2187062900

AetherUnbound avatar Jul 19 '24 22:07 AetherUnbound

Would pgcli be a better alternative? It might also be easier to install via pipx.

dhruvkb avatar Jul 20 '24 09:07 dhruvkb

Yea that works! We'll still need to have the libraries required for psql, per the install documentation:

Pgcli uses psycopg to talk to postgres database. In order to install psycopg, you will need libpq and python-dev installed on your system. Since psycopg is a C extension for Python, a C compiler is needed to install it on your system.

AetherUnbound avatar Jul 22 '24 17:07 AetherUnbound

This seems simple enough to do, I can work on this. (New here ehehe)

vivek378521 avatar Jul 29 '24 05:07 vivek378521

Welcome @vivek378521! I've assigned this to you.

dhruvkb avatar Jul 29 '24 06:07 dhruvkb

Created a PR: https://github.com/WordPress/openverse/pull/4664

For starting the psql server there are additional steps though, so might need to keep that in mind: https://developer.fedoraproject.org/tech/database/postgresql/about.html

vivek378521 avatar Jul 29 '24 07:07 vivek378521