Skip to content

Commit 6f6b4aa

Browse files
committed
Merge remote-tracking branch 'upstream/main' into RHINENG-20701
2 parents c56fa85 + 81a7e26 commit 6f6b4aa

File tree

71 files changed

+2849
-2315
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

71 files changed

+2849
-2315
lines changed

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,11 +79,11 @@ deploy-acm:
7979

8080
.PHONY: build-mcp-image
8181
build-mcp-image:
82-
DOCKER_FILE_NAME="Dockerfile.mcp" scripts/build-image.sh
82+
DOCKER_FILE_NAME="Dockerfile.mcp" REPO="monitoring-console-plugin" scripts/build-image.sh
8383

8484
.PHONY: build-dev-mcp-image
8585
build-dev-mcp-image:
86-
DOCKER_FILE_NAME="Dockerfile.dev-mcp" scripts/build-image.sh
86+
DOCKER_FILE_NAME="Dockerfile.dev-mcp" REPO="monitoring-console-plugin" scripts/build-image.sh
8787

8888
.PHONY: start-feature-console
8989
start-feature-console:

README.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -156,21 +156,21 @@ $ make start-feature-backend
156156

157157
`make start-feature-backend` will inject the `perses-dashboards`, `incidents`, and `dev-config` features by default. Features such as `acm-alerting` which take in extra parameters will need to run the `make start-feature-backend` command with the appropriate environment variables, such as `MONITORING_PLUGIN_ALERTMANAGER`.
158158

159-
#### Local Development with Perses Proxy
159+
#### Local Development with Perses Proxy
160160
The bridge script `start-console.sh` is configured to proxy to a local Perses instance running at port `:8080`. To run the local Perses instance you will need to clone the [perses/perses](https://github.com/perses/perses) repository and follow the start up instructions in [ui/README.md](https://github.com/perses/perses/blob/63601751674403f626d1dea3dec168bdad0ef1c7/ui/README.md) :
161161

162162
```
163-
# Clone the perses/perses repo
163+
# Clone the perses/perses repo
164164
$ git clone https://github.com/perses/perses.git
165165
$ cd perses
166166
167167
# Follow the instructions in ui/README.md
168-
$ cd ui
169-
$ npm install
168+
$ cd ui
169+
$ npm install
170170
$ npm run build
171171
$ ./scripts/api_backend_dev.sh
172172
173-
# Lastly navigate to http://localhost:8080/ to see Perses app running
173+
# Lastly navigate to http://localhost:8080/ to see Perses app running
174174
```
175175

176176
##### Install COO && Perses Datasource && Perses Sample Dashboard
@@ -194,3 +194,4 @@ curl "http://localhost:9090/api/v1/query?query=up"
194194

195195
Adjust Perses local instance http://localhost:8080/ to use the a proxy to http://localhost:9090/ instead of http://demo.prometheus.io.
196196

197+

config/acm-alerting.patch.json

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@
1919
"type": "console.page/route",
2020
"properties": {
2121
"exact": false,
22-
"path": [
23-
"/multicloud/monitoring"
24-
],
25-
"component": { "$codeRef": "AlertingPage" }
22+
"path": ["/multicloud/monitoring"],
23+
"component": {
24+
"$codeRef": "AlertingPage.McpAcmAlertingPage"
25+
}
2626
}
2727
}
2828
},
@@ -34,7 +34,7 @@
3434
"properties": {
3535
"exact": false,
3636
"path": "/multicloud/monitoring/silences/~new",
37-
"component": { "$codeRef": "SilenceCreatePage" }
37+
"component": { "$codeRef": "SilenceCreatePage.McpAcmCreateSilencePage" }
3838
}
3939
}
4040
},
@@ -46,7 +46,7 @@
4646
"properties": {
4747
"exact": false,
4848
"path": "/multicloud/monitoring/silences/:id/edit",
49-
"component": { "$codeRef": "SilenceEditPage" }
49+
"component": { "$codeRef": "SilenceEditPage.McpAcmSilenceEditPage" }
5050
}
5151
}
5252
},
@@ -58,7 +58,9 @@
5858
"properties": {
5959
"exact": false,
6060
"path": "/multicloud/monitoring/silences/:id",
61-
"component": { "$codeRef": "SilencesDetailsPage" }
61+
"component": {
62+
"$codeRef": "SilencesDetailsPage.McpAcmSilencesDetailsPage"
63+
}
6264
}
6365
}
6466
},
@@ -70,7 +72,9 @@
7072
"properties": {
7173
"exact": false,
7274
"path": ["/multicloud/monitoring/alertrules/:id"],
73-
"component": { "$codeRef": "AlertRulesDetailsPage" }
75+
"component": {
76+
"$codeRef": "AlertRulesDetailsPage.McpAcmAlertRulesDetailsPage"
77+
}
7478
}
7579
}
7680
},
@@ -82,7 +86,7 @@
8286
"properties": {
8387
"exact": false,
8488
"path": ["/multicloud/monitoring/alerts/:ruleID"],
85-
"component": { "$codeRef": "AlertsDetailsPage" }
89+
"component": { "$codeRef": "AlertsDetailsPage.McpAcmAlertsDetailsPage" }
8690
}
8791
}
8892
},

config/incidents.patch.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"name": "%plugin__monitoring-console-plugin~Incidents%",
1010
"href": "incidents",
1111
"component": {
12-
"$codeRef": "IncidentsPage"
12+
"$codeRef": "IncidentsPage.McpCmoAlertingPage"
1313
}
1414
}
1515
}

