redis socket support

This commit is contained in:
chris meyers
2020-03-05 14:19:46 -05:00
committed by Ryan Petrello
parent d58df0f34a
commit 770b457430
26 changed files with 95 additions and 91 deletions

View File

@@ -24,7 +24,6 @@ services:
#entrypoint: ["bash"]
environment:
CURRENT_UID:
BROKER_URL: "redis://redis_1:63791"
SDB_HOST: 0.0.0.0
SDB_PORT: 5899
AWX_GROUP_QUEUES: alpha,tower
@@ -32,6 +31,7 @@ services:
working_dir: "/awx_devel"
volumes:
- "../:/awx_devel"
- "./redis/redis_socket_ha_1:/var/run/redis/"
ports:
- "5899-5999:5899-5999"
awx-2:
@@ -44,12 +44,12 @@ services:
working_dir: "/awx_devel"
environment:
CURRENT_UID:
BROKER_URL: "redis://redis_2:63792"
SDB_HOST: 0.0.0.0
SDB_PORT: 7899
AWX_GROUP_QUEUES: bravo,tower
volumes:
- "../:/awx_devel"
- "./redis/redis_socket_ha_2:/var/run/redis/"
ports:
- "7899-7999:7899-7999"
awx-3:
@@ -63,39 +63,42 @@ services:
working_dir: "/awx_devel"
environment:
CURRENT_UID:
BROKER_URL: "redis://redis_3:63793"
SDB_HOST: 0.0.0.0
SDB_PORT: 8899
AWX_GROUP_QUEUES: charlie,tower
volumes:
- "../:/awx_devel"
- "./redis/redis_socket_ha_3:/var/run/redis/"
ports:
- "8899-8999:8899-8999"
redis_1:
user: ${CURRENT_UID}
image: redis:latest
hostname: redis_1
container_name: tools_redis_1_1
command: "redis-server /usr/local/etc/redis/redis.conf"
command: ["/usr/local/etc/redis/redis.conf"]
volumes:
- "./redis/redis_1.conf:/usr/local/etc/redis/redis.conf"
- "./redis/redis.conf:/usr/local/etc/redis/redis.conf"
- "./redis/redis_socket_ha_1:/var/run/redis/"
ports:
- "63791:63791"
redis_2:
user: ${CURRENT_UID}
image: redis:latest
hostname: redis_2
container_name: tools_redis_2_1
command: "redis-server /usr/local/etc/redis/redis.conf"
command: ["/usr/local/etc/redis/redis.conf"]
volumes:
- "./redis/redis_2.conf:/usr/local/etc/redis/redis.conf"
- "./redis/redis.conf:/usr/local/etc/redis/redis.conf"
- "./redis/redis_socket_ha_2:/var/run/redis/"
ports:
- "63792:63792"
redis_3:
user: ${CURRENT_UID}
image: redis:latest
hostname: redis_3
container_name: tools_redis_3_1
command: "redis-server /usr/local/etc/redis/redis.conf"
command: ["/usr/local/etc/redis/redis.conf"]
volumes:
- "./redis/redis_3.conf:/usr/local/etc/redis/redis.conf"
- "./redis/redis.conf:/usr/local/etc/redis/redis.conf"
- "./redis/redis_socket_ha_3:/var/run/redis/"
ports:
- "63793:63793"
postgres:

View File

@@ -32,6 +32,7 @@ services:
volumes:
- "../:/awx_devel"
- "../awx/projects/:/var/lib/awx/projects/"
- "./redis/redis_socket_standalone:/var/run/redis/"
privileged: true
# A useful container that simply passes through log messages to the console
# helpful for testing awx/tower logging
@@ -58,4 +59,8 @@ services:
container_name: tools_redis_1
ports:
- "6379:6379"
user: ${CURRENT_UID}
volumes:
- "./redis/redis.conf:/usr/local/etc/redis/redis.conf"
- "./redis/redis_socket_standalone:/var/run/redis/"
command: ["/usr/local/etc/redis/redis.conf"]

View File

@@ -4,6 +4,7 @@ set +x
# Wait for the databases to come up
ansible -i "127.0.0.1," -c local -v -m wait_for -a "host=postgres port=5432" all
ansible -i "127.0.0.1," -c local -v -m wait_for -a "host=memcached port=11211" all
ansible -i "127.0.0.1," -c local -v -m wait_for -a "path=/var/run/redis/redis.sock" all
# In case AWX in the container wants to connect to itself, use "docker exec" to attach to the container otherwise
# TODO: FIX

10
tools/redis/redis.conf Normal file
View File

@@ -0,0 +1,10 @@
unixsocket /var/run/redis/redis.sock
unixsocketperm 770
port 0
# Do not actually listen to any tcp port
# but include the bind directive because without it redis will
# listen on the public interface. Port 0 causes it to NOT listen on
# the public interface. Adding the below line is an extra precaution.
# If a developer comes by later and wants to listen on a tcp port and changes
# the above port, it will ONLY listen on the local interface.
bind 127.0.0.1

View File

@@ -1,4 +0,0 @@
protected-mode no
port 63791
dir .
logfile "/tmp/redis.log"

View File

@@ -1,4 +0,0 @@
protected-mode no
port 63792
dir .
logfile "/tmp/redis.log"

View File

@@ -1,4 +0,0 @@
protected-mode no
port 63793
dir .
logfile "/tmp/redis.log"

View File

@@ -0,0 +1 @@
This dir must pre-exist and be owned by the user you are launching awx dev env as. If the dir does not exist before launching the awx dev environment then docker will create the dir and it will be owned by root. Since we start our awx dev environment with user: ${CURRENT_UID} the redis container will be unable to create a socket file in a directory owned by root.

View File

@@ -0,0 +1 @@
This dir must pre-exist and be owned by the user you are launching awx dev env as. If the dir does not exist before launching the awx dev environment then docker will create the dir and it will be owned by root. Since we start our awx dev environment with user: ${CURRENT_UID} the redis container will be unable to create a socket file in a directory owned by root.

View File

@@ -0,0 +1 @@
This dir must pre-exist and be owned by the user you are launching awx dev env as. If the dir does not exist before launching the awx dev environment then docker will create the dir and it will be owned by root. Since we start our awx dev environment with user: ${CURRENT_UID} the redis container will be unable to create a socket file in a directory owned by root.

View File

@@ -0,0 +1 @@
This dir must pre-exist and be owned by the user you are launching awx dev env as. If the dir does not exist before launching the awx dev environment then docker will create the dir and it will be owned by root. Since we start our awx dev environment with user: ${CURRENT_UID} the redis container will be unable to create a socket file in a directory owned by root.