Skip to content

Commit

Permalink
Update README and RELEASE docs
Browse files Browse the repository at this point in the history
  • Loading branch information
dlabrecq committed Dec 6, 2023
1 parent 9db1454 commit 98fb7a5
Show file tree
Hide file tree
Showing 4 changed files with 79 additions and 16 deletions.
45 changes: 45 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
42 changes: 30 additions & 12 deletions RELEASE.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

```
Expand All @@ -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

Expand All @@ -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
4 changes: 2 additions & 2 deletions fec.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit 98fb7a5

Please sign in to comment.