From 55a4cf1fd096f49583365bfac31e6c62636204a6 Mon Sep 17 00:00:00 2001 From: d_auras Date: Thu, 5 Jan 2023 11:12:11 +0100 Subject: [PATCH 1/8] finally hooked up redis insights to redis --- ansible/dev.yaml | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/ansible/dev.yaml b/ansible/dev.yaml index d022ba3c..04252c0d 100644 --- a/ansible/dev.yaml +++ b/ansible/dev.yaml @@ -10,6 +10,42 @@ state: present driver: bridge + - name: Set up Redis + community.docker.docker_container: + name: redis + #name: oasst-redis + image: redis + state: started + restart_policy: always + network_mode: oasst + ports: + - 6379:6379 + healthcheck: + test: ["CMD-SHELL", "redis-cli ping | grep PONG"] + interval: 2s + timeout: 2s + retries: 10 + command: redis-server /usr/local/etc/redis/redis.conf + volumes: + - "./redis.conf:/usr/local/etc/redis/redis.conf" + + - name: Set up Redis Insights + community.docker.docker_container: + name: redis-insights + #name: oasst-redis-insights + image: redislabs/redisinsight:latest + #command: pip install redis-cli python entry.pyc + state: started + restart_policy: always + network_mode: oasst + ports: + - 8001:8001 + env: + REDIS_URL: redis://redis:6379 + REDIS_HOST: redis + #environment: + #- REDIS_URL=redis://redis:6379 + - name: Create postgres containers community.docker.docker_container: name: "{{ item.name }}" From 8921b4f8dd9d2157f5e69b3bd1b231d08c0baec3 Mon Sep 17 00:00:00 2001 From: d_auras Date: Thu, 5 Jan 2023 11:31:13 +0100 Subject: [PATCH 2/8] added test files and README, ready for pull request --- ansible/README.md | 3 +++ ansible/dev.yaml | 12 ++---------- ansible/test.inventory.ini | 2 ++ 3 files changed, 7 insertions(+), 10 deletions(-) create mode 100644 ansible/README.md create mode 100644 ansible/test.inventory.ini diff --git a/ansible/README.md b/ansible/README.md new file mode 100644 index 00000000..b15bf75c --- /dev/null +++ b/ansible/README.md @@ -0,0 +1,3 @@ +To test the ansible playbook on localhost run ```ansible-playbook -i test.inventory.ini dev.yaml```. +Point Redis Insights to the Redis database by visiting localhost:8001 in a browser and select "I already have a database" followed by "Connect to a Redis Database". +For host, port and name fill in ```oasst-redis```, ```6379``` and ```redis```. diff --git a/ansible/dev.yaml b/ansible/dev.yaml index 04252c0d..c9195966 100644 --- a/ansible/dev.yaml +++ b/ansible/dev.yaml @@ -12,8 +12,7 @@ - name: Set up Redis community.docker.docker_container: - name: redis - #name: oasst-redis + name: oasst-redis image: redis state: started restart_policy: always @@ -31,20 +30,13 @@ - name: Set up Redis Insights community.docker.docker_container: - name: redis-insights - #name: oasst-redis-insights + name: oasst-redis-insights image: redislabs/redisinsight:latest - #command: pip install redis-cli python entry.pyc state: started restart_policy: always network_mode: oasst ports: - 8001:8001 - env: - REDIS_URL: redis://redis:6379 - REDIS_HOST: redis - #environment: - #- REDIS_URL=redis://redis:6379 - name: Create postgres containers community.docker.docker_container: diff --git a/ansible/test.inventory.ini b/ansible/test.inventory.ini new file mode 100644 index 00000000..bfe6d93f --- /dev/null +++ b/ansible/test.inventory.ini @@ -0,0 +1,2 @@ +[test] +dev ansible_connection=local From 43227b2cdcd241534355a5c8b075966bcc0d2b05 Mon Sep 17 00:00:00 2001 From: d_auras Date: Thu, 5 Jan 2023 11:42:02 +0100 Subject: [PATCH 3/8] fixed line breaks in README --- ansible/README.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/ansible/README.md b/ansible/README.md index b15bf75c..b8bd2a48 100644 --- a/ansible/README.md +++ b/ansible/README.md @@ -1,3 +1,4 @@ -To test the ansible playbook on localhost run ```ansible-playbook -i test.inventory.ini dev.yaml```. -Point Redis Insights to the Redis database by visiting localhost:8001 in a browser and select "I already have a database" followed by "Connect to a Redis Database". -For host, port and name fill in ```oasst-redis```, ```6379``` and ```redis```. +To test the ansible playbook on localhost run ```ansible-playbook -i test.inventory.ini dev.yaml```.\ +In case you're missing the ansible docker depencency install it with ```ansible-galaxy collection install community.docker```.\ +Point Redis Insights to the Redis database by visiting localhost:8001 in a browser and select "I already have a database" followed by "Connect to a Redis Database".\ +For host, port and name fill in ```oasst-redis```, ```6379``` and ```redis```.\ From aa09245f7346b02bb13e6c0767993ecdd1f18393 Mon Sep 17 00:00:00 2001 From: d_auras Date: Thu, 5 Jan 2023 11:44:39 +0100 Subject: [PATCH 4/8] fixed last trailing line break in README --- ansible/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ansible/README.md b/ansible/README.md index b8bd2a48..370f9e1e 100644 --- a/ansible/README.md +++ b/ansible/README.md @@ -1,4 +1,4 @@ To test the ansible playbook on localhost run ```ansible-playbook -i test.inventory.ini dev.yaml```.\ In case you're missing the ansible docker depencency install it with ```ansible-galaxy collection install community.docker```.\ Point Redis Insights to the Redis database by visiting localhost:8001 in a browser and select "I already have a database" followed by "Connect to a Redis Database".\ -For host, port and name fill in ```oasst-redis```, ```6379``` and ```redis```.\ +For host, port and name fill in ```oasst-redis```, ```6379``` and ```redis```. From d379193bed67db15fd9c56929320cc0fc1c7eccd Mon Sep 17 00:00:00 2001 From: rasdani <73563550+rasdani@users.noreply.github.com> Date: Thu, 5 Jan 2023 16:15:20 +0100 Subject: [PATCH 5/8] add REDIS_HOST environment variable to backend to comply fully with `docker-compose.yaml` --- ansible/dev.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/ansible/dev.yaml b/ansible/dev.yaml index ca2a11d9..eea49a3e 100644 --- a/ansible/dev.yaml +++ b/ansible/dev.yaml @@ -79,6 +79,7 @@ network_mode: oasst env: POSTGRES_HOST: oasst-postgres + REDIS_HOST: oasst-redis DEBUG_ALLOW_ANY_API_KEY: "true" DEBUG_USE_SEED_DATA: "true" MAX_WORKERS: "1" From a40e6ec31d17f988d7154b663263de5d15d4d740 Mon Sep 17 00:00:00 2001 From: d_auras Date: Thu, 5 Jan 2023 16:25:58 +0100 Subject: [PATCH 6/8] ran pre-commit again --- ansible/README.md | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/ansible/README.md b/ansible/README.md index 370f9e1e..2ab1943e 100644 --- a/ansible/README.md +++ b/ansible/README.md @@ -1,4 +1,7 @@ -To test the ansible playbook on localhost run ```ansible-playbook -i test.inventory.ini dev.yaml```.\ -In case you're missing the ansible docker depencency install it with ```ansible-galaxy collection install community.docker```.\ -Point Redis Insights to the Redis database by visiting localhost:8001 in a browser and select "I already have a database" followed by "Connect to a Redis Database".\ -For host, port and name fill in ```oasst-redis```, ```6379``` and ```redis```. +To test the ansible playbook on localhost run +`ansible-playbook -i test.inventory.ini dev.yaml`.\ +In case you're missing the ansible docker depencency install it with `ansible-galaxy collection install community.docker`.\ +Point Redis Insights to the Redis database by visiting localhost:8001 in a +browser and select "I already have a database" followed by "Connect to a Redis +Database".\ +For host, port and name fill in `oasst-redis`, `6379` and `redis`. From 2870524aa780f55b2bd03d7d1aad1516864f187b Mon Sep 17 00:00:00 2001 From: d_auras Date: Fri, 6 Jan 2023 20:03:15 +0100 Subject: [PATCH 7/8] ansible copies redis.conf to managed node now --- ansible/dev.yaml | 5 +++++ ansible/redis.conf | 2 ++ ansible/remote.inventory.ini | 3 +++ 3 files changed, 10 insertions(+) create mode 100644 ansible/redis.conf create mode 100644 ansible/remote.inventory.ini diff --git a/ansible/dev.yaml b/ansible/dev.yaml index eea49a3e..90f7a85a 100644 --- a/ansible/dev.yaml +++ b/ansible/dev.yaml @@ -10,6 +10,11 @@ state: present driver: bridge + - name: Copy redis.conf to managed node + ansible.builtin.copy: + src: ./redis.conf + dest: ./redis.conf + - name: Set up Redis community.docker.docker_container: name: oasst-redis diff --git a/ansible/redis.conf b/ansible/redis.conf new file mode 100644 index 00000000..58da1e05 --- /dev/null +++ b/ansible/redis.conf @@ -0,0 +1,2 @@ +maxmemory 100mb +maxmemory-policy allkeys-lru diff --git a/ansible/remote.inventory.ini b/ansible/remote.inventory.ini new file mode 100644 index 00000000..a3afb2df --- /dev/null +++ b/ansible/remote.inventory.ini @@ -0,0 +1,3 @@ +[dev] +;list your remote hosts here +ubuntu-ssh From c1dab2d213e4c6684edb78e1b0b6de5f672ea64a Mon Sep 17 00:00:00 2001 From: d_auras Date: Fri, 6 Jan 2023 21:46:51 +0100 Subject: [PATCH 8/8] deleted my remote.inventory.ini --- ansible/remote.inventory.ini | 3 --- 1 file changed, 3 deletions(-) delete mode 100644 ansible/remote.inventory.ini diff --git a/ansible/remote.inventory.ini b/ansible/remote.inventory.ini deleted file mode 100644 index a3afb2df..00000000 --- a/ansible/remote.inventory.ini +++ /dev/null @@ -1,3 +0,0 @@ -[dev] -;list your remote hosts here -ubuntu-ssh