From 783eaaceb2c00056b17844acc21f34906e8d2676 Mon Sep 17 00:00:00 2001 From: sriram veeraghanta Date: Wed, 22 May 2024 12:43:58 +0530 Subject: [PATCH] fix: docker entry point cloud --- apiserver/bin/docker-entry-api.sh | 5 +---- apiserver/bin/docker-entrypoint-api-cloud.sh | 16 ++++++++++++++++ ...akeoff.cloud => docker-entrypoint-api-ee.sh} | 17 ++++++++++++++--- 3 files changed, 31 insertions(+), 7 deletions(-) create mode 100644 apiserver/bin/docker-entrypoint-api-cloud.sh rename apiserver/bin/{takeoff.cloud => docker-entrypoint-api-ee.sh} (52%) mode change 100644 => 100755 diff --git a/apiserver/bin/docker-entry-api.sh b/apiserver/bin/docker-entry-api.sh index 35d61a9d9e..e9b4648c33 100755 --- a/apiserver/bin/docker-entry-api.sh +++ b/apiserver/bin/docker-entry-api.sh @@ -20,9 +20,6 @@ SIGNATURE=$(echo "$HOSTNAME$MAC_ADDRESS$CPU_INFO$MEMORY_INFO$DISK_INFO" | sha256 # Export the variables export MACHINE_SIGNATURE=$SIGNATURE -# License check -python manage.py license_check - # Register instance python manage.py register_instance "$MACHINE_SIGNATURE" @@ -35,4 +32,4 @@ python manage.py create_bucket # Clear Cache before starting to remove stale values python manage.py clear_cache -exec gunicorn -w "$GUNICORN_WORKERS" -k uvicorn.workers.UvicornWorker plane.asgi:application --bind 0.0.0.0:"${PORT:-8000}" --max-requests 1200 --max-requests-jitter 1000 --access-logfile - +exec gunicorn -w "$GUNICORN_WORKERS" -k uvicorn.workers.UvicornWorker plane.asgi:application --bind 0.0.0.0:"${PORT:-8000}" --max-requests 1200 --max-requests-jitter 1000 --access-logfile - \ No newline at end of file diff --git a/apiserver/bin/docker-entrypoint-api-cloud.sh b/apiserver/bin/docker-entrypoint-api-cloud.sh new file mode 100644 index 0000000000..747f9ab021 --- /dev/null +++ b/apiserver/bin/docker-entrypoint-api-cloud.sh @@ -0,0 +1,16 @@ +#!/bin/bash +set -e + +export SKIP_ENV_VAR=0 + +python manage.py wait_for_db +# Wait for migrations +python manage.py wait_for_migrations + +# Clear Cache before starting to remove stale values +python manage.py clear_cache + +# Register instance +python manage.py setup_instance $INSTANCE_ADMIN_EMAIL + +exec gunicorn -w "$GUNICORN_WORKERS" -k uvicorn.workers.UvicornWorker plane.asgi:application --bind 0.0.0.0:"${PORT:-8000}" --max-requests 1200 --max-requests-jitter 1000 --access-logfile - \ No newline at end of file diff --git a/apiserver/bin/takeoff.cloud b/apiserver/bin/docker-entrypoint-api-ee.sh old mode 100644 new mode 100755 similarity index 52% rename from apiserver/bin/takeoff.cloud rename to apiserver/bin/docker-entrypoint-api-ee.sh index 18feb40875..8d8913d221 --- a/apiserver/bin/takeoff.cloud +++ b/apiserver/bin/docker-entrypoint-api-ee.sh @@ -1,7 +1,8 @@ #!/bin/bash set -e python manage.py wait_for_db -python manage.py migrate +# Wait for migrations +python manage.py wait_for_migrations # Create the default bucket #!/bin/bash @@ -18,11 +19,21 @@ SIGNATURE=$(echo "$HOSTNAME$MAC_ADDRESS$CPU_INFO$MEMORY_INFO$DISK_INFO" | sha256 # Export the variables export MACHINE_SIGNATURE=$SIGNATURE +export SKIP_ENV_VAR=1 + +# License check +python manage.py license_check # Register instance -python manage.py setup_instance $INSTANCE_ADMIN_EMAIL +python manage.py register_instance "$MACHINE_SIGNATURE" + +# Load the configuration variable +python manage.py configure_instance # Create the default bucket python manage.py create_bucket -exec gunicorn -w $GUNICORN_WORKERS -k uvicorn.workers.UvicornWorker plane.asgi:application --bind 0.0.0.0:${PORT:-8000} --max-requests 1200 --max-requests-jitter 1000 --access-logfile - +# Clear Cache before starting to remove stale values +python manage.py clear_cache + +exec gunicorn -w "$GUNICORN_WORKERS" -k uvicorn.workers.UvicornWorker plane.asgi:application --bind 0.0.0.0:"${PORT:-8000}" --max-requests 1200 --max-requests-jitter 1000 --access-logfile -