Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update gh-pages #3

Merged
merged 7 commits into from
Oct 12, 2024
Merged
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
71 changes: 71 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
name: Build and Push Images

on:
push:
branches: [ "main" ]
tags:
- v[0-9]+.[0-9]+.[0-9]+.[0-9]+
- v[0-9]+.[0-9]+.[0-9]+
- v[0-9]+.[0-9]+
pull_request:
branches: [ "main" ]

env:
GO_VERSION: "1.22.5"

jobs:
build-and-push-frontend:
name: Build and Push Frontend Image
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Get branch names.
id: branch-names
uses: tj-actions/branch-names@v8

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1

- name: Log in to DockerHub
uses: docker/[email protected]
with:
username: ${{ secrets.DOCKERHUB_TOKEN }}
password: ${{ secrets.DOCKERHUB_PASSWD }}

- name: Build and push frontend image
uses: docker/build-push-action@v6
with:
platforms: linux/amd64,linux/arm64
push: true
tags: projecthami/hami-webui-fe-oss:${{ steps.branch-names.outputs.current_branch || steps.branch-names.outputs.tag }}

build-and-push-backend:
name: Build and Push Backend Image
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2


- name: Get branch names.
id: branch-names
uses: tj-actions/branch-names@v8

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1

- name: Log in to DockerHub
uses: docker/[email protected]
with:
username: ${{ secrets.DOCKERHUB_TOKEN }}
password: ${{ secrets.DOCKERHUB_PASSWD }}

- name: Build and push backend image
uses: docker/build-push-action@v6
with:
context: ./server
platforms: linux/amd64,linux/arm64
push: true
tags: projecthami/hami-webui-be-oss:${{ steps.branch-names.outputs.current_branch || steps.branch-names.outputs.tag }}
4 changes: 2 additions & 2 deletions charts/hami-webui/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@ type: application
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 1.0.1
version: 1.0.3

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
# follow Semantic Versioning. They should reflect the version the application is using.
# It is recommended to use it with quotes.
appVersion: "1.0.0"
appVersion: "1.0.3"

dependencies:
- condition: dcgm-exporter.enabled
Expand Down
16 changes: 11 additions & 5 deletions charts/hami-webui/README.md
Original file line number Diff line number Diff line change
@@ -1,30 +1,36 @@
# HAMi-WebUI

