Skip to content

Commit

Permalink
Merge pull request #52 from edenartlab/staging
Browse files Browse the repository at this point in the history
postprocessing
  • Loading branch information
genekogan authored Jan 8, 2025
2 parents 0371fee + 4009a52 commit 76348a4
Show file tree
Hide file tree
Showing 33 changed files with 1,740 additions and 727 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/prod.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,4 @@ jobs:

- name: Deploy to Modal
working-directory: eve
run: rye run modal deploy ./eve/api.py
run: rye run modal deploy ./eve/api/api.py
2 changes: 1 addition & 1 deletion .github/workflows/staging.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,4 @@ jobs:

- name: Deploy to Modal
working-directory: eve
run: rye run modal deploy ./eve/api.py
run: rye run modal deploy ./eve/api/api.py
11 changes: 9 additions & 2 deletions comfyui.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@
specific_test = os.getenv("SPECIFIC_TEST") if os.getenv("SPECIFIC_TEST") else ""
skip_tests = os.getenv("SKIP_TESTS")

# Run a bunch of checks to verify input args:
if test_all and specific_test:
print(f"WARNING: can't have both TEST_ALL and SPECIFIC_TEST at the same time...")
print(f"Running TEST_ALL instead")
Expand All @@ -80,6 +81,11 @@
print(f"skip_tests: {skip_tests}")
print("========================================")

if not test_workflows and workspace_name and not test_all:
print("\n!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!")
print("!!!! WARNING: You are deploying a workspace without TEST_ALL !!!!")
print("!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n")

def install_comfyui():
snapshot = json.load(open("/root/workspace/snapshot.json", 'r'))
comfyui_commit_sha = snapshot["comfyui"]
Expand Down Expand Up @@ -362,7 +368,8 @@ def test_workflows(self):
else:
tests = [f"/root/workspace/workflows/{workflow}/test.json"]
print(f"====> Running tests for {workflow}: ", tests)
for test in tests:
for i, test in enumerate(tests):
print(f"\n\n\n------------------ Running test {i+1} of {len(tests)} ------------------")
tool = Tool.from_yaml(f"/root/workspace/workflows/{workflow}/api.yaml")
if tool.status == "inactive":
print(f"{workflow} is inactive, skipping test")
Expand Down Expand Up @@ -691,7 +698,7 @@ def validate_url(url):
#print("found lora:\n", lora)

if not lora:
raise Exception(f"Lora {key} with id: {lora_id} not found!")
raise Exception(f"Lora {key} with id: {lora_id} not found in DB {db}!")

base_model = lora.get("base_model")
lora_url = lora.get("checkpoint")
Expand Down
13 changes: 10 additions & 3 deletions eve/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import logging
import sentry_sdk
from dotenv import load_dotenv
from pathlib import Path
Expand All @@ -6,17 +7,20 @@

home_dir = str(Path.home())


EDEN_API_KEY = None

logging.basicConfig(
level=logging.INFO, format="%(asctime)s - %(name)s - %(levelname)s - %(message)s"
)


def load_env(db):
global EDEN_API_KEY

db = db.upper()
if db not in ["STAGE", "PROD"]:
raise ValueError(f"Invalid database: {db}")

os.environ["DB"] = db

# First try ~/.eve
Expand All @@ -37,7 +41,10 @@ def load_env(db):

# start sentry
sentry_dsn = os.getenv("SENTRY_DSN")
sentry_sdk.init(dsn=sentry_dsn, traces_sample_rate=1.0, profiles_sample_rate=1.0)
if sentry_dsn:
sentry_sdk.init(
dsn=sentry_dsn, traces_sample_rate=1.0, profiles_sample_rate=1.0
)

# load api keys
EDEN_API_KEY = SecretStr(os.getenv("EDEN_API_KEY", ""))
Expand Down
1 change: 0 additions & 1 deletion eve/agent.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import os
import yaml
import time
import json
import traceback
Expand Down
Loading

0 comments on commit 76348a4

Please sign in to comment.