config/perses-dashboards.patch.json

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,7 @@
4545
"path": "/extensions/1",
4646
"value": {
4747
"type": "console.navigation/href",
48-
"flags": {
49-
"required": ["PROMETHEUS", "MONITORING", "CAN_GET_NS"]
50-
},
48+
5149
"properties": {
5250
"id": "perses-dashboards",
5351
"name": "%plugin__monitoring-console-plugin~Dashboards (Perses)%",
@@ -75,9 +73,7 @@
7573
"path": "/extensions/1",
7674
"value": {
7775
"type": "console.navigation/href",
78-
"flags": {
79-
"required": ["PROMETHEUS", "MONITORING", "CAN_GET_NS"]
80-
},
76+
8177
"properties": {
8278
"id": "virt-perses-dashboards",
8379
"name": "%plugin__monitoring-console-plugin~Dashboards (Perses)%",

scripts/build-image.sh

Lines changed: 32 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -7,24 +7,17 @@ PUSH="${PUSH:-0}"
77
TAG="${TAG:-v1.0.0}"
88
REGISTRY_ORG="${REGISTRY_ORG:-openshift-observability-ui}"
99
DOCKER_FILE_NAME="${DOCKER_FILE_NAME:-Dockerfile.dev}"
10+
REPO="${REPO:-monitoring-plugin}"
1011

11-
# Terminal output colors
12-
YELLOW='\033[0;33m'
13-
ENDCOLOR='\033[0m' # No Color
12+
# Define ANSI color codes
1413
RED='\033[0;31m'
14+
GREEN='\033[0;32m'
15+
ENDCOLOR='\033[0m'
1516

16-
17-
# due to apple silicon limitation with installing npm packages inside amd64 images, builds of the frontend must be done outside the dockerfile.
18-
if [[ "$OSTYPE" == "darwin"* ]] && [[ "$DOCKER_FILE_NAME" == "Dockerfile.mcp" ]]; then
19-
printf "${YELLOW}Updateing plugin-name ${ENDCOLOR}\n"
20-
make update-plugin-name
21-
export I18N_NAMESPACE='plugin__monitoring-console-plugin'
22-
23-
printf "${YELLOW}Installing Frontend${ENDCOLOR}\n"
24-
make install-frontend
25-
26-
printf "${YELLOW}Building Frontend${ENDCOLOR}\n"
27-
make build-frontend
17+
# Prompt user for TAG
18+
read -p "$(echo -e "${RED}Enter a value for TAG [${TAG}]: ${ENDCOLOR}")" USER_TAG
19+
if [ -n "$USER_TAG" ]; then
20+
TAG="$USER_TAG"
2821
fi
2922

3023
if [[ -x "$(command -v podman)" && $PREFER_PODMAN == 1 ]]; then
@@ -33,23 +26,35 @@ else
3326
OCI_BIN="docker"
3427
fi
3528

36-
BASE_IMAGE="quay.io/${REGISTRY_ORG}/monitoring-plugin"
29+
BASE_IMAGE="quay.io/${REGISTRY_ORG}/${REPO}"
3730
IMAGE=${BASE_IMAGE}:${TAG}
3831

32+
echo_vars() {
33+
echo "Environmental Variables set to : "
34+
echo -e "${GREEN} PREFER_PODMAN: ${ENDCOLOR} ${PREFER_PODMAN}"
35+
echo -e "${GREEN} PUSH: ${ENDCOLOR} ${PUSH}"
36+
echo -e "${GREEN} TAG: ${ENDCOLOR} ${TAG}"
37+
echo -e "${GREEN} REGISTRY_ORG: ${ENDCOLOR} ${REGISTRY_ORG}"
38+
echo -e "${GREEN} DOCKER_FILE_NAME: ${ENDCOLOR} ${DOCKER_FILE_NAME}"
39+
echo -e "${GREEN} REPO: ${ENDCOLOR}: ${REPO}"
40+
echo -e "${GREEN} IMAGE: ${ENDCOLOR}: ${IMAGE}"
41+
}
42+
echo_vars
43+
44+
# Prompt use it check env vars before proceeding to build
45+
read -r -p "Are the environmental variables correct [y/N] " response
46+
if [[ "${response:0:1}" =~ ^([nN])$ ]]
47+
then
48+
exit 0
49+
fi
50+
51+
# Build
52+
echo -e "${GREEN} Linting... ${ENDCOLOR}"
3953
make lint-backend
4054

41-
echo "Building image '${IMAGE}' with ${OCI_BIN}"
55+
echo -e "${GREEN} Building image '${IMAGE}' with ${OCI_BIN} ${ENDCOLOR}"
4256
$OCI_BIN build -t $IMAGE --platform=linux/amd64 -f $DOCKER_FILE_NAME .
4357

44-
if [[ $PUSH == 1 ]]; then
58+
if [[ $PUSH == 1 ]]; then
4559
$OCI_BIN push $IMAGE
4660
fi
47-
48-
49-
# Rollback local changes made
50-
if [[ "$OSTYPE" == "darwin"* ]] && [[ "$DOCKER_FILE_NAME" == "Dockerfile.mcp" ]]; then
51-
printf "${YELLOW}Replacing in package.json and values.yaml${ENDCOLOR}\n"
52-
sed -i 's/"name": "monitoring-console-plugin",/"name": "monitoring-plugin",/g' web/package.json
53-
printf "${YELLOW}Renaming translations to the original plugin name${ENDCOLOR}\n"
54-
cd web/locales/ && for dir in *; do if cd $dir; then for filename in *; do mv plugin__monitoring-console-plugin.json plugin__monitoring-plugin.json; done; cd ..; fi; done
55-
fi

0 commit comments

Comments
 (0)