Skip to content

Commit

Permalink
Formatting in rst to not block quote
Browse files Browse the repository at this point in the history
  • Loading branch information
Vebop committed Nov 8, 2024
1 parent 74e864b commit bc0400d
Showing 1 changed file with 28 additions and 24 deletions.
52 changes: 28 additions & 24 deletions doc/operator-guide/schema-migration-process.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ Schema Migration Process
- Create a Jira ticket and assign it to Valerie to create a schema migration. (Is there a separate migration request process?)


* Create an Alembic Migration

- Alembic (https://alembic.sqlalchemy.org/en/latest/front.html) keeps track of versioning by autogenerated migrations to sync the test stands and summit databases.
Expand All @@ -38,21 +39,22 @@ Schema Migration Process
- Remove the ``visit1`` and ``ccdvisit1`` views.
- Ensure constraints and renamed columns are correct.


* Test alembic migration and code to populate the new columns/tables at TTS/BTS if Summit schema is changing

You will need to rest the migration on your ``consdb`` branch on TTS before merging or applying the migration to the Summit.
- You will need to rest the migration on your ``consdb`` branch on TTS before merging or applying the migration to the Summit.

1. Update the deployment on the test stand:
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-<test stand>.yaml`` to point to your branch.
Coordinate and announce in the appropriate slack channel that you will begin testing your migrations.
Update the consdb deployment in ``<url.to.teststand>/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 <database name>``
Deploy new consdb software (``hinfo``, ``pqserver``) and check the initial logs.
- Choose the appropriate test stand (TTS, BTS)
- Create a branch in ``phalanx`` and edit the corresponding test stand environment file ``phalanx/applications/consdb/values-<test stand>.yaml`` to point to your branch.
- Coordinate and announce in the appropriate slack channel that you will begin testing your migrations.
- Update the consdb deployment in ``<url.to.teststand>/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 <database name>``
- Deploy new consdb software (``hinfo``, ``pqserver``) and check the initial logs.

2. Test with LATISS imaging in ATQueue:
2. Test with LATISS imaging in ATQueue:

- Access LOVE via ``<url.to.teststand>/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.
Expand All @@ -74,34 +76,36 @@ Schema Migration Process
- If tests are successful, create a pull request for the Alembic migration in ``consdb``. Tag the release according to ``standards-practices`` guidelines.
- Update your existing phalanx branch to point the environment based deployments to this consdb tag. You are able to retest on the test stand at this point, hopefully there were no changes to your consdb pull request so this step is trivial.


* Deploy migration in synchrony at Summit (if necessary), USDF, and Prompt Release (if necessary)

What is prompt release?
- What is prompt release?


* Deploy code to populate at Summit and/or USDF

Follow the testing steps above for testing alembic migration and code at TTS/BTS, before the you consider deploying at the summit.
- Follow the testing steps above for testing alembic migration and code at TTS/BTS, before the you consider deploying at the summit.

The steps to deploy at the summit mirror the steps to test on a test stand with coordination and permission from the observers and site teams.
Access to argo-cd deployments is available via the Summit OpenVPN.
To coordinate your deployment update on the summit, you must attend Coordination Activities Planning (CAP) meeting on Tuesday mornings and announce your request.
- The steps to deploy at the summit mirror the steps to test on a test stand with coordination and permission from the observers and site teams.
- Access to argo-cd deployments is available via the Summit OpenVPN.
- To coordinate your deployment update on the summit, you must attend Coordination Activities Planning (CAP) meeting on Tuesday mornings and announce your request.

- Add it to the agenda here: https://rubinobs.atlassian.net/wiki/spaces/LSSTCOM/pages/53765933/Agenda+Items+for+Future+CAP+Meetings

The CAP members may tell you a time frame that is acceptable for you to perform these changes.
- The CAP members may tell you a time frame that is acceptable for you to perform these changes.

- They may also tell you specific people to coordinate with to help you take images to test LATISS and LSSTCOMCAMSIM tables. There will be more tables to test eventually.
- Some important channels to note: #rubinobs-test-planning; #summit-announce; #summit-auxtel, https://obs-ops.lsst.io/Communications/slack-channel-usage.html.

When you get your final approval and designated time to perform the changes to ConsDb, announce on #summit-announce, and follow similar steps as test stand procedure above.
- When you get your final approval and designated time to perform the changes to ConsDb, announce on #summit-announce, and follow similar steps as test stand procedure above.

* Summit Deployment Steps
* Summit Deployment Steps

1. Use a branch in ``phalanx`` to point to the ``consdb`` tag for deployment.
2. Set the ``argo-cd`` application ``consdb's`` target revision to your ``phalanx`` branch.
3. Refresh the consdb application and review pod logs.
4. Have an image taken with the observing team, then verify database entries with a SQL query or Jupyter notebook.
5. Check your new entries in the database using a jupyter notebook or SQL query in RSP showing your new image has been inserted to the database as expected.
1. Use a branch in ``phalanx`` to point to the ``consdb`` tag for deployment.
2. Set the ``argo-cd`` application ``consdb's`` target revision to your ``phalanx`` branch.
3. Refresh the consdb application and review pod logs.
4. Have an image taken with the observing team, then verify database entries with a SQL query or Jupyter notebook.
5. Check your new entries in the database using a jupyter notebook or SQL query in RSP showing your new image has been inserted to the database as expected.


- Once deployment succeeds, set the ``Target Revision`` in ``argo-cd`` back to ``main`` and complete the ``phalanx`` PR for the tested ``consdb`` tag.
- Once deployment succeeds, set the ``Target Revision`` in ``argo-cd`` back to ``main`` and complete the ``phalanx`` PR for the tested ``consdb`` tag.

0 comments on commit bc0400d

Please sign in to comment.