This document describes how to release and deploy the Narrative Interface app onto the different KBase environments. It's intended for KBase developers and admins.
- Last modified: Oct. 2, 2020
Table of Contents
The various KBase environments are all used used for slightly different purposes:
- ci https://ci.kbase.us is intended for testing and demoing of new features that may not always work right. It's also intended to be continuously upgraded and redeployed.
- next https://next.kbase.us is used for final internal testing before being promoted to the public-facing environments - appdev and production. Most services should be up to date here, and this is used for final integration and acceptance testing.
- appdev https://appdev.kbase.us is used primarily for KBase app development using the KBase SDK. This environment mirrors the production environment, but allows for finding and running apps in "dev" mode.
- prod https://narrative.kbase.us is the main production environment. This is the place where most users will use KBase and run apps that have either been entirely released or have been made available for beta testing.
- Create a "development" image for CI.
- Deploy image to CI.
- Once tested in CI, draft a release by bumping the version and creating a Github release tag.
- Create a single production image for appdev, next, & prod.
- Tag the production image for deployment using the
deploy_tag.sh
script. - Deploy the production image in the relevant environments.
- Create a new temporary branch from the
develop
branch. - Add a single bug fix or new feature to your temporary branch.
- Create a new pull request to merge your branch into
develop
. - Ensure the automated build test completes successfully.
- Complete review and testing.
- Merge pull request.
Once a pull request is merged from a temporary branch to develop
a new development image will be available at:
ghcr.io/kbase/narrative-develop:latest
. This is automatically deployed to CI.
To see your changes once the new image is created, simply open a narrative on CI. If you already have one loaded, restart the application by selecting the "Shutdown and Restart" option from the menu in the upper left.
-
Update versions following (roughly) semantic versioning. The files to be updated are:
package.json
,package-lock.json
,src/config.json
,src/config.json.templ
,src/biokbase/narrative/__init__.py
- Major - backward incompatible changes, like the move from Python 2 -> Python 3, or Narrative typed object changes. These are generally considered to be changes that have a strong impact on the Narrative Interface and are hard or impossible to move backward from.
- Minor - new features that don't affect compatibility.
- Patch - adjustments to existing features, bug fixes.
-
Add release notes in
RELEASE_NOTES.md
- Add a new heading with the updated version.
- Add a list of changes with some reasonable detail. You don't need to add the name of every module changed, just the overall feature affected. Include JIRA ticket numbers where appropriate.
-
PR these changes to the develop branch.
- Ensure that tests pass.
-
PR the develop branch to the main branch.
- Deploy on the narrative-dev environment.
- Ensure that things work as expected.
-
Create a new release in the narrative repo on GitHub.
- Create a new tag with the new version number, prefixed with v (e.g. v4.2.1).
- Set the new tag against the
main
branch. - Put the recent notes in the description.
The next, appdev, and production environments are all deployed using a production image.
The narrative-refactor image is automatically built against the "develop" branch of the repo and is called narrative-develop:pr### when still in a PR state or narrative-develop:latest after merge. The images can be found here: https://github.com/orgs/kbase/packages
The narrative-dev environment is meant for pre-release and iterative testing of new UI features and changes. As such, this isn't always tied to any particular branch, although it is most often set to deploy the production image. Contact a DevOps team member if there are any questions.
- Create a new pull request to merge the
develop
branch intomain
. - Ensure the automated tests complete successfully.
- Complete the review and merge the PR.
Once a pull request is merged from develop
to main
a new production image will be available at:
ghcr.io/kbase/narrative:latest
.
Note: This section applies only to KBase admins who will be doing the deploy process.
- Ensure the deploy_tag.sh script is installed on either your local workstation, or under your home directory on a secured system, such as
install.kbase.lbl.gov
. - Create a GitHub personal access token and set it as "$TOKEN" in your workstation/server shell environment.
- Run the
deploy_tag.sh
with the following syntax:./deploy_tag.sh -o "kbase" -r "narrative" -t "latest" -e "appdev"
(In practice, for this repo, you'll only be changing the-e
flag value)
Where:
-o ORG is the organization (`kbase`, `kbaseapps`, etc.)
-r REPO is the repository (e.g. `narrative`)
-t IMAGE_TAG is the *current* Docker image tag, typically `pr-#` or `latest`
-e TARGET Sets target environment's tag. This is typically either:`next`, `appdev`, or `prod`.
- Restart the
narrative
container for the desired environment (e.g.appdev
) in Rancher. Thenext
,appdev
, andprod
Rancher environments all have their access limited to the KBase devops staff, so ask them (on the #sysadmin channel) for help.
Environment | Image URL |
---|---|
CI | ghcr.io/kbase/narrative-develop:latest |
Narrative-refactor | ghcr.io/kbase/narrative-develop:latest |
Appdev | ghcr.io/kbase/narrative:appdev |
Next | ghcr.io/kbase/narrative:next |
Production | ghcr.io/kbase/narrative:prod |