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

Do a release with new deployment model #288

Closed
23 tasks done
Tracked by #282
angela-tran opened this issue Aug 8, 2023 · 4 comments
Closed
23 tasks done
Tracked by #282

Do a release with new deployment model #288

angela-tran opened this issue Aug 8, 2023 · 4 comments
Assignees

Comments

@angela-tran
Copy link
Member

angela-tran commented Aug 8, 2023

Depends on #284, #286, #287

  • Deploy an -rc version to test environment
    • Check out the default branch and make sure it's up-to-date with remote default branch
    • Make an annotated Git tag following release candidate version number format, 2024.01.1-rc1, and push it
    • Check on the Azure DevOps infra pipeline for each transit agency:
      • Did the pipeline run?
      • Was terraform plan successful?
      • Did the pipeline wait for your approval to run terraform apply?
      • Was terraform apply succcessful?
    • Check on the GitHub workflow that does the Docker publish:
      • Did the tests run?
      • Did a new Docker image get published with the expected Docker tags (2024.01.1-rc1, test, and the Git SHA)?
    • QA the app:
      • Does the app respond? (/healthcheck)
      • Is the version number correct?
  • Deploy a new version to prod environment
    • Check out the release candidate tag
    • Make an annotated Git tag following release version number format, 2024.01.1, and push it
      • git tag -a 2024.01.1
      • git push origin 2024.01.1
    • Check on the Azure DevOps infra pipeline for each transit agency:
      • Did the pipeline run?
      • Was terraform plan successful?
      • Did the pipeline wait for your approval to run terraform apply?
      • Was terraform apply succcessful?
    • Check on the GitHub workflow that does the Docker publish:
      • Did the tests run?
      • Did a new Docker image get published with the expected Docker tags (2024.01.1, prod, and the Git SHA)?
    • Check on the GitHub workflow that creates the GitHub release:
    • QA the app:
      • Does the app respond? (/healthcheck)
      • Is the version number correct?
        • The version inside the prod Docker image says 2024.01.4rc1 which is incorrect - is GitHub caching something?
@angela-tran angela-tran added this to the Tag-based deployment model milestone Aug 8, 2023
@thekaveman thekaveman moved this from Todo to Stretch in Digital Services Aug 31, 2023
@thekaveman thekaveman moved this from Stretch to Todo in Digital Services Sep 15, 2023
@thekaveman thekaveman moved this from Todo to Stretch in Digital Services Sep 19, 2023
@thekaveman thekaveman moved this from Stretch to Todo in Digital Services Oct 26, 2023
@angela-tran
Copy link
Member Author

Planning on doing this after our winter break!

@angela-tran angela-tran self-assigned this Dec 21, 2023
@angela-tran angela-tran moved this from Todo to In Progress in Digital Services Dec 21, 2023
@angela-tran
Copy link
Member Author

Actually, #393 needs to be done first

@angela-tran angela-tran moved this from In Progress to Todo in Digital Services Dec 22, 2023
@thekaveman thekaveman moved this from Todo to In Progress in Digital Services Jan 5, 2024
@thekaveman thekaveman self-assigned this Jan 5, 2024
@thekaveman
Copy link
Member

  • Is the version number correct?
    • The version inside the prod Docker image says 2024.01.4rc1 which is incorrect - is GitHub caching something?

OMG I think I finally figured this out. See logs for 2024.01.12-rc1 and 2024.01.12.

It took from 2024.01.5-rc1 until 2024.01.12 (16 total tag pushes!!!) to get this sorted 😓

Debug process

This was extra messy 🚧 👷 🏗️, because I could never reproduce the issue locally (with act or otherwise).

  • I temporarily turned off branch protections on dev to avoid PRs / review cycles (back on now)
  • I temporarily added a bunch of extra debug output to the docker-publish workflow (removed now)
  • I temporarily disabled Docker image building and pushing in the docker-publish workflow (back on now)
  • I temporarily disabled the release workflow to avoid publishing meaningless releases (back on now)
  • I ignored just about every Azure pipeline run/approval (although there were no Terraform changes, see Fix release-tag trigger in infra pipeline definition files #377)

The logs from the test workflow ended up being really helpful. This workflow is called for RC and release tag pushes by the docker-deploy workflow, so it was always running before these previously broken runs.

I noticed that in the test workflow, it was always installing the correct version of the package (i.e. matching the expected RC or release tag).

Here's an example for of the test workflow for the 2024.01.4 tag, which we saw incorrectly installed as 2024.01.4-rc1 for the docker-publish workflow.

Changes that got it to stick

The changes I made to the docker-publish workflow to align it more closely with the test workflow:

  • Remove fetch-depth: 0 and fetch-tags from the actions/checkout step -- since our docker-publish workflow is triggered by a tag push, this tag will be the ref that is checked out. Don't allow extra tags/refs to come in and pollute the git environment
  • Remove pip caching in the actions/setup-python step
  • Upgrade pip in both the workflow step AND during both phases of the Docker image build
  • Remove usage of venv, just pip install directly into the action runner
  • Full changelog with all my nonsense: 2024.01.4...2024.01.12

FINALLY going to mark this issue as complete! 🎉 ✨

Thank you for all of your work that led up to this @angela-tran 🙏 🙏

@thekaveman
Copy link
Member

thekaveman commented Jan 25, 2024

Yesssssssssssssssssssssssss

2024-01-25T23:48:09.325111047Z INFO eligibility_server.sentry:42 Enabling Sentry for environment 'prod',
  release '2024.1.12'...
...
2024-01-25T23:48:10.611937797Z INFO eligibility_server.app:31 Starting Eligibility Server 2024.1.12
2024-01-25T23:48:10.795858463Z INFO Starting gunicorn 21.2.0

@github-project-automation github-project-automation bot moved this from In Progress to Done in Digital Services Jan 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

No branches or pull requests

2 participants