diff --git a/.github/workflows/studio-windows-api-smoke.yml b/.github/workflows/studio-windows-api-smoke.yml index 0208b0f5d..b166112c4 100644 --- a/.github/workflows/studio-windows-api-smoke.yml +++ b/.github/workflows/studio-windows-api-smoke.yml @@ -78,6 +78,30 @@ jobs: HF_HUB_ENABLE_HF_TRANSFER=1 \ hf download "$GGUF_REPO" "$GGUF_FILE" + # Caches around install.ps1 -- restore the heavy artefacts the + # installer would otherwise rebuild from scratch every run. + # Keys hash every input file that would meaningfully change + # the produced artefact, so a stale cache cannot mask a real + # dependency change. + - name: Cache Studio venv (~/.unsloth/studio/unsloth_studio) + id: cache-studio-venv + uses: actions/cache@v4 + with: + path: ~/.unsloth/studio/unsloth_studio + key: ${{ runner.os }}-studio-venv-v1-${{ hashFiles('pyproject.toml', 'studio/backend/requirements/**', 'install.ps1', 'studio/setup.ps1', 'studio/install_python_stack.py') }} + - name: Cache prebuilt llama.cpp (~/.unsloth/llama.cpp) + id: cache-llama-prebuilt + uses: actions/cache@v4 + with: + path: ~/.unsloth/llama.cpp + key: ${{ runner.os }}-llama-cpp-prebuilt-v1-${{ hashFiles('studio/install_llama_prebuilt.py') }} + - name: Cache frontend dist (studio/frontend/dist) + id: cache-frontend-dist + uses: actions/cache@v4 + with: + path: studio/frontend/dist + key: ${{ runner.os }}-studio-frontend-dist-v1-${{ hashFiles('studio/frontend/package-lock.json', 'studio/frontend/src/**', 'studio/frontend/index.html', 'studio/frontend/vite.config.*', 'studio/frontend/tsconfig*.json', 'studio/frontend/components.json') }} + - name: Install Studio (--local, --no-torch) shell: pwsh env: diff --git a/.github/workflows/studio-windows-inference-smoke.yml b/.github/workflows/studio-windows-inference-smoke.yml index 32a86d239..454c21c75 100644 --- a/.github/workflows/studio-windows-inference-smoke.yml +++ b/.github/workflows/studio-windows-inference-smoke.yml @@ -88,6 +88,30 @@ jobs: HF_HUB_ENABLE_HF_TRANSFER=1 \ hf download "$GGUF_REPO" "$GGUF_FILE" + # Caches around install.ps1 -- restore the heavy artefacts the + # installer would otherwise rebuild from scratch every run. + # Keys hash every input file that would meaningfully change + # the produced artefact, so a stale cache cannot mask a real + # dependency change. + - name: Cache Studio venv (~/.unsloth/studio/unsloth_studio) + id: cache-studio-venv + uses: actions/cache@v4 + with: + path: ~/.unsloth/studio/unsloth_studio + key: ${{ runner.os }}-studio-venv-v1-${{ hashFiles('pyproject.toml', 'studio/backend/requirements/**', 'install.ps1', 'studio/setup.ps1', 'studio/install_python_stack.py') }} + - name: Cache prebuilt llama.cpp (~/.unsloth/llama.cpp) + id: cache-llama-prebuilt + uses: actions/cache@v4 + with: + path: ~/.unsloth/llama.cpp + key: ${{ runner.os }}-llama-cpp-prebuilt-v1-${{ hashFiles('studio/install_llama_prebuilt.py') }} + - name: Cache frontend dist (studio/frontend/dist) + id: cache-frontend-dist + uses: actions/cache@v4 + with: + path: studio/frontend/dist + key: ${{ runner.os }}-studio-frontend-dist-v1-${{ hashFiles('studio/frontend/package-lock.json', 'studio/frontend/src/**', 'studio/frontend/index.html', 'studio/frontend/vite.config.*', 'studio/frontend/tsconfig*.json', 'studio/frontend/components.json') }} + - name: Install Studio (--local, --no-torch) shell: pwsh env: @@ -353,6 +377,30 @@ jobs: HF_HUB_ENABLE_HF_TRANSFER=1 \ hf download "$GGUF_REPO" "$GGUF_FILE" + # Caches around install.ps1 -- restore the heavy artefacts the + # installer would otherwise rebuild from scratch every run. + # Keys hash every input file that would meaningfully change + # the produced artefact, so a stale cache cannot mask a real + # dependency change. + - name: Cache Studio venv (~/.unsloth/studio/unsloth_studio) + id: cache-studio-venv + uses: actions/cache@v4 + with: + path: ~/.unsloth/studio/unsloth_studio + key: ${{ runner.os }}-studio-venv-v1-${{ hashFiles('pyproject.toml', 'studio/backend/requirements/**', 'install.ps1', 'studio/setup.ps1', 'studio/install_python_stack.py') }} + - name: Cache prebuilt llama.cpp (~/.unsloth/llama.cpp) + id: cache-llama-prebuilt + uses: actions/cache@v4 + with: + path: ~/.unsloth/llama.cpp + key: ${{ runner.os }}-llama-cpp-prebuilt-v1-${{ hashFiles('studio/install_llama_prebuilt.py') }} + - name: Cache frontend dist (studio/frontend/dist) + id: cache-frontend-dist + uses: actions/cache@v4 + with: + path: studio/frontend/dist + key: ${{ runner.os }}-studio-frontend-dist-v1-${{ hashFiles('studio/frontend/package-lock.json', 'studio/frontend/src/**', 'studio/frontend/index.html', 'studio/frontend/vite.config.*', 'studio/frontend/tsconfig*.json', 'studio/frontend/components.json') }} + - name: Install Studio (--local, --no-torch) shell: pwsh env: @@ -709,6 +757,30 @@ jobs: HF_HUB_ENABLE_HF_TRANSFER=1 \ hf download "$GGUF_REPO" "$MMPROJ_FILE" + # Caches around install.ps1 -- restore the heavy artefacts the + # installer would otherwise rebuild from scratch every run. + # Keys hash every input file that would meaningfully change + # the produced artefact, so a stale cache cannot mask a real + # dependency change. + - name: Cache Studio venv (~/.unsloth/studio/unsloth_studio) + id: cache-studio-venv + uses: actions/cache@v4 + with: + path: ~/.unsloth/studio/unsloth_studio + key: ${{ runner.os }}-studio-venv-v1-${{ hashFiles('pyproject.toml', 'studio/backend/requirements/**', 'install.ps1', 'studio/setup.ps1', 'studio/install_python_stack.py') }} + - name: Cache prebuilt llama.cpp (~/.unsloth/llama.cpp) + id: cache-llama-prebuilt + uses: actions/cache@v4 + with: + path: ~/.unsloth/llama.cpp + key: ${{ runner.os }}-llama-cpp-prebuilt-v1-${{ hashFiles('studio/install_llama_prebuilt.py') }} + - name: Cache frontend dist (studio/frontend/dist) + id: cache-frontend-dist + uses: actions/cache@v4 + with: + path: studio/frontend/dist + key: ${{ runner.os }}-studio-frontend-dist-v1-${{ hashFiles('studio/frontend/package-lock.json', 'studio/frontend/src/**', 'studio/frontend/index.html', 'studio/frontend/vite.config.*', 'studio/frontend/tsconfig*.json', 'studio/frontend/components.json') }} + - name: Install Studio (--local, --no-torch) shell: pwsh env: diff --git a/.github/workflows/studio-windows-ui-smoke.yml b/.github/workflows/studio-windows-ui-smoke.yml index 2ceb99fa0..03255de3b 100644 --- a/.github/workflows/studio-windows-ui-smoke.yml +++ b/.github/workflows/studio-windows-ui-smoke.yml @@ -87,6 +87,31 @@ jobs: HF_HUB_ENABLE_HF_TRANSFER=1 \ hf download "$GGUF_REPO" "$GGUF_FILE" + # Caches around install.ps1 -- restore the heavy artefacts the + # installer would otherwise rebuild from scratch every run. + # Keys hash on every input file that would meaningfully change + # the produced artefact, so a stale cache cannot mask a real + # dependency change. Cache scope is branch-partitioned by + # GitHub Actions, so a malicious PR can't poison main's cache. + - name: Cache Studio venv (~/.unsloth/studio/unsloth_studio) + id: cache-studio-venv + uses: actions/cache@v4 + with: + path: ~/.unsloth/studio/unsloth_studio + key: ${{ runner.os }}-studio-venv-v1-${{ hashFiles('pyproject.toml', 'studio/backend/requirements/**', 'install.ps1', 'studio/setup.ps1', 'studio/install_python_stack.py') }} + - name: Cache prebuilt llama.cpp (~/.unsloth/llama.cpp) + id: cache-llama-prebuilt + uses: actions/cache@v4 + with: + path: ~/.unsloth/llama.cpp + key: ${{ runner.os }}-llama-cpp-prebuilt-v1-${{ hashFiles('studio/install_llama_prebuilt.py') }} + - name: Cache frontend dist (studio/frontend/dist) + id: cache-frontend-dist + uses: actions/cache@v4 + with: + path: studio/frontend/dist + key: ${{ runner.os }}-studio-frontend-dist-v1-${{ hashFiles('studio/frontend/package-lock.json', 'studio/frontend/src/**', 'studio/frontend/index.html', 'studio/frontend/vite.config.*', 'studio/frontend/tsconfig*.json', 'studio/frontend/components.json') }} + - name: Install Studio (--local, --no-torch) # install.ps1 is the supported Windows installer. install.sh # has no Windows branch (apt-get / brew calls). The PS1 diff --git a/.github/workflows/studio-windows-update-smoke.yml b/.github/workflows/studio-windows-update-smoke.yml index 86957f2b3..e2bf771dd 100644 --- a/.github/workflows/studio-windows-update-smoke.yml +++ b/.github/workflows/studio-windows-update-smoke.yml @@ -73,6 +73,30 @@ jobs: # then fatal-errors with "Cache folder path is retrieved # for pip but doesn't exist on disk". + # Caches around install.ps1 -- restore the heavy artefacts the + # installer would otherwise rebuild from scratch every run. + # Keys hash every input file that would meaningfully change + # the produced artefact, so a stale cache cannot mask a real + # dependency change. + - name: Cache Studio venv (~/.unsloth/studio/unsloth_studio) + id: cache-studio-venv + uses: actions/cache@v4 + with: + path: ~/.unsloth/studio/unsloth_studio + key: ${{ runner.os }}-studio-venv-v1-${{ hashFiles('pyproject.toml', 'studio/backend/requirements/**', 'install.ps1', 'studio/setup.ps1', 'studio/install_python_stack.py') }} + - name: Cache prebuilt llama.cpp (~/.unsloth/llama.cpp) + id: cache-llama-prebuilt + uses: actions/cache@v4 + with: + path: ~/.unsloth/llama.cpp + key: ${{ runner.os }}-llama-cpp-prebuilt-v1-${{ hashFiles('studio/install_llama_prebuilt.py') }} + - name: Cache frontend dist (studio/frontend/dist) + id: cache-frontend-dist + uses: actions/cache@v4 + with: + path: studio/frontend/dist + key: ${{ runner.os }}-studio-frontend-dist-v1-${{ hashFiles('studio/frontend/package-lock.json', 'studio/frontend/src/**', 'studio/frontend/index.html', 'studio/frontend/vite.config.*', 'studio/frontend/tsconfig*.json', 'studio/frontend/components.json') }} + - name: Install Studio (--local, --no-torch) shell: pwsh env: