Updates to production container builds for new repository

This commit is contained in:
Matthew Jones
2017-08-03 10:39:04 -04:00
parent 6bf7d850f4
commit af3652bb2f
9 changed files with 58 additions and 70 deletions

View File

@@ -12,8 +12,6 @@ USER root
ADD https://github.com/krallin/tini/releases/download/v0.14.0/tini /tini
RUN chmod +x /tini
# Tower Dependencies Install
# TODO: Probably only need Tower dependencies here
ADD Makefile /tmp/Makefile
RUN mkdir /tmp/requirements
ADD requirements/requirements_ansible.txt \
@@ -29,18 +27,18 @@ RUN yum -y install epel-release && yum -y localinstall http://download.postgresq
RUN pip install virtualenv supervisor
WORKDIR /tmp
RUN mkdir -p /var/lib/awx/public/static
# TODO: Handlers could be stripped of this
RUN mkdir -p /var/log/tower
RUN mkdir -p /etc/tower
RUN echo "ansibletower" > /etc/tower/SECRET_KEY
RUN VENV_BASE=/var/lib/awx/venv make requirements_ansible && VENV_BASE=/var/lib/awx/venv make requirements_tower
COPY dist/ansible-tower-3.2.0.tar.gz /tmp/ansible-tower-3.2.0.tar.gz
RUN pip install /tmp/ansible-tower-3.2.0.tar.gz
# TODO: Replace this with the actual version
RUN echo "3.2.0" > /var/lib/awx/.tower_version
RUN echo "awxsecret" > /etc/tower/SECRET_KEY
RUN VENV_BASE=/var/lib/awx/venv make requirements_ansible && VENV_BASE=/var/lib/awx/venv make requirements_awx
COPY dist/{{ tar }} /tmp/{{ tar }}
RUN OFFICIAL=yes pip install /tmp/{{ tar }}
RUN echo "{{ version }}" > /var/lib/awx/.tower_version
ADD installer/openshift/nginx.conf /etc/nginx/nginx.conf
ADD installer/openshift/supervisor.conf /supervisor.conf
ADD installer/openshift/launch_tower.sh /usr/bin/launch_tower.sh
ADD installer/openshift/launch_awx.sh /usr/bin/launch_awx.sh
ADD installer/openshift/settings.py /etc/tower/settings.py
RUN yum -y remove gcc postgresql-devel libxml2-devel libxslt-devel cyrus-sasl-devel openldap-devel xmlsec1-devel krb5-devel xmlsec1-openssl-devel libtool-ltdl-devel gcc-c++ python-devel && yum -y clean all
RUN rm -rf /root/.cache
@@ -51,4 +49,4 @@ USER 1000
EXPOSE 8052
WORKDIR /var/lib/awx
ENTRYPOINT ["/tini", "--"]
CMD /usr/bin/launch_tower.sh
CMD /usr/bin/launch_awx.sh

View File

