diff --git a/.github/workflows/test_pip.yml b/.github/workflows/test_pip.yml index 40c1e1f..ef7b51a 100644 --- a/.github/workflows/test_pip.yml +++ b/.github/workflows/test_pip.yml @@ -1,33 +1,33 @@ -name: pip install -run-name: pip install -on: - push: - paths: - - '**.py' - - 'pyproject.toml' - pull_request: - paths: - - '**.py' - - 'pyproject.toml' - - '.github/workflows/**' - workflow_dispatch: -jobs: - install-and-run: - strategy: - matrix: - os: [ubuntu-latest, macos-latest, windows-latest] - python-version: ['3.12'] - fail-fast: false - continue-on-error: true - runs-on: ${{ matrix.os }} - steps: - - name: Checkout repository - uses: actions/checkout@v4 - - name: Set up Python - uses: actions/setup-python@v5 - with: - python-version: ${{ matrix.python-version }} - - name: Install from repository - run: python -m pip install . - #- name: Run abogen - # run: abogen +name: pip install +run-name: pip install +on: + push: + paths: + - '**.py' + - 'pyproject.toml' + pull_request: + paths: + - '**.py' + - 'pyproject.toml' + - '.github/workflows/**' + workflow_dispatch: +jobs: + install-and-run: + strategy: + matrix: + os: [ubuntu-latest, macos-latest, windows-latest] + python-version: ['3.12'] + fail-fast: false + runs-on: ${{ matrix.os }} + steps: + - name: Checkout repository + uses: actions/checkout@v7 + - name: Set up Python + uses: actions/setup-python@v6 + with: + python-version: ${{ matrix.python-version }} + cache: pip + - name: Install from repository + run: python -m pip install . + #- name: Run abogen + # run: abogen diff --git a/.github/workflows/test_publish.yml b/.github/workflows/test_publish.yml index c59c440..b0686b2 100644 --- a/.github/workflows/test_publish.yml +++ b/.github/workflows/test_publish.yml @@ -1,63 +1,63 @@ -name: Build multi-arch Docker Image - -on: - # Build and push - #release: - # types: [published] - # Build only - #push: it - # branches: [main] - # TODO - enable build on pull requests if build times can be reduced - # pull_request: - workflow_dispatch: - -env: - IMAGE_REPOSITORY: ghcr.io/denizsafak/abogen - -jobs: - build: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - - name: Login to Github Container Registry - # Only if we need to push an image - # if: ${{ github.event_name == 'release' && github.event.action == 'published' }} - uses: docker/login-action@v3 - with: - registry: ghcr.io - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - - # Setup for buildx - - name: Set up QEMU - uses: docker/setup-qemu-action@v3 - - - name: Set up Docker Buildx - id: buildx - uses: docker/setup-buildx-action@v3 - - # Debugging information - - name: Docker info - run: docker info - - - name: Buildx inspect - run: docker buildx inspect - - # Build and (optionally) push the image - - name: Build image - uses: docker/build-push-action@v6 - with: - context: ./abogen - file: ./abogen/Dockerfile - # platforms: linux/amd64,linux/arm/v7,linux/arm64,linux/ppc64le,linux/s390x - # platforms: linux/amd64,linux/arm64 - platforms: linux/amd64 # using the solution mentioned in https://github.com/denizsafak/abogen/issues/46 - # Only push if we are publishing a release - # push: ${{ github.event_name == 'release' && github.event.action == 'published' }} - push: true - # Use a 'temp' tag, that won't be pushed, for non-release builds - tags: ${{ env.IMAGE_REPOSITORY }}:${{ github.event.release.tag_name || 'latest' }} - # Use a cache to reduce build times - cache-to: type=gha,mode=max - cache-from: type=gha +name: Build multi-arch Docker Image + +on: + # Build and push + #release: + # types: [published] + # Build only + #push: it + # branches: [main] + # TODO - enable build on pull requests if build times can be reduced + # pull_request: + workflow_dispatch: + +env: + IMAGE_REPOSITORY: ghcr.io/denizsafak/abogen + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v7 + + - name: Login to Github Container Registry + # Only if we need to push an image + # if: ${{ github.event_name == 'release' && github.event.action == 'published' }} + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + # Setup for buildx + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + + - name: Set up Docker Buildx + id: buildx + uses: docker/setup-buildx-action@v3 + + # Debugging information + - name: Docker info + run: docker info + + - name: Buildx inspect + run: docker buildx inspect + + # Build and (optionally) push the image + - name: Build image + uses: docker/build-push-action@v6 + with: + context: ./abogen + file: ./abogen/Dockerfile + # platforms: linux/amd64,linux/arm/v7,linux/arm64,linux/ppc64le,linux/s390x + # platforms: linux/amd64,linux/arm64 + platforms: linux/amd64 # using the solution mentioned in https://github.com/denizsafak/abogen/issues/46 + # Only push if we are publishing a release + # push: ${{ github.event_name == 'release' && github.event.action == 'published' }} + push: true + # Use a 'temp' tag, that won't be pushed, for non-release builds + tags: ${{ env.IMAGE_REPOSITORY }}:${{ github.event.release.tag_name || 'latest' }} + # Use a cache to reduce build times + cache-to: type=gha,mode=max + cache-from: type=gha diff --git a/abogen/webui/Dockerfile b/abogen/webui/Dockerfile index 4c65733..b7a6869 100644 --- a/abogen/webui/Dockerfile +++ b/abogen/webui/Dockerfile @@ -27,8 +27,6 @@ RUN python3 -m venv "$VIRTUAL_ENV" WORKDIR /app COPY pyproject.toml README.md ./ -COPY abogen ./abogen - RUN pip install --upgrade pip \ && if [ -n "$TORCH_VERSION" ]; then \ pip install torch=="$TORCH_VERSION" torchvision=="$TORCH_VERSION" torchaudio=="$TORCH_VERSION" --index-url "$TORCH_INDEX_URL"; \ @@ -39,6 +37,8 @@ RUN pip install --upgrade pip \ https://github.com/explosion/spacy-models/releases/download/en_core_web_sm-3.8.0/en_core_web_sm-3.8.0-py3-none-any.whl \ && pip install --no-cache-dir "mutagen>=1.47.0" +COPY abogen ./abogen + # Install onnxruntime-gpu for CUDA acceleration (supertonic uses ONNX Runtime) # Set USE_GPU=false to skip this for CPU-only deployments RUN if [ "$USE_GPU" = "true" ]; then \