Skip to content
This repository has been archived by the owner on Sep 3, 2024. It is now read-only.

Commit

Permalink
[ID-763] Bond resources cleanup (#232)
Browse files Browse the repository at this point in the history
* Bond resources cleanup

* update readme to remove jenkins refs

* dont run on changes to local docker compose

* improve build gha

* fix default branch name

* put tags-ignore back

* Update README.md

reference independent servies release checklist vs bond specific one.

* alpha is ded

* alpha is ded 2

---------

Co-authored-by: Tristan Garwood <tristan.garwood@gmail.com>
  • Loading branch information
em-may and Ghost-in-a-Jar authored Jan 16, 2024
1 parent ed21d0a commit 3a6de16
Show file tree
Hide file tree
Showing 7 changed files with 39 additions and 238 deletions.
123 changes: 0 additions & 123 deletions .circleci/config.yml

This file was deleted.

20 changes: 18 additions & 2 deletions .github/workflows/build-test-tag.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,24 @@
name: Build, test, and tag docker image

on:
pull_request:
types:
- opened
- reopened
- synchronize
paths-ignore:
- .circleci
- hooks
- app.yaml
- CONTRIBUTING.md
- deploy.sh
- docker/local-docker-compose.yml
- README.md
- release-checklist.md
- run_local.sh
push:
branches:
- '**'
- develop
tags-ignore:
- '**'
paths-ignore:
Expand All @@ -12,6 +27,7 @@ on:
- app.yaml
- CONTRIBUTING.md
- deploy.sh
- docker/local-docker-compose.yml
- README.md
- release-checklist.md
- run_local.sh
Expand Down Expand Up @@ -84,7 +100,7 @@ jobs:
if [ ${{ github.ref_name }} == ${{ github.event.repository.default_branch }} ]; then
BRANCH_TAG="${NAME}:latest"
else
BRANCH_TAG="${NAME}:${{ github.ref_name }}"
BRANCH_TAG="${NAME}:${GITHUB_HEAD_REF}"
fi
TAGS="${VERSION_TAG},${BRANCH_TAG}"
echo "NAME: ${NAME}"
Expand Down
28 changes: 13 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ A) To run an existing image:

1) Render configs.
2) Browse the available tags [here](https://quay.io/repository/databiosphere/bond?tag=latest&tab=tags)
3) With your tag of choice (such as `develop`), run `IMAGE_ID=quay.io/databiosphere/bond:{TAG} docker-compose -f docker/local-docker-compose.yml up`
3) With your tag of choice (such as `develop`), run `IMAGE_ID=us-central1-docker.pkg.dev/dsp-artifact-registry/bond/bond:{TAG} docker-compose -f docker/local-docker-compose.yml up`
4) Check http://127.0.0.1:8080/api/status/v1/status to make sure you're up and running
5) Navigate to http://127.0.0.1:8080/api/docs/ to interact with endpoints via Swagger

Expand Down Expand Up @@ -223,8 +223,7 @@ logger.warning("I like turtles")

# Deployment (for Broad only)

Deployments to non-production and production environments are performed in Jenkins. In order to access Jenkins, you
will need to be on the Broad network or logged on to the Broad VPN.
Deployments to non-production and production environments are performed in Beehive.

## Deploy to the "dev" environment

Expand All @@ -233,34 +232,33 @@ A deployment to `dev` environment will be automatically triggered every time the
branch or tag to the `dev` environment, you can do so by following the instructions below, but be aware that a new
deployment of the `develop` branch will be triggered if anyone commits or pushes to that branch.

## Deploy to non-production environments
## Deploy to other non-production environments

