Skip to content

Commit d3b2712

Browse files
authored
Update run.sh
1 parent dcbb271 commit d3b2712

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

docker/streamlit_deploy/run.sh

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,22 +14,28 @@ elif [ -z "${DIR}" ]; then
1414
source ~/.bashrc
1515
if [ -f "environment.yml" ]; then
1616
conda install -c conda-forge mamba -y
17-
mamba env create -f environment.yml --prefix ~/.conda/envs/developer --force
17+
mamba env create -f environment.yml --prefix ~/.conda/envs/developer
1818
~/.conda/envs/developer/bin/python streamlit run $ENTRY --server.port=8501 --server.address=0.0.0.0
1919
elif [ -f "requirements.txt" ]; then
2020
/miniconda/bin/python -m pip install -r requirements.txt --trusted-host pypi.python.org --trusted-host files.pythonhosted.org --trusted-host pypi.org
2121
/miniconda/bin/python -m streamlit run $ENTRY --server.port=8501 --server.address=0.0.0.0
2222
fi
2323
elif [ -z "${REPO}" ]; then
2424
echo "No Github given, attempting to use directory."
25-
cd $DIR
25+
if [ -d "$TARGET_DIR" ]; then
26+
cd $DIR
27+
else
28+
echo "Cannot access $DIR, sleeping for 60 minutes."
29+
sleep 3600
30+
fi
2631
/miniconda/bin/conda config --set ssl_verify False
2732
/miniconda/bin/conda update -y conda
2833
/miniconda/bin/conda init
2934
source ~/.bashrc
3035
if [ -f "environment.yml" ]; then
3136
conda install -c conda-forge mamba -y
32-
mamba env create -f environment.yml --prefix ~/.conda/envs/developer --force
37+
rm ~/.conda/envs/developer
38+
mamba env create -f environment.yml --prefix ~/.conda/envs/developer
3339
~/.conda/envs/developer/bin/python streamlit run $ENTRY --server.port=8501 --server.address=0.0.0.0
3440
elif [ -f "requirements.txt" ]; then
3541
/miniconda/bin/python -m pip install -r requirements.txt --trusted-host pypi.python.org --trusted-host files.pythonhosted.org --trusted-host pypi.org

0 commit comments

Comments
 (0)