forked from ansible/galaxy_ng
-
Notifications
You must be signed in to change notification settings - Fork 0
/
aap_compose_dev.yaml
236 lines (213 loc) · 6.46 KB
/
aap_compose_dev.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
x-common-env: &common-env
DJANGO_SUPERUSER_USERNAME: admin
DJANGO_SUPERUSER_EMAIL: [email protected]
DJANGO_SUPERUSER_PASSWORD: admin
POSTGRES_USER: galaxy_ng
POSTGRES_PASSWORD: galaxy_ng
POSTGRES_DB: galaxy_ng
# no spying
PULP_ANALYTICS: 'false'
# normally goes into settings.py ...
PULP_DATABASES__default__ENGINE: django.db.backends.postgresql
PULP_DATABASES__default__NAME: galaxy_ng
PULP_DATABASES__default__USER: galaxy_ng
PULP_DATABASES__default__PASSWORD: galaxy_ng
PULP_DATABASES__default__HOST: postgres
PULP_DATABASES__default__PORT: 5432
PULP_DEBUG: 1
PULP_GALAXY_DEPLOYMENT_MODE: 'standalone'
PULP_DEFAULT_FILE_STORAGE: "pulpcore.app.models.storage.FileSystem"
PULP_REDIRECT_TO_OBJECT_STORAGE: 'false'
# Hostname and prefix has to be correct
PULP_GALAXY_API_PATH_PREFIX: '/api/galaxy/'
PULP_CONTENT_PATH_PREFIX: '/pulp/content/'
PULP_ANSIBLE_API_HOSTNAME: 'https://localhost'
PULP_ANSIBLE_CONTENT_HOSTNAME: "https://localhost"
PULP_CONTENT_ORIGIN: "https://localhost"
PULP_CSRF_TRUSTED_ORIGINS: "['https://localhost']"
# signing ...
ENABLE_SIGNING: 0
PULP_GALAXY_AUTO_SIGN_COLLECTIONS: 'false'
PULP_GALAXY_REQUIRE_CONTENT_APPROVAL: 'true'
PULP_GALAXY_REQUIRE_SIGNATURE_FOR_APPROVAL: 'false'
PULP_GALAXY_COLLECTION_SIGNING_SERVICE: 'ansible-default'
PULP_GALAXY_CONTAINER_SIGNING_SERVICE: 'container-default'
# pulp container ...
PULP_TOKEN_AUTH_DISABLED: 'false'
PULP_TOKEN_SERVER: 'https://localhost/token/'
PULP_TOKEN_SIGNATURE_ALGORITHM: 'ES256'
PULP_PUBLIC_KEY_PATH: '/src/galaxy_ng/dev/common/container_auth_public_key.pem'
PULP_PRIVATE_KEY_PATH: '/src/galaxy_ng/dev/common/container_auth_private_key.pem'
# auth ...
PULP_GALAXY_AUTHENTICATION_CLASSES: "['galaxy_ng.app.auth.session.SessionAuthentication', 'ansible_base.jwt_consumer.hub.auth.HubJWTAuth', 'rest_framework.authentication.TokenAuthentication', 'rest_framework.authentication.BasicAuthentication']"
PULP_ANSIBLE_BASE_JWT_VALIDATE_CERT: 'false'
PULP_ANSIBLE_BASE_JWT_KEY: 'https://localhost'
PULP_GALAXY_FEATURE_FLAGS__external_authentication: 'true'
# disable user/group modifications
PULP_ALLOW_LOCAL_RESOURCE_MANAGEMENT: 'false'
# role content workaround ..
PULP_ANSIBLE_BASE_ROLES_REQUIRE_VIEW: 'false'
services:
base_img:
build:
context: .
dockerfile: Dockerfile
image: "localhost/galaxy_ng/galaxy_ng:base"
redis:
image: "redis:5"
postgres:
image: "postgres:13"
ports:
- '5433:5432'
environment:
<<: *common-env
healthcheck:
test: ["CMD", "pg_isready", "-U", "galaxy_ng"]
interval: 10s
retries: 5
command: ["postgres", "-c", "log_statement=all", "-c", "log_destination=stderr"]
helper:
image: quay.io/centos/centos:stream9
environment:
<<: *common-env
depends_on:
- postgres
volumes:
- "etc_pulp_certs:/etc/pulp/certs"
- "var_lib_pulp:/var/lib/pulp"
command: |
bash -c "
if [[ ! -e /etc/pulp/certs/database_fields.symmetric.key ]] || [[ -s /etc/pulp/certs/database_fields.symmetric.key ]]; then
mkdir -p /etc/pulp/certs/;
echo 'check openssl and install ...';
rpm -q openssl || dnf -y install openssl;
echo 'generate key ...';
openssl rand -base64 32 > /etc/pulp/certs/database_fields.symmetric.key;
echo 'chown key ...';
chmod 640 /etc/pulp/certs/database_fields.symmetric.key;
else
echo 'symmetric key exists'
fi;
find /etc/pulp ;
echo '# KEY >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>';
cat /etc/pulp/certs/database_fields.symmetric.key;
echo '<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<';
echo "DONE!";
"
migrations:
image: "localhost/galaxy_ng/galaxy_ng:base"
depends_on:
- base_img
- postgres
- helper
volumes:
- "etc_pulp_certs:/etc/pulp/certs"
- "var_lib_pulp:/var/lib/pulp"
- ".:/src/galaxy_ng"
environment:
<<: *common-env
user: root
command: |
bash -c "
set -e;
while [[ ! -f /etc/pulp/certs/database_fields.symmetric.key ]]; do
echo 'Waiting for key';
sleep 2;
done;
pulpcore-manager check --database default;
pulpcore-manager migrate;
touch /var/lib/pulp/.migrated;
pulpcore-manager shell < /src/galaxy_ng/dev/common/setup_test_data.py;
pulpcore-manager createsuperuser --noinput;
"
api:
image: "localhost/galaxy_ng/galaxy_ng:base"
depends_on:
- base_img
- postgres
- helper
- migrations
volumes:
- "etc_pulp_certs:/etc/pulp/certs"
- "var_lib_pulp:/var/lib/pulp"
- ".:/src/galaxy_ng"
environment:
<<: *common-env
extra_hosts:
localhost: "host-gateway"
networks:
- default
- service-mesh
command: |
bash -c "
while [[ ! -f /var/lib/pulp/.migrated ]]; do
echo 'Waiting for migrations ...';
sleep 2;
done && exec pulpcore-api --reload;
"
content:
image: "localhost/galaxy_ng/galaxy_ng:base"
depends_on:
- base_img
- postgres
- helper
- migrations
volumes:
- "etc_pulp_certs:/etc/pulp/certs"
- "var_lib_pulp:/var/lib/pulp"
- ".:/src/galaxy_ng"
environment:
<<: *common-env
extra_hosts:
localhost: "host-gateway"
networks:
- default
- service-mesh
command: |
bash -c "
while [[ ! -f /var/lib/pulp/.migrated ]]; do
echo 'Waiting for migrations ...';
sleep 2;
done && exec pulpcore-content --reload;
"
worker:
image: "localhost/galaxy_ng/galaxy_ng:base"
depends_on:
- base_img
- postgres
- helper
- migrations
volumes:
- "etc_pulp_certs:/etc/pulp/certs"
- "var_lib_pulp:/var/lib/pulp"
- ".:/src/galaxy_ng"
environment:
<<: *common-env
command: |
bash -c "
while [[ ! -f /var/lib/pulp/.migrated ]]; do
echo 'Waiting for migrations ...';
sleep 2;
done && exec pulpcore-worker;
"
nginx:
image: "nginx:latest"
depends_on:
- base_img
- postgres
- helper
- migrations
- api
- content
ports:
- '5001:5001'
volumes:
- './dev/nginx/nginx.conf:/etc/nginx/nginx.conf:ro'
volumes:
var_lib_pulp:
name: var_lib_pulp
etc_pulp_certs:
name: etc_pulp_certs
networks:
service-mesh:
name: service-mesh