You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

124 lines
5.1 KiB

2 years ago
  1. name: docker
  2. on:
  3. workflow_dispatch:
  4. inputs:
  5. version:
  6. description: "Spleeter version to build image for"
  7. required: true
  8. default: "2.1.2"
  9. jobs:
  10. cuda-base:
  11. runs-on: ubuntu-latest
  12. strategy:
  13. matrix:
  14. distribution: [3.6, 3.7, 3.8]
  15. fail-fast: true
  16. steps:
  17. - uses: actions/checkout@v2
  18. - name: Build CUDA base image
  19. run: |
  20. docker build \
  21. --build-arg BASE=python:${{ matrix.distribution }} \
  22. -t deezer/python-cuda-10-1:${{ matrix.distribution }} \
  23. -f docker/cuda-10-1.dockerfile .
  24. - name: Docker login
  25. run: echo ${{ secrets.DOCKERHUB_PASSWORD }} | docker login -u ${{ secrets.DOCKERHUB_USERNAME }} --password-stdin
  26. - name: Push deezer/python-cuda-10-1:${{ matrix.distribution }} image
  27. run: docker push deezer/python-cuda-10-1:${{ matrix.distribution }}
  28. pip-images:
  29. needs: cuda-base
  30. runs-on: ubuntu-latest
  31. strategy:
  32. matrix:
  33. platform: [cpu, gpu]
  34. distribution: [3.6, 3.7, 3.8]
  35. fail-fast: true
  36. steps:
  37. - uses: actions/checkout@v2
  38. - if: ${{ matrix.platform == 'cpu' }}
  39. run: |
  40. echo "base=python:${{ matrix.distribution }}" >> $GITHUB_ENV
  41. echo "image=spleeter" >> $GITHUB_ENV
  42. - if: ${{ matrix.platform == 'gpu' }}
  43. run: |
  44. echo "base=deezer/python-cuda-10-1:${{ matrix.distribution }}" >> $GITHUB_ENV
  45. echo "image=spleeter-gpu" >> $GITHUB_ENV
  46. - name: Build deezer/${{ env.image }}:${{ matrix.distribution }} image
  47. run: |
  48. docker build \
  49. --build-arg BASE=${{ env.base }} \
  50. --build-arg SPLEETER_VERSION=${{ github.event.inputs.version }} \
  51. -t deezer/${{ env.image }}:${{ matrix.distribution }} \
  52. -f docker/spleeter.dockerfile .
  53. - name: Test deezer/${{ env.image }}:${{ matrix.distribution }} image
  54. run: |
  55. docker run \
  56. -v $(pwd):/runtime \
  57. deezer/${{ env.image }}:${{ matrix.distribution }} \
  58. separate -o /tmp /runtime/audio_example.mp3
  59. - name: Docker login
  60. run: echo ${{ secrets.DOCKERHUB_PASSWORD }} | docker login -u ${{ secrets.DOCKERHUB_USERNAME }} --password-stdin
  61. - name: Push deezer/${{ env.image }}:${{ matrix.distribution }} image
  62. run: docker push deezer/${{ env.image }}:${{ matrix.distribution }}
  63. conda-images:
  64. needs: cuda-base
  65. runs-on: ubuntu-latest
  66. strategy:
  67. matrix:
  68. platform: [cpu, gpu]
  69. fail-fast: true
  70. steps:
  71. - uses: actions/checkout@v2
  72. - if: ${{ matrix.platform == 'cpu' }}
  73. name: Build Conda base image
  74. run: |
  75. docker build -t conda:cpu -f docker/conda.dockerfile .
  76. echo "image=spleeter" >> $GITHUB_ENV
  77. - if: ${{ matrix.platform == 'gpu' }}
  78. name: Build Conda base image
  79. run: |
  80. docker build --build-arg BASE=deezer/python-cuda-10-1:3.8 -t conda:gpu -f docker/conda.dockerfile .
  81. echo "image=spleeter-gpu" >> $GITHUB_ENV
  82. - name: Build deezer/${{ env.image }}:${{ env.tag }} image
  83. run: |
  84. docker build \
  85. --build-arg BASE=conda:${{ matrix.platform }} \
  86. --build-arg SPLEETER_VERSION=${{ github.event.inputs.version }} \
  87. -t deezer/${{ env.image }}:conda \
  88. -f docker/spleeter-conda.dockerfile .
  89. - name: Docker login
  90. run: echo ${{ secrets.DOCKERHUB_PASSWORD }} | docker login -u ${{ secrets.DOCKERHUB_USERNAME }} --password-stdin
  91. - name: Push deezer/${{ env.image }}:conda image
  92. run: docker push deezer/${{ env.image }}:conda
  93. images-with-model:
  94. needs: [pip-images, conda-images]
  95. runs-on: ubuntu-latest
  96. strategy:
  97. matrix:
  98. platform: [cpu, gpu]
  99. distribution: [3.6, 3.7, 3.8]
  100. model: [2stems, 4stems, 5stems]
  101. fail-fast: true
  102. steps:
  103. - uses: actions/checkout@v2
  104. - if: ${{ matrix.platform == 'cpu' }}
  105. run: echo "image=spleeter" >> $GITHUB_ENV
  106. - if: ${{ matrix.platform == 'gpu' }}
  107. run: echo "image=spleeter-gpu" >> $GITHUB_ENV
  108. - name: Build deezer/${{ env.image }}:${{ matrix.distribution }}-${{ matrix.model }} image
  109. run: |
  110. docker build \
  111. --build-arg BASE=deezer/${{ env.image }}:${{ matrix.distribution }} \
  112. --build-arg MODEL=${{ matrix.model }} \
  113. -t deezer/${{ env.image }}:${{ matrix.distribution }}-${{ matrix.model }} \
  114. -f docker/spleeter-model.dockerfile .
  115. - name: Test deezer/${{ env.image }}:${{ matrix.distribution }}-${{ matrix.model }} image
  116. run: |
  117. docker run \
  118. -v $(pwd):/runtime \
  119. deezer/${{ env.image }}:${{ matrix.distribution }} \
  120. separate -o /tmp -p spleeter:${{ matrix.model }} /runtime/audio_example.mp3
  121. - name: Docker login
  122. run: echo ${{ secrets.DOCKERHUB_PASSWORD }} | docker login -u ${{ secrets.DOCKERHUB_USERNAME }} --password-stdin
  123. - name: Push deezer/${{ env.image }}:${{ matrix.distribution }}-${{ matrix.model }} image
  124. run: docker push deezer/${{ env.image }}:${{ matrix.distribution }}-${{ matrix.model }}