@@ -12,7 +12,7 @@ USER root
ADD https://github.com/krallin/tini/releases/download/v0.14.0/tini /tini
RUN chmod +x /tini
# Tower Dependencies Install
# AWX Dependencies Install
ADD Makefile /tmp/Makefile
RUN mkdir /tmp/requirements
ADD requirements/requirements_ansible.txt \
@@ -28,19 +28,19 @@ RUN yum -y install epel-release && yum -y localinstall http://download.postgresq
RUN pip install virtualenv supervisor
WORKDIR /tmp
RUN mkdir -p /var/lib/awx
# TODO: Handlers could be stripped of this
RUN mkdir -p /var/log/tower
RUN mkdir -p /etc/tower
RUN mkdir -p /var/lib/awx/public/static
RUN echo "ansibletower" > /etc/tower/SECRET_KEY
RUN VENV_BASE=/var/lib/awx/venv make requirements_ansible && VENV_BASE=/var/lib/awx/venv make requirements_tower
COPY dist/ansible-tower-3.2.0.tar.gz /tmp/ansible-tower-3.2.0.tar.gz
RUN pip install /tmp/ansible-tower-3.2.0.tar.gz
# TODO: Replace this with the actual version
RUN echo "3.2.0" > /var/lib/awx/.tower_version
RUN echo "awxsecret" > /etc/tower/SECRET_KEY
RUN VENV_BASE=/var/lib/awx/venv make requirements_ansible && VENV_BASE=/var/lib/awx/venv make requirements_awx
COPY dist/{{ tar }} /tmp/{{ tar }}
RUN OFFICIAL=yes pip install /tmp/{{ tar }}
RUN echo "{{ version }}" > /var/lib/awx/.tower_version
ADD installer/openshift/nginx.conf /etc/nginx/nginx.conf
ADD installer/openshift/supervisor_task.conf /supervisor_task.conf
ADD installer/openshift/launch_tower_task.sh /usr/bin/launch_tower_task.sh
ADD installer/openshift/launch_awx_task.sh /usr/bin/launch_awx_task.sh
ADD installer/openshift/settings.py /etc/tower/settings.py
RUN yum -y remove gcc postgresql-devel libxml2-devel libxslt-devel cyrus-sasl-devel openldap-devel xmlsec1-devel krb5-devel xmlsec1-openssl-devel libtool-ltdl-devel gcc-c++ python-devel && yum -y clean all
RUN rm -rf /root/.cache
@@ -50,4 +50,4 @@ USER 1000
EXPOSE 80 443
WORKDIR /var/lib/awx
ENTRYPOINT ["/tini", "--"]
CMD /usr/bin/launch_tower_task.sh
CMD /usr/bin/launch_awx_task.sh

View File

