diff --git a/.github/workflows/docker-build.yml b/.github/workflows/docker-build.yml index 909f3723f..7386469dc 100644 --- a/.github/workflows/docker-build.yml +++ b/.github/workflows/docker-build.yml @@ -1,43 +1,21 @@ name: Build and Publish Docker Image - on: push: - env: REGISTRY: ghcr.io IMAGE_NAME: hiddenswitch/comfyui jobs: build: - runs-on: ubuntu-latest + runs-on: [ self-hosted, Linux, X64, cpu ] + container: gcr.io/kaniko-project/executor:v1.23.2 permissions: contents: read packages: write - steps: - - uses: jlumbroso/free-disk-space@main - with: - # this might remove tools that are actually needed, - # if set to "true" but frees about 6 GB - tool-cache: false - - # all of these default to true, but feel free to set to - # "false" if necessary for your workflow - android: false - dotnet: false - haskell: false - large-packages: false - docker-images: true - swap-storage: false - uses: actions/checkout@v4 - - uses: docker/login-action@v3 + - name: Kaniko build + uses: aevea/action-kaniko@master with: - registry: ${{ env.REGISTRY }} - username: ${{ github.actor }} + registry: ghcr.io password: ${{ secrets.GITHUB_TOKEN }} - - uses: docker/build-push-action@v6 - with: - context: . - push: true - tags: | - ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest - ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ github.sha }} \ No newline at end of file + image: comfyui \ No newline at end of file diff --git a/.github/workflows/stale-issues.yml b/.github/workflows/stale-issues.yml deleted file mode 100644 index 045996070..000000000 --- a/.github/workflows/stale-issues.yml +++ /dev/null @@ -1,21 +0,0 @@ -name: 'Close stale issues' -on: - schedule: - # Run daily at 430 am PT - - cron: '30 11 * * *' -permissions: - issues: write - -jobs: - stale: - runs-on: ubuntu-latest - steps: - - uses: actions/stale@v9 - with: - stale-issue-message: "This issue is being marked stale because it has not had any activity for 30 days. Reply below within 7 days if your issue still isn't solved, and it will be left open. Otherwise, the issue will be closed automatically." - days-before-stale: 30 - days-before-close: 7 - stale-issue-label: 'Stale' - only-labels: 'User Support' - exempt-all-assignees: true - exempt-all-milestones: true diff --git a/.github/workflows/update-frontend.yml b/.github/workflows/update-frontend.yml deleted file mode 100644 index 0c5774789..000000000 --- a/.github/workflows/update-frontend.yml +++ /dev/null @@ -1,58 +0,0 @@ -name: Update Frontend Release - -on: - workflow_dispatch: - inputs: - version: - description: "Frontend version to update to (e.g., 1.0.0)" - required: true - type: string - -jobs: - update-frontend: - runs-on: ubuntu-latest - permissions: - contents: write - pull-requests: write - - steps: - - name: Checkout ComfyUI - uses: actions/checkout@v4 - - uses: actions/setup-python@v4 - with: - python-version: '3.10' - - name: Install requirements - run: | - python -m pip install --upgrade pip - pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cpu - pip install -r requirements.txt - pip install wait-for-it - # Frontend asset will be downloaded to ComfyUI/web_custom_versions/Comfy-Org_ComfyUI_frontend/{version} - - name: Start ComfyUI server - run: | - python main.py --cpu --front-end-version Comfy-Org/ComfyUI_frontend@${{ github.event.inputs.version }} 2>&1 | tee console_output.log & - wait-for-it --service 127.0.0.1:8188 -t 30 - - name: Configure Git - run: | - git config --global user.name "GitHub Action" - git config --global user.email "action@github.com" - # Replace existing frontend content with the new version and remove .js.map files - # See https://github.com/Comfy-Org/ComfyUI_frontend/issues/2145 for why we remove .js.map files - - name: Update frontend content - run: | - rm -rf web/ - cp -r web_custom_versions/Comfy-Org_ComfyUI_frontend/${{ github.event.inputs.version }} web/ - rm web/**/*.js.map - - name: Create Pull Request - uses: peter-evans/create-pull-request@v7 - with: - token: ${{ secrets.PR_BOT_PAT }} - commit-message: "Update frontend to v${{ github.event.inputs.version }}" - title: "Frontend Update: v${{ github.event.inputs.version }}" - body: | - Automated PR to update frontend content to version ${{ github.event.inputs.version }} - - This PR was created automatically by the frontend update workflow. - branch: release-${{ github.event.inputs.version }} - base: master - labels: Frontend,dependencies diff --git a/.github/workflows/update-version.yml b/.github/workflows/update-version.yml deleted file mode 100644 index d9d488974..000000000 --- a/.github/workflows/update-version.yml +++ /dev/null @@ -1,58 +0,0 @@ -name: Update Version File - -on: - pull_request: - paths: - - "pyproject.toml" - branches: - - master - -jobs: - update-version: - runs-on: ubuntu-latest - # Don't run on fork PRs - if: github.event.pull_request.head.repo.full_name == github.repository - permissions: - pull-requests: write - contents: write - - steps: - - name: Checkout repository - uses: actions/checkout@v4 - - - name: Set up Python - uses: actions/setup-python@v4 - with: - python-version: "3.11" - - - name: Install dependencies - run: | - python -m pip install --upgrade pip - - - name: Update comfyui_version.py - run: | - # Read version from pyproject.toml and update comfyui_version.py - python -c ' - import tomllib - - # Read version from pyproject.toml - with open("pyproject.toml", "rb") as f: - config = tomllib.load(f) - version = config["project"]["version"] - - # Write version to comfyui_version.py - with open("comfyui_version.py", "w") as f: - f.write("# This file is automatically generated by the build process when version is\n") - f.write("# updated in pyproject.toml.\n") - f.write(f"__version__ = \"{version}\"\n") - ' - - - name: Commit changes - run: | - git config --local user.name "github-actions" - git config --local user.email "github-actions@github.com" - git fetch origin ${{ github.head_ref }} - git checkout -B ${{ github.head_ref }} origin/${{ github.head_ref }} - git add comfyui_version.py - git diff --quiet && git diff --staged --quiet || git commit -m "chore: Update comfyui_version.py to match pyproject.toml" - git push origin HEAD:${{ github.head_ref }} diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 000000000..d968a3156 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,56 @@ +name: "comfyui" +services: + backend: + build: + context: . + dockerfile: Dockerfile + volumes: + - workspace_data:/workspace + deploy: + replicas: 1 + resources: + reservations: + devices: + - driver: nvidia + count: all + capabilities: [ gpu ] + environment: + - COMFYUI_DISTRIBUTED_QUEUE_CONNECTION_URI=amqp://guest:guest@rabbitmq:5672 + - COMFYUI_LOGGING_LEVEL=ERROR + command: + - comfyui-worker + healthcheck: + test: curl -f http://localhost:9090/health + interval: 10s + timeout: 5s + retries: 3 + start_period: 10s + restart: unless-stopped + frontend: + build: + context: . + dockerfile: Dockerfile + deploy: + replicas: 1 + volumes: + - workspace_data:/workspace + environment: + - COMFYUI_DISTRIBUTED_QUEUE_CONNECTION_URI=amqp://guest:guest@rabbitmq:5672 + - COMFYUI_DISTRIBUTED_QUEUE_FRONTEND=1 + - COMFYUI_LOGGING_LEVEL=INFO + ports: + - "8188:8188" + command: + - comfyui + - --listen + healthcheck: + test: curl -f http://localhost:8188/object_info + interval: 10s + timeout: 5s + retries: 3 + start_period: 10s + restart: unless-stopped + rabbitmq: + image: rabbitmq:3 +volumes: + workspace_data: {} \ No newline at end of file