Updated type

This commit is contained in:
Netkas 2021-01-14 13:51:46 -05:00
parent 6421e5ddba
commit bcab3ce753
4 changed files with 102 additions and 101 deletions

View File

@ -1,73 +1,72 @@
#!/bin/sh
echo "### Initializing CoffeeHouse-Utils ###"
chmod a+x /usr/local/bin/update_server
if [ ! -f /firstrun.pass ]; then
echo "(!) First run! Installing resources..."
update_server
echo "(+) Setting boot flag..."
touch /firstrun.pass
echo "[...] Restarting server in detached mode..."
else
cd /CoffeeHousePy
echo "### Starting CoffeeHouse-LangDetect ###"
make start_langdetect &
echo "### Starting CoffeeHouse-SpamDetect ###"
make start_spamdetect &
echo "### Starting CoffeeHouse-CoreNLP ###"
make start_corenlp &
echo "### Starting CoffeeHouse-NSFW ###"
make start_nsfw &
echo "### Checking Service Status ###"
if ! python3 scripts/warmup.py; then
echo "ERROR: Some services failed to start successfully duing the warmup process"
exit 1
fi
echo "### Starting Ping Service ###"
make start_ping &
while sleep 60; do
# If grep find anything, they exit with 0 status
# If they are not 0, then something is wrong
ps aux | grep coffeehouse_languagedetection | grep -q -v grep
LANGDETECT_STATUS=$?
if [ $LANGDETECT_STATUS -ne 0 ]; then
echo "ERROR: coffeehouse_languagedetection has been terminated, terminating container."
exit 1
fi
ps aux | grep coffeehouse_spamdetection | grep -q -v grep
SPAMDETECT_STATUS=$?
if [ $SPAMDETECT_STATUS -ne 0 ]; then
echo "ERROR: coffeehouse_spamdetection has been terminated, terminating container."
exit 1
fi
ps aux | grep coffeehouse_nsfw | grep -q -v grep
NSFW_STATUS=$?
if [ $NSFW_STATUS -ne 0 ]; then
echo "ERROR: coffeehouse_nsfw has been terminated, terminating container."
exit 1
fi
ps aux | grep coffeehouse_ping | grep -q -v grep
PING_STATUS=$?
if [ $PING_STATUS -ne 0 ]; then
echo "ERROR: coffeehouse_ping has been terminated, terminating container."
exit 1
fi
ps aux | grep edu.stanford.nlp.pipeline.StanfordCoreNLPServer | grep -q -v grep
CORENLP_STATUS=$?
if [ $CORENLP_STATUS -ne 0 ]; then
echo "ERROR: coffeehouse_corenlp has been terminated, terminating container."
exit 1
fi
done
#!/bin/sh
echo "### Initializing CoffeeHouse-Utils ###"
chmod a+x /usr/local/bin/update_server
if [ ! -f /firstrun.pass ]; then
echo "(!) First run! Installing resources..."
update_server
echo "(+) Setting boot flag..."
touch /firstrun.pass
echo "[...] Restarting server in detached mode..."
else
cd /CoffeeHousePy
echo "### Starting CoffeeHouse-LangDetect ###"
make start_langdetect &
echo "### Starting CoffeeHouse-SpamDetect ###"
make start_spamdetect &
echo "### Starting CoffeeHouse-CoreNLP ###"
make start_corenlp &
echo "### Starting CoffeeHouse-NSFW ###"
make start_nsfw &
echo "### Checking Service Status ###"
if ! python3 scripts/warmup.py; then
echo "ERROR: Some services failed to start successfully duing the warmup process"
exit 1
fi
echo "### Starting Ping Service ###"
make start_ping &
while sleep 60; do
# If grep find anything, they exit with 0 status
# If they are not 0, then something is wrong
ps aux | grep coffeehouse_languagedetection | grep -q -v grep
LANGDETECT_STATUS=$?
if [ $LANGDETECT_STATUS -ne 0 ]; then
echo "ERROR: coffeehouse_languagedetection has been terminated, terminating container."
exit 1
fi
ps aux | grep coffeehouse_spamdetection | grep -q -v grep
SPAMDETECT_STATUS=$?
if [ $SPAMDETECT_STATUS -ne 0 ]; then
echo "ERROR: coffeehouse_spamdetection has been terminated, terminating container."
exit 1
fi
ps aux | grep coffeehouse_nsfw | grep -q -v grep
NSFW_STATUS=$?
if [ $NSFW_STATUS -ne 0 ]; then
echo "ERROR: coffeehouse_nsfw has been terminated, terminating container."
exit 1
fi
ps aux | grep coffeehouse_ping | grep -q -v grep
PING_STATUS=$?
if [ $PING_STATUS -ne 0 ]; then
echo "ERROR: coffeehouse_ping has been terminated, terminating container."
exit 1
fi
ps aux | grep edu.stanford.nlp.pipeline.StanfordCoreNLPServer | grep -q -v grep
CORENLP_STATUS=$?
if [ $CORENLP_STATUS -ne 0 ]; then
echo "ERROR: coffeehouse_corenlp has been terminated, terminating container."
exit 1
fi
done
fi

View File

@ -1,28 +1,28 @@
#!/bin/bash
# Written by Netkas 3/01/2021
echo "Intellivoid Provisioning"
echo "Running on x86_64 (docker) [PRODUCTION]"
echo " "
echo " ## Authentication Required "
read -p 'Enter your 25-50 character PAT: ' GIT_API_KEY
echo " #### Cloning CoffeeHousePy"
git clone https://${GIT_API_KEY}@github.com/Intellivoid/CoffeeHousePy.git
cd /CoffeeHousePy
git checkout nsfw_detection
echo " #### Preparing System for Python"
make system_prep_python
echo " #### Preparing System for pip"
make system_prep_pip
echo " #### Preparing System for GCC"
make system_prep_gcc
echo " #### Preparing System for Java"
make system_prep_java
echo " #### Building and Installing CoffeeHousePy"
#!/bin/bash
# Written by Netkas 3/01/2021
echo "Intellivoid Provisioning"
echo "Running on x86_64 (docker) [PRODUCTION]"
echo " "
echo " ## Authentication Required "
read -p 'Enter your 25-50 character PAT: ' GIT_API_KEY
echo " #### Cloning CoffeeHousePy"
git clone https://${GIT_API_KEY}@github.com/Intellivoid/CoffeeHousePy.git
cd /CoffeeHousePy
git checkout nsfw_detection
echo " #### Preparing System for Python"
make system_prep_python
echo " #### Preparing System for pip"
make system_prep_pip
echo " #### Preparing System for GCC"
make system_prep_gcc
echo " #### Preparing System for Java"
make system_prep_java
echo " #### Building and Installing CoffeeHousePy"
make install_full

View File

@ -1,2 +0,0 @@
import os
print(os.path.dirname(os.path.realpath(__file__)))

4
test.sh Normal file
View File

@ -0,0 +1,4 @@
if ! python3 scripts/warmup.py; then
echo "ERROR: Some services failed to start successfully duing the warmup process"
exit 1
fi