diff --git a/.github/workflows/pulp_images.yml b/.github/workflows/pulp_images.yml index eed5a55e..54a23bab 100644 --- a/.github/workflows/pulp_images.yml +++ b/.github/workflows/pulp_images.yml @@ -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 @@ -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" diff --git a/CHANGES/468.bugfix b/CHANGES/468.bugfix new file mode 100644 index 00000000..421d7662 --- /dev/null +++ b/CHANGES/468.bugfix @@ -0,0 +1 @@ +Fix the postgresql database not being preserved for docker-compose. diff --git a/images/compose/README.md b/images/compose/README.md index 9fe85327..351dd07c 100644 --- a/images/compose/README.md +++ b/images/compose/README.md @@ -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 ``` @@ -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 ``` diff --git a/images/compose/compose.folders.yml b/images/compose/compose.folders.yml index 37cb2b50..b2a8a9e2 100644 --- a/images/compose/compose.folders.yml +++ b/images/compose/compose.folders.yml @@ -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 @@ -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 @@ -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 @@ -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 diff --git a/images/compose/compose.yml b/images/compose/compose.yml index 187c5f7e..6a57a298 100644 --- a/images/compose/compose.yml +++ b/images/compose/compose.yml @@ -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 @@ -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 @@ -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 @@ -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