From de6b8fd2952ca912206fd4d7adc6d2913e9e0375 Mon Sep 17 00:00:00 2001 From: henryruhs Date: Wed, 30 Oct 2024 22:26:07 +0100 Subject: [PATCH 1/4] Introduce deployment --- .github/workflows/ci.yml | 41 ++++++++++++++++++++++++++++++++-------- 1 file changed, 33 insertions(+), 8 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 98c7bba..e7f2d88 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -4,21 +4,46 @@ on: [ push, pull_request ] jobs: test: - name: ${{ matrix.config.image-name }} + name: ${{ matrix.config.image-slug }} runs-on: ubuntu-latest strategy: matrix: config: - - { docker-file: 'Dockerfile.cpu', image-name: 'facefusion-cpu' } - - { docker-file: 'Dockerfile.cuda', image-name: 'facefusion-cuda' } - - { docker-file: 'Dockerfile.tensorrt', image-name: 'facefusion-tensorrt' } - - { docker-file: 'Dockerfile.rocm', image-name: 'facefusion-rocm' } + - { docker-file: 'Dockerfile.cpu', image-slug: 'facefusion/facefusion:${{ github.ref_name }}-cpu' } + - { docker-file: 'Dockerfile.cuda', image-slug: 'facefusion/facefusion:${{ github.ref_name }}-cuda' } + - { docker-file: 'Dockerfile.tensorrt', image-slug: 'facefusion/facefusion:${{ github.ref_name }}-tensorrt' } + - { docker-file: 'Dockerfile.rocm', image-slug: 'facefusion/facefusion:${{ github.ref_name }}-rocm' } steps: - name: Checkout uses: actions/checkout@v2 - name: Build - run: docker build -f ${{ matrix.config.docker-file }} -t ${{ matrix.config.image-name }} . + run: docker build -f ${{ matrix.config.docker-file }} -t ${{ matrix.config.image-slug }} . - name: Run - run: docker run -d ${{ matrix.config.image-name }} + run: docker run -d ${{ matrix.config.image-slug }} - name: Validate - run: docker ps | grep -q ${{ matrix.config.image-name }} + run: docker ps | grep -q ${{ matrix.config.image-slug }} + deploy: + name: ${{ matrix.config.image-slug }} + runs-on: ubuntu-latest + needs: test + strategy: + matrix: + config: + - { docker-file: 'Dockerfile.cpu', image-slug: 'facefusion/facefusion:${{ github.ref_name }}-cpu' } + - { docker-file: 'Dockerfile.cuda', image-slug: 'facefusion/facefusion:${{ github.ref_name }}-cuda' } + - { docker-file: 'Dockerfile.tensorrt', image-slug: 'facefusion/facefusion:${{ github.ref_name }}-tensorrt' } + - { docker-file: 'Dockerfile.rocm', image-slug: 'facefusion/facefusion:${{ github.ref_name }}-rocm' } + steps: + - name: Login + uses: docker/login-action@v2 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + - name: Checkout + uses: actions/checkout@v2 + - name: Build + run: docker build -f ${{ matrix.config.docker-file }} -t ${{ matrix.config.image-slug }} . + - name: Deploy + run: docker push ${{ matrix.config.image-slug }} + - name: Logout + run: docker logout From ae29dd8ad7a9cf35e31acadb7d14634b31fc989c Mon Sep 17 00:00:00 2001 From: henryruhs Date: Wed, 30 Oct 2024 22:43:10 +0100 Subject: [PATCH 2/4] Introduce deployment part2 --- .github/workflows/ci.yml | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e7f2d88..5f10240 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -4,18 +4,18 @@ on: [ push, pull_request ] jobs: test: - name: ${{ matrix.config.image-slug }} + name: ${{ matrix.config.display-name }} runs-on: ubuntu-latest strategy: matrix: config: - - { docker-file: 'Dockerfile.cpu', image-slug: 'facefusion/facefusion:${{ github.ref_name }}-cpu' } - - { docker-file: 'Dockerfile.cuda', image-slug: 'facefusion/facefusion:${{ github.ref_name }}-cuda' } - - { docker-file: 'Dockerfile.tensorrt', image-slug: 'facefusion/facefusion:${{ github.ref_name }}-tensorrt' } - - { docker-file: 'Dockerfile.rocm', image-slug: 'facefusion/facefusion:${{ github.ref_name }}-rocm' } + - { display-name: 'test-cpu', docker-file: 'Dockerfile.cpu', image-slug: 'facefusion/facefusion:${{ github.ref_name }}-cpu' } + - { display-name: 'test-cuda', docker-file: 'Dockerfile.cuda', image-slug: 'facefusion/facefusion:${{ github.ref_name }}-cuda' } + - { display-name: 'test-tensorrt', docker-file: 'Dockerfile.tensorrt', image-slug: 'facefusion/facefusion:${{ github.ref_name }}-tensorrt' } + - { display-name: 'test-rocm', docker-file: 'Dockerfile.rocm', image-slug: 'facefusion/facefusion:${{ github.ref_name }}-rocm' } steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Build run: docker build -f ${{ matrix.config.docker-file }} -t ${{ matrix.config.image-slug }} . - name: Run @@ -23,19 +23,19 @@ jobs: - name: Validate run: docker ps | grep -q ${{ matrix.config.image-slug }} deploy: - name: ${{ matrix.config.image-slug }} + name: ${{ matrix.config.display-name }} runs-on: ubuntu-latest needs: test strategy: matrix: config: - - { docker-file: 'Dockerfile.cpu', image-slug: 'facefusion/facefusion:${{ github.ref_name }}-cpu' } - - { docker-file: 'Dockerfile.cuda', image-slug: 'facefusion/facefusion:${{ github.ref_name }}-cuda' } - - { docker-file: 'Dockerfile.tensorrt', image-slug: 'facefusion/facefusion:${{ github.ref_name }}-tensorrt' } - - { docker-file: 'Dockerfile.rocm', image-slug: 'facefusion/facefusion:${{ github.ref_name }}-rocm' } + - { display-name: 'deploy-cpu', docker-file: 'Dockerfile.cpu', image-slug: 'facefusion/facefusion:${{ github.ref_name }}-cpu' } + - { display-name: 'deploy-cuda', docker-file: 'Dockerfile.cuda', image-slug: 'facefusion/facefusion:${{ github.ref_name }}-cuda' } + - { display-name: 'deploy-tensorrt', docker-file: 'Dockerfile.tensorrt', image-slug: 'facefusion/facefusion:${{ github.ref_name }}-tensorrt' } + - { display-name: 'deploy-rocm', docker-file: 'Dockerfile.rocm', image-slug: 'facefusion/facefusion:${{ github.ref_name }}-rocm' } steps: - name: Login - uses: docker/login-action@v2 + uses: docker/login-action@v4 with: username: ${{ secrets.DOCKER_USERNAME }} password: ${{ secrets.DOCKER_PASSWORD }} From e38d3b91798f55e515003202c8b89be5542c2ff8 Mon Sep 17 00:00:00 2001 From: henryruhs Date: Wed, 30 Oct 2024 22:49:06 +0100 Subject: [PATCH 3/4] Introduce deployment part2 --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5f10240..b88f5cb 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -35,12 +35,12 @@ jobs: - { display-name: 'deploy-rocm', docker-file: 'Dockerfile.rocm', image-slug: 'facefusion/facefusion:${{ github.ref_name }}-rocm' } steps: - name: Login - uses: docker/login-action@v4 + uses: docker/login-action@v3 with: username: ${{ secrets.DOCKER_USERNAME }} password: ${{ secrets.DOCKER_PASSWORD }} - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Build run: docker build -f ${{ matrix.config.docker-file }} -t ${{ matrix.config.image-slug }} . - name: Deploy From c3dbbd7e632aa78cf11820e481bbd6af9673a4a4 Mon Sep 17 00:00:00 2001 From: henryruhs Date: Wed, 30 Oct 2024 23:00:17 +0100 Subject: [PATCH 4/4] Introduce deployment part3 --- .github/workflows/ci.yml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b88f5cb..c4ca9d2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -9,10 +9,10 @@ jobs: strategy: matrix: config: - - { display-name: 'test-cpu', docker-file: 'Dockerfile.cpu', image-slug: 'facefusion/facefusion:${{ github.ref_name }}-cpu' } - - { display-name: 'test-cuda', docker-file: 'Dockerfile.cuda', image-slug: 'facefusion/facefusion:${{ github.ref_name }}-cuda' } - - { display-name: 'test-tensorrt', docker-file: 'Dockerfile.tensorrt', image-slug: 'facefusion/facefusion:${{ github.ref_name }}-tensorrt' } - - { display-name: 'test-rocm', docker-file: 'Dockerfile.rocm', image-slug: 'facefusion/facefusion:${{ github.ref_name }}-rocm' } + - { display-name: 'test (cpu)', docker-file: 'Dockerfile.cpu', image-slug: 'facefusion/facefusion:${{ github.ref_name }}-cpu' } + - { display-name: 'test (cuda)', docker-file: 'Dockerfile.cuda', image-slug: 'facefusion/facefusion:${{ github.ref_name }}-cuda' } + - { display-name: 'test (tensorrt)', docker-file: 'Dockerfile.tensorrt', image-slug: 'facefusion/facefusion:${{ github.ref_name }}-tensorrt' } + - { display-name: 'test (rocm)', docker-file: 'Dockerfile.rocm', image-slug: 'facefusion/facefusion:${{ github.ref_name }}-rocm' } steps: - name: Checkout uses: actions/checkout@v4 @@ -29,10 +29,10 @@ jobs: strategy: matrix: config: - - { display-name: 'deploy-cpu', docker-file: 'Dockerfile.cpu', image-slug: 'facefusion/facefusion:${{ github.ref_name }}-cpu' } - - { display-name: 'deploy-cuda', docker-file: 'Dockerfile.cuda', image-slug: 'facefusion/facefusion:${{ github.ref_name }}-cuda' } - - { display-name: 'deploy-tensorrt', docker-file: 'Dockerfile.tensorrt', image-slug: 'facefusion/facefusion:${{ github.ref_name }}-tensorrt' } - - { display-name: 'deploy-rocm', docker-file: 'Dockerfile.rocm', image-slug: 'facefusion/facefusion:${{ github.ref_name }}-rocm' } + - { display-name: 'deploy (cpu)', docker-file: 'Dockerfile.cpu', image-slug: 'facefusion/facefusion:${{ github.ref_name }}-cpu' } + - { display-name: 'deploy (cuda)', docker-file: 'Dockerfile.cuda', image-slug: 'facefusion/facefusion:${{ github.ref_name }}-cuda' } + - { display-name: 'deploy (tensorrt)', docker-file: 'Dockerfile.tensorrt', image-slug: 'facefusion/facefusion:${{ github.ref_name }}-tensorrt' } + - { display-name: 'deploy (rocm)', docker-file: 'Dockerfile.rocm', image-slug: 'facefusion/facefusion:${{ github.ref_name }}-rocm' } steps: - name: Login uses: docker/login-action@v3