Skip to content
Merged
Show file tree
Hide file tree
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
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ __pycache__/
*.py[cod]
*$py.class

.vscode/
.vscode/*
!.vscode/launch.json

# C extensions
*.so
Expand Down
23 changes: 23 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Python Debugger: refinery-gateway",
"type": "debugpy",
"request": "attach",
"connect": {
"host": "localhost",
"port": 15670
},
"pathMappings": [
{
"localRoot": "${workspaceFolder}",
"remoteRoot": "."
}
]
}
]
}
3 changes: 2 additions & 1 deletion requirements-dev.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
-r requirements.txt
httpx>=0.25.0
pytest==8.1.1
pytest==8.1.1
debugpy==1.8.12
24 changes: 22 additions & 2 deletions start
Original file line number Diff line number Diff line change
@@ -1,4 +1,20 @@
#!/bin/bash

DEBUG_MODE=false
DEBUG_PORT=15670

while getopts d flag
do
case "${flag}" in
d) DEBUG_MODE=true;;
esac
done

CMD=""
if [ $DEBUG_MODE = true ]; then
CMD="debugpy --wait-for-client --listen 0.0.0.0:$DEBUG_PORT -m uvicorn app:app --host 0.0.0.0 --port 80 --reload"
fi

trap "echo -ne '\nstopping container...' && docker stop refinery-gateway > /dev/null 2>&1 && echo -ne '\t\t [done]\n'" EXIT

unameOut="$(uname -s)"
Expand Down Expand Up @@ -60,7 +76,7 @@ then
fi

echo -ne 'building container...'
docker build -t graphql-dev -f dev.Dockerfile . > /dev/null 2>&1
docker build -t graphql-dev -f dev.Dockerfile .
echo -ne '\t\t [done]\n'

echo -ne 'migrating db...\n'
Expand All @@ -76,6 +92,7 @@ echo -ne 'migration done\n'
echo -ne 'starting...'
docker run -d --rm \
--name refinery-gateway \
-p $DEBUG_PORT:$DEBUG_PORT \
-p 7051:80 \
-e AC_EXEC_ENV_IMAGE=registry.dev.kern.ai/code-kern-ai/refinery-ac-exec-env:dev$IS_ARM64 \
-e LF_EXEC_ENV_IMAGE=registry.dev.kern.ai/code-kern-ai/refinery-lf-exec-env:dev$IS_ARM64 \
Expand Down Expand Up @@ -106,7 +123,10 @@ docker run -d --rm \
--mount type=bind,source="$(pwd)"/,target=/app \
-v /var/run/docker.sock:/var/run/docker.sock \
--network dev-setup_default \
graphql-dev > /dev/null 2>&1
graphql-dev $CMD > /dev/null 2>&1
echo -ne '\t\t\t [done]\n'

if [ $DEBUG_MODE = true ]; then
echo -e "\033[0;33muse VSCode Debugger (Python Debugger: refinery-gateway) to start the service\033[0m"
fi
docker logs -f refinery-gateway \
2 changes: 1 addition & 1 deletion submodules/model
Submodule model updated 1 files
+10 −3 util.py
Loading