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 19, 2023
1 parent d42d7a6 commit 58573c6
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 24 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
24 changes: 20 additions & 4 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 All @@ -30,8 +42,8 @@ services:
image: "pulp/pulp-web:latest"
command: ['/usr/bin/nginx.sh']
depends_on:
postgres:
condition: service_healthy
# postgres:
# condition: service_healthy
pulp_api:
pulp_content:
ports:
Expand All @@ -52,6 +64,8 @@ services:
redis:
postgres:
condition: service_healthy
migration_service:
condition: service_completed_successfully
hostname: pulp-api
user: pulp
volumes:
Expand All @@ -71,6 +85,8 @@ services:
redis:
postgres:
condition: service_healthy
migration_service:
condition: service_completed_successfully
hostname: pulp-content
user: pulp
volumes:
Expand All @@ -86,8 +102,8 @@ services:
command: ['pulp-worker']
depends_on:
redis:
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 58573c6

Please sign in to comment.