- License Usage Calculation realised

- View License Usages
- Celery Beat container added
- First schedule in Celery Beat for calculating usage (hourly)
- repopack can now split for different components
- Various fixes as consequece of changing file_location / file_name ==> bucket_name / object_name
- Celery Routing / Queuing updated
This commit is contained in:
Josako
2024-10-11 16:33:36 +02:00
parent 5ffad160b1
commit 9f5f090f0c
57 changed files with 935 additions and 174 deletions

10
scripts/entrypoint_no_db.sh Executable file
View File

@@ -0,0 +1,10 @@
#!/bin/bash
set -e
# Ensure the logs directory has the correct permissions
echo "Changing permissions on logs directory"
#chown -R appuser:appuser /app/logs
chmod -R 777 /app/logs
# Switch to appuser and execute the command passed to the script
exec su -- appuser -c "$@"

View File

@@ -1,17 +1,35 @@
#!/bin/bash
# Delete previous repopack files
rm -f *repo.txt
# Run repopack to generate the file
repopack
# Define the list of components
components=("docker" "eveai_api" "eveai_app" "eveai_beat" "eveai_chat" "eveai_chat_workers" "eveai_entitlements" "eveai_workers" "nginx" "full" "integrations")
# Check if repopack generated the eveai_repo.txt file
if [[ -f "eveai_repo.txt" ]]; then
# Get the current timestamp in the format YYYY-DD-MM_HH:MM:SS
timestamp=$(date +"%Y-%d-%m_%H-%M-%S")
# Get the current date and time in the format YYYY-MM-DD_HH-MM
timestamp=$(date +"%Y-%m-%d_%H-%M")
# Rename the file with the timestamp
mv eveai_repo.txt "${timestamp}_eveai_repo.txt"
# Loop through each component and perform the tasks
for component in "${components[@]}"; do
echo "Processing component: $component"
echo "File renamed to ${timestamp}_eveai_repo.txt"
else
echo "Error: eveai_repo.txt not found. repopack may have failed."
fi
# Merge the .repopackignore_base and .repopackignore_<component> into .repopackignore
if [[ -f ".repopackignore_base" && -f ".repopackignore_$component" ]]; then
cat .repopackignore_base .repopackignore_$component > .repopackignore
else
echo "Warning: Missing .repopackignore_base or .repopackignore_$component for $component"
continue
fi
# Execute repopack
repopack
# Rename the resulting eveai_repo.txt file to <component>YYYY-MM-DD_HH-MM_repo.txt
if [[ -f "eveai_repo.txt" ]]; then
mv eveai_repo.txt "${component}_${timestamp}_repo.txt"
echo "Renamed eveai_repo.txt to ${component}_${timestamp}_repo.txt"
else
echo "Error: repopack did not generate eveai_repo.txt for $component"
fi
echo "Finished processing $component"
done

17
scripts/start_eveai_beat.sh Executable file
View File

@@ -0,0 +1,17 @@
#!/bin/bash
cd "/app/" || exit 1
export PROJECT_DIR="/app"
export PYTHONPATH="$PROJECT_DIR/patched_packages:$PYTHONPATH:$PROJECT_DIR" # Include the app directory in the Python path & patched packages
# Ensure we can write the logs
chown -R appuser:appuser /app/logs
# Start Celery Beat
celery -A eveai_beat.celery beat --scheduler=redbeat.RedBeatScheduler --loglevel=debug &
# Start a worker for the 'llm_interactions' queue with auto-scaling - not necessary, in eveai_chat_workers
# celery -A eveai_workers.celery worker --loglevel=info - Q llm_interactions --autoscale=2,8 --hostname=interactions_worker@%h &
# Wait for all background processes to finish
wait

View File

@@ -0,0 +1,17 @@
#!/bin/bash
cd "/app/" || exit 1
export PROJECT_DIR="/app"
export PYTHONPATH="$PROJECT_DIR/patched_packages:$PYTHONPATH:$PROJECT_DIR" # Include the app directory in the Python path & patched packages
# Ensure we can write the logs
chown -R appuser:appuser /app/logs
# Start a worker for the 'embeddings' queue with higher concurrency
celery -A eveai_entitlements.celery worker --loglevel=debug -Q entitlements --autoscale=2,8 --hostname=entitlements_worker@%h &
# Start a worker for the 'llm_interactions' queue with auto-scaling - not necessary, in eveai_chat_workers
# celery -A eveai_workers.celery worker --loglevel=info - Q llm_interactions --autoscale=2,8 --hostname=interactions_worker@%h &
# Wait for all background processes to finish
wait

0
scripts/start_flower.sh Normal file → Executable file
View File