sweep
September 14, 2023, 10:10pm
1
How can I deploy Sweep as a docker image/uvicorn run on replit?
https://replit.com/@sweep/sweep .
We to deploy it and expose the port. We’re having issues with running:
echo PORT: ${PORT:-8080} redis-server /app/redis.conf --bind 0.0.0.0 --port 6379 & uvicorn sweepai.api:app --host 0.0.0.0 --port ${PORT:-8080}
Hi @sweep , welcome to the forums! It appears that your repl is a Python repl, but you do not have a main.py
file to run.
May I ask what file is the main file that you would like to run?
sweep
September 15, 2023, 1:13am
3
Got it, apologies as I’m new to replit. We want to run uvicorn at sweepai/api.py
Hey @sweep !
Just click the ⋮ next to “Files” then click “Show hidden files”. Next click on the .replit
file and finally you can change the entrypoint
to /sweepai/api.py
.
Images
You should also see the docs on how to configure a Repl: https://docs.replit.com/programming-ide/configuring-repl
And if you want to run the last edited file, take a look at this post:
improved: add/change to start of .replit
:
onBoot = '''/nix/store/fbi9r30p3lqk96lmw5b1v1bpbj62cr2l-inotify-tools-3.20.11.0/bin/inotifywait -rqme create --format=%f%w --include='\..+\.py.[0-9]+~' .|while
read f
do
f=${f#.}
o=
r=
while
read -r l||[ "$l" ]
do
case $r
in
"")case $l
in entrypoint*)m="${l%\"*\"}\"${f#*~./}${f%.*~*}\""
case $m
in
"$l")break
esac
l=$m
r=1
esac
esac
o="$o$l
"
false
done<.replit||echo -n "$o">.replit
done'''
And run kill 1
in Shell.
This will map the entrypoint to the last file you edited through the IDE.
Replace .+\.py
on line 1 with the ERE of the files you want to be auto-set as entrypoint.
(I tried an option which checks for you just visiting the file in the editor but I found that that’s impossible. Maybe you can do this with an extension)