trying to fix anoyying error with dht peers
This commit is contained in:
@ -1,4 +1,6 @@
|
||||
# dobromirpopov/petals-ai :latest full
|
||||
# dobromirpopov/petals-ai:full
|
||||
#
|
||||
FROM python:slim
|
||||
|
||||
# System dependencies
|
||||
@ -16,20 +18,18 @@ ENV ENV_PARAMS=
|
||||
# pull petals and bake it into the image. comment for lite image
|
||||
RUN git clone https://github.com/d-popov/health.petals.dev.git && cd /health.petals.dev && pip install -r requirements.txt
|
||||
|
||||
|
||||
# Create the entrypoint script inside the Dockerfile
|
||||
RUN echo '#!/bin/sh\n\
|
||||
INITIAL_PEERS=""\n\
|
||||
if [ -n "$DHT_PEERS" ]; then\n\
|
||||
INITIAL_PEERS="--initial_peers $DHT_PEERS"\n\
|
||||
fi\n\
|
||||
echo "Script is starting..."\n\
|
||||
echo "MODE is set to: $MODE"\n\
|
||||
echo "DHT_PEERS is set to: $DHT_PEERS"\n\
|
||||
if [ ! -f "/initialized" ]; then\n\
|
||||
touch /initialized\n\
|
||||
pip install --upgrade petals\n\
|
||||
case "$MODE" in\n\
|
||||
"monitor")\n\
|
||||
git clone https://github.com/d-popov/health.petals.dev.git && \
|
||||
cd /health.petals.dev && pip install -r requirements.txt\n\
|
||||
# git clone https://github.com/d-popov/health.petals.dev.git && \
|
||||
# cd /health.petals.dev && pip install -r requirements.txt\n\
|
||||
;;\n\
|
||||
"chat")\n\
|
||||
git clone https://github.com/petals-infra/chat.petals.dev.git && \
|
||||
@ -41,14 +41,25 @@ if [ ! -f "/initialized" ]; then\n\
|
||||
esac\n\
|
||||
fi\n\
|
||||
if [ "$MODE" = "monitor" ] && [ -n "$DHT_PEERS" ]; then\n\
|
||||
echo "INITIAL_PEERS = ['$(echo $DHT_PEERS | sed "s/ /','/g")']" >> /health.petals.dev/config.py;\n\
|
||||
echo "setting initial peers to ['$(echo $DHT_PEERS | sed "s/ /','/g")']";\n\
|
||||
FORMATTED_PEERS=$(echo $DHT_PEERS | sed "s/ /','/g")\n\
|
||||
echo "Debug FORMATTED_PEERS: $FORMATTED_PEERS"\n\
|
||||
echo "INITIAL_PEERS = ['$FORMATTED_PEERS']" >> /health.petals.dev/config.py\n\
|
||||
#echo "INITIAL_PEERS = ['$(echo $DHT_PEERS | sed "s/ /','/g")']" >> /health.petals.dev/config.py;\n\
|
||||
echo "INITIAL_PEERS = ['"$FORMATTED_PEERS"']" >> /health.petals.dev/config.py\n\
|
||||
#echo "monitorring private swarm. Initial peers set to ['$(echo $DHT_PEERS | sed "s/ /','/g")']"\n\
|
||||
echo "monitoring private swarm. Initial peers set to ['"$FORMATTED_PEERS"']"\n\
|
||||
else \n\
|
||||
echo "monitor has no DHT peers. Monitoring public swarm."\n\
|
||||
fi\n\
|
||||
if [ -n "$HF_TOKEN" ]; then\n\
|
||||
git config --global credential.helper store && \n\
|
||||
huggingface-cli login --token $HF_TOKEN --add-to-git-credential && \n\
|
||||
ENV_PARAMS="--use_auth_token $ENV_PARAMS"\n\
|
||||
fi\n\
|
||||
INITIAL_PEERS=""\n\
|
||||
if [ -n "$DHT_PEERS" ]; then\n\
|
||||
INITIAL_PEERS="--initial_peers $DHT_PEERS"\n\
|
||||
fi\n\
|
||||
case "$MODE" in\n\
|
||||
"monitor")\n\
|
||||
cd /health.petals.dev\n\
|
||||
|
Reference in New Issue
Block a user