|
| 1 | +x-common-env: &common-env |
| 2 | + |
| 3 | + GNUPGHOME: /root/.gnupg/ |
| 4 | + GALAXY_IMPORTER_CONFIG: /src/galaxy_ng/profiles/insights/galaxy-importer/galaxy-importer.cfg |
| 5 | + |
| 6 | + DJANGO_SUPERUSER_USERNAME: admin |
| 7 | + DJANGO_SUPERUSER_EMAIL: admin@example.com |
| 8 | + DJANGO_SUPERUSER_PASSWORD: admin |
| 9 | + |
| 10 | + POSTGRES_USER: galaxy_ng |
| 11 | + POSTGRES_PASSWORD: galaxy_ng |
| 12 | + POSTGRES_DB: galaxy_ng |
| 13 | + |
| 14 | + # no spying |
| 15 | + PULP_ANALYTICS: 'false' |
| 16 | + |
| 17 | + # normally goes into settings.py ... |
| 18 | + PULP_DATABASES__default__ENGINE: django.db.backends.postgresql |
| 19 | + PULP_DATABASES__default__NAME: galaxy_ng |
| 20 | + PULP_DATABASES__default__USER: galaxy_ng |
| 21 | + PULP_DATABASES__default__PASSWORD: galaxy_ng |
| 22 | + PULP_DATABASES__default__HOST: postgres |
| 23 | + PULP_DATABASES__default__PORT: 5432 |
| 24 | + |
| 25 | + PULP_DEBUG: 1 |
| 26 | + PULP_GALAXY_DEPLOYMENT_MODE: 'insights' |
| 27 | + PULP_RH_ENTITLEMENT_REQUIRED: 'insights' |
| 28 | + PULP_DEFAULT_FILE_STORAGE: "pulpcore.app.models.storage.FileSystem" |
| 29 | + PULP_REDIRECT_TO_OBJECT_STORAGE: 'false' |
| 30 | + |
| 31 | + # Hostname and prefix has to be correct |
| 32 | + PULP_GALAXY_API_PATH_PREFIX: '/api/automation-hub/' |
| 33 | + PULP_CONTENT_PATH_PREFIX: '/pulp/content/' |
| 34 | + PULP_ANSIBLE_API_HOSTNAME: 'https://localhost' |
| 35 | + PULP_ANSIBLE_CONTENT_HOSTNAME: "https://localhost" |
| 36 | + PULP_CONTENT_ORIGIN: "https://localhost" |
| 37 | + PULP_CSRF_TRUSTED_ORIGINS: "['https://localhost']" |
| 38 | + |
| 39 | + # auth ... |
| 40 | + PULP_GALAXY_AUTHENTICATION_CLASSES: "['galaxy_ng.app.auth.auth.RHIdentityAuthentication']" |
| 41 | + |
| 42 | + PULP_GALAXY_FEATURE_FLAGS__dab_resource_registry: 'false' |
| 43 | + PULP_GALAXY_REQUIRE_CONTENT_APPROVAL: 'true' |
| 44 | + PULP_GALAXY_AUTO_SIGN_COLLECTIONS: 'false' |
| 45 | + |
| 46 | + # Resource server |
| 47 | + # This disables the attempt for resource syncing |
| 48 | + PULP_RESOURCE_SERVER_SYNC_ENABLED: 'false' |
| 49 | + # Set above to 'true' if/when RESOURCE_SERVER is configured |
| 50 | + # The next variables must be configured to enable resource sync |
| 51 | + # PULP_RESOURCE_SERVER__URL='https://localhost' |
| 52 | + # PULP_RESOURCE_SERVER__SECRET_KEY='?' |
| 53 | + # PULP_RESOURCE_SERVER__VALIDATE_HTTPS='false' |
| 54 | + |
| 55 | + # Integration test settings |
| 56 | + HUB_AUTH_URL: "{API_PROTOCOL}://{API_HOST}:{INSIGHTS_PROXY_PORT}/auth/realms/redhat-external/protocol/openid-connect/token" |
| 57 | + HUB_API_ROOT: "{API_PROTOCOL}://{API_HOST}:{INSIGHTS_PROXY_PORT}{PULP_GALAXY_API_PATH_PREFIX}" |
| 58 | + HUB_LOCAL: 0 |
| 59 | + HUB_TEST_MARKS: deployment_cloud or all |
| 60 | + |
| 61 | + # Unpin dependencies on setup.py if set to 0 |
| 62 | + LOCK_REQUIREMENTS: 0 |
| 63 | + |
| 64 | + # DEV EDITABLE STUFF |
| 65 | + # To enable editable to install local checkouts set DEV_SOURCE_PATH keeping the ordering as follows: |
| 66 | + # "dynaconf:pulpcore:galaxy_importer:pulp_ansible:pulp_container:galaxy_ng:django-ansible-base" |
| 67 | + # This can be done as part of the `docker compose` call: |
| 68 | + # $ DEV_SOURCE_PATH="pulp_container:galaxy_ng" docker compose -f dev/compose/aap.yaml up |
| 69 | + DEV_SOURCE_PATH: |
| 70 | + |
| 71 | + |
| 72 | +services: |
| 73 | + base_img: |
| 74 | + build: |
| 75 | + context: ../../ |
| 76 | + dockerfile: Dockerfile |
| 77 | + image: "localhost/galaxy_ng/galaxy_ng:base" |
| 78 | + |
| 79 | + base_img_dev: # Extends base_img with extra files and dev tools |
| 80 | + depends_on: |
| 81 | + - base_img |
| 82 | + build: |
| 83 | + context: . |
| 84 | + dockerfile: Dockerfile.dev |
| 85 | + args: |
| 86 | + <<: *common-env |
| 87 | + image: "localhost/galaxy_ng/galaxy_ng:dev" |
| 88 | + |
| 89 | + proxy: |
| 90 | + build: |
| 91 | + context: "../../profiles/insights/proxy" |
| 92 | + ports: |
| 93 | + - "8080:8080" |
| 94 | + environment: |
| 95 | + UPSTREAM_URL: "http://api:24817" |
| 96 | + PROXY_PORT: "8080" |
| 97 | + volumes: |
| 98 | + - "../../profiles/insights/proxy:/app:ro" |
| 99 | + |
| 100 | + redis: |
| 101 | + image: "redis:5" |
| 102 | + |
| 103 | + postgres: |
| 104 | + image: "postgres:13" |
| 105 | + ports: |
| 106 | + - '5433:5432' |
| 107 | + environment: |
| 108 | + <<: *common-env |
| 109 | + healthcheck: |
| 110 | + test: ["CMD", "pg_isready", "-U", "galaxy_ng"] |
| 111 | + interval: 10s |
| 112 | + retries: 5 |
| 113 | + # Uncomment below to spam out every DB statement to the service stderr |
| 114 | + # WARNING: enabling log_statement=all makes database slower |
| 115 | + # command: ["postgres", "-c", "log_statement=ddl", "-c", "log_destination=stderr"] |
| 116 | + |
| 117 | + migrations: |
| 118 | + image: "localhost/galaxy_ng/galaxy_ng:dev" |
| 119 | + depends_on: |
| 120 | + - base_img_dev |
| 121 | + - postgres |
| 122 | + volumes: |
| 123 | + - "etc_pulp_certs:/etc/pulp/certs" |
| 124 | + - "var_lib_pulp:/var/lib/pulp" |
| 125 | + - "../../../:/src" |
| 126 | + - "../../:/app" |
| 127 | + environment: |
| 128 | + <<: *common-env |
| 129 | + user: root |
| 130 | + command: | |
| 131 | + bash -c " |
| 132 | + set -e; |
| 133 | + rm -rf /var/lib/pulp/.migrated; |
| 134 | + /src/galaxy_ng/dev/compose/bin/devinstall; |
| 135 | +
|
| 136 | + pulpcore-manager check --database default; |
| 137 | + pulpcore-manager migrate; |
| 138 | + pulpcore-manager shell < /src/galaxy_ng/dev/common/setup_test_data.py; |
| 139 | + pulpcore-manager createsuperuser --noinput || true; |
| 140 | +
|
| 141 | + touch /var/lib/pulp/.migrated; |
| 142 | + " |
| 143 | +
|
| 144 | + api: |
| 145 | + image: "localhost/galaxy_ng/galaxy_ng:dev" |
| 146 | + depends_on: |
| 147 | + - base_img_dev |
| 148 | + - postgres |
| 149 | + - migrations |
| 150 | + volumes: |
| 151 | + - "etc_pulp_certs:/etc/pulp/certs" |
| 152 | + - "var_lib_pulp:/var/lib/pulp" |
| 153 | + - "../../../:/src" |
| 154 | + - "../../:/app" |
| 155 | + environment: |
| 156 | + <<: *common-env |
| 157 | + extra_hosts: |
| 158 | + localhost: "host-gateway" |
| 159 | + networks: |
| 160 | + - default |
| 161 | + - service-mesh |
| 162 | + user: root |
| 163 | + command: | |
| 164 | + bash -c " |
| 165 | + /src/galaxy_ng/dev/compose/bin/wait /var/lib/pulp/.migrated; |
| 166 | + /src/galaxy_ng/dev/compose/bin/devinstall; |
| 167 | + /src/galaxy_ng/dev/compose/bin/reloader /venv/bin/pulpcore-api |
| 168 | + " |
| 169 | +
|
| 170 | + content: |
| 171 | + image: "localhost/galaxy_ng/galaxy_ng:dev" |
| 172 | + depends_on: |
| 173 | + - base_img_dev |
| 174 | + - postgres |
| 175 | + - migrations |
| 176 | + volumes: |
| 177 | + - "etc_pulp_certs:/etc/pulp/certs" |
| 178 | + - "var_lib_pulp:/var/lib/pulp" |
| 179 | + - "../../../:/src" |
| 180 | + - "../../:/app" |
| 181 | + environment: |
| 182 | + <<: *common-env |
| 183 | + extra_hosts: |
| 184 | + localhost: "host-gateway" |
| 185 | + networks: |
| 186 | + - default |
| 187 | + - service-mesh |
| 188 | + user: root |
| 189 | + command: | |
| 190 | + bash -c " |
| 191 | + /src/galaxy_ng/dev/compose/bin/wait /var/lib/pulp/.migrated; |
| 192 | + /src/galaxy_ng/dev/compose/bin/devinstall; |
| 193 | + /src/galaxy_ng/dev/compose/bin/reloader /venv/bin/pulpcore-content |
| 194 | + " |
| 195 | +
|
| 196 | + worker: |
| 197 | + image: "localhost/galaxy_ng/galaxy_ng:dev" |
| 198 | + depends_on: |
| 199 | + - base_img_dev |
| 200 | + - postgres |
| 201 | + - migrations |
| 202 | + volumes: |
| 203 | + - "etc_pulp_certs:/etc/pulp/certs" |
| 204 | + - "var_lib_pulp:/var/lib/pulp" |
| 205 | + - "../../../:/src" |
| 206 | + - "../../:/app" |
| 207 | + environment: |
| 208 | + <<: *common-env |
| 209 | + user: root |
| 210 | + command: | |
| 211 | + bash -c " |
| 212 | + /src/galaxy_ng/dev/compose/bin/wait /var/lib/pulp/.migrated; |
| 213 | + /src/galaxy_ng/dev/compose/bin/devinstall; |
| 214 | +
|
| 215 | + # Worker needs gpg in order to consume signing tasks; |
| 216 | + gpg --list-secret-keys; |
| 217 | +
|
| 218 | + /src/galaxy_ng/dev/compose/bin/reloader /venv/bin/pulpcore-worker |
| 219 | + " |
| 220 | +
|
| 221 | + manager: |
| 222 | + image: "localhost/galaxy_ng/galaxy_ng:dev" |
| 223 | + depends_on: |
| 224 | + - base_img_dev |
| 225 | + - postgres |
| 226 | + - migrations |
| 227 | + - worker |
| 228 | + volumes: |
| 229 | + - "etc_pulp_certs:/etc/pulp/certs" |
| 230 | + - "var_lib_pulp:/var/lib/pulp" |
| 231 | + - "../../../:/src" |
| 232 | + - "../../:/app" |
| 233 | + environment: |
| 234 | + <<: *common-env |
| 235 | + user: root |
| 236 | + command: | |
| 237 | + bash -c " |
| 238 | + /src/galaxy_ng/dev/compose/bin/wait /var/lib/pulp/.migrated; |
| 239 | + /src/galaxy_ng/dev/compose/bin/devinstall; |
| 240 | +
|
| 241 | + # Give some time for API to start; |
| 242 | + sleep 5; |
| 243 | +
|
| 244 | + # Setup repository gpgkey for upload verification; |
| 245 | + /src/galaxy_ng/dev/compose/signing/setup_repo_keyring.sh; |
| 246 | +
|
| 247 | + echo ' '; |
| 248 | + echo '###################### API ROOT ##############################'; |
| 249 | + curl -s -k -u org-admin:redhat http://proxy:8080/api/automation-hub/ | python -m json.tool; |
| 250 | + echo '################### DEV_SOURCE_PATH ##########################'; |
| 251 | + echo $$DEV_SOURCE_PATH; |
| 252 | + echo ' '; |
| 253 | + echo '######################## READY ###############################'; |
| 254 | + echo ' '; |
| 255 | + echo 'Credentials: org-admin:redhat OR jdoe:redhat'; |
| 256 | + echo 'API Spec: http://localhost:5001/api/automation-hub/v3/swagger-ui/'; |
| 257 | + echo 'API Spec proxy:http://localhost:8080/api/automation-hub/v3/swagger-ui/'; |
| 258 | + echo 'Django Admin: docker compose -f dev/compose/aap.yaml exec manager pulpcore-manager'; |
| 259 | + echo 'Settings list: docker compose -f dev/compose/aap.yaml exec manager dynaconf list'; |
| 260 | + echo 'Docs: https://github.com/ansible/galaxy_ng/blob/master/dev/compose/README.md'; |
| 261 | + echo '##############################################################'; |
| 262 | +
|
| 263 | + # Keep it running indefinitely to enable `docker compose -f ... exec manager /bin/bash`; |
| 264 | + tail -f /dev/null |
| 265 | + " |
| 266 | +
|
| 267 | + nginx: |
| 268 | + image: "nginx:latest" |
| 269 | + depends_on: |
| 270 | + - postgres |
| 271 | + - migrations |
| 272 | + - api |
| 273 | + - content |
| 274 | + ports: |
| 275 | + - '5001:5001' |
| 276 | + volumes: |
| 277 | + - '../nginx/nginx.conf:/etc/nginx/nginx.conf:ro' |
| 278 | + |
| 279 | +volumes: |
| 280 | + var_lib_pulp: |
| 281 | + name: var_lib_pulp |
| 282 | + etc_pulp_certs: |
| 283 | + name: etc_pulp_certs |
| 284 | + |
| 285 | +networks: |
| 286 | + service-mesh: |
| 287 | + name: service-mesh |
0 commit comments