Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: run the worker locally #19

Merged
merged 6 commits into from
Feb 12, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions .github/workflows/dev.yml
Original file line number Diff line number Diff line change
@@ -8,7 +8,7 @@ on:

jobs:
dev:
runs-on: ubuntu-latest
runs-on: ubuntu-latest-m
steps:
- name: Checkout
uses: actions/checkout@v3
@@ -49,5 +49,3 @@ jobs:
push: true
tags: |
${{ secrets.DOCKERHUB_REPO }}/${{ secrets.DOCKERHUB_IMG }}:dev


Original file line number Diff line number Diff line change
@@ -1,12 +1,20 @@
name: CD | Release Docker Image
name: Release

on:
release:
types: [published]
workflow_dispatch:
push:
branches:
- "main"

jobs:
docker:
release:
runs-on: ubuntu-latest
if: ${{ !contains(github.event.head_commit.message, 'chore(release)') }}
permissions:
contents: write # to be able to publish a GitHub release
issues: write # to be able to comment on released issues
pull-requests: write # to be able to comment on released pull requests

steps:
- name: Checkout
uses: actions/checkout@v3
@@ -41,17 +49,34 @@ jobs:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Build and push
- name: Update the ToC in the README.md
run: npx markdown-toc README.md -i

- name: Semantic release
uses: codfish/semantic-release-action@v3
id: semanticrelease
with:
additional-packages: |
['@semantic-release/git', '@semantic-release/changelog']
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Build image and push it to Docker Hub
if: steps.semanticrelease.outputs.new-release-published == 'true'
uses: docker/build-push-action@v5
with:
push: true
tags: |
${{ secrets.DOCKERHUB_REPO }}/${{ secrets.DOCKERHUB_IMG }}:${{ github.event.release.tag_name }}
${{ secrets.DOCKERHUB_REPO }}/${{ secrets.DOCKERHUB_IMG }}:${{ steps.semanticrelease.outputs.release-version }}
${{ secrets.DOCKERHUB_REPO }}/${{ secrets.DOCKERHUB_IMG }}:latest

- name: Docker Hub Description

- name: Update description on Docker Hub
if: steps.semanticrelease.outputs.new-release-published == 'true'
uses: peter-evans/dockerhub-description@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
repository: ${{ secrets.DOCKERHUB_REPO }}/${{ secrets.DOCKERHUB_IMG }}



7 changes: 4 additions & 3 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -2,12 +2,13 @@ version: "3.8"

services:
comfyui:
image: timpietruskyblibla/runpod-worker-comfy:1.0.0
image: timpietruskyblibla/runpod-worker-comfy:latest
container_name: comfyui-worker
environment:
- NVIDIA_VISIBLE_DEVICES=all
env_file:
- .env
- SERVE_API_LOCALLY=true
ports:
- "8000:8000"
runtime: nvidia
volumes:
- ./data/comfyui/output:/comfyui/output
8 changes: 7 additions & 1 deletion src/start.sh
Original file line number Diff line number Diff line change
@@ -8,4 +8,10 @@ echo "runpod-worker-comfy: Starting ComfyUI"
python3 /comfyui/main.py --disable-auto-launch --disable-metadata &

echo "runpod-worker-comfy: Starting RunPod Handler"
python3 -u /rp_handler.py

# Serve the API and don't shutdown the container
if [ "$SERVE_API_LOCALLY" == "true" ]; then
python3 -u /rp_handler.py --rp_serve_api --rp_api_host=0.0.0.0
else
python3 -u /rp_handler.py
fi
Loading