Skip to content

Commit

Permalink
Code cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
yohasebe committed Sep 16, 2024
1 parent 6b04223 commit 6c9faab
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 15 deletions.
23 changes: 12 additions & 11 deletions docker/services/python/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -26,26 +26,27 @@ RUN pip install -U pip && pip install --no-cache-dir --default-timeout=1000 \
seaborn \
jupyterlab \
gunicorn \
statsmodels \
tiktoken \
pymupdf \
selenium \
statsmodels \
japanize-matplotlib \
graphviz \
pydotplus \
openpyxl \
python-docx \
python-pptx \
wordcloud \
mecab-python3 \
html2text \
librosa \
flask \
tiktoken \
opencv-python \
moviepy \
pymupdf \
textblob \
nltk \
gensim
moviepy

# librosa \
# mecab-python3 \
# wordcloud \
# textblob \
# nltk \
# gensim

# Set up JupyterLab user settings
RUN mkdir -p /root/.jupyter/lab/user-settings
Expand Down Expand Up @@ -73,4 +74,4 @@ RUN ln -s /monadic/data /data
COPY Dockerfile /monadic/Dockerfile

# Install NLTK modules (failure to install these modules will skip the installation)
RUN python -m nltk.downloader all || true
# RUN python -m nltk.downloader all || true
2 changes: 1 addition & 1 deletion docker/services/ruby/bin/monadic_dev
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ def start_server(opts)
else
puts "Server failed to start"
# Save detailed error log to the specified directory on the host
File.open(File.join(DATA_DIR, "error.log"), "a") do |file|
File.open(File.join(DATA_DIR, "monadic.log"), "a") do |file|
file.puts("Failed to start server at #{Time.now}")
file.puts(output) # Write the detailed error output
end
Expand Down
4 changes: 2 additions & 2 deletions docker/services/ruby/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
#!/bin/sh

# Attempt to start the thin server and capture any errors
thin start -R config.ru -p 4567 -e development > /monadic/data/error.log 2>&1
thin start -R config.ru -p 4567 -e development > /monadic/data/monadic.log 2>&1

# Check if the thin server started successfully
if [ $? -ne 0 ]; then
echo "Failed to start thin server at $(date)" >> /monadic/data/error.log
echo "Failed to start thin server at $(date)" >> /monadic/data/monadic.log
fi

# Keep the container running
Expand Down
2 changes: 1 addition & 1 deletion main.js
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ class DockerManager {
openBrowser('http://localhost:4567');
})
.catch(error => {
writeToScreen('[HTML]: <p><b>Failed to start Monadic Chat server.</b></p><p>Please try rebuilding the image ("Menu" → "Action" → "Rebuild") and starting the server again.</p><hr />');
writeToScreen('[HTML]: <p><b>Failed to start Monadic Chat server.</b></p><p>Please check out monadic.log in the shared folder, rebuild the image ("Menu" → "Action" → "Rebuild"), and start the server again.</p><hr />');
console.error('Fetch operation failed after retries:', error);
currentStatus = 'Stopped';
updateTrayImage(currentStatus);
Expand Down

0 comments on commit 6c9faab

Please sign in to comment.