Note: if you are deploying to non-prod envs as part of a prod release, then skip this section since these instructions are already included in the [Production Deployment Checklist](#production-deployment-checklist).

1. Log in to [Jenkins](https://fc-jenkins.dsp-techops.broadinstitute.org/)
1. Navigate to the [bond-manual-deploy](https://fc-jenkins.dsp-techops.broadinstitute.org/view/Indie%20Deploys/job/bond-manual-deploy/)
job
1. In the left menu, click [Build with Parameters](https://fc-jenkins.dsp-techops.broadinstitute.org/view/Indie%20Deploys/job/bond-manual-deploy/build?delay=0sec)
and select the `BRANCH_OR_TAG` that you want to deploy, the `TARGET` environment to which you want to deploy, and enter
the `SLACK_CHANNEL` that you would like to receive notifications of the deploy jobs success/failure
1. Click the `Build` button
1. Deploy to dev first, as staging follows dev, and prod follow staging.
2. Log in to [Beehive](https://beehive.dsp-devops.broadinstitute.org/).
3. Navigate to the [Environments](https://beehive.dsp-devops.broadinstitute.org/environments) section.
4. In the left menu, click on the environment you want to deploy to.
5. Click on the Bond instance in the list.
6. Click on "Change Versions" and then "Click to Refresh and Preview Changes". If the version of Bond you want to deploy is in dev already, you should see a diff, if not, go back to step 1.
7. Apply the changes.

## Production Deployment Checklist

### Create a ticket and load the Bond Release Checklist template
To perform a release, you are _required_ to create a Release Issue in [Jira](https://broadworkbench.atlassian.net/browse/CA).
You should title the issue something like `Bond Release version x.x.x` (`x.x.x` is a placeholder that will get replaced). After creating the issue, search for a way to add a "Checklist" (which may be a ☑ icon near the top of the ticket) and click on the ellipsis `...` icon for
that field and choose `Load templates`, select `Bond Release Checklist`, and click the `Load templates` button.
that field and choose `Load templates`, select `Independent Services Release Checklist`, and click the `Load templates` button.

When doing a production deployment, each step of the checklist **must** be performed.

### Deploy and Test
You must deploy to each tier one-by-one and [manually test](https://docs.google.com/document/d/1-SXw-tgt1tb3FEuNCGHWIZJ304POmfz5ragpphlq2Ng/edit?ts=5e964fbe#)
in each tier after you deploy to it. Your deployment to a tier should not be considered complete until you have
successfully executed each step of the [manual test](https://docs.google.com/document/d/1-SXw-tgt1tb3FEuNCGHWIZJ304POmfz5ragpphlq2Ng/edit?ts=5e964fbe#)
on that tier. To deploy the application code, navigate to the [Bond Manual Deploy](https://fc-jenkins.dsp-techops.broadinstitute.org/view/Indie%20Deploys/job/bond-manual-deploy/)
job and click the "Build with Parameters" link. Select the `TAG` that you just created during the preparation steps and
the `TIER` to which you want to deploy:
on that tier. To deploy the application code, navigate to [Beehive](https://beehive.dsp-devops.broadinstitute.org/)
and follow the non-prod deployment instructions above. Then do the same but for the prod environment.

**NOTE:**
* It is important that you deploy to all tiers. Because Bond is an "indie service", we should strive to make sure
Expand Down
9 changes: 0 additions & 9 deletions app.yaml

This file was deleted.

73 changes: 0 additions & 73 deletions deploy.sh

This file was deleted.

2 changes: 1 addition & 1 deletion docker/local-docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
version: '2'
services:
bond-app:
# Image id from local docker build or remote image like 'quay.io/databiosphere/bond:{tag}'
# Image id from local docker build or remote image like 'us-central1-docker.pkg.dev/dsp-artifact-registry/bond/bond:{tag}'
image: $IMAGE_ID
volumes:
# Use locally rendered config.ini file.
Expand Down
22 changes: 7 additions & 15 deletions release-checklist.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@
--- Production Deployment Preparation
* [] Confirm that `dev_tests_passed_[timestamp]` tag was created for the commit you wish to deploy.
>> When the latest code passes tests in CircleCI, it is tagged `dev_tests_passed_[timestamp]` where `[timestamp]` is the epoch time when the tag was created.
* [] Create and push a new [semver](https://semver.org/) tag for this same commit.
>> You should look at the existing tags to ensure that the tag is incremented properly based on the last released version. Tags should be plain semver numbers like `1.0.0` and should not have any additional prefix like `v1.0.0` or `releases/1.0.0`. Suffixes are permitted so long as they conform to the [semver spec](https://semver.org/).
* [] Manually tag the Docker image with the correct semver number on Quay
>> Pushing the new tag to the git origin repository will _not_ automatically tag the Docker image. You will need to manually tag the Docker image with the correct semver number. Go to the [Bond project on Quay.io](https://quay.io/repository/databiosphere/bond?tab=tags) and navigate to the "Tags" menu. You should see two new images for `latest` and `develop`. Confirm that the ages of these images correspond to when you merged your changes into the `develop` branch. On the right of one of these rows, click on the gear icon and select "Add New Tag". Enter the semver number for your release.
>>
>> NOTE: if you have issues logging in, you may need to link your old Quay account with new redhat account at https://recovery.quay.io/
>> When the latest code passes tests in GHA, it is tagged `dev_tests_passed_[timestamp]` where `[timestamp]` is the epoch time when the tag was created.
* [] Update the ticket name, replacing `x.x.x` with the semver number.
* [] Create Bond Release in Jira
>> In Jira, make sure the Bond Release exists or create a new one in the [Cloud Integration Project](https://broadworkbench.atlassian.net/projects/CA?selectedItem=com.atlassian.jira.jira-projects-plugin%3Arelease-page) named like: `Bond-X.Y.Z` where `X.Y.Z` is the same semantic version number you created in the previous step
Expand All @@ -17,19 +11,17 @@
* [] Set the `Fix Version` on _this_ Release Issue
--- Deploy and Test
* [] Deploy to `dev` and perform manual test
>> * Navigate to the [Bond Manual Deploy](https://fc-jenkins.dsp-techops.broadinstitute.org/view/Indie%20Deploys/job/bond-manual-deploy/) job and click the "Build with Parameters" link. Select the `TAG` that you just created during the preparation steps and `dev` as the Target tier to deploy to.
>> * Technically, this same commit is probably already running on `dev` courtesy of the automatic `dev` deployment job. However, deploying again is an important step because someone else may have triggered a `dev` deployment and we want to ensure that you understand the deployment process, the deployment tools are working properly, and that everything is working as intended.
>> * Bond is automatically deployed to dev on merge to the default branch (i.e. `develop`).
>> * Perform the [manual test](https://docs.google.com/document/d/1-SXw-tgt1tb3FEuNCGHWIZJ304POmfz5ragpphlq2Ng/edit?ts=5e964fbe#)
If desired, you can manually promote Bond through to whatever environments you want as follows, however, new Bond helm charts and versions are automatically released on merge to Bond and terra-helmfile and promoted with the monolith release, so this is for independent releases or hotfixes only:
* [] Check the [Release Protection Window Calendar](https://calendar.google.com/calendar/u/0?cid=YnJvYWRpbnN0aXR1dGUub3JnX2ZrMGMxb2E0Ym5rY21rOXEyajY5ZWdtMjljQGdyb3VwLmNhbGVuZGFyLmdvb2dsZS5jb20)
* [] Notify the [#workbench-release](https://broadinstitute.slack.com/archives/C6DTFUCDD) Slack channel that you will be releasing a new version of Bond to `alpha`, `staging`, and `prod` along with the link to the release version in Jira.
* [] Deploy to `alpha` and perform manual test
>> * Navigate to the [Bond Manual Deploy](https://fc-jenkins.dsp-techops.broadinstitute.org/view/Indie%20Deploys/job/bond-manual-deploy/) job and click the "Build with Parameters" link. Select the `TAG` that you just created during the preparation steps and `alpha` as the Target tier to deploy to.
>> * Perform the [manual test](https://docs.google.com/document/d/1-SXw-tgt1tb3FEuNCGHWIZJ304POmfz5ragpphlq2Ng/edit?ts=5e964fbe#)
* [] Notify the [#workbench-release](https://broadinstitute.slack.com/archives/C6DTFUCDD) Slack channel that you will be releasing a new version of Bond to `staging`, and `prod` along with the link to the release version in Jira.
* [] Deploy to `staging` and perform manual test
>> * Navigate to the [Bond Manual Deploy](https://fc-jenkins.dsp-techops.broadinstitute.org/view/Indie%20Deploys/job/bond-manual-deploy/) job and click the "Build with Parameters" link. Select the `TAG` that you just created during the preparation steps and `staging` as the Target tier to deploy to.
>> * Navigate to [bond-staging in Beehive](https://beehive.dsp-devops.broadinstitute.org/environments/staging/chart-releases/bond), click on "Change Versions" and then "Click to Refresh and Preview Changes". Review the changeset, and if it looks good, apply it and wait for Staging to be updated.
>> * Perform the [manual test](https://docs.google.com/document/d/1-SXw-tgt1tb3FEuNCGHWIZJ304POmfz5ragpphlq2Ng/edit?ts=5e964fbe#)
* [] Deploy to `prod` and perform manual test
>> * In order to deploy to `prod`, you must be on the DSP Suitability Roster. You will need to log into the production Jenkins instance and use the "Bond Manual Deploy" job to release the same tag to production.
>> * In order to deploy to `prod`, you must be on the DSP Suitability Roster.
>> * Navigate to [bond-bond in Beehive](https://beehive.dsp-devops.broadinstitute.org/environments/prod/chart-releases/bond), click on "Change Versions" and then "Click to Refresh and Preview Changes". Review the changeset, and if it looks good, apply it and wait for Prod to be updated.
>> * Perform the [manual test](https://docs.google.com/document/d/1-SXw-tgt1tb3FEuNCGHWIZJ304POmfz5ragpphlq2Ng/edit?ts=5e964fbe#)
* [] Transition all tickets in the Release in Jira to "Done"
* [] Mark the Release in Jira as "Released"
Expand Down

0 comments on commit 3a6de16

Please sign in to comment.