Uploaded image for project: 'Data Management'
  1. Data Management
  2. DM-36709

Update the exposurelog teststand to work with the new postgres butler

    XMLWordPrintable

    Details

    • Type: Story
    • Status: Done
    • Resolution: Done
    • Fix Version/s: None
    • Component/s: None
    • Labels:

      Description

      The Tucson teststand butler registries are now in postgres, with secrets.

      Kian-Tat Lim suggests setting these two environment variables:

      • PGUSER=username
      • PGPASSWORD=password

      The data is available in the source of secrets that exposurelog already uses.

        Attachments

          Activity

          Show
          rowen Russell Owen added a comment - - edited Pull requests: https://github.com/lsst-sqre/phalanx/pull/1796 https://github.com/lsst-sqre/exposurelog/pull/57 https://github.com/lsst-sqre/exposurelog/pull/58
          Hide
          ktl Kian-Tat Lim added a comment -

          As mentioned on SLAC, I think this is actually the wrong way to go. We should use Postgres mechanisms to give the account you're already using access to the Butler schemas.

          Show
          ktl Kian-Tat Lim added a comment - As mentioned on SLAC, I think this is actually the wrong way to go. We should use Postgres mechanisms to give the account you're already using access to the Butler schemas.
          Hide
          ktl Kian-Tat Lim added a comment -

          OK, so you'll use the original env vars to get access for the exposurelog code and the "new" PG* env vars to allow the Butler to get access, all with the same credentials. That seems reasonable, although you could theoretically get rid of the original ones.

          Show
          ktl Kian-Tat Lim added a comment - OK, so you'll use the original env vars to get access for the exposurelog code and the "new" PG* env vars to allow the Butler to get access, all with the same credentials. That seems reasonable, although you could theoretically get rid of the original ones.
          Hide
          rowen Russell Owen added a comment -

          I would much rather have two sets of credentials in case we ever want to make the butler credentials different than the exposurelog database credentials.

          Show
          rowen Russell Owen added a comment - I would much rather have two sets of credentials in case we ever want to make the butler credentials different than the exposurelog database credentials.
          Hide
          rowen Russell Owen added a comment - - edited

          Tagged exposurelog 0.9.6 (after fixing deployment issues in 0.9.5).

          Deployment succeeded on the summit but failed on the Tucson test stand with:

          Failed to instantiate Butler from config file:///volume_1/butler.yaml.
          ERROR: Traceback (most recent call last):
          File "/opt/venv/lib/python3.10/site-packages/sqlalchemy/engine/base.py", line 1900, in _execute_context
          self.dialect.do_execute(
          File "/opt/venv/lib/python3.10/site-packages/sqlalchemy/engine/default.py", line 736, in do_execute
          cursor.execute(statement, parameters)
          psycopg2.errors.InsufficientPrivilege: permission denied for schema lsstcomcam
          LINE 2: FROM lsstcomcam.butler_attributes

          See https://tucson-teststand.lsst.codes/argo-cd/applications/exposurelog?view=tree&resource=&node=%2FPod%2Fexposurelog%2Fexposurelog-9d4cdd9fd-gpkhh%2F0&tab=logs

          Show
          rowen Russell Owen added a comment - - edited Tagged exposurelog 0.9.6 (after fixing deployment issues in 0.9.5). Deployment succeeded on the summit but failed on the Tucson test stand with: Failed to instantiate Butler from config file:///volume_1/butler.yaml . ERROR: Traceback (most recent call last): File "/opt/venv/lib/python3.10/site-packages/sqlalchemy/engine/base.py", line 1900, in _execute_context self.dialect.do_execute( File "/opt/venv/lib/python3.10/site-packages/sqlalchemy/engine/default.py", line 736, in do_execute cursor.execute(statement, parameters) psycopg2.errors.InsufficientPrivilege: permission denied for schema lsstcomcam LINE 2: FROM lsstcomcam.butler_attributes See https://tucson-teststand.lsst.codes/argo-cd/applications/exposurelog?view=tree&resource=&node=%2FPod%2Fexposurelog%2Fexposurelog-9d4cdd9fd-gpkhh%2F0&tab=logs
          Hide
          ktl Kian-Tat Lim added a comment - - edited

          The problem was that I forgot that we need these commands as well, which Joshua Hoblitt has now run for us:

          GRANT USAGE ON SCHEMA latiss TO exposurelog;
          GRANT USAGE ON SCHEMA lsstcomcam TO exposurelog;
          

          in addition to the two original commands to give access to the tables:

          GRANT SELECT ON ALL TABLES IN SCHEMA latiss TO exposurelog;
          GRANT SELECT ON ALL TABLES IN SCHEMA lsstcomcam TO exposurelog;
          

          Show
          ktl Kian-Tat Lim added a comment - - edited The problem was that I forgot that we need these commands as well, which Joshua Hoblitt has now run for us: GRANT USAGE ON SCHEMA latiss TO exposurelog; GRANT USAGE ON SCHEMA lsstcomcam TO exposurelog; in addition to the two original commands to give access to the tables: GRANT SELECT ON ALL TABLES IN SCHEMA latiss TO exposurelog; GRANT SELECT ON ALL TABLES IN SCHEMA lsstcomcam TO exposurelog;

            People

            Assignee:
            rowen Russell Owen
            Reporter:
            rowen Russell Owen
            Reviewers:
            Kian-Tat Lim
            Watchers:
            Kian-Tat Lim, Russell Owen
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Jenkins

                No builds found.