Skip to content

Commit

Permalink
Merge pull request #11 from durandom/main
Browse files Browse the repository at this point in the history
poetry / pre-commit / re-format
  • Loading branch information
durandom authored Oct 11, 2024
2 parents b253973 + e9ae2f0 commit 775bd15
Show file tree
Hide file tree
Showing 32 changed files with 2,994 additions and 460 deletions.
2 changes: 1 addition & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -90,4 +90,4 @@ frontend/next-env.d.ts
aider_hints/
start_bot.json

storytelling-chatbot/
storytelling-chatbot/
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -157,4 +157,4 @@ runpod.toml
aider_hints/
start_bot.json

.vscode/
.vscode/
63 changes: 63 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
repos:
- repo: https://github.com/Lucas-C/pre-commit-hooks
rev: v1.5.5
hooks:
- id: remove-tabs

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.0
hooks:
- id: check-added-large-files
args: ["--maxkb=2048"]
- id: check-ast
- id: fix-byte-order-marker
- id: check-case-conflict
- id: check-docstring-first
- id: check-json
- id: check-merge-conflict
- id: check-symlinks
- id: check-toml
- id: check-yaml
args: [--allow-multiple-documents]
- id: debug-statements
- id: detect-private-key
- id: end-of-file-fixer
- id: trailing-whitespace

- repo: https://github.com/psf/black
rev: "24.8.0"
hooks:
- id: black
args: ["--line-length=120"]

- repo: https://github.com/PyCQA/flake8
rev: "7.1.1"
hooks:
- id: flake8
additional_dependencies: ["pep8-naming"]
# Ignore all format-related checks as Black takes care of those.
args:
[
"--ignore",
"E2,W5,D100,D101",
"--select",
"E,W,F,N",
"--max-line-length=150",
]

- repo: https://github.com/pycqa/bandit
rev: 1.7.9
hooks:
- id: bandit
args: ["-iii", "-ll"]

- repo: https://github.com/pycqa/isort
rev: 5.13.2
hooks:
- id: isort
args: []

- repo: https://github.com/commitizen-tools/commitizen
rev: v3.29.0
hooks:
- id: commitizen
11 changes: 11 additions & 0 deletions .prow.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
presubmits:
- name: pre-commit
decorate: true
skip_report: false
always_run: true
context: op1st/prow/pre-commit
spec:
containers:
- image: quay.io/thoth-station/pre-commit:v0.17.0
command:
- "prow-job-precommit"
33 changes: 22 additions & 11 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,36 +4,46 @@ ifneq (,$(wildcard ./.env))
export
endif

.PHONY: test bot participant deploy-bot fly-secrets fly-launch fly-build fly-deploy-bot docker-build-linux docker-run-bash docker-run-bot bot-with-prompt
# use `docker` as a CONTAINER_ENGINE or `podman` as a default to build container images
ifeq ($(shell which docker),)
CONTAINER_ENGINE := $(shell which podman)
else
CONTAINER_ENGINE := $(shell which docker)
endif

.PHONY: test
test:
# TEST_PATTERN="test_aggregators" make test
# PYTHONPATH=. pipenv run pytest -vrP $(if $(TEST_PATTERN),-k "$(TEST_PATTERN)",)
PYTHONPATH=. pipenv run pytest -vrP $(if $(TEST_PATTERN),-k "$(TEST_PATTERN)",) tests/

bot:
pipenv run python ./bot.py
.PHONY: bot
bot: bot.py
poetry run ./bot.py

bot-runner:
pipenv run env RUN_AS_PROCESS=true python ./bot_runner.py

.PHONY: participant
participant:
pipenv run python ./participant.py

docker-build:
docker build --tag=durandom/mds-moderator .
.PHONY: container-build container-build-linux container-run-bash container-run-bot
container-build:
$(CONTAINER_ENGINE) build --tag=durandom/mds-moderator .

docker-build-linux:
docker build --tag=durandom/mds-moderator --platform linux/amd64 .
container-build-linux:
$(CONTAINER_ENGINE) build --tag=durandom/mds-moderator --platform linux/amd64 .

docker-run-bash:
docker run -it --rm -v $(PWD):/app --platform linux/amd64 python:3.12.3-bookworm bash
container-run-bash:
$(CONTAINER_ENGINE) run -it --rm -v $(PWD):/app --platform linux/amd64 python:3.12.3-bookworm bash

docker-run-bot:
docker run -p 7860:7860 --env-file .env durandom/mds-moderator
container-run-bot:
$(CONTAINER_ENGINE) run -p 7860:7860 --env-file .env durandom/mds-moderator


# creates the new fly app
.PHONY: fly-secrets fly-launch fly-build fly-deploy fly-deploy-bot
fly-launch:
flyctl launch

Expand All @@ -50,6 +60,7 @@ fly-deploy-bot:
pipenv run python ./bot_runner.py --deploy-bot

# starts a bot with a prompt on fly.io
.PHONY: bot-with-prompt bot-with-prompt-local
bot-with-prompt:
curl --verbose --location --request POST "$${DEPLOYMENT_URL}/start_bot" \
--header 'Content-Type: application/json' \
Expand Down
5 changes: 2 additions & 3 deletions NOTES.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
## Notes
# Notes

* TTS: TextFrames have to end with punctuation, otherwise TTS will not kick in
* Don't add a processor twice to a pipeline


Du bist ein stiller Zuhoerer und antwortest nur wenn du explizit gefragt wirst. Es it ok auch nichts zu sagen. Antworte nicht, es sei denn du wirst explizit gefragt. Eine leere Antwort, also leerer text, ist in den meissten faellen die richtige reaktion.
Du bist ein stiller Zuhoerer und antwortest nur wenn du explizit gefragt wirst. Es it ok auch nichts zu sagen. Antworte nicht, es sei denn du wirst explizit gefragt. Eine leere Antwort, also leerer text, ist in den meissten faellen die richtige reaktion.
10 changes: 10 additions & 0 deletions OWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# See the OWNERS docs at https://go.k8s.io/owners

approvers:
- durandom
- goern

reviewers:
- durandom
- goern
- schwesig
19 changes: 10 additions & 9 deletions Pipfile
Original file line number Diff line number Diff line change
@@ -1,22 +1,23 @@
[[source]]
name = "pypi"
url = "https://pypi.org/simple"
verify_ssl = true
name = "pypi"

[packages]
requests = "*"
python-dotenv = "*"
boto3 = "*"
fastapi = "*"
uvicorn = "*"
pipecat-ai = {extras = ["silero,openai,daily"] }
python-dotenv = "*"
python-multipart = "*"
requests = "*"
torch = "==2.3.1"
torchaudio = "==2.3.1"
boto3 = "*"
python-multipart = "*"
pipecat-ai = {extras = ["silero,openai,daily,elevenlabs"], version = "==0.0.41"}
tenacity = "*"
uvicorn = "*"

[dev-packages]
pytest = "*"
pytest = ">=8.3"
black = ">=24.8"
pylance = ">=0.18"

[requires]
python_version = "3.12"
Loading

0 comments on commit 775bd15

Please sign in to comment.