diff --git a/.github/workflows/prod.opencl.yml b/.github/workflows/prod.opencl.yml new file mode 100644 index 0000000..8868c28 --- /dev/null +++ b/.github/workflows/prod.opencl.yml @@ -0,0 +1,63 @@ +name: OpenCL Production CI/CD + +on: + push: + tags: + - "v*" + branches: + - "main" + +env: + REGISTRY: "ghcr.io" + REGISTRY_USER: ${{ github.actor }} + REGISTRY_SECRET: ${{ secrets.GITHUB_TOKEN }} + IMAGE_NAME: ${{ github.repository }} + +permissions: + contents: read + packages: write + +jobs: + build_and_publish: + runs-on: ubuntu-latest + strategy: + matrix: + include: + - docker_file: Dockerfile.opencl.nvidia + label: "latest-opencl-nvidia" + - docker_file: Dockerfile.opencl.amd + label: "latest-opencl-amd" + + steps: + - uses: actions/checkout@v4 + + - name: Meta + id: meta + uses: docker/metadata-action@v5 + with: + images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} + tags: | + type=ref,event=branch + type=ref,event=pr + type=ref,event=tag + type=sha,prefix=sha- + labels: | + type=raw,value=image-type=${{ matrix.label }} + + - uses: docker/login-action@v3 + with: + registry: ${{ env.REGISTRY }} + username: ${{ env.REGISTRY_USER }} + password: ${{ env.REGISTRY_SECRET }} + + - name: Build and push + uses: docker/build-push-action@v5 + with: + context: . + file: ${{ matrix.docker_file }} + push: ${{ github.event_name != 'pull_request' }} + tags: | + ${{ steps.meta.outputs.tags }} + ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ matrix.label }} + labels: ${{ steps.meta.outputs.labels }} + platforms: linux/amd64 \ No newline at end of file diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 71a6c83..8bf35a5 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -1,9 +1,11 @@ -name: ghcr.io CI/CD +name: Production CI/CD on: push: tags: - 'v*' + branches: + - "main" env: REGISTRY: "ghcr.io" diff --git a/README.md b/README.md index e87fe69..410286f 100644 --- a/README.md +++ b/README.md @@ -32,6 +32,7 @@ services: ### **NVIDIA GPU Support** > [!IMPORTANT] > Nvidia driver >=560 needs to be installed on the host machine. + **CUDA (AMD64 & ARM64):** ```yml services: @@ -85,7 +86,8 @@ services: ### **AMD GPU Support** > [!WARNING] -> Unless AMD starts to support older Cards again (e.g. gfx803), ROCm will not be available. +> Unless AMD starts to officially support older Cards again (e.g. gfx803), ROCm will not be available. + **OpenCL (AMD64):** ```yml services: @@ -110,8 +112,8 @@ services: security_opt: - seccomp:unconfined group_add: - - "39" - - "109" + - "video" + - "render" ``` ## Environment Variables @@ -132,6 +134,7 @@ API_KEYS=abc,123,xyz ## Tested Devices Only tested with consumer grade hardware and only on Linux based systems. + #### CPU - AMD FX-6300 - Intel Core i5-12400F @@ -243,6 +246,8 @@ curl -X 'POST' \ > [!TIP] > You can find code examples in the [`examples`](./examples/) folder. +> [!IMPORTANT] +> Many thanks to Artyom Beilis and company for providing the awesome [OpenCL backend for PyTorch](https://github.com/artyom-beilis/pytorch_dlprim)! --- _Notice:_ _This project was initally created to be used in-house, as such the