Skip to content

Commit

Permalink
Merge pull request #625 from Gencaster/workshop-fixes
Browse files Browse the repository at this point in the history
improvements from workshop
  • Loading branch information
capital-G authored Nov 29, 2023
2 parents 3d4f4e4 + 4d4f031 commit 539f313
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 7 deletions.
2 changes: 1 addition & 1 deletion caster-back/gencaster/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -635,7 +635,7 @@ async def cleanup_on_stop(**kwargs: Dict[str, str]):
# a stream variable which is set from the frontend
yield StreamInfo(stream=stream, stream_instruction=None) # type: ignore

async for instruction in engine.start(max_steps=int(10e4)):
async for instruction in engine.start(max_steps=int(10e10)):
if type(instruction) == Dialog:
yield instruction
else:
Expand Down
1 change: 1 addition & 0 deletions caster-back/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,4 @@ pydantic==1.10.7
channels-redis==4.1.0
sentry-sdk==1.30.0
django-stubs-ext==4.2.2
requests==2.31.0
9 changes: 7 additions & 2 deletions caster-back/story_graph/engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,13 @@

import asyncio
import logging
import random
import time
from copy import deepcopy
from datetime import datetime, timedelta
from typing import Any, AsyncGenerator, Dict, Optional, Union

import requests
from asgiref.sync import sync_to_async

from stream.frontend_types import Button, Checkbox, Dialog, Input, Text
Expand Down Expand Up @@ -219,6 +221,8 @@ def get_engine_global_vars(
"Button": Button,
"Checkbox": Checkbox,
"Input": Input,
"list": list,
"random": random,
**runtime_values,
}
}
Expand Down Expand Up @@ -260,6 +264,7 @@ async def execute_python_cell(self, cell_code: str) -> AsyncGenerator[Dialog, No
"self": self,
"get_stream_variables": self.get_stream_variables,
"wait_for_stream_variable": self.wait_for_stream_variable,
"requests": requests,
}
),
# locals which mirror the current namespace and allow for modification
Expand Down Expand Up @@ -390,9 +395,9 @@ async def get_next_node(self) -> Node:
# a broad exception because many things can go wrong here while evaluating
# python code (e.g. even raising a custom exception), therefore we catch all
# possible exceptions here
except Exception:
except Exception as e:
log.debug(
f"Exception raised on evaluating code of node door {node_door}"
f"Exception raised on evaluating code of node door {node_door}: {e}"
)
continue
if active_exit:
Expand Down
3 changes: 3 additions & 0 deletions docker-compose.deploy.dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ services:
- static:/home/gencaster/static:rw
- ./data:/data
- ./data:/home/gencaster/media
extra_hosts:
- "host.docker.internal:host-gateway"

osc_backend:
volumes:
Expand All @@ -31,6 +33,7 @@ services:
- 7000:7000/udp

sound:
network_mode: "host"
env_file:
- vars.env
- vars.deploy.dev.env
Expand Down
1 change: 1 addition & 0 deletions docker-compose.deploy.live.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ services:
- 7000:7000/udp

sound:
network_mode: "host"
env_file:
- vars.env
- vars.deploy.live.env
Expand Down
4 changes: 2 additions & 2 deletions vars.deploy.dev.env
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
SUPERCOLLIDER_HOST=sound
SUPERCOLLIDER_HOST=host.docker.internal

DJANGO_SETTINGS_MODULE="gencaster.settings.deploy_dev"
BACKEND_OSC_HOST=osc_backend
BACKEND_OSC_HOST=localhost

# this is needed during build time so change it in
# docker-compose.deploy.dev.yml as well if this changes
Expand Down
4 changes: 2 additions & 2 deletions vars.deploy.live.env
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
SUPERCOLLIDER_HOST=sound
SUPERCOLLIDER_HOST=host.docker.internal

DJANGO_SETTINGS_MODULE="gencaster.settings.deploy_live"
BACKEND_OSC_HOST=osc_backend
BACKEND_OSC_HOST=localhost

# this is needed during build time so change it in
# docker-compose.deploy.dev.yml as well if this changes
Expand Down

0 comments on commit 539f313

Please sign in to comment.