From 4f8d0706b31916a9d6e92513b53659fbb29fb285 Mon Sep 17 00:00:00 2001 From: John Parent Date: Wed, 17 Jul 2024 16:54:09 -0400 Subject: [PATCH 01/12] Add basic GHA jobs Converts existing GHA job to new workflow model Adds build jobs for Windows, Linux, and MacOS Signed-off-by: John Parent --- .github/workflows/codespell.yml | 6 +--- .github/workflows/gpt4all.yml | 51 +++++++++++++++++++++++++++++++++ 2 files changed, 52 insertions(+), 5 deletions(-) create mode 100644 .github/workflows/gpt4all.yml diff --git a/.github/workflows/codespell.yml b/.github/workflows/codespell.yml index 3bda7023b6c3..83677016ca9a 100644 --- a/.github/workflows/codespell.yml +++ b/.github/workflows/codespell.yml @@ -2,16 +2,12 @@ name: Codespell on: - push: - branches: [main] - pull_request: - branches: [main] + workflow_call jobs: codespell: name: Check for spelling errors runs-on: ubuntu-latest - steps: - name: Checkout uses: actions/checkout@v4 diff --git a/.github/workflows/gpt4all.yml b/.github/workflows/gpt4all.yml new file mode 100644 index 000000000000..58f3012e1338 --- /dev/null +++ b/.github/workflows/gpt4all.yml @@ -0,0 +1,51 @@ +# Serves as the entrypoint for all of Gpt4All's GHA CI workflows +# all other workflows should either be a manual trigger job independent +# of PR context (see close_issues.yml) or should be dispatched by this +# workflow + + +name: gpt4all-ci + +on: + push: + branches: + - main + pull_request: + branches: + - main + +jobs: + changes: + runs-on: ubuntu-latest + outputs: + core: ${{ steps.changes.outputs.core }} + chat: ${{ steps.changes.outputs.chat }} + python: ${{ steps.changes.outputs.python }} + typescript: ${{ steps.changes.outputs.typescript }} + steps: + - uses: actions/checkout@v3 + with: + fetch_depth: 0 + - uses: dorny/paths-filter@v2 + id: changes + with: + filters: | + core: + - '.github/workflows/**' + - 'gpt4all-backend/**' + chat: + - 'gpt4all-chat/**' + python: + - 'gpt4all-bindings/python/**' + typescript: + - 'gpt4all-bindings/typescript/**' + spellcheck: + uses: ./.github/workflows/codespell.yml + secrets: inherit + build-chat: + name: "Build Gpt4All chat" + needs: [changes] + if: ${{ needs.changes.outputs.core || needs.changes.outputs.chat }} + uses: ./.github/workflows/build-chat.yml + + From 0ed3128e51ba2b8a1a549b16ce4410eee7da8a02 Mon Sep 17 00:00:00 2001 From: John Parent Date: Wed, 17 Jul 2024 17:01:56 -0400 Subject: [PATCH 02/12] Add ignored file Signed-off-by: John Parent --- .github/workflows/build-chat.yml | 110 +++++++++++++++++++++++++++++++ 1 file changed, 110 insertions(+) create mode 100644 .github/workflows/build-chat.yml diff --git a/.github/workflows/build-chat.yml b/.github/workflows/build-chat.yml new file mode 100644 index 000000000000..71c04c01e4fd --- /dev/null +++ b/.github/workflows/build-chat.yml @@ -0,0 +1,110 @@ +on: + workflow_call: + +jobs: + build-chat-windows: + runs-on: windows-latest + defaults: + run: + shell: powershell -noe -c "&{Import-Module """C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\Common7\Tools\Microsoft.VisualStudio.DevShell.dll"""; Enter-VsDevShell eb4dc59a}" + steps: + - name: Checkout + uses: actions/checkout@v3 + with: + fetch_depth: 0 + submodules: true + - name: Install QT + uses: jurplel/install-qt-action@v4 + with: + version: '4.6.0' + host: 'windows' + target: 'desktop' + arch: 'win64_msvc2013_64' + dir: '${{ github.workspace }}/Qt' + cache: true + tools: 'qt.tools.cmake qt.tools.ifw.47 qt.tools.ninja qt.qt6.651.win64_msvc2019_64 qt.qt6.651.qt5compat qt.qt6.651.debug_info qt.qt6.651.addons.qtpdf qt.qt6.651.addons.qthttpserver' + set-env: 'true' + tools-only: 'false' + - name: Install Vulkan + uses: humbletim/setup-vulkan-sdk@v1.2.0 + with: + vulkan-query-version: 1.3.261.1 + vulkan-components: Vulkan-Headers, Vulkan-Loader + vulkan-use-cache: true + - name: Install CUDA ToolKit + uses: Jimver/cuda-toolkit@v0.2.16 + id: cuda-toolkit + with: + method: network + sub-packages: '["nvcc_11.8", "visual_studio_integration"]' + non-cuda-sub-packages: '["cudart_11.8", "cublas_11.8", "cublas_dev_11.8"]' + cuda: 11.8.0 + - name: Build Chat + run: | + cmake -G Ninja -DCMAKE_BUILD_TYPE=Release -DKOMPUTE_OPT_DISABLE_VULKAN_VERSION_CHECK=ON -S gpt4all-chat -B build + ninja -C build + build-chat-macos: + runs-on: macos-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + with: + fetch_depth: 0 + submodules: true + - name: Setup XCode + uses: maxim-lobanov/setup-xcode@v1 + with: + xcode-version: '14.0.0' + - name: Install QT + uses: jurplel/install-qt-action@v4 + with: + version: '4.6.0' + host: 'mac' + target: 'desktop' + arch: 'clang_64' + dir: '${{ github.workspace }}/Qt' + cache: true + tools: 'qt.tools.cmake qt.tools.ifw.47 qt.tools.ninja qt.qt6.651.clang_64 qt.qt6.651.qt5compat qt.qt6.651.debug_info qt.qt6.651.addons.qtpdf qt.qt6.651.addons.qthttpserver' + set-env: 'true' + tools-only: 'false' + - name: Install Rosetta + run: softwareupdate --install-rosetta --agree-to-license + - name: Build Chat + run: | + cmake -G Ninja -DCMAKE_BUILD_TYPE=Release -S gpt4all-chat -B build + cmake --build build --target all + build-chat-linux: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + with: + fetch_depth: 0 + submodules: true + - name: Install QT + uses: jurplel/install-qt-action@v4 + with: + version: '4.6.0' + host: 'linux' + target: 'desktop' + arch: 'gcc_64' + dir: '${{ github.workspace }}/Qt' + cache: true + tools: 'qt.tools.cmake qt.tools.ifw.47 qt.tools.ninja qt.qt6.651.gcc_64 qt.qt6.651.qt5compat qt.qt6.651.debug_info qt.qt6.651.addons.qtpdf qt.qt6.651.addons.qthttpserver qt.qt6.651.qtwaylandcompositor' + set-env: 'true' + tools-only: 'false' + - name: Install Vulkan + Cuda + run: | + wget -qO- https://packages.lunarg.com/lunarg-signing-key-pub.asc | sudo tee /etc/apt/trusted.gpg.d/lunarg.asc + sudo wget -qO /etc/apt/sources.list.d/lunarg-vulkan-jammy.list http://packages.lunarg.com/vulkan/lunarg-vulkan-jammy.list + wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64/cuda-keyring_1.1-1_all.deb + sudo dpkg -i cuda-keyring_1.1-1_all.deb + sudo apt update && sudo apt install -y libfontconfig1 libfreetype6 libx11-6 libx11-xcb1 libxext6 libxfixes3 libxi6 libxrender1 libxcb1 libxcb-cursor0 libxcb-glx0 libxcb-keysyms1 libxcb-image0 libxcb-shm0 libxcb-icccm4 libxcb-sync1 libxcb-xfixes0 libxcb-shape0 libxcb-randr0 libxcb-render-util0 libxcb-util1 libxcb-xinerama0 libxcb-xkb1 libxkbcommon0 libxkbcommon-x11-0 bison build-essential flex gperf python3 gcc g++ libgl1-mesa-dev libwayland-dev vulkan-sdk cuda-compiler-11-8 libcublas-dev-11-8 libnvidia-compute-550-server libmysqlclient21 libodbc2 libpq5 + echo "/usr/local/cuda/bin" >> $GITHUB_PATH + - name: Build Chat + run: | + cmake -GNinja -DCMAKE_BUILD_TYPE=Release -S gpt4all-chat -B build + cmake --build build --target all + + + From cc643d0f9a625cfff4ac5f4336ccd1d1dbf8a52a Mon Sep 17 00:00:00 2001 From: John Parent Date: Thu, 18 Jul 2024 18:55:22 -0400 Subject: [PATCH 03/12] Correct Qt Version Signed-off-by: John Parent --- .github/workflows/build-chat.yml | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/.github/workflows/build-chat.yml b/.github/workflows/build-chat.yml index 71c04c01e4fd..084da4be1620 100644 --- a/.github/workflows/build-chat.yml +++ b/.github/workflows/build-chat.yml @@ -16,7 +16,7 @@ jobs: - name: Install QT uses: jurplel/install-qt-action@v4 with: - version: '4.6.0' + version: '5.15.11' host: 'windows' target: 'desktop' arch: 'win64_msvc2013_64' @@ -44,7 +44,7 @@ jobs: cmake -G Ninja -DCMAKE_BUILD_TYPE=Release -DKOMPUTE_OPT_DISABLE_VULKAN_VERSION_CHECK=ON -S gpt4all-chat -B build ninja -C build build-chat-macos: - runs-on: macos-latest + runs-on: macos-13 steps: - name: Checkout uses: actions/checkout@v3 @@ -52,13 +52,11 @@ jobs: fetch_depth: 0 submodules: true - name: Setup XCode - uses: maxim-lobanov/setup-xcode@v1 - with: - xcode-version: '14.0.0' + run: sudo xcode-select -s '/Applications/Xcode_14.1.app' - name: Install QT uses: jurplel/install-qt-action@v4 with: - version: '4.6.0' + version: '5.15.11' host: 'mac' target: 'desktop' arch: 'clang_64' @@ -84,7 +82,7 @@ jobs: - name: Install QT uses: jurplel/install-qt-action@v4 with: - version: '4.6.0' + version: '5.15.11' host: 'linux' target: 'desktop' arch: 'gcc_64' From 6fc3215f1d3236ccfbd6eef8a8493530cafdc348 Mon Sep 17 00:00:00 2001 From: John Parent Date: Fri, 19 Jul 2024 18:05:57 -0400 Subject: [PATCH 04/12] Stop using broken 3rd party actions --- .github/workflows/build-chat.yml | 72 ++++++++++---------------------- 1 file changed, 23 insertions(+), 49 deletions(-) diff --git a/.github/workflows/build-chat.yml b/.github/workflows/build-chat.yml index 084da4be1620..28a80651083d 100644 --- a/.github/workflows/build-chat.yml +++ b/.github/workflows/build-chat.yml @@ -14,31 +14,17 @@ jobs: fetch_depth: 0 submodules: true - name: Install QT - uses: jurplel/install-qt-action@v4 - with: - version: '5.15.11' - host: 'windows' - target: 'desktop' - arch: 'win64_msvc2013_64' - dir: '${{ github.workspace }}/Qt' - cache: true - tools: 'qt.tools.cmake qt.tools.ifw.47 qt.tools.ninja qt.qt6.651.win64_msvc2019_64 qt.qt6.651.qt5compat qt.qt6.651.debug_info qt.qt6.651.addons.qtpdf qt.qt6.651.addons.qthttpserver' - set-env: 'true' - tools-only: 'false' + run: | + Invoke-WebRequest -Uri https://gpt4all.io/ci/qt-unified-windows-x64-4.6.0-online.exe -OutFile qt-unified-windows-x64-4.6.0-online.exe + & .\qt-unified-windows-x64-4.6.0-online.exe --no-force-installations --no-default-installations --no-size-checking --default-answer --accept-licenses --confirm-command --accept-obligations --email ${Env:QT_EMAIL} --password ${Env:QT_PASSWORD} install qt.tools.cmake qt.tools.ifw.47 qt.tools.ninja qt.qt6.651.win64_msvc2019_64 qt.qt6.651.qt5compat qt.qt6.651.debug_info qt.qt6.651.addons.qtpdf qt.qt6.651.addons.qthttpserver - name: Install Vulkan - uses: humbletim/setup-vulkan-sdk@v1.2.0 - with: - vulkan-query-version: 1.3.261.1 - vulkan-components: Vulkan-Headers, Vulkan-Loader - vulkan-use-cache: true - - name: Install CUDA ToolKit - uses: Jimver/cuda-toolkit@v0.2.16 - id: cuda-toolkit - with: - method: network - sub-packages: '["nvcc_11.8", "visual_studio_integration"]' - non-cuda-sub-packages: '["cudart_11.8", "cublas_11.8", "cublas_dev_11.8"]' - cuda: 11.8.0 + run: | + Invoke-WebRequest -Uri https://sdk.lunarg.com/sdk/download/1.3.261.1/windows/VulkanSDK-1.3.261.1-Installer.exe -OutFile VulkanSDK-1.3.261.1-Installer.exe + .\VulkanSDK-1.3.261.1-Installer.exe --accept-licenses --default-answer --confirm-command install + - name: Install CUDA + run: | + Invoke-WebRequest -Uri https://developer.download.nvidia.com/compute/cuda/11.8.0/network_installers/cuda_11.8.0_windows_network.exe -OutFile cuda_11.8.0_windows_network.exe + .\cuda_11.8.0_windows_network.exe -s cudart_11.8 nvcc_11.8 cublas_11.8 cublas_dev_11.8 - name: Build Chat run: | cmake -G Ninja -DCMAKE_BUILD_TYPE=Release -DKOMPUTE_OPT_DISABLE_VULKAN_VERSION_CHECK=ON -S gpt4all-chat -B build @@ -54,19 +40,14 @@ jobs: - name: Setup XCode run: sudo xcode-select -s '/Applications/Xcode_14.1.app' - name: Install QT - uses: jurplel/install-qt-action@v4 - with: - version: '5.15.11' - host: 'mac' - target: 'desktop' - arch: 'clang_64' - dir: '${{ github.workspace }}/Qt' - cache: true - tools: 'qt.tools.cmake qt.tools.ifw.47 qt.tools.ninja qt.qt6.651.clang_64 qt.qt6.651.qt5compat qt.qt6.651.debug_info qt.qt6.651.addons.qtpdf qt.qt6.651.addons.qthttpserver' - set-env: 'true' - tools-only: 'false' + run: | + curl -o qt-unified-macOS-x64-4.6.0-online.dmg https://gpt4all.io/ci/qt-unified-macOS-x64-4.6.0-online.dmg + hdiutil attach qt-unified-macOS-x64-4.6.0-online.dmg + /Volumes/qt-unified-macOS-x64-4.6.0-online/qt-unified-macOS-x64-4.6.0-online.app/Contents/MacOS/qt-unified-macOS-x64-4.6.0-online --no-force-installations --no-default-installations --no-size-checking --default-answer --accept-licenses --confirm-command --accept-obligations --email $QT_EMAIL --password $QT_PASSWORD install qt.tools.cmake qt.tools.ifw.47 qt.tools.ninja qt.qt6.651.clang_64 qt.qt6.651.qt5compat qt.qt6.651.debug_info qt.qt6.651.addons.qtpdf qt.qt6.651.addons.qthttpserver + hdiutil detach /Volumes/qt-unified-macOS-x64-4.6.0-online - name: Install Rosetta - run: softwareupdate --install-rosetta --agree-to-license + run: | + softwareupdate --install-rosetta --agree-to-license - name: Build Chat run: | cmake -G Ninja -DCMAKE_BUILD_TYPE=Release -S gpt4all-chat -B build @@ -80,17 +61,10 @@ jobs: fetch_depth: 0 submodules: true - name: Install QT - uses: jurplel/install-qt-action@v4 - with: - version: '5.15.11' - host: 'linux' - target: 'desktop' - arch: 'gcc_64' - dir: '${{ github.workspace }}/Qt' - cache: true - tools: 'qt.tools.cmake qt.tools.ifw.47 qt.tools.ninja qt.qt6.651.gcc_64 qt.qt6.651.qt5compat qt.qt6.651.debug_info qt.qt6.651.addons.qtpdf qt.qt6.651.addons.qthttpserver qt.qt6.651.qtwaylandcompositor' - set-env: 'true' - tools-only: 'false' + run: | + wget https://gpt4all.io/ci/qt-unified-linux-x64-4.6.0-online.run + chmod +x qt-unified-linux-x64-4.6.0-online.run + ./qt-unified-linux-x64-4.6.0-online.run --no-force-installations --no-default-installations --no-size-checking --default-answer --accept-licenses --confirm-command --accept-obligations --email $QT_EMAIL --password $QT_PASSWORD install qt.tools.cmake qt.tools.ifw.47 qt.tools.ninja qt.qt6.651.gcc_64 qt.qt6.651.qt5compat qt.qt6.651.debug_info qt.qt6.651.addons.qtpdf qt.qt6.651.addons.qthttpserver qt.qt6.651.qtwaylandcompositor - name: Install Vulkan + Cuda run: | wget -qO- https://packages.lunarg.com/lunarg-signing-key-pub.asc | sudo tee /etc/apt/trusted.gpg.d/lunarg.asc @@ -101,8 +75,8 @@ jobs: echo "/usr/local/cuda/bin" >> $GITHUB_PATH - name: Build Chat run: | - cmake -GNinja -DCMAKE_BUILD_TYPE=Release -S gpt4all-chat -B build - cmake --build build --target all + cmake -GNinja -DCMAKE_BUILD_TYPE=Release -S gpt4all-chat -B build + cmake --build build --target all From 8196c8a654c6f1682457f9a983fb81809db15811 Mon Sep 17 00:00:00 2001 From: John Parent Date: Fri, 19 Jul 2024 18:48:48 -0400 Subject: [PATCH 05/12] Add caching --- .github/workflows/build-chat.yml | 70 +++++++++++++++++++++++++++----- 1 file changed, 60 insertions(+), 10 deletions(-) diff --git a/.github/workflows/build-chat.yml b/.github/workflows/build-chat.yml index 28a80651083d..76a4d3311fb5 100644 --- a/.github/workflows/build-chat.yml +++ b/.github/workflows/build-chat.yml @@ -13,18 +13,42 @@ jobs: with: fetch_depth: 0 submodules: true - - name: Install QT - run: | - Invoke-WebRequest -Uri https://gpt4all.io/ci/qt-unified-windows-x64-4.6.0-online.exe -OutFile qt-unified-windows-x64-4.6.0-online.exe - & .\qt-unified-windows-x64-4.6.0-online.exe --no-force-installations --no-default-installations --no-size-checking --default-answer --accept-licenses --confirm-command --accept-obligations --email ${Env:QT_EMAIL} --password ${Env:QT_PASSWORD} install qt.tools.cmake qt.tools.ifw.47 qt.tools.ninja qt.qt6.651.win64_msvc2019_64 qt.qt6.651.qt5compat qt.qt6.651.debug_info qt.qt6.651.addons.qtpdf qt.qt6.651.addons.qthttpserver - - name: Install Vulkan + - name: Cache Vulkan + id: cache_vulkan + uses: actions/cache@v3 + with: + path: C:\VulkanSDK + key: ${{ runner.os }}-build-vulkan-${{ hashFiles('C:\VulkanSDK\**') }} + restore_keys: | + ${{ runner.os }}-build-vulkan- + - if: ${{ steps.cache_vulkan.outputs.cache-hit != 'true' }} + name: Install Vulkan run: | Invoke-WebRequest -Uri https://sdk.lunarg.com/sdk/download/1.3.261.1/windows/VulkanSDK-1.3.261.1-Installer.exe -OutFile VulkanSDK-1.3.261.1-Installer.exe .\VulkanSDK-1.3.261.1-Installer.exe --accept-licenses --default-answer --confirm-command install + echo "VULKAN_SDK=C:\VulkanSDK\1.3.261.1" >> $Env:GITHUB_ENV + echo "C:\VulkanSDK\1.3.261.1\bin" >> $Env:GITHUB_PATH - name: Install CUDA run: | Invoke-WebRequest -Uri https://developer.download.nvidia.com/compute/cuda/11.8.0/network_installers/cuda_11.8.0_windows_network.exe -OutFile cuda_11.8.0_windows_network.exe .\cuda_11.8.0_windows_network.exe -s cudart_11.8 nvcc_11.8 cublas_11.8 cublas_dev_11.8 + - name: Cache Qt + id: cache_qt + uses: actions/cache@v3 + with: + path: C:\Qt + key: ${{ runner.os }}-build-qt-${{ hashFiles('C:\Qt\**') }} + restore_keys: | + ${{ runner.os }}-build-qt- + - if: ${{ steps.cache_qt.outputs.cache-hit != 'true' }} + name: Install QT + env: + QT_EMAIL: ${{ secrets.QT_EMAIL }} + QT_PASSWORD: ${{ secrets.QT_PASSWORD }} + run: | + Invoke-WebRequest -Uri https://gpt4all.io/ci/qt-unified-windows-x64-4.6.0-online.exe -OutFile qt-unified-windows-x64-4.6.0-online.exe + & .\qt-unified-windows-x64-4.6.0-online.exe --no-force-installations --no-default-installations --no-size-checking --default-answer --accept-licenses --confirm-command --accept-obligations --email $Env:QT_EMAIL --password $Env:QT_PASSWORD install qt.tools.cmake qt.tools.ifw.47 qt.tools.ninja qt.qt6.651.win64_msvc2019_64 qt.qt6.651.qt5compat qt.qt6.651.debug_info qt.qt6.651.addons.qtpdf qt.qt6.651.addons.qthttpserver + echo "Qt6_DIR=C:/Qt/6.5.1/msvc2019_64" >> $Env:GITHUB_ENV - name: Build Chat run: | cmake -G Ninja -DCMAKE_BUILD_TYPE=Release -DKOMPUTE_OPT_DISABLE_VULKAN_VERSION_CHECK=ON -S gpt4all-chat -B build @@ -39,15 +63,28 @@ jobs: submodules: true - name: Setup XCode run: sudo xcode-select -s '/Applications/Xcode_14.1.app' - - name: Install QT + - name: Install Rosetta + run: | + softwareupdate --install-rosetta --agree-to-license + - name: Cache Qt + id: cache_qt + uses: actions/cache@v3 + with: + path: "~/Qt" + key: ${{ runner.os }}-build-qt-${{ hashFiles('~/Qt/**') }} + restore_keys: | + ${{ runner.os }}-build-qt- + - if: ${{ steps.cache_qt.outputs.cache-hit != 'true' }} + name: Install QT + env: + QT_EMAIL: ${{ secrets.QT_EMAIL }} + QT_PASSWORD: ${{ secrets.QT_PASSWORD }} run: | curl -o qt-unified-macOS-x64-4.6.0-online.dmg https://gpt4all.io/ci/qt-unified-macOS-x64-4.6.0-online.dmg hdiutil attach qt-unified-macOS-x64-4.6.0-online.dmg /Volumes/qt-unified-macOS-x64-4.6.0-online/qt-unified-macOS-x64-4.6.0-online.app/Contents/MacOS/qt-unified-macOS-x64-4.6.0-online --no-force-installations --no-default-installations --no-size-checking --default-answer --accept-licenses --confirm-command --accept-obligations --email $QT_EMAIL --password $QT_PASSWORD install qt.tools.cmake qt.tools.ifw.47 qt.tools.ninja qt.qt6.651.clang_64 qt.qt6.651.qt5compat qt.qt6.651.debug_info qt.qt6.651.addons.qtpdf qt.qt6.651.addons.qthttpserver hdiutil detach /Volumes/qt-unified-macOS-x64-4.6.0-online - - name: Install Rosetta - run: | - softwareupdate --install-rosetta --agree-to-license + echo "Qt6_DIR=$HOME/Qt/6.5.1/macos/lib/cmake/Qt6" >> $GITHUB_ENV - name: Build Chat run: | cmake -G Ninja -DCMAKE_BUILD_TYPE=Release -S gpt4all-chat -B build @@ -60,11 +97,24 @@ jobs: with: fetch_depth: 0 submodules: true - - name: Install QT + - name: Cache Qt + id: cache_qt + uses: actions/cache@v3 + with: + path: "/Qt" + key: ${{ runner.os }}-build-qt-${{ hashFiles('/Qt/**') }} + restore_keys: | + ${{ runner.os }}-build-qt- + - if: ${{ steps.cache_qt.outputs.cache-hit != 'true' }} + name: Install QT + env: + QT_EMAIL: ${{ secrets.QT_EMAIL }} + QT_PASSWORD: ${{ secrets.QT_PASSWORD }} run: | wget https://gpt4all.io/ci/qt-unified-linux-x64-4.6.0-online.run chmod +x qt-unified-linux-x64-4.6.0-online.run ./qt-unified-linux-x64-4.6.0-online.run --no-force-installations --no-default-installations --no-size-checking --default-answer --accept-licenses --confirm-command --accept-obligations --email $QT_EMAIL --password $QT_PASSWORD install qt.tools.cmake qt.tools.ifw.47 qt.tools.ninja qt.qt6.651.gcc_64 qt.qt6.651.qt5compat qt.qt6.651.debug_info qt.qt6.651.addons.qtpdf qt.qt6.651.addons.qthttpserver qt.qt6.651.qtwaylandcompositor + echo "Qt6_DIR=/Qt/6.5.1/gcc_64/lib/cmake" >> $GITHUB_ENV - name: Install Vulkan + Cuda run: | wget -qO- https://packages.lunarg.com/lunarg-signing-key-pub.asc | sudo tee /etc/apt/trusted.gpg.d/lunarg.asc From 77b8fbafbebea9b55c30090267ef97c1bc51b7cb Mon Sep 17 00:00:00 2001 From: John Parent Date: Fri, 19 Jul 2024 18:53:55 -0400 Subject: [PATCH 06/12] Correct Windows shell --- .github/workflows/build-chat.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-chat.yml b/.github/workflows/build-chat.yml index 76a4d3311fb5..691496bac3b0 100644 --- a/.github/workflows/build-chat.yml +++ b/.github/workflows/build-chat.yml @@ -6,7 +6,7 @@ jobs: runs-on: windows-latest defaults: run: - shell: powershell -noe -c "&{Import-Module """C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\Common7\Tools\Microsoft.VisualStudio.DevShell.dll"""; Enter-VsDevShell eb4dc59a}" + shell: powershell -noe -c "&{Import-Module """C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\Common7\Tools\Microsoft.VisualStudio.DevShell.dll"""; Enter-VsDevShell eb4dc59a}"; {0} steps: - name: Checkout uses: actions/checkout@v3 From bdf8e009daa6ea57a7ef435f869c693fd70737ea Mon Sep 17 00:00:00 2001 From: John Parent Date: Fri, 19 Jul 2024 18:54:30 -0400 Subject: [PATCH 07/12] Correct fetch-deps useage --- .github/workflows/build-chat.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build-chat.yml b/.github/workflows/build-chat.yml index 691496bac3b0..15c56662d1a0 100644 --- a/.github/workflows/build-chat.yml +++ b/.github/workflows/build-chat.yml @@ -11,7 +11,7 @@ jobs: - name: Checkout uses: actions/checkout@v3 with: - fetch_depth: 0 + fetch-depth: 0 submodules: true - name: Cache Vulkan id: cache_vulkan @@ -59,7 +59,7 @@ jobs: - name: Checkout uses: actions/checkout@v3 with: - fetch_depth: 0 + fetch-depth: 0 submodules: true - name: Setup XCode run: sudo xcode-select -s '/Applications/Xcode_14.1.app' @@ -95,7 +95,7 @@ jobs: - name: Checkout uses: actions/checkout@v3 with: - fetch_depth: 0 + fetch-depth: 0 submodules: true - name: Cache Qt id: cache_qt From 46acc2fdc0204e3790c79888220bcdce1383c7f0 Mon Sep 17 00:00:00 2001 From: John Parent Date: Fri, 19 Jul 2024 19:03:23 -0400 Subject: [PATCH 08/12] Fix linux and macos --- .github/workflows/build-chat.yml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/build-chat.yml b/.github/workflows/build-chat.yml index 15c56662d1a0..449591b7afa7 100644 --- a/.github/workflows/build-chat.yml +++ b/.github/workflows/build-chat.yml @@ -54,7 +54,7 @@ jobs: cmake -G Ninja -DCMAKE_BUILD_TYPE=Release -DKOMPUTE_OPT_DISABLE_VULKAN_VERSION_CHECK=ON -S gpt4all-chat -B build ninja -C build build-chat-macos: - runs-on: macos-13 + runs-on: macos-latest steps: - name: Checkout uses: actions/checkout@v3 @@ -97,6 +97,14 @@ jobs: with: fetch-depth: 0 submodules: true + - name: Install Vulkan + Cuda + run: | + wget -qO- https://packages.lunarg.com/lunarg-signing-key-pub.asc | sudo tee /etc/apt/trusted.gpg.d/lunarg.asc + sudo wget -qO /etc/apt/sources.list.d/lunarg-vulkan-jammy.list http://packages.lunarg.com/vulkan/lunarg-vulkan-jammy.list + wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64/cuda-keyring_1.1-1_all.deb + sudo dpkg -i cuda-keyring_1.1-1_all.deb + sudo apt update && sudo apt install -y libfontconfig1 libfreetype6 libx11-6 libx11-xcb1 libxext6 libxfixes3 libxi6 libxrender1 libxcb1 libxcb-cursor0 libxcb-glx0 libxcb-keysyms1 libxcb-image0 libxcb-shm0 libxcb-icccm4 libxcb-sync1 libxcb-xfixes0 libxcb-shape0 libxcb-randr0 libxcb-render-util0 libxcb-util1 libxcb-xinerama0 libxcb-xkb1 libxkbcommon0 libxkbcommon-x11-0 bison build-essential flex gperf python3 gcc g++ libgl1-mesa-dev libwayland-dev vulkan-sdk cuda-compiler-11-8 libcublas-dev-11-8 libnvidia-compute-550-server libmysqlclient21 libodbc2 libpq5 + echo "/usr/local/cuda/bin" >> $GITHUB_PATH - name: Cache Qt id: cache_qt uses: actions/cache@v3 @@ -115,14 +123,6 @@ jobs: chmod +x qt-unified-linux-x64-4.6.0-online.run ./qt-unified-linux-x64-4.6.0-online.run --no-force-installations --no-default-installations --no-size-checking --default-answer --accept-licenses --confirm-command --accept-obligations --email $QT_EMAIL --password $QT_PASSWORD install qt.tools.cmake qt.tools.ifw.47 qt.tools.ninja qt.qt6.651.gcc_64 qt.qt6.651.qt5compat qt.qt6.651.debug_info qt.qt6.651.addons.qtpdf qt.qt6.651.addons.qthttpserver qt.qt6.651.qtwaylandcompositor echo "Qt6_DIR=/Qt/6.5.1/gcc_64/lib/cmake" >> $GITHUB_ENV - - name: Install Vulkan + Cuda - run: | - wget -qO- https://packages.lunarg.com/lunarg-signing-key-pub.asc | sudo tee /etc/apt/trusted.gpg.d/lunarg.asc - sudo wget -qO /etc/apt/sources.list.d/lunarg-vulkan-jammy.list http://packages.lunarg.com/vulkan/lunarg-vulkan-jammy.list - wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64/cuda-keyring_1.1-1_all.deb - sudo dpkg -i cuda-keyring_1.1-1_all.deb - sudo apt update && sudo apt install -y libfontconfig1 libfreetype6 libx11-6 libx11-xcb1 libxext6 libxfixes3 libxi6 libxrender1 libxcb1 libxcb-cursor0 libxcb-glx0 libxcb-keysyms1 libxcb-image0 libxcb-shm0 libxcb-icccm4 libxcb-sync1 libxcb-xfixes0 libxcb-shape0 libxcb-randr0 libxcb-render-util0 libxcb-util1 libxcb-xinerama0 libxcb-xkb1 libxkbcommon0 libxkbcommon-x11-0 bison build-essential flex gperf python3 gcc g++ libgl1-mesa-dev libwayland-dev vulkan-sdk cuda-compiler-11-8 libcublas-dev-11-8 libnvidia-compute-550-server libmysqlclient21 libodbc2 libpq5 - echo "/usr/local/cuda/bin" >> $GITHUB_PATH - name: Build Chat run: | cmake -GNinja -DCMAKE_BUILD_TYPE=Release -S gpt4all-chat -B build From 536162a4526ffc8b5dd1a0c0d7eb2f33961e0e59 Mon Sep 17 00:00:00 2001 From: John Parent Date: Mon, 22 Jul 2024 12:36:52 -0400 Subject: [PATCH 09/12] proper macos version --- .github/workflows/build-chat.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-chat.yml b/.github/workflows/build-chat.yml index 449591b7afa7..4c9ef73a22af 100644 --- a/.github/workflows/build-chat.yml +++ b/.github/workflows/build-chat.yml @@ -54,7 +54,7 @@ jobs: cmake -G Ninja -DCMAKE_BUILD_TYPE=Release -DKOMPUTE_OPT_DISABLE_VULKAN_VERSION_CHECK=ON -S gpt4all-chat -B build ninja -C build build-chat-macos: - runs-on: macos-latest + runs-on: macos-13-arm64 steps: - name: Checkout uses: actions/checkout@v3 From 792451fab47e685eb236e92d1f0af1b961adb4f9 Mon Sep 17 00:00:00 2001 From: John Parent Date: Mon, 22 Jul 2024 12:49:13 -0400 Subject: [PATCH 10/12] test Windows shell --- .github/workflows/build-chat.yml | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/.github/workflows/build-chat.yml b/.github/workflows/build-chat.yml index 4c9ef73a22af..20739b5e07ee 100644 --- a/.github/workflows/build-chat.yml +++ b/.github/workflows/build-chat.yml @@ -4,9 +4,6 @@ on: jobs: build-chat-windows: runs-on: windows-latest - defaults: - run: - shell: powershell -noe -c "&{Import-Module """C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\Common7\Tools\Microsoft.VisualStudio.DevShell.dll"""; Enter-VsDevShell eb4dc59a}"; {0} steps: - name: Checkout uses: actions/checkout@v3 @@ -19,7 +16,7 @@ jobs: with: path: C:\VulkanSDK key: ${{ runner.os }}-build-vulkan-${{ hashFiles('C:\VulkanSDK\**') }} - restore_keys: | + restore-keys: | ${{ runner.os }}-build-vulkan- - if: ${{ steps.cache_vulkan.outputs.cache-hit != 'true' }} name: Install Vulkan @@ -38,7 +35,7 @@ jobs: with: path: C:\Qt key: ${{ runner.os }}-build-qt-${{ hashFiles('C:\Qt\**') }} - restore_keys: | + restore-keys: | ${{ runner.os }}-build-qt- - if: ${{ steps.cache_qt.outputs.cache-hit != 'true' }} name: Install QT @@ -50,6 +47,7 @@ jobs: & .\qt-unified-windows-x64-4.6.0-online.exe --no-force-installations --no-default-installations --no-size-checking --default-answer --accept-licenses --confirm-command --accept-obligations --email $Env:QT_EMAIL --password $Env:QT_PASSWORD install qt.tools.cmake qt.tools.ifw.47 qt.tools.ninja qt.qt6.651.win64_msvc2019_64 qt.qt6.651.qt5compat qt.qt6.651.debug_info qt.qt6.651.addons.qtpdf qt.qt6.651.addons.qthttpserver echo "Qt6_DIR=C:/Qt/6.5.1/msvc2019_64" >> $Env:GITHUB_ENV - name: Build Chat + shell: powershell -noe -c "&{Import-Module """C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\Common7\Tools\Microsoft.VisualStudio.DevShell.dll"""; Enter-VsDevShell eb4dc59a}"; {0} run: | cmake -G Ninja -DCMAKE_BUILD_TYPE=Release -DKOMPUTE_OPT_DISABLE_VULKAN_VERSION_CHECK=ON -S gpt4all-chat -B build ninja -C build @@ -72,7 +70,7 @@ jobs: with: path: "~/Qt" key: ${{ runner.os }}-build-qt-${{ hashFiles('~/Qt/**') }} - restore_keys: | + restore-keys: | ${{ runner.os }}-build-qt- - if: ${{ steps.cache_qt.outputs.cache-hit != 'true' }} name: Install QT @@ -111,7 +109,7 @@ jobs: with: path: "/Qt" key: ${{ runner.os }}-build-qt-${{ hashFiles('/Qt/**') }} - restore_keys: | + restore-keys: | ${{ runner.os }}-build-qt- - if: ${{ steps.cache_qt.outputs.cache-hit != 'true' }} name: Install QT From 8ce57e1c07a4ce5ed7e7ef03f045ba057763205e Mon Sep 17 00:00:00 2001 From: John Parent Date: Mon, 22 Jul 2024 13:01:31 -0400 Subject: [PATCH 11/12] Forced to use macos-latest --- .github/workflows/build-chat.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-chat.yml b/.github/workflows/build-chat.yml index 20739b5e07ee..2cbf21cc7c27 100644 --- a/.github/workflows/build-chat.yml +++ b/.github/workflows/build-chat.yml @@ -52,7 +52,7 @@ jobs: cmake -G Ninja -DCMAKE_BUILD_TYPE=Release -DKOMPUTE_OPT_DISABLE_VULKAN_VERSION_CHECK=ON -S gpt4all-chat -B build ninja -C build build-chat-macos: - runs-on: macos-13-arm64 + runs-on: macos-latest steps: - name: Checkout uses: actions/checkout@v3 @@ -60,7 +60,7 @@ jobs: fetch-depth: 0 submodules: true - name: Setup XCode - run: sudo xcode-select -s '/Applications/Xcode_14.1.app' + run: sudo xcode-select -s '/Applications/Xcode_14.3.1.app' - name: Install Rosetta run: | softwareupdate --install-rosetta --agree-to-license From 11496245b5fa4d678c501fe6f0e464551c5a4d78 Mon Sep 17 00:00:00 2001 From: John Parent Date: Mon, 22 Jul 2024 13:07:38 -0400 Subject: [PATCH 12/12] try Windows again --- .github/workflows/build-chat.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-chat.yml b/.github/workflows/build-chat.yml index 2cbf21cc7c27..d05bb3608cbd 100644 --- a/.github/workflows/build-chat.yml +++ b/.github/workflows/build-chat.yml @@ -47,7 +47,7 @@ jobs: & .\qt-unified-windows-x64-4.6.0-online.exe --no-force-installations --no-default-installations --no-size-checking --default-answer --accept-licenses --confirm-command --accept-obligations --email $Env:QT_EMAIL --password $Env:QT_PASSWORD install qt.tools.cmake qt.tools.ifw.47 qt.tools.ninja qt.qt6.651.win64_msvc2019_64 qt.qt6.651.qt5compat qt.qt6.651.debug_info qt.qt6.651.addons.qtpdf qt.qt6.651.addons.qthttpserver echo "Qt6_DIR=C:/Qt/6.5.1/msvc2019_64" >> $Env:GITHUB_ENV - name: Build Chat - shell: powershell -noe -c "&{Import-Module """C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\Common7\Tools\Microsoft.VisualStudio.DevShell.dll"""; Enter-VsDevShell eb4dc59a}"; {0} + shell: powershell -ExecutionPolicy Bypass -c "&{Import-Module """C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\Common7\Tools\Microsoft.VisualStudio.DevShell.dll"""; Enter-VsDevShell eb4dc59a}"; {0} run: | cmake -G Ninja -DCMAKE_BUILD_TYPE=Release -DKOMPUTE_OPT_DISABLE_VULKAN_VERSION_CHECK=ON -S gpt4all-chat -B build ninja -C build