mirror of
https://github.com/wassname/Open-Assistant.git
synced 2026-07-05 17:30:48 +08:00
Merge pull request #405 from rasdani/main
Added Redis and Redis Insight to Ansible playbook.
This commit is contained in:
@@ -0,0 +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`.
|
||||
@@ -10,6 +10,39 @@
|
||||
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
|
||||
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: oasst-redis-insights
|
||||
image: redislabs/redisinsight:latest
|
||||
state: started
|
||||
restart_policy: always
|
||||
network_mode: oasst
|
||||
ports:
|
||||
- 8001:8001
|
||||
|
||||
- name: Create postgres containers
|
||||
community.docker.docker_container:
|
||||
name: "{{ item.name }}"
|
||||
@@ -51,6 +84,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"
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
maxmemory 100mb
|
||||
maxmemory-policy allkeys-lru
|
||||
@@ -0,0 +1,2 @@
|
||||
[test]
|
||||
dev ansible_connection=local
|
||||
Reference in New Issue
Block a user