@@ -11,6 +11,9 @@ data:
ADMINS = ()
DEBUG = True
# Container environments don't like chroots
AWX_PROOT_ENABLED = False
#Autoprovisioning should replace this
CLUSTER_HOST_ID = socket.gethostname()
SYSTEM_UUID = '00000000-0000-0000-0000-000000000000'
@@ -44,12 +47,14 @@ data:
LOGGING['loggers']['social']['handlers'] = ['console']
LOGGING['loggers']['system_tracking_migrations']['handlers'] = ['console']
LOGGING['loggers']['rbac_migrations']['handlers'] = ['console']
LOGGING['loggers']['awx.isolated.manager.playbooks']['handlers'] = ['console']
LOGGING['handlers']['callback_receiver'] = {'class': 'logging.NullHandler'}
LOGGING['handlers']['fact_receiver'] = {'class': 'logging.NullHandler'}
LOGGING['handlers']['task_system'] = {'class': 'logging.NullHandler'}
LOGGING['handlers']['tower_warnings'] = {'class': 'logging.NullHandler'}
LOGGING['handlers']['rbac_migrations'] = {'class': 'logging.NullHandler'}
LOGGING['handlers']['system_tracking_migrations'] = {'class': 'logging.NullHandler'}
LOGGING['handlers']['management_playbooks'] = {'class': 'logging.NullHandler'}
DATABASES = {
'default': {

View File

@@ -4,5 +4,5 @@ if [ `id -u` -ge 10000 ]; then
cat /tmp/passwd > /etc/passwd
rm /tmp/passwd
fi
tower-manage collectstatic --noinput --clear
awx-manage collectstatic --noinput --clear
supervisord -c /supervisor.conf

View File

@@ -5,9 +5,9 @@ if [ `id -u` -ge 10000 ]; then
rm /tmp/passwd
fi
ANSIBLE_REMOTE_TEMP=/tmp ANSIBLE_LOCAL_TEMP=/tmp ansible -i "127.0.0.1," -c local -v -m postgresql_db -U $DATABASE_USER -a "name=$DATABASE_NAME owner=$DATABASE_USER login_user=$DATABASE_USER login_host=$DATABASE_HOST login_password=$DATABASE_PASSWORD" all
tower-manage migrate --noinput --fake-initial
echo "from django.contrib.auth.models import User; User.objects.create_superuser('admin', 'root@localhost', 'password')" | tower-manage shell
tower-manage create_preload_data
tower-manage register_instance --hostname=$(hostname)
tower-manage register_queue --queuename=tower --hostnames=$(hostname)
awx-manage migrate --noinput --fake-initial
echo "from django.contrib.auth.models import User; User.objects.create_superuser('admin', 'root@localhost', 'password')" | awx-manage shell
awx-manage create_preload_data
awx-manage register_instance --hostname=$(hostname)
awx-manage register_queue --queuename=tower --hostnames=$(hostname)
supervisord -c /supervisor_task.conf

View File

@@ -13,7 +13,7 @@ stderr_logfile=/dev/stderr
stderr_logfile_maxbytes=0
[program:uwsgi]
command = /var/lib/awx/venv/tower/bin/uwsgi --socket 127.0.0.1:8050 --module=awx.wsgi:application --vacuum --processes=5 --harakiri=120 --no-orphans --master --max-requests=1000 --master-fifo=/var/lib/awx/awxfifo --lazy-apps -b 32768
command = /var/lib/awx/venv/awx/bin/uwsgi --socket 127.0.0.1:8050 --module=awx.wsgi:application --vacuum --processes=5 --harakiri=120 --no-orphans --master --max-requests=1000 --master-fifo=/var/lib/awx/awxfifo --lazy-apps -b 32768
directory = /var/lib/awx
autostart = true
2autorestart = true
@@ -25,7 +25,7 @@ stderr_logfile=/dev/stderr
stderr_logfile_maxbytes=0
[program:daphne]
command = /var/lib/awx/venv/tower/bin/daphne -b 127.0.0.1 -p 8051 awx.asgi:channel_layer
command = /var/lib/awx/venv/awx/bin/daphne -b 127.0.0.1 -p 8051 awx.asgi:channel_layer
directory = /var/lib/awx
autostart = true
autorestart = true

View File

@@ -4,7 +4,7 @@ umask = 022
[program:celery]
# TODO: Needs to be reworked to dynamically use instance group queues
command = tower-manage celery worker -l debug --autoscale=4 -Ofair -Q tower_scheduler,tower_broadcast_all,tower,%(host_node_name)s -n celery@localhost
command = awx-manage celery worker -l debug --autoscale=4 -Ofair -Q tower_scheduler,tower_broadcast_all,tower,%(host_node_name)s -n celery@localhost
directory = /var/lib/awx
environment = LANGUAGE="en_US.UTF-8",LANG="en_US.UTF-8",LC_ALL="en_US.UTF-8",LC_CTYPE="en_US.UTF-8"
#user = {{ aw_user }}
@@ -17,7 +17,7 @@ stderr_logfile=/dev/stderr
stderr_logfile_maxbytes=0
[program:awx-celeryd-beat]
command = /usr/bin/tower-manage celery beat -l debug --pidfile= -s /var/lib/awx/beat.db
command = /usr/bin/awx-manage celery beat -l debug --pidfile= -s /var/lib/awx/beat.db
directory = /var/lib/awx
autostart = true
autorestart = true
@@ -29,18 +29,7 @@ stderr_logfile = /dev/stderr
stderr_logfile_maxbytes = 0
[program:callback-receiver]
command = tower-manage run_callback_receiver
directory = /var/lib/awx
autostart = true
autorestart = true
stopwaitsecs = 5
stdout_logfile=/dev/stdout
stdout_logfile_maxbytes=0
stderr_logfile=/dev/stderr
stderr_logfile_maxbytes=0
[program:fact-cache-receiver]
command = tower-manage run_fact_cache_receiver
command = awx-manage run_callback_receiver
directory = /var/lib/awx
autostart = true
autorestart = true
@@ -51,7 +40,7 @@ stderr_logfile=/dev/stderr
stderr_logfile_maxbytes=0
[program:channels-worker]
command = tower-manage runworker --only-channels websocket.*
command = awx-manage runworker --only-channels websocket.*
directory = /var/lib/awx
autostart = true
autorestart = true
@@ -62,7 +51,7 @@ stderr_logfile=/dev/stderr
stderr_logfile_maxbytes=0
[group:tower-processes]
programs=celery,callback-receiver,channels-worker,fact-cache-receiver
programs=celery,callback-receiver,channels-worker
priority=5
# TODO: Exit Handler