![Version: 1.0.0](https://img.shields.io/badge/Version-1.0.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 1.0.0](https://img.shields.io/badge/AppVersion-1.0.0-informational?style=flat-square)
![Version: 1.0.3](https://img.shields.io/badge/Version-1.0.3-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 1.0.3](https://img.shields.io/badge/AppVersion-1.0.3-informational?style=flat-square)

## Get Repo Info

```console
helm repo add hami-charts https://project-hami.github.io/HAMi/
helm repo add hami-webui https://project-hami.github.io/HAMi-WebUI
helm repo update
```

_See [helm repo](https://helm.sh/docs/helm/helm_repo/) for command documentation._

## Installing the Chart

To install the chart with the release name `my-release`:
Before deploying, ensure that you configure the `values.yaml` file to match your cluster’s requirements. For detailed instructions, refer to the [Configuration Guide for HAMi-WebUI Helm Chart](#configuration-guide-for-hamiwebui-helm-chart)
> _**Important**_: You must adjust the values.yaml before proceeding with the deployment.

Download the `values.yaml` file from the Helm Charts repository:

https://github.com/Project-HAMi/HAMi-WebUI/blob/main/charts/hami-webui/values.yaml


```console
helm install hami-webui hami-charts/hami-webui
helm install my-hami-webui hami-webui/hami-webui --create-namespace --namespace hami -f values.yaml
```

## Uninstalling the Chart

To uninstall/delete the my-release deployment:

```console
helm delete hami-webui
helm delete my-hami-webui
```

The command removes all the Kubernetes components associated with the chart and deletes the release.
Expand Down
5 changes: 3 additions & 2 deletions charts/hami-webui/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,7 @@ spec:
image: "{{ .Values.image.frontend.repository }}:{{ .Values.image.frontend.tag | default .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.image.frontend.pullPolicy }}
env:
- name: TZ
value: "Asia/Shanghai"
{{- toYaml .Values.env.frontend | nindent 12 }}
ports:
- name: http
containerPort: 3000
Expand All @@ -49,6 +48,8 @@ spec:
{{- toYaml .Values.securityContext | nindent 12 }}
image: "{{ .Values.image.backend.repository }}:{{ .Values.image.backend.tag | default .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.image.backend.pullPolicy }}
env:
{{- toYaml .Values.env.backend | nindent 12 }}
ports:
- name: metrics
containerPort: 8000
Expand Down
14 changes: 11 additions & 3 deletions charts/hami-webui/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ image:
repository: projecthami/hami-webui-fe-oss
pullPolicy: IfNotPresent
# Overrides the image tag whose default is the chart appVersion.
tag: "v1.0.0"
tag: "v1.0.3"
backend:
repository: projecthami/hami-webui-be-oss
pullPolicy: IfNotPresent
tag: "v1.0.0"
tag: "v1.0.3"

imagePullSecrets: []
nameOverride: ""
Expand Down Expand Up @@ -88,6 +88,14 @@ resources:
# cpu: 100m
# memory: 128Mi

env:
frontend:
- name: TZ
value: "Asia/Shanghai"
backend:
- name: TZ
value: "Asia/Shanghai"

serviceMonitor:
enabled: true
interval: 15s
Expand Down Expand Up @@ -123,7 +131,7 @@ dcgm-exporter:
gpu: "on"

kube-prometheus-stack:
enabled: true
enabled: false
crds:
enabled: false
defaultRules:
Expand Down
20 changes: 12 additions & 8 deletions docs/installation/helm/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,19 +37,19 @@ To set up the HAMi-WebUI Helm repository so that you download the correct HAMi-W
The following example adds the `hami-webui` Helm repository.

```bash
helm repo add hami-charts https://project-hami.github.io/HAMi/
helm repo add hami-webui https://project-hami.github.io/HAMi-WebUI
```

2. Run the following command to verify the repository was added:

```bash
helm repo list | grep hami
helm repo list | grep hami-webui
```

After you add the repository, you should see an output similar to the following:

```bash
hami-charts https://project-hami.github.io/HAMi/
hami-webui https://project-hami.github.io/HAMi-WebUI
```

3. Run the following command to update the repository to download the latest HAMi-WebUI Helm charts:
Expand Down Expand Up @@ -78,23 +78,27 @@ When you create a new namespace in Kubernetes, you can better organize, allocate
namespace/hami created
```

2. Search for the official `hami-charts/hami-webui` repository using the command:
2. Search for the official `hami-webui/hami-webui` repository using the command:

`helm search repo <repo-name/package-name>`

For example, the following command provides a list of the HAMi-WebUI Helm Charts from which you will install the latest version of the HAMi-WebUI chart.

```bash
helm search repo hami-charts/hami-webui
helm search repo hami-webui/hami-webui
```

3. Before proceeding, navigate to the [Configuration Guide for HAMi-WebUI Helm Chart](../../../charts/hami-webui/README.md#configuration-guide-for-hamiwebui-helm-chart), where you'll find instructions on configuring the necessary `values.yaml` based on your cluster's requirements.
> It is **critical** to modify the values accordingly before deploying.
3. Before deploying, ensure that you configure the `values.yaml` file to match your cluster’s requirements. For detailed instructions, refer to the [Configuration Guide for HAMi-WebUI Helm Chart](../../../charts/hami-webui/README.md#configuration-guide-for-hamiwebui-helm-chart)
> _**Important**_: You must adjust the values.yaml before proceeding with the deployment.

Download the `values.yaml` file from the Helm Charts repository:

https://github.com/Project-HAMi/HAMi-WebUI/blob/main/charts/hami-webui/values.yaml

4. Once you've adjusted the `values.yaml`, run the following command to deploy the HAMi-WebUI Helm Chart inside your namespace:

```bash
helm install my-hami-webui hami-charts/hami-webui --namespace hami
helm install my-hami-webui hami-webui/hami-webui --namespace hami -f values.yaml
```

Where:
Expand Down
2 changes: 0 additions & 2 deletions server/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ FROM golang:1.23.1 AS builder

WORKDIR /src

ENV GOPROXY=https://goproxy.cn,direct

COPY . .

RUN apt-get update && apt-get install -y --no-install-recommends protobuf-compiler
Expand Down
4 changes: 3 additions & 1 deletion server/internal/data/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,9 @@ func (r *nodeRepo) updateLocalNodes() {
}
for _, node := range nodes {
bizNode := r.fetchNodeInfo(node)
n[node.UID] = bizNode
if _, ok := n[node.UID]; !ok {
n[node.UID] = bizNode
}
devices, err := p.FetchDevices(node)
if err != nil {
r.log.Warnf("list devices info error: %s", err)
Expand Down
2 changes: 1 addition & 1 deletion src/config/development/proxy.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
export default {
vgpu: {
target: 'http://192.168.10.137:8000',
target: 'http://127.0.0.1:8000',
secure: false,
pathRewrite: {
'^/api/vgpu': '',
Expand Down
Loading