Skip to content

Commit 137f733

Browse files
committed
added oasst postgres
1 parent 4285438 commit 137f733

3 files changed

Lines changed: 11 additions & 27 deletions

File tree

ansible/deploy-to-node.yaml

Lines changed: 8 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -57,15 +57,22 @@
5757
- name: Create postgres containers
5858
community.docker.docker_container:
5959
name: "oasst-{{ stack_name }}-postgres-{{ item.name }}"
60-
image: postgres:15
60+
image: ghcr.io/laion-ai/open-assistant/oasst-postgres
6161
state: started
62+
pull: true
6263
recreate: "{{ (stack_name == 'dev') | bool }}"
6364
restart_policy: always
6465
network_mode: "oasst-{{ stack_name }}"
6566
env:
6667
POSTGRES_USER: postgres
6768
POSTGRES_PASSWORD: "{{ postgres_password }}"
6869
POSTGRES_DB: postgres
70+
S3_BUCKET_NAME:
71+
"{{ lookup('ansible.builtin.env', 'S3_BUCKET_NAME') }}"
72+
AWS_ACCESS_KEY_ID:
73+
"{{ lookup('ansible.builtin.env', 'AWS_ACCESS_KEY') }}"
74+
AWS_SECRET_ACCESS_KEY:
75+
"{{ lookup('ansible.builtin.env', 'AWS_SECRET_KEY') }}"
6976
volumes:
7077
- "oasst-{{ stack_name }}-postgres-{{ item.name
7178
}}:/var/lib/postgresql/data"
@@ -78,30 +85,6 @@
7885
- name: backend
7986
- name: web
8087

81-
- name: Copy pgbackrest.conf to managed node
82-
ansible.builtin.copy:
83-
src: ./pgbackrest.conf
84-
dest: "./{{ stack_name }}/pgbackrest.conf"
85-
mode: 0644
86-
87-
- name: Create pgbackrest container
88-
community.docker.docker_container:
89-
name: "oasst-{{ stack_name }}-pgbackrest"
90-
image: woblerr/pgbackrest:2.43
91-
state: "{{ 'started' if stack_name == 'production' else 'absent' }}"
92-
network_mode: "oasst-{{ stack_name }}"
93-
entrypoint: ["/bin/bash", "-c", "sleep infinity"]
94-
volumes:
95-
- "./{{ stack_name }}/pgbackrest.conf:/etc/pgbackrest/pgbackrest.conf"
96-
- "oasst-{{ stack_name }}-postgres-backend:/var/lib/postgresql/data"
97-
env:
98-
PGBACKREST_REPO1_S3_BUCKET:
99-
"{{ lookup('ansible.builtin.env', 'S3_BUCKET_NAME') }}"
100-
PGBACKREST_REPO1_S3_KEY:
101-
"{{ lookup('ansible.builtin.env', 'AWS_ACCESS_KEY') }}"
102-
PGBACKREST_REPO1_S3_KEY_SECRET:
103-
"{{ lookup('ansible.builtin.env', 'AWS_SECRET_KEY') }}"
104-
10588
- name: Run the oasst oasst-backend
10689
community.docker.docker_container:
10790
name: "oasst-{{ stack_name }}-backend"

docker-compose.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@ services:
1818

1919
# This DB is for the FastAPI Backend.
2020
db:
21-
image: postgres
21+
image: ghcr.io/laion-ai/open-assistant/oasst-postgres
22+
pull_policy: always
2223
restart: always
2324
ports:
2425
- 5432:5432

docker/Dockerfile.postgres

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM postgres
1+
FROM postgres:15
22

33
# install unzip
44
RUN apt-get update && apt-get install -y unzip curl && rm -rf /var/lib/apt/lists/*

0 commit comments

Comments
 (0)