Skip to content

Commit

Permalink
Merge pull request #3604 from project-koku/release_prod-stable.37774
Browse files Browse the repository at this point in the history
Deployment commit for prod-stable
  • Loading branch information
dlabrecq committed Jan 10, 2024
2 parents 8649dd5 + 126d518 commit e76b0a5
Show file tree
Hide file tree
Showing 57 changed files with 1,070 additions and 1,081 deletions.
105 changes: 51 additions & 54 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
[![AGPLv3][license-badge]][license]
[![Build Status][build-badge]][build]

React.js app for Cost Management.

User interface is based on Patternfly [![Patternfly][pf-logo]][patternfly]

To submit an issue, please visit https://issues.redhat.com/projects/COST/
Expand Down Expand Up @@ -59,6 +61,54 @@ Follow the prompts that follow.
https://stage.foo.redhat.com:1337/beta/openshift/cost-management
```

### Running Koku UI with 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 local Koku microfrontend (MFE)

See https://github.com/project-koku/koku-ui-mfe

1. Start development server in Koku MFE repo
```
npm start:static
```

2. Start development server in Koku UI repo
```
npm start:mfe
```

### Running Koku UI with local Koku microfrontend (MFE) and Cloud Services Backend

See https://github.com/RedHatInsights/chrome-service-backend/blob/main/docs/cloud-services-config.md#serving-files-locally
and https://github.com/project-koku/koku-ui-mfe

1. Serve files locally from Cloud Services Backend repo
```
make dev-static-node
```

2. Start development server in Koku 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 Expand Up @@ -141,60 +191,7 @@ http://localhost:1337/beta/settings/applications/cost-management

## Releasing Koku UI

This [RELEASE][release-doc] doc describes how to release the UI to each staging environment.

## Useful Links

#### Libs

* [TypeScript](http://www.typescriptlang.org/docs/handbook/react-&-webpack.html)
* [React](https://reactjs.org/docs/react-api.html)
* [Redux](https://redux.js.org/) - State Management
* [Redux-Thunk](https://github.com/reduxjs/redux-thunk#redux-thunk) - Middleware for returning functions from actions (gives access to dispatch and getState to action)
* [typesafe-actions](https://github.com/piotrwitek/typesafe-actions#motivation) - Typesafe Redux
* [Selectors](https://redux.js.org/introduction/learningresources#selectors)
* [Axios](https://github.com/axios/axios#axios-api) - HTTP Client
* [React Router](https://reacttraining.com/react-router/web/guides/philosophy)
* [withRouter](https://reacttraining.com/react-router/web/api/withRouter) - Injects components with route props
* [Link](https://reacttraining.com/react-router/web/api/Link)
* [Route](https://reacttraining.com/react-router/web/api/Route)
* [React I18Next](https://react.i18next.com/) - React Wrapper for i18next
* [PatternFly React 4](https://patternfly-react.netlify.com/)
* [Source](https://github.com/patternfly/patternfly-react/tree/main/packages) - `react-*/**`
* [PRS](https://github.com/patternfly/patternfly-react/pulls?q=is%3Aopen+is%3Apr+label%3APF4)
* [Issues](https://github.com/patternfly/patternfly-react/issues?q=is%3Aopen+is%3Aissue+label%3APF4)

#### Tools

* [React Devtools](https://github.com/facebook/react-devtools)
* [Chrome](https://chrome.google.com/webstore/detail/react-developer-tools/fmkadmapgofadopljbjfkapdkoienihi)
* [Firefox](https://addons.mozilla.org/firefox/addon/react-devtools/)
* [Redux Devtools](https://github.com/zalmoxisus/redux-devtools-extension)
* [Chrome](https://chrome.google.com/webstore/detail/redux-devtools/lmhkpmbekcpmknklioeibfkpmmfibljd)
* [Firefox](https://addons.mozilla.org/en-US/firefox/addon/remotedev/)
* VSCode
* [TSLint](https://marketplace.visualstudio.com/items?itemName=eg2.tslint) - Linting
* In Settings add
```json
{
...
"tslint.autoFixOnSave": true,
...
}
* [Prettier](https://marketplace.visualstudio.com/items?itemName=esbenp.prettier-vscode) - Autoformat
* In settings add:
```json
{
...
"[typescript]": {
"editor.formatOnSave": true
},
"[typescriptreact]": {
"editor.formatOnSave": true
},
...
}
* [Docker](https://marketplace.visualstudio.com/items?itemName=PeterJausovec.vscode-docker) - Manage Docker images from VSCode
This [RELEASE][release-doc] doc describes how to release Koku UI to each staging environment.

[build]: https://travis-ci.com/project-koku/UI'
[build-badge]: https://img.shields.io/travis/project-koku/koku-ui.svg?style=for-the-badge
Expand Down
40 changes: 27 additions & 13 deletions RELEASE.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
# Releasing Koku UI

This doc describes how to release the UI to each staging environment. Note that this should be done in order for testing purposes; stage-stable, prod-beta, and finally prod-stable
This doc describes how to release Koku UI to each staging environment. Note that this should be done in order for testing purposes; stage-stable, prod-beta, and finally prod-stable

## 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,31 @@ 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.
```
- name: hccm-frontend
...
# Stage Stable Deployment
- namespace:
$ref: /services/insights/frontend-operator/namespaces/stage-frontends.yml
ref: 4bdd960da2fe34ed8964acfcbc2d3267a752f3e5 // Replace with latest SHA for stage-beta branch
...
# Prod Beta Deployment
- namespace:
$ref: /services/insights/frontend-operator/namespaces/prod-beta-frontends.yml
ref: 23909da4ea017963caa78d59168054db842ce014 // Replace with latest SHA for prod-beta branch
...
# Prod Stable Deployment
- namespace:
$ref: /services/insights/frontend-operator/namespaces/prod-frontends.yml
ref: c7f6c75fd1e895afbc05a2a6d26835fa16a0edfa // Replace with latest SHA for prod-stable branch
...
```

## Testing

Expand All @@ -64,6 +78,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
74 changes: 48 additions & 26 deletions locales/data.json
Original file line number Diff line number Diff line change
Expand Up @@ -2487,6 +2487,14 @@
}
]
},
"clusters": {
"value": [
{
"type": 0,
"value": "Clusters"
}
]
},
"gcp_project": {
"value": [
{
Expand Down Expand Up @@ -3486,52 +3494,52 @@
"value": "https://access.redhat.com/documentation/en-us/cost_management_service/1-latest/html-single/adding_an_openshift_container_platform_source_to_cost_management"
}
],
"docsConfigCostCategory": [
"docsCostCategory": [
{
"type": 0,
"value": "https://access.redhat.com/documentation/en-us/cost_management_service/1-latest"
}
],
"docsConfigCostModels": [
"docsCostModelTerminology": [
{
"type": 0,
"value": "https://access.redhat.com/documentation/en-us/cost_management_service/1-latest/html-single/using_cost_models/index#assembly-setting-up-cost-models"
"value": "https://access.redhat.com/documentation/en-us/cost_management_service/1-latest/html-single/using_cost_models/index#cost-model-terminology"
}
],
"docsConfigCostModelsOcp": [
"docsCostModels": [
{
"type": 0,
"value": "https://access.redhat.com/documentation/en-us/cost_management_service/1-latest/html/using_cost_models/assembly-setting-up-cost-models#creating-an-ocp-cost-model_setting-up-cost-models"
"value": "https://access.redhat.com/documentation/en-us/cost_management_service/1-latest/html-single/using_cost_models/index#assembly-setting-up-cost-models"
}
],
"docsConfigPlatformProjects": [
"docsCostModelsDistribution": [
{
"type": 0,
"value": "https://access.redhat.com/documentation/en-us/cost_management_service/1-latest"
"value": "https://access.redhat.com/documentation/en-us/cost_management_service/1-latest/html/using_cost_models/assembly-setting-up-cost-models#creating-an-AWS-Azure-cost-model_setting-up-cost-models"
}
],
"docsConfigTags": [
"docsCostModelsMarkup": [
{
"type": 0,
"value": "https://access.redhat.com/documentation/en-us/cost_management_service/1-latest/html/managing_cost_data_using_tagging/assembly-configuring-tags-and-labels-in-cost-management"
"value": "https://access.redhat.com/documentation/en-us/cost_management_service/1-latest/html/using_cost_models/assembly-setting-up-cost-models#creating-an-AWS-Azure-cost-model_setting-up-cost-models"
}
],
"docsCostModelTerminology": [
"docsCostModelsOcp": [
{
"type": 0,
"value": "https://access.redhat.com/documentation/en-us/cost_management_service/1-latest/html-single/using_cost_models/index#cost-model-terminology"
"value": "https://access.redhat.com/documentation/en-us/cost_management_service/1-latest/html/using_cost_models/assembly-setting-up-cost-models#creating-an-ocp-cost-model_setting-up-cost-models"
}
],
"docsCostModelsDistribution": [
"docsPlatformProjects": [
{
"type": 0,
"value": "https://access.redhat.com/documentation/en-us/cost_management_service/1-latest/html/using_cost_models/assembly-setting-up-cost-models#creating-an-AWS-Azure-cost-model_setting-up-cost-models"
"value": "https://access.redhat.com/documentation/en-us/cost_management_service/1-latest"
}
],
"docsCostModelsMarkup": [
"docsTags": [
{
"type": 0,
"value": "https://access.redhat.com/documentation/en-us/cost_management_service/1-latest/html/using_cost_models/assembly-setting-up-cost-models#creating-an-AWS-Azure-cost-model_setting-up-cost-models"
"value": "https://access.redhat.com/documentation/en-us/cost_management_service/1-latest/html/managing_cost_data_using_tagging/assembly-configuring-tags-and-labels-in-cost-management"
}
],
"docsUsingCostModels": [
Expand Down Expand Up @@ -7366,6 +7374,14 @@
}
]
},
"default": {
"value": [
{
"type": 0,
"value": "Default"
}
]
},
"gcp_project": {
"value": [
{
Expand Down Expand Up @@ -11178,16 +11194,6 @@
"value": "value"
}
],
"platfomProjectaDesc": [
{
"type": 0,
"value": "Associate additional projects with OpenShift Platform project costs to charge for utilization of resources. Changes will be reflected in this month's cost calculations within 24 hrs. "
},
{
"type": 1,
"value": "learnMore"
}
],
"platform": [
{
"type": 0,
Expand All @@ -11206,6 +11212,16 @@
"value": "Platform distributed"
}
],
"platformProjectsDesc": [
{
"type": 0,
"value": "Associate additional projects with OpenShift Platform project costs to charge for utilization of resources. Changes will be reflected in this month's cost calculations within 24 hrs. "
},
{
"type": 1,
"value": "learnMore"
}
],
"platformProjectsTitle": [
{
"type": 0,
Expand Down Expand Up @@ -11548,6 +11564,12 @@
"value": "Select categories to enable or disable"
}
],
"selectProjects": [
{
"type": 0,
"value": "Select projects to add or remove"
}
],
"selectRow": [
{
"type": 0,
Expand Down Expand Up @@ -11610,7 +11632,7 @@
"value": "Changes will be reflected in report summarizations within 24 hours"
}
],
"settingsSuccessCostCategoryKeys": [
"settingsSuccessCostCategories": [
{
"options": {
"disable": {
Expand Down

0 comments on commit e76b0a5

Please sign in to comment.