Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 0 additions & 41 deletions .eslintrc

This file was deleted.

27 changes: 27 additions & 0 deletions .eslintrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
env:
browser: true
es2021: true
extends:
- eslint:recommended
- plugin:react/recommended
- plugin:@typescript-eslint/recommended
- prettier
parser: '@typescript-eslint/parser'
parserOptions:
ecmaFeatures:
jsx: true
ecmaVersion: 2016
sourceType: module
plugins:
- prettier
- react
- '@typescript-eslint'
rules:
prettier/prettier:
- error
react/prop-types: off
settings:
react:
version: detect


3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ typings/

# parcel-bundler cache (https://parceljs.org/)
.cache
.cache_*

# Next.js build output
.next
Expand Down Expand Up @@ -102,3 +103,5 @@ dist

# TernJS port file
.tern-port

.vscode
6 changes: 2 additions & 4 deletions .prettierrc.yaml → .prettierrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,5 @@ arrowParens: always
printWidth: 100
singleQuote: true
trailingComma: all
tabWidth: 2
semi: true
jsxSingleQuote: false
proseWrap: always


28 changes: 28 additions & 0 deletions .stylelintrc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
extends:
- stylelint-config-standard
rules:
# Disallow color names and hex colors as these don't work well with dark mode.
# Use PF global variables instead:
# https://patternfly-react-main.surge.sh/developer-resources/global-css-variables#global-css-variables
color-named: never
color-no-hex: true
# PatternFly CSS vars don't conform to stylelint's regex. Disable this rule.
custom-property-pattern: null
function-disallowed-list:
- rgb
# Disable the standard rule to allow BEM-style classnames with underscores.
selector-class-pattern: null
# Disallow CSS classnames prefixed with .pf- or .co- as these prefixes are
# reserved by PatternFly and OpenShift console.
selector-disallowed-list:
- "*"
- /\.(pf|co)-/
# Plugins should avoid naked element selectors like `table` and `li` since
# this can impact layout of existing pages in console.
selector-max-type:
- 0
- ignore:
- compounded
- descendant


2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
"**/dist": true
},
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true
"source.fixAll.eslint": "explicit"
},
"editor.quickSuggestions": {
"comments": "on",
Expand Down
15 changes: 8 additions & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@

FROM registry.access.redhat.com/ubi8/nodejs-16:latest AS builder
FROM registry.access.redhat.com/ubi9/nodejs-20:latest AS build
USER root
RUN command -v yarn || npm i -g yarn

COPY . /opt/app-root/src
RUN yarn install --frozen-lockfile && yarn build
ADD . /usr/src/app
WORKDIR /usr/src/app
RUN yarn install && yarn build

FROM registry.access.redhat.com/ubi9/nginx-120:latest
COPY default.conf "${NGINX_CONFIGURATION_PATH}"
COPY --from=builder /opt/app-root/src/dist .

COPY --from=build /usr/src/app/dist /usr/share/nginx/html
USER 1001
CMD /usr/libexec/s2i/run

ENTRYPOINT ["nginx", "-g", "daemon off;"]
9 changes: 5 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,16 @@ Dynamic plugin for the OpenShift console which adds GPU capabilities.

| NVIDIA GPU plugin | OCP Console |
| ---------------------- | ----------- |
| release-0.2.5/latest | 4.12-4.18 |
| release-0.2.4 | 4.11 |
| release-0.0.1 | 4.10 |
| main/latest | 4.19+ |
| 0.2.5 | 4.12-4.18 |
| 0.2.4 | 4.11 |
| 0.0.1 | 4.10 |

## QuickStart

### Prerequisites

- [Red Hat OpenShift](https://www.redhat.com/en/technologies/cloud-computing/openshift) 4.12-4.18
- [Red Hat OpenShift](https://www.redhat.com/en/technologies/cloud-computing/openshift) 4.19+ (for main/latest)
- [NVIDIA GPU operator](https://github.com/NVIDIA/gpu-operator)
- [Helm](https://helm.sh/docs/intro/install/)

Expand Down
14 changes: 0 additions & 14 deletions default.conf

This file was deleted.

2 changes: 1 addition & 1 deletion deployment/console-plugin-nvidia-gpu/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apiVersion: v2
appVersion: latest
description: |
Red Hat OpenShift dynamic console plugin that leverages the NVIDIA GPU operator metrics and serves the respective console-extensions. Requires Red Hat OpenShift version 4.12+
Red Hat OpenShift dynamic console plugin that leverages the NVIDIA GPU operator metrics and serves the respective console-extensions. Requires Red Hat OpenShift version 4.19+
name: console-plugin-nvidia-gpu
sources:
- https://github.com/rh-ecosystem-edge/console-plugin-nvidia-gpu
Expand Down
18 changes: 9 additions & 9 deletions deployment/console-plugin-nvidia-gpu/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ in order to serve the respective [console-extensions](https://github.com/openshi

### Prerequisites

- [Red Hat OpenShift](https://www.redhat.com/en/technologies/cloud-computing/openshift) 4.12-4.18
- [Red Hat OpenShift](https://www.redhat.com/en/technologies/cloud-computing/openshift) 4.19+
- [NVIDIA GPU operator](https://github.com/NVIDIA/gpu-operator)
- [Helm](https://helm.sh/docs/intro/install/)

Expand All @@ -23,20 +23,20 @@ $ helm repo update
# install Helm chart in the default NVIDIA GPU operator namespace
$ helm install -n nvidia-gpu-operator console-plugin-nvidia-gpu rh-ecosystem-edge/console-plugin-nvidia-gpu

# The plugin will be automatically enabled via a post-install hook!
# No manual 'oc patch' commands needed.

# view deployed resources
$ kubectl -n nvidia-gpu-operator get all -l app.kubernetes.io/name=console-plugin-nvidia-gpu

# check if a plugins field is specified
$ oc get consoles.operator.openshift.io cluster --output=jsonpath="{.spec.plugins}"

# if not, then run the following to enable the plugin
$ oc patch consoles.operator.openshift.io cluster --patch '{ "spec": { "plugins": ["console-plugin-nvidia-gpu"] } }' --type=merge

# if yes, then run the following to enable the plugin
$ oc patch consoles.operator.openshift.io cluster --patch '[{"op": "add", "path": "/spec/plugins/-", "value": "console-plugin-nvidia-gpu" }]' --type=json
# verify the plugin was automatically enabled
$ oc get consoles.operator.openshift.io cluster --output=jsonpath="{.spec.plugins}" | grep console-plugin-nvidia-gpu

# add the required DCGM Exporter metrics ConfigMap to the existing NVIDIA operator ClusterPolicy CR
$ oc patch clusterpolicies.nvidia.com gpu-cluster-policy --patch '{ "spec": { "dcgmExporter": { "config": { "name": "console-plugin-nvidia-gpu" } } } }' --type=merge

# (Optional) To disable auto-enablement, set plugin.jobs.patchConsoles.enabled=false:
$ helm install -n nvidia-gpu-operator console-plugin-nvidia-gpu rh-ecosystem-edge/console-plugin-nvidia-gpu --set plugin.jobs.patchConsoles.enabled=false
```

### Helm Tests
Expand Down
Loading
Loading