An orchestrator for managing a collection of Kubernetes Helm charts.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

entrypoint.sh 1.6KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. #!/bin/bash
  2. #
  3. # Copyright 2017 AT&T Intellectual Property. All other rights reserved.
  4. #
  5. # Licensed under the Apache License, Version 2.0 (the "License");
  6. # you may not use this file except in compliance with the License.
  7. # You may obtain a copy of the License at
  8. #
  9. # http://www.apache.org/licenses/LICENSE-2.0
  10. #
  11. # Unless required by applicable law or agreed to in writing, software
  12. # distributed under the License is distributed on an "AS IS" BASIS,
  13. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  14. # See the License for the specific language governing permissions and
  15. # limitations under the License.
  16. set -ex
  17. CMD="armada"
  18. # Define port
  19. ARMADA_UWSGI_PORT=${ARMADA_UWSGI_PORT:-8000}
  20. # How long uWSGI should wait for each Armada response
  21. ARMADA_UWSGI_TIMEOUT=${ARMADA_UWSGI_TIMEOUT:-3600}
  22. # Number of uWSGI workers to handle API requests
  23. ARMADA_UWSGI_WORKERS=${ARMADA_UWSGI_WORKERS:-4}
  24. # Threads per worker
  25. ARMADA_UWSGI_THREADS=${ARMADA_UWSGI_THREADS:-1}
  26. # Start Armada application
  27. # TODO(fmontei): Should be specifying callable too. But Armada spins up the
  28. # server during import in `armada.api.server`.
  29. if [ "$1" = 'server' ]; then
  30. exec uwsgi \
  31. -b 32768 \
  32. --die-on-term \
  33. --http :"${ARMADA_UWSGI_PORT}" \
  34. --http-timeout "$ARMADA_UWSGI_TIMEOUT" \
  35. --enable-threads \
  36. -L \
  37. --lazy-apps \
  38. --master \
  39. --paste config:/etc/armada/api-paste.ini \
  40. --pyargv "--config-file /etc/armada/armada.conf" \
  41. --threads "$ARMADA_UWSGI_THREADS" \
  42. --workers "$ARMADA_UWSGI_WORKERS"
  43. else
  44. exec $CMD "$@"
  45. fi