From 98fb7a59e7438688c241f75cca4c52e4d4c6234e Mon Sep 17 00:00:00 2001 From: Dan Labrecque Date: Wed, 6 Dec 2023 15:22:55 -0500 Subject: [PATCH] Update README and RELEASE docs --- README.md | 45 +++++++++++++++++++++++++++++++++++++++++++++ RELEASE.md | 42 ++++++++++++++++++++++++++++++------------ fec.config.js | 4 ++-- package.json | 4 ++-- 4 files changed, 79 insertions(+), 16 deletions(-) diff --git a/README.md b/README.md index 07c885a1b..95a8c56ec 100644 --- a/README.md +++ b/README.md @@ -59,6 +59,51 @@ Follow the prompts that follow. https://stage.foo.redhat.com:1337/beta/openshift/cost-management ``` +### Running Koku UI with a local Cloud Services Backend + +See https://github.com/RedHatInsights/chrome-service-backend/blob/main/docs/cloud-services-config.md#serving-files-locally + +1. Serve files locally from Cloud Services Backend repo +``` +make dev-static-node +``` + +2. Start development server in Koku UI repo +``` +npm start:csb +``` + +### Running Koku UI with a local Koku UI microfrontend (MFE) + +1. Start development server in Koku UI microfrontend (MFE) repo +``` +npm start:static +``` + +2. Start development server in Koku UI repo +``` +npm start:mfe +``` + +### Running Koku UI with a local Koku UI microfrontend (MFE) and Cloud Services Backend + +See https://github.com/RedHatInsights/chrome-service-backend/blob/main/docs/cloud-services-config.md#serving-files-locally + +1. Serve files locally from Cloud Services Backend repo +``` +make dev-static-node +``` + +2. Start development server in Koku UI microfrontend (MFE) repo +``` +npm start:static +``` + +3. Start development server in Koku UI repo +``` +npm start:csb:mfe +``` + ## Running local instances of Koku UI & Koku API #### Koku UI diff --git a/RELEASE.md b/RELEASE.md index d24856aea..1f07026a0 100644 --- a/RELEASE.md +++ b/RELEASE.md @@ -4,12 +4,14 @@ This doc describes how to release the UI to each staging environment. Note that ## Release script -Using our script ensures that code is always pulled from the correct branches. For example, we always pull from: +The release script creates a PR with a unique SHA, used for a namespace \`ref\` in the app-interface repo. The script also ensures that code is always pulled from the correct branches. For example, we always: 1. Pull from master when pushing to stage-stable 2. Pull from stage-stable when pushing to prod-beta 3. Pull from prod-beta when pushing to prod-stable +Please allow the PR to build successfully and merge before running the script again for the next branch. + ### Release to stage-stable ``` @@ -28,19 +30,35 @@ sh scripts/release-branch.sh -b sh scripts/release-branch.sh -p ``` -## Travis build - -Whenever a branch is merged, our Travis script automatically builds and pushes a bundle to our RedHatInsights build repo. - -To view our Travis build, see https://app.travis-ci.com/github/project-koku/koku-ui/builds +## Deployment -## RedHatInsights build repo +After all PRs have been merged, update the \`hccm-frontend\` resource in https://gitlab.cee.redhat.com/service/app-interface/-/blob/master/data/services/insights/hccm/deploy-clowder.yml -After each successfully Travis build, you should see a new commit here https://github.com/RedHatInsights/cost-management-build. +Use the latest commit of each branch to update namespaces \`ref\` in the app-interface repo. Don't use a merge commit, SHAs must be unique when images are created for each branch. -At this point, the Insights pipeline takes over and the bundle should be available shortly in the expected staging environment. - -Depending on how many builds are queued, this could take a few minutes or hours. Typically, the prod-stable environment is updated within 15-30 min. +``` + # Stage Stable Deployment + - namespace: + $ref: /services/insights/frontend-operator/namespaces/stage-frontends.yml + ref: 4bdd960da2fe34ed8964acfcbc2d3267a752f3e5 // Replace with latest SHA for stage-beta branch + parameters: + ENV_NAME: "frontends" + IMAGE: "quay.io/cloudservices/hccm-frontend" + # Prod Beta Deployment + - namespace: + $ref: /services/insights/frontend-operator/namespaces/prod-beta-frontends.yml + ref: 23909da4ea017963caa78d59168054db842ce014 // Replace with latest SHA for prod-beta branch + parameters: + ENV_NAME: "frontends-beta" + IMAGE: "quay.io/cloudservices/hccm-frontend" + # Prod Stable Deployment + - namespace: + $ref: /services/insights/frontend-operator/namespaces/prod-frontends.yml + ref: c7f6c75fd1e895afbc05a2a6d26835fa16a0edfa // Replace with latest SHA for prod-stable branch + parameters: + ENV_NAME: "frontends" + IMAGE: "quay.io/cloudservices/hccm-frontend" +``` ## Testing @@ -64,6 +82,6 @@ For release examples, please see existing releases here https://github.com/proje ## Troubleshooting -If a staging environment has not updated as expected, it's best to ask questions in the forum-consoledot-ui channel of http://coreos.slack.com. +If a staging environment has not updated as expected, it's best to ask questions in the forum-consoledot-ui or proj-fecontainer-migration channels of http://coreos.slack.com. Alternatively, open a Jira issue under the "ConsoleDot Platform (console.redhat.com) (RHCLOUD)" project category. For an example, see https://issues.redhat.com/browse/RHCLOUD-18259 diff --git a/fec.config.js b/fec.config.js index 0f49fb133..794c26ab3 100644 --- a/fec.config.js +++ b/fec.config.js @@ -90,8 +90,8 @@ module.exports = { /** * Chrome services backend config routes, typically localhost:8000 */ - ...(process.env.CLOUD_SERVICES_CONFIG_PORT && { - '/api/chrome-service/v1/static': { host: `http://localhost:${process.env.CLOUD_SERVICES_CONFIG_PORT}` }, + ...(process.env.CLOUD_SERVICES_BACKEND_PORT && { + '/api/chrome-service/v1/static': { host: `http://localhost:${process.env.CLOUD_SERVICES_BACKEND_PORT}` }, }), /** * Ephemeral routes, typically localhost:8000 diff --git a/package.json b/package.json index 84ebbf63a..24d9bc217 100644 --- a/package.json +++ b/package.json @@ -29,8 +29,8 @@ "patch:hosts": "fec patch-etc-hosts", "postinstall": "ts-patch install && rm -rf .cache", "start": "fec dev", - "start:csc": "CLOUD_SERVICES_CONFIG_PORT=8000 npm start", - "start:csc:mfe": "FEC_STATIC_PORT=8003 npm run start:csc", + "start:csb": "CLOUD_SERVICES_BACKEND_PORT=8000 npm start", + "start:csb:mfe": "FEC_STATIC_PORT=8003 npm run start:csb", "start:ephemeral": "EPHEMERAL_PORT=8000 npm start", "start:hmr": "HMR=true npm start", "start:local:api": "LOCAL_API_PORT=8000 LOCAL_API_HOST=localhost KEYCLOAK_PORT=4020 npm start",