From 56352f02e7d8dee06410a08885843810b5ee6c06 Mon Sep 17 00:00:00 2001 From: Valerie Becker Date: Mon, 18 Nov 2024 16:36:43 -0700 Subject: [PATCH] Tox helps with docs --- .../schema-migration-process.rst | 66 ++++++++++--------- 1 file changed, 36 insertions(+), 30 deletions(-) diff --git a/doc/operator-guide/schema-migration-process.rst b/doc/operator-guide/schema-migration-process.rst index 4ca6737a..96151408 100644 --- a/doc/operator-guide/schema-migration-process.rst +++ b/doc/operator-guide/schema-migration-process.rst @@ -36,36 +36,42 @@ Create an Alembic Migration (manually) Test alembic migration ====================== - - You will need to test the version migrating the TTS db using your ``consdb`` branch on before merging or applying the migration to the Summit. - - This testing should include testing any code that populates the new columns/tables at TTS/BTS if Summit schema is changing. - - 1. Update the deployment on the test stand: - - - Choose the appropriate test stand (TTS, BTS) - - Create a branch in ``phalanx`` and edit the corresponding test stand environment file ``phalanx/applications/consdb/values-.yaml`` to point to your branch's built docker image (tickets-DM-###). - - Coordinate and announce in the appropriate slack channel that you will begin testing your migrations. - - Update the consdb deployment in ``/argo-cd`` to use your ``phalanx`` branch in the ``Target Revision``. Refresh and check pod logs. - - Verify the tables that you will be upgrading exist using ``psql`` - - From the ``consdb/`` directory, (where ``alembic.ini`` file is) use the alembic commands to upgrade the existing database tables: ``alembic upgrade head -n `` - - Deploy new consdb software (``hinfo``, ``pqserver``) and check the initial logs. - - 2. Test with LATISS imaging in ATQueue: - - - Access LOVE via ``/love`` and use the 1Password admin information to sign in, or your SLAC username and password. - - Navigate to the ATQueue or Auxillary Telescope (AuxTel) Script Queue. - - See (TTS Start Guide)[https://rubinobs.atlassian.net/wiki/spaces/LSSTCOM/pages/53739987/Tucson+Test+Stand+Start+Guide] for guidelines on using the test stands. - - Before editing these scripts, note their starting configurations, as we will return the configuration to that when we are done. - - Take a test/simulated picture with LATISS through the ATQueue using these three scripts: - - 1. ``set_summary_state.py`` Change the configuration to enable ATHeaderService and ATCamera. - 2. ``enable_latiss.py`` Remove any existing configuration. - 3. ``take_image_latiss.py`` Update the configuration to remove anything that is not 'nimages' (1) and 'image_type' (ENGTEST) - - - Once you have put these three scripts in the queue, click ``run``. - - Watch for errors in the Script Queue and the ``argo-cd`` ``consdb`` pod logs and ``hinfo-latiss`` deployment. - - Address any errors and retest. - - Check the database by using ``psql`` commands like ``\dt`` to display the table names and maybe even ``SELECT * from cdb_latiss.exposure where day_obs == ;`` to view the most recent data. - - If you have encountered errors in this process, do not proceed to the summit, but address those errors and retest them with your ``phalanx`` branch pointing to your ``consdb`` branch with the updates that fix the errors. +- You will need to test the version migrating the TTS db using your ``consdb`` branch on before merging or applying the migration to the Summit. +- This testing should include testing any code that populates the new columns/tables at TTS/BTS if Summit schema is changing. + +1. Update the deployment on the test stand: +------------------------------------------- + + - Choose the appropriate test stand (TTS, BTS) + - Create a branch in ``phalanx`` and edit the corresponding test stand environment file ``phalanx/applications/consdb/values-.yaml`` to point to your branch's built docker image (tickets-DM-###). + - Coordinate and announce in the appropriate slack channel that you will begin testing your migrations. + - Update the consdb deployment in ``/argo-cd`` to use your ``phalanx`` branch in the ``Target Revision``. Refresh and check pod logs. + - Verify the tables that you will be upgrading exist using ``psql`` + - From the ``consdb/`` directory, (where ``alembic.ini`` file is) use the alembic commands to upgrade the existing database tables: ``alembic upgrade head -n `` + - Deploy new consdb software (``hinfo``, ``pqserver``) and check the initial logs. + +2. Test with LATISS imaging in ATQueue: +--------------------------------------- + + - Access LOVE via ``/love`` and use the 1Password admin information to sign in, or your SLAC username and password. + - Navigate to the ATQueue or Auxillary Telescope (AuxTel) Script Queue. + - See (TTS Start Guide)[https://rubinobs.atlassian.net/wiki/spaces/LSSTCOM/pages/53739987/Tucson+Test+Stand+Start+Guide] for guidelines on using the test stands. + - Before editing these scripts, note their starting configurations, as we will return the configuration to that when we are done. + - Take a test/simulated picture with LATISS through the ATQueue using these three scripts: + + 1. ``set_summary_state.py`` Change the configuration to set ATHeaderService and ATCamera to ENABLED. + 2. ``enable_latiss.py`` Remove any existing configuration. + 3. ``take_image_latiss.py`` Update the configuration to remove anything that is not 'nimages' (1) and 'image_type' (BIAS or DARK or FLAT) + + - Once you have put these three scripts in the queue, click ``run``. + - Watch for errors in the Script Queue and the ``argo-cd`` ``consdb`` pod logs and ``hinfo-latiss`` deployment. + - Address any errors and retest. + - Check the database by using ``psql`` commands like ``\dt`` to display the table names and maybe even ``SELECT * from cdb_latiss.exposure where day_obs == ;`` to view the most recent data. + + - Run set_summary_state to set ATHeaderService and ATCamera back to STANDBY, and return LATISS back to STANDBY. + - Then return these three scripts to their original configurations. + + - If you have encountered errors in this process, do not proceed to the summit, but address those errors and retest them with your ``phalanx`` branch pointing to your ``consdb`` branch with the updates that fix the errors. - If tests are successful, create a pull request for the Alembic migration in ``consdb``. Tag the release according to ``standards-practices`` guidelines.