From f2235e8f4946f1a8b6cabb946767a9330ff6f8f4 Mon Sep 17 00:00:00 2001 From: eball Date: Thu, 22 May 2025 01:01:15 +0800 Subject: [PATCH] olares: compatible with current version olares-cli (#1335) * olares: compatible with current version olares-cli * fix: release workflows bug --- .github/workflows/daily-lint-check.yaml | 2 +- .github/workflows/release-daily.yaml | 22 +++---- .github/workflows/release.yaml | 32 ++++----- .../deploy/nvshare-system-quotas.yaml | 42 ++++++++++++ build/base-package/deploy/nvshare-system.yaml | 19 ++++++ build/base-package/deploy/scheduler.yaml | 66 +++++++++++++++++++ .../{resttic => restic}/.olares/Olares.yaml | 0 infrastructure/{resttic => restic}/README.md | 0 8 files changed, 155 insertions(+), 28 deletions(-) create mode 100644 build/base-package/deploy/nvshare-system-quotas.yaml create mode 100644 build/base-package/deploy/nvshare-system.yaml create mode 100644 build/base-package/deploy/scheduler.yaml rename infrastructure/{resttic => restic}/.olares/Olares.yaml (100%) rename infrastructure/{resttic => restic}/README.md (100%) diff --git a/.github/workflows/daily-lint-check.yaml b/.github/workflows/daily-lint-check.yaml index 32128cd5a..743c9b660 100644 --- a/.github/workflows/daily-lint-check.yaml +++ b/.github/workflows/daily-lint-check.yaml @@ -33,5 +33,5 @@ jobs: - name: Run chart-testing (lint) run: | - ct lint --chart-dirs build/installer/wizard/config,build/installer/wizard/config/apps,build/installer/wizard/config/gpu --check-version-increment=false --all + ct lint --chart-dirs .dist/wizard/config,.dist/wizard/config/apps,.dist/wizard/config/gpu --check-version-increment=false --all diff --git a/.github/workflows/release-daily.yaml b/.github/workflows/release-daily.yaml index 993587ae4..ca3a72c7a 100644 --- a/.github/workflows/release-daily.yaml +++ b/.github/workflows/release-daily.yaml @@ -117,7 +117,7 @@ jobs: - name: Update checksum uses: eball/write-tag-to-version-file@latest with: - filename: 'build/installer/install.sh' + filename: 'build/base-package/install.sh' placeholder: '#__MD5SUM__' tag: ${{ steps.vars.outputs.version_md5sum }} @@ -127,9 +127,9 @@ jobs: - name: 'Archives' run: | - cp .dist/install-wizard/install.sh build/installer - cp build/installer/install.sh build/installer/publicInstaller.sh - cp .dist/install-wizard/install.ps1 build/installer + cp .dist/install-wizard/install.sh build/base-package + cp build/base-package/install.sh build/base-package/publicInstaller.sh + cp .dist/install-wizard/install.ps1 build/base-package - name: Release public files uses: softprops/action-gh-release@v1 @@ -138,13 +138,13 @@ jobs: tag_name: ${{ steps.vars.outputs.tag_version }} files: | install-wizard-v${{ steps.vars.outputs.tag_version }}.tar.gz - build/installer/publicInstaller.sh - build/installer/install.sh - build/installer/install.ps1 - build/installer/joincluster.sh - build/installer/publicAddnode.sh - build/installer/version.hint - build/installer/publicRestoreInstaller.sh + build/base-package/publicInstaller.sh + build/base-package/install.sh + build/base-package/install.ps1 + build/base-package/joincluster.sh + build/base-package/publicAddnode.sh + build/base-package/version.hint + build/base-package/publicRestoreInstaller.sh prerelease: true env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index e17159cf9..6dfeff2c3 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -77,7 +77,7 @@ jobs: ref: ${{ github.event.inputs.tags }} - name: Update env - working-directory: ./build/installer + working-directory: ./build/base-package run: | echo 'DEBUG_VERSION="false"' > .env @@ -89,7 +89,7 @@ jobs: - name: Update checksum uses: eball/write-tag-to-version-file@latest with: - filename: 'build/installer/install.sh' + filename: 'build/base-package/install.sh' placeholder: '#__MD5SUM__' tag: ${{ steps.vars.outputs.version_md5sum }} @@ -99,11 +99,11 @@ jobs: - name: 'Archives' run: | - cp .dist/install-wizard/install.sh build/installer - cp build/installer/install.sh build/installer/publicInstaller.sh - cp build/installer/install.sh build/installer/publicInstaller.latest - cp .dist/install-wizard/install.ps1 build/installer - cp build/installer/install.ps1 build/installer/publicInstaller.latest.ps1 + cp .dist/install-wizard/install.sh build/base-package + cp build/base-package/install.sh build/base-package/publicInstaller.sh + cp build/base-package/install.sh build/base-package/publicInstaller.latest + cp .dist/install-wizard/install.ps1 build/insbase-packagetaller + cp build/base-package/install.ps1 build/base-package/publicInstaller.latest.ps1 - name: Release public files uses: softprops/action-gh-release@v1 @@ -112,15 +112,15 @@ jobs: tag_name: ${{ github.event.inputs.tags }} files: | install-wizard-v${{ github.event.inputs.tags }}.tar.gz - build/installer/publicInstaller.sh - build/installer/publicInstaller.latest - build/installer/install.sh - build/installer/publicInstaller.latest.ps1 - build/installer/install.ps1 - build/installer/publicAddnode.sh - build/installer/joincluster.sh - build/installer/version.hint - build/installer/publicRestoreInstaller.sh + build/base-package/publicInstaller.sh + build/base-package/publicInstaller.latest + build/base-package/install.sh + build/base-package/publicInstaller.latest.ps1 + build/base-package/install.ps1 + build/base-package/publicAddnode.sh + build/instbase-packagealler/joincluster.sh + build/base-package/version.hint + build/base-package/publicRestoreInstaller.sh prerelease: true env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/build/base-package/deploy/nvshare-system-quotas.yaml b/build/base-package/deploy/nvshare-system-quotas.yaml new file mode 100644 index 000000000..a2596d25a --- /dev/null +++ b/build/base-package/deploy/nvshare-system-quotas.yaml @@ -0,0 +1,42 @@ +# Copyright (c) 2023 Georgios Alexopoulos +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# We must create the `ResourceQuota` object for the namespace in order for the +# K8s API server to allow creation of resources with the `system-node-critical` +# and `system-cluster-critical` PriorityClasses in this namespace. + +apiVersion: v1 +kind: ResourceQuota +metadata: + name: pods-system-cluster-critical + namespace: nvshare-system +spec: + scopeSelector: + matchExpressions: + - operator : In + scopeName: PriorityClass + values: ["system-cluster-critical"] +--- +apiVersion: v1 +kind: ResourceQuota +metadata: + name: pods-system-node-critical + namespace: nvshare-system +spec: + scopeSelector: + matchExpressions: + - operator : In + scopeName: PriorityClass + values: ["system-node-critical"] + diff --git a/build/base-package/deploy/nvshare-system.yaml b/build/base-package/deploy/nvshare-system.yaml new file mode 100644 index 000000000..616707409 --- /dev/null +++ b/build/base-package/deploy/nvshare-system.yaml @@ -0,0 +1,19 @@ +# Copyright (c) 2023 Georgios Alexopoulos +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +apiVersion: v1 +kind: Namespace +metadata: + name: nvshare-system + diff --git a/build/base-package/deploy/scheduler.yaml b/build/base-package/deploy/scheduler.yaml new file mode 100644 index 000000000..6e1109821 --- /dev/null +++ b/build/base-package/deploy/scheduler.yaml @@ -0,0 +1,66 @@ +# Copyright (c) 2023 Georgios Alexopoulos +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +apiVersion: apps/v1 +kind: DaemonSet +metadata: + name: nvshare-scheduler + namespace: nvshare-system +spec: + selector: + matchLabels: + name: nvshare-scheduler + template: + metadata: + labels: + name: nvshare-scheduler + spec: + priorityClassName: system-node-critical + nodeSelector: + gpu.bytetrade.io/cuda-supported: 'true' + initContainers: + - name: init-dir + image: busybox:1.28 + volumeMounts: + - name: nvshare-socket-directory + mountPath: /var/run/nvshare + command: + - sh + - -c + - "[ -d /var/run/nvshare/scheduler.sock ] && rm -rf /var/run/nvshare/scheduler.sock || true" + containers: + - name: nvshare-scheduler + image: bytetrade/nvshare:nvshare-scheduler + imagePullPolicy: IfNotPresent + securityContext: + allowPrivilegeEscalation: false + capabilities: + drop: ["ALL"] + command: + - sh + - -c + - "test -f /var/run/nvshare/scheduler.sock && rm -rf /var/run/nvshare/scheduler.sock; pid1 nvshare-scheduler" + volumeMounts: + - name: nvshare-socket-directory + mountPath: /var/run/nvshare + volumes: + - name: nvshare-socket-directory + hostPath: + path: /var/run/nvshare + type: DirectoryOrCreate + tolerations: + - key: nvidia.com/gpu + operator: Exists + effect: NoSchedule + diff --git a/infrastructure/resttic/.olares/Olares.yaml b/infrastructure/restic/.olares/Olares.yaml similarity index 100% rename from infrastructure/resttic/.olares/Olares.yaml rename to infrastructure/restic/.olares/Olares.yaml diff --git a/infrastructure/resttic/README.md b/infrastructure/restic/README.md similarity index 100% rename from infrastructure/resttic/README.md rename to infrastructure/restic/README.md