Skip to content

Commit

Permalink
Split up some responsabilities from the entrypoint to a service conta…
Browse files Browse the repository at this point in the history
…iner.

Closes pulp#544
  • Loading branch information
decko committed Sep 20, 2023
1 parent acab2c7 commit ef88c6b
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 20 deletions.
14 changes: 0 additions & 14 deletions images/assets/pulp-api
Original file line number Diff line number Diff line change
@@ -1,18 +1,4 @@
#!/bin/bash -x

mkdir -p /var/lib/pulp/media \
/var/lib/pulp/assets \
/var/lib/pulp/tmp

/usr/bin/wait_on_postgres.py

# Get list of installed plugins via pip
# Assumes they are all named like "pulp-file" -> "file", with no 2nd dash.
# (Was previously needed when we ran `pulpcore-manager makemigrations`)
# PLUGINS=$(pip list | awk -F '[[:space:]]+|[-]' '/pulp-/{printf $2 " " }')

/usr/local/bin/pulpcore-manager migrate --noinput

set +x

if [ -n "${PULP_SIGNING_KEY_FINGERPRINT}" ]; then
Expand Down
3 changes: 0 additions & 3 deletions images/assets/pulp-content
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
#!/bin/bash -x

/usr/bin/wait_on_postgres.py
/usr/bin/wait_on_database_migrations.sh

if which pulpcore-content
then
PULP_CONTENT_ENTRYPOINT=("pulpcore-content")
Expand Down
3 changes: 0 additions & 3 deletions images/assets/pulp-worker
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
#!/bin/bash -x

/usr/bin/wait_on_postgres.py
/usr/bin/wait_on_database_migrations.sh

export PATH=/usr/local/bin:/usr/bin/
exec pulpcore-worker
18 changes: 18 additions & 0 deletions images/compose/compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,18 @@ services:
timeout: 5s
retries: 5

migration_service:
image: "pulp/pulp-minimal:latest"
depends_on:
postgres:
condition: service_healthy
restart: never
command: ['pulpcore-manager', 'migrate', '--noinput']
volumes:
- "./assets/settings.py:/etc/pulp/settings.py:z"
- "./assets/certs:/etc/pulp/certs:z"
- "pulp:/var/lib/pulp"

redis:
image: "docker.io/library/redis:latest"
volumes:
Expand Down Expand Up @@ -56,6 +68,8 @@ services:
condition: service_healthy
postgres:
condition: service_healthy
migration_service:
condition: service_completed_successfully
hostname: pulp-api
user: pulp
volumes:
Expand All @@ -81,6 +95,8 @@ services:
condition: service_healthy
postgres:
condition: service_healthy
migration_service:
condition: service_completed_successfully
hostname: pulp-content
user: pulp
volumes:
Expand All @@ -104,6 +120,8 @@ services:
condition: service_healthy
postgres:
condition: service_healthy
migration_service:
condition: service_completed_successfully
user: pulp
volumes:
- "./assets/settings.py:/etc/pulp/settings.py:z"
Expand Down

0 comments on commit ef88c6b

Please sign in to comment.