Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix the postgresql database not being preserved #477

Merged
merged 3 commits into from
Nov 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion .github/workflows/pulp_images.yml
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,10 @@ jobs:
echo "Working around https://bugs.launchpad.net/ubuntu/+source/libpod/+bug/2024394"
curl -O http://archive.ubuntu.com/ubuntu/pool/universe/g/golang-github-containernetworking-plugins/containernetworking-plugins_1.1.1+ds1-3_amd64.deb
sudo dpkg -i containernetworking-plugins_1.1.1+ds1-3_amd64.deb
pip install httpie podman-compose
# Ubuntu 22.04 has old podman 3.4.4, we need podman-compose==1.0.3 to avoid an
# error with dependency contianers not being detected as running.
# "error generating dependency graph for container"
pip install httpie podman-compose==1.0.3
shell: bash

- name: Build images
Expand Down Expand Up @@ -254,8 +257,12 @@ jobs:
- name: Compose up
run: |
if [[ "${{ matrix.app.image_name }}" == "pulp" || "${{ matrix.app.image_name }}" == "galaxy" ]]; then

# Reuse the folders from the s6 mode tests
FILE="compose.folders.yml"
echo "host all all 10.0.0.0/8 trust" | sudo tee -a pgsql/data/pg_hba.conf > /dev/null
echo "listen_addresses = '*'" | sudo tee -a pgsql/data/postgresql.conf > /dev/null

# We'll pull the web image from a registry since we didn't build it.
if [ "${{ matrix.image_variant }}" == "nightly" ]; then
WEB_TAG="nightly"
Expand Down
1 change: 1 addition & 0 deletions CHANGES/468.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix the postgresql database not being preserved for docker-compose.
4 changes: 2 additions & 2 deletions images/compose/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ docker-compose scale pulp_api=4 pulp_content=4
pip install podman-compose
git clone git@github.com:pulp/pulp-oci-images.git
cd images/compose
mkdir ../../pgsql ../../pulp_storage
mkdir -p ../../pgsql/data ../../pulp_storage
podman unshare chown 700:700 ../../pulp_storage
podman-compose -f compose.folders.yml up
```
Expand All @@ -39,7 +39,7 @@ podman-compose -f compose.folders.yml up
pip install podman-compose
git clone git@github.com:pulp/pulp-oci-images.git
cd images/compose
mkdir ../../pgsql ../../pulp_storage
mkdir -p ../../pgsql/data ../../pulp_storage
sudo chown 700:700 ../../pulp_storage
podman-compose -f compose.folders.yml up
```
10 changes: 5 additions & 5 deletions images/compose/compose.folders.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ services:
POSTGRES_INITDB_ARGS: '--auth-host=scram-sha-256'
POSTGRES_HOST_AUTH_METHOD: 'scram-sha-256'
volumes:
- "../../pgsql:/var/lib/postgresql:Z"
- "../../pgsql/data:/var/lib/postgresql/data:Z"
- "./assets/postgres/passwd:/etc/passwd:Z"
restart: always
healthcheck:
test: [ "CMD-SHELL", "pg_isready -U pulp" ]
test: pg_isready -U pulp
interval: 10s
timeout: 5s
retries: 5
Expand All @@ -26,7 +26,7 @@ services:
- "redis_data:/data"
restart: always
healthcheck:
test: [ "CMD-SHELL", "redis-cli ping" ]
test: redis-cli ping
interval: 10s
timeout: 5s
retries: 5
Expand Down Expand Up @@ -107,7 +107,7 @@ services:
- "../../pulp_storage:/var/lib/pulp:z"
restart: always
healthcheck:
test: [ "CMD-SHELL", "readyz.py /pulp/api/v3/status/" ]
test: readyz.py /pulp/api/v3/status/
interval: 10s
timeout: 5s
retries: 5
Expand All @@ -132,7 +132,7 @@ services:
- "../../pulp_storage:/var/lib/pulp:z"
restart: always
healthcheck:
test: [ "CMD-SHELL", "readyz.py /pulp/content/" ]
test: readyz.py /pulp/content
interval: 10s
timeout: 5s
retries: 5
Expand Down
10 changes: 5 additions & 5 deletions images/compose/compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ services:
POSTGRES_INITDB_ARGS: '--auth-host=scram-sha-256'
POSTGRES_HOST_AUTH_METHOD: 'scram-sha-256'
volumes:
- "pg_data:/var/lib/postgresql"
- "pg_data:/var/lib/postgresql/data"
- "./assets/postgres/passwd:/etc/passwd:Z"
restart: always
healthcheck:
test: [ "CMD-SHELL", "pg_isready -U pulp" ]
test: pg_isready -U pulp
interval: 10s
timeout: 5s
retries: 5
Expand All @@ -26,7 +26,7 @@ services:
- "redis_data:/data"
restart: always
healthcheck:
test: [ "CMD-SHELL", "redis-cli ping" ]
test: redis-cli ping
interval: 10s
timeout: 5s
retries: 5
Expand Down Expand Up @@ -109,7 +109,7 @@ services:
- "pulp:/var/lib/pulp"
restart: always
healthcheck:
test: [ "CMD-SHELL", "readyz.py /pulp/api/v3/status/" ]
test: readyz.py /pulp/api/v3/status/
interval: 10s
timeout: 5s
retries: 5
Expand All @@ -134,7 +134,7 @@ services:
- "pulp:/var/lib/pulp"
restart: always
healthcheck:
test: [ "CMD-SHELL", "readyz.py /pulp/content/" ]
test: readyz.py /pulp/content/
interval: 10s
timeout: 5s
retries: 5
Expand Down
Loading