Skip to content

Commit 98b36a0

Browse files
committed
updated ci environments to fix vaule
1 parent 6ea59f3 commit 98b36a0

6 files changed

Lines changed: 100 additions & 59 deletions

File tree

.github/workflows/test-square.yml

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ on:
55
pull_request:
66
push:
77
tags:
8-
- 'v*'
8+
- "v*"
99
branches:
1010
- master
1111
- release-*
@@ -32,13 +32,13 @@ jobs:
3232
if [[ ! "$REF" =~ ^release-.* ]]; then
3333
REF="master"
3434
fi
35-
35+
3636
EVENT_NAME=${{ github.event_name }}
3737
# Fallback to pull_request for manual triggers
3838
if [ "$EVENT_NAME" = "workflow_dispatch" ]; then
3939
EVENT_NAME="pull_request"
4040
fi
41-
41+
4242
# SECURITY: curl output piped to GITHUB_OUTPUT -- ensure tyktechnologies.github.io is trusted
4343
curl -s -L --retry 5 --retry-delay 10 --fail-with-body "https://tyktechnologies.github.io/gromit/v2/$VARIATION/tyk-pro/$REF/$EVENT_NAME/api.gho" | tee -a "$GITHUB_OUTPUT"
4444
if ! [[ $VARIATION =~ prod ]] ;then
@@ -83,7 +83,7 @@ jobs:
8383
- id: ecr
8484
uses: aws-actions/amazon-ecr-login@183a1442edf41672e66566b7fc560e297a290896 # v2
8585
with:
86-
mask-password: 'true'
86+
mask-password: "true"
8787
- name: Setup tmate session only in debug mode
8888
uses: mxschmitt/action-tmate@c0afd6f790e3a5564914980036ebf83216678101 # v3
8989
if: runner.debug == '1'
@@ -101,7 +101,7 @@ jobs:
101101
working-directory: auto
102102
id: env_up
103103
env:
104-
pull_policy: 'if_not_present'
104+
pull_policy: "if_not_present"
105105
GH_TOKEN: ${{ steps.app-token.outputs.token }}
106106
TYK_DB_LICENSEKEY: ${{ secrets.DASH_LICENSE }}
107107
TYK_MDCB_LICENSE: ${{ secrets.MDCB_LICENSE }}
@@ -164,8 +164,8 @@ jobs:
164164
echo "Current commit: $(git rev-parse HEAD)"
165165
- uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5
166166
with:
167-
cache: 'pip'
168-
python-version: '3.10'
167+
cache: "pip"
168+
python-version: "3.10"
169169
- name: Run API tests
170170
id: test_execution
171171
working-directory: tyk-analytics/tests/api
@@ -190,6 +190,7 @@ jobs:
190190
USER_API_SECRET=${{ steps.env_up.outputs.USER_API_SECRET }}
191191
TYK_TEST_KEYCLOAK_INTERNAL_URL=http://keycloak:8080
192192
TYK_TEST_MCP_URL=http://mcp-server:7878
193+
TYK_TEST_VAULT_URL=http://localhost:8200
193194
EOF
194195
env $(cat pytest.env | xargs) $pytest -m "${{ matrix.envfiles.apimarkers }}"
195196
- name: Generate metadata and upload test reports
@@ -220,7 +221,7 @@ jobs:
220221
if: failure() && (steps.test_execution.outcome != 'success' || steps.env_up.outcome != 'success')
221222
working-directory: auto
222223
env:
223-
pull_policy: 'if_not_present'
224+
pull_policy: "if_not_present"
224225
GH_TOKEN: ${{ steps.app-token.outputs.token }}
225226
TYK_DB_LICENSEKEY: ${{ secrets.DASH_LICENSE }}
226227
TYK_MDCB_LICENSE: ${{ secrets.MDCB_LICENSE }}
@@ -256,13 +257,13 @@ jobs:
256257
if [[ ! "$REF" =~ ^release-.* ]]; then
257258
REF="master"
258259
fi
259-
260+
260261
EVENT_NAME=${{ github.event_name }}
261262
# Fallback to pull_request for manual triggers
262263
if [ "$EVENT_NAME" = "workflow_dispatch" ]; then
263264
EVENT_NAME="pull_request"
264265
fi
265-
266+
266267
# SECURITY: curl output piped to GITHUB_OUTPUT -- ensure tyktechnologies.github.io is trusted
267268
curl -s -L --retry 5 --retry-delay 10 --fail-with-body "https://tyktechnologies.github.io/gromit/v2/$VARIATION/tyk-pro/$REF/$EVENT_NAME/ui.gho" | tee -a "$GITHUB_OUTPUT"
268269
if ! [[ $VARIATION =~ prod ]] ;then
@@ -307,7 +308,7 @@ jobs:
307308
- id: ecr
308309
uses: aws-actions/amazon-ecr-login@183a1442edf41672e66566b7fc560e297a290896 # v2
309310
with:
310-
mask-password: 'true'
311+
mask-password: "true"
311312
- name: Setup tmate session only in debug mode
312313
uses: mxschmitt/action-tmate@c0afd6f790e3a5564914980036ebf83216678101 # v3
313314
if: runner.debug == '1'
@@ -325,7 +326,7 @@ jobs:
325326
working-directory: auto
326327
id: env_up
327328
env:
328-
pull_policy: 'if_not_present'
329+
pull_policy: "if_not_present"
329330
GH_TOKEN: ${{ steps.app-token.outputs.token }}
330331
TYK_DB_LICENSEKEY: ${{ secrets.DASH_LICENSE }}
331332
TYK_MDCB_LICENSE: ${{ secrets.MDCB_LICENSE }}
@@ -391,7 +392,7 @@ jobs:
391392
with:
392393
node-version: "18.16"
393394
cache-dependency-path: tyk-analytics/tests/ui
394-
cache: 'npm'
395+
cache: "npm"
395396
- name: Fix private module deps
396397
env:
397398
TOKEN: ${{ steps.app-token.outputs.token }}
@@ -401,7 +402,7 @@ jobs:
401402
working-directory: tyk-analytics/tests/ui
402403
id: test_execution
403404
env:
404-
GW_URL: 'https://localhost:8080/'
405+
GW_URL: "https://localhost:8080/"
405406
NODE_TLS_REJECT_UNAUTHORIZED: 0
406407
UI_MARKERS: ${{ matrix.envfiles.uimarkers && format('--grep {0}', matrix.envfiles.uimarkers ) || '' }}
407408
run: "npm ci\nnpx playwright install --with-deps chromium\nPLAYWRIGHT_JUNIT_OUTPUT_NAME=${XUNIT_REPORT_PATH} npx playwright test --project=chromium --reporter=junit,html $UI_MARKERS \n"
@@ -411,7 +412,7 @@ jobs:
411412
env:
412413
AWS_ACCESS_KEY_ID: ${{ secrets.UI_AWS_ACCESS_KEY_ID }}
413414
AWS_SECRET_ACCESS_KEY: ${{ secrets.UI_AWS_SECRET_ACCESS_KEY }}
414-
RUN_ID: 'tyk-analytics/${{ github.run_id }}'
415+
RUN_ID: "tyk-analytics/${{ github.run_id }}"
415416
working-directory: tyk-analytics/tests/ui
416417
- name: Share S3 report link into summary
417418
if: failure() && steps.test_execution.outcome != 'success' && steps.env_up.outcome == 'success'
@@ -447,7 +448,7 @@ jobs:
447448
if: failure() && (steps.test_execution.outcome != 'success' || steps.env_up.outcome != 'success')
448449
working-directory: auto
449450
env:
450-
pull_policy: 'if_not_present'
451+
pull_policy: "if_not_present"
451452
GH_TOKEN: ${{ steps.app-token.outputs.token }}
452453
TYK_DB_LICENSEKEY: ${{ secrets.DASH_LICENSE }}
453454
TYK_MDCB_LICENSE: ${{ secrets.MDCB_LICENSE }}

deps_pro-ha.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,32 @@ services:
182182
- VAULT_DEV_LISTEN_ADDRESS=0.0.0.0:8200
183183
cap_add:
184184
- IPC_LOCK
185+
healthcheck:
186+
test: ["CMD", "vault", "status", "-address=http://127.0.0.1:8200"]
187+
interval: 5s
188+
retries: 10
189+
start_period: 3s
190+
timeout: 5s
191+
192+
vault-seed:
193+
profiles: ["all", "master-datacenter"]
194+
container_name: vault-seed
195+
image: curlimages/curl:latest
196+
depends_on:
197+
vault:
198+
condition: service_healthy
199+
entrypoint: ["/bin/sh", "-c"]
200+
command:
201+
- |
202+
set -e
203+
curl -sf -X POST -H "X-Vault-Token: root" -H "Content-Type: application/json" \
204+
-d '{"data": {"cert_file": "placeholder", "value": "placeholder"}}' \
205+
http://vault:8200/v1/secret/data/oauth/cert_file
206+
curl -sf -X POST -H "X-Vault-Token: root" -H "Content-Type: application/json" \
207+
-d '{"data": {"key_file": "placeholder", "value": "placeholder"}}' \
208+
http://vault:8200/v1/secret/data/oauth/key_file
209+
echo "Vault seeded with placeholder OAuth mTLS cert_file and key_file secrets"
210+
restart: "no"
185211

186212
upstream-auth-server:
187213
profiles: ["all", "master-datacenter"]

deps_pro.yml

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -120,8 +120,8 @@ services:
120120
environment:
121121
- VAULT_DEV_ROOT_TOKEN_ID=root
122122
- VAULT_DEV_LISTEN_ADDRESS=0.0.0.0:8200
123-
cap_add:
124-
- IPC_LOCK
123+
- VAULT_DISABLE_MLOCK=1
124+
- SKIP_SETCAP=1
125125
healthcheck:
126126
test: ["CMD", "vault", "status", "-address=http://127.0.0.1:8200"]
127127
interval: 5s
@@ -132,18 +132,20 @@ services:
132132
vault-seed:
133133
profiles: ["all", "master-datacenter"]
134134
container_name: vault-seed
135-
image: hashicorp/vault:latest
136-
environment:
137-
- VAULT_ADDR=http://vault:8200
138-
- VAULT_TOKEN=root
135+
image: curlimages/curl:latest
139136
depends_on:
140137
vault:
141138
condition: service_healthy
142139
entrypoint: ["/bin/sh", "-c"]
143140
command:
144141
- |
145-
vault kv put secret/oauth/cert_file cert_file="placeholder" value="placeholder"
146-
vault kv put secret/oauth/key_file key_file="placeholder" value="placeholder"
142+
set -e
143+
curl -sf -X POST -H "X-Vault-Token: root" -H "Content-Type: application/json" \
144+
-d '{"data": {"cert_file": "placeholder", "value": "placeholder"}}' \
145+
http://vault:8200/v1/secret/data/oauth/cert_file
146+
curl -sf -X POST -H "X-Vault-Token: root" -H "Content-Type: application/json" \
147+
-d '{"data": {"key_file": "placeholder", "value": "placeholder"}}' \
148+
http://vault:8200/v1/secret/data/oauth/key_file
147149
echo "Vault seeded with placeholder OAuth mTLS cert_file and key_file secrets"
148150
restart: "no"
149151

local-mongo44.env

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
TYK_DB_MONGOURL=mongodb://mongo:27017/tyk_analytics
2+
TYK_GW_HASHKEYFUNCTION=murmur128
23
TYK_GW_HASHKEYFUNCTION=sha256
34
TYK_GW_HASHKEYS=true
45
TYK_GW_SLAVEOPTIONS_APIKEY=<PLACEHOLDER>
@@ -12,13 +13,13 @@ TYK_MDCB_LOGLEVEL=debug
1213
TYK_MDCB_STORAGE_HOST=redis
1314
TYK_PMP_ANALYTICSSTORAGECONFIG_HOST=redis
1415
TYK_PMP_LOGLEVEL=debug
16+
TYK_PMP_PUMPS_MCPAGG_META_MONGOURL=mongodb://mongo:27017/tyk_analytics
17+
TYK_PMP_PUMPS_MCPAGG_META_USEMIXEDCOLLECTION=true
18+
TYK_PMP_PUMPS_MCPAGG_TYPE=mongo-mcp-aggregate
1519
TYK_PMP_PUMPS_MONGOAGGREGATE_META_MONGOURL=mongodb://mongo:27017/tyk_analytics
1620
TYK_PMP_PUMPS_MONGOAGGREGATE_META_TRACKALLPATHS=true
1721
TYK_PMP_PUMPS_MONGOAGGREGATE_META_USEMIXEDCOLLECTION=true
1822
TYK_PMP_PUMPS_MONGOAGGREGATE_TYPE=mongo-pump-aggregate
19-
TYK_PMP_PUMPS_MCPAGG_TYPE=mongo-mcp-aggregate
20-
TYK_PMP_PUMPS_MCPAGG_META_MONGOURL=mongodb://mongo:27017/tyk_analytics
21-
TYK_PMP_PUMPS_MCPAGG_META_USEMIXEDCOLLECTION=true
2223
TYK_PMP_PUMPS_MONGOSELECTIVE_META_MONGOURL=mongodb://mongo:27017/tyk_analytics
2324
TYK_PMP_PUMPS_MONGOSELECTIVE_META_TRACKALLPATHS=true
2425
TYK_PMP_PUMPS_MONGOSELECTIVE_META_USEMIXEDCOLLECTION=true

pro-ha.yml

Lines changed: 38 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@ services:
1515
- "6000:6000"
1616
- "8003:8003"
1717
- "8080:8080"
18+
restart: on-failure
19+
depends_on:
20+
vault-seed:
21+
condition: service_completed_successfully
1822
entrypoint: ["/opt/tyk-gateway/tyk"]
1923
command:
2024
- --conf
@@ -36,7 +40,7 @@ services:
3640
- "3000:3000"
3741
- "5000:5000"
3842
- "1026:1025"
39-
command: [ "--conf", "/conf/tyk-analytics.conf" ]
43+
command: ["--conf", "/conf/tyk-analytics.conf"]
4044
restart: on-failure
4145

4246
tyk-pump:
@@ -45,12 +49,12 @@ services:
4549
image: ${tyk_pump_image}
4650
pull_policy: ${pull_policy}
4751
env_file:
48-
- ${env_file}
52+
- ${env_file}
4953
volumes:
5054
- ${confs_dir}:/conf/
51-
ports:
55+
ports:
5256
- "8061:8061"
53-
command: [ "--conf", "/conf/tyk-pump.conf" ]
57+
command: ["--conf", "/conf/tyk-pump.conf"]
5458
depends_on:
5559
- wait_db
5660

@@ -66,9 +70,9 @@ services:
6670
volumes:
6771
- ${confs_dir}:/conf/
6872
ports:
69-
- "9090:9090"
73+
- "9090:9090"
7074
entrypoint: ["/opt/tyk-sink/tyk-sink", "--conf", "/conf/tyk-sink.conf"]
71-
75+
7276
tyk-gateway-datacenter-1-alfa:
7377
profiles: ["all", "slave-datacenter"]
7478
container_name: tyk-gateway-datacenter-1-alfa
@@ -85,7 +89,8 @@ services:
8589
- ${confs_dir}:/conf/
8690
ports:
8791
- "8181:8181"
88-
entrypoint: ["/opt/tyk-gateway/tyk", "--conf", "/conf/tyk-datacenter-1.conf"]
92+
entrypoint:
93+
["/opt/tyk-gateway/tyk", "--conf", "/conf/tyk-datacenter-1.conf"]
8994

9095
tyk-gateway-datacenter-1-beta:
9196
profiles: ["all", "slave-datacenter"]
@@ -103,7 +108,8 @@ services:
103108
- ${confs_dir}:/conf/
104109
ports:
105110
- "8182:8182"
106-
entrypoint: ["/opt/tyk-gateway/tyk", "--conf", "/conf/tyk-datacenter-1.conf"]
111+
entrypoint:
112+
["/opt/tyk-gateway/tyk", "--conf", "/conf/tyk-datacenter-1.conf"]
107113

108114
tyk-gateway-datacenter-2-alfa:
109115
profiles: ["all", "slave-datacenter"]
@@ -121,7 +127,8 @@ services:
121127
- ${confs_dir}:/conf/
122128
ports:
123129
- "8281:8281"
124-
entrypoint: ["/opt/tyk-gateway/tyk", "--conf", "/conf/tyk-datacenter-2.conf"]
130+
entrypoint:
131+
["/opt/tyk-gateway/tyk", "--conf", "/conf/tyk-datacenter-2.conf"]
125132

126133
tyk-gateway-datacenter-2-beta:
127134
profiles: ["all", "slave-datacenter"]
@@ -139,7 +146,8 @@ services:
139146
- ${confs_dir}:/conf/
140147
ports:
141148
- "8282:8282"
142-
entrypoint: ["/opt/tyk-gateway/tyk", "--conf", "/conf/tyk-datacenter-2.conf"]
149+
entrypoint:
150+
["/opt/tyk-gateway/tyk", "--conf", "/conf/tyk-datacenter-2.conf"]
143151

144152
tyk-gateway-datacenter-3-alfa:
145153
profiles: ["all", "slave-datacenter"]
@@ -158,7 +166,8 @@ services:
158166
- ${confs_dir}:/conf/
159167
ports:
160168
- "8381:8381"
161-
entrypoint: ["/opt/tyk-gateway/tyk", "--conf", "/conf/tyk-datacenter-3.conf"]
169+
entrypoint:
170+
["/opt/tyk-gateway/tyk", "--conf", "/conf/tyk-datacenter-3.conf"]
162171

163172
tyk-gateway-datacenter-3-beta:
164173
profiles: ["all", "slave-datacenter"]
@@ -177,7 +186,8 @@ services:
177186
- ${confs_dir}:/conf/
178187
ports:
179188
- "8382:8382"
180-
entrypoint: ["/opt/tyk-gateway/tyk", "--conf", "/conf/tyk-datacenter-3.conf"]
189+
entrypoint:
190+
["/opt/tyk-gateway/tyk", "--conf", "/conf/tyk-datacenter-3.conf"]
181191

182192
gateway-checker:
183193
profiles: ["all", "master-datacenter"]
@@ -289,25 +299,24 @@ services:
289299
profiles: ["all", "slave-datacenter"]
290300
image: hello-world:linux
291301
depends_on:
292-
gateway-checker-1a:
293-
condition: service_healthy
294-
gateway-checker-1b:
295-
condition: service_healthy
296-
gateway-checker-2a:
297-
condition: service_healthy
298-
gateway-checker-2b:
299-
condition: service_healthy
300-
gateway-checker-3a:
301-
condition: service_healthy
302-
gateway-checker-3b:
303-
condition: service_healthy
304-
302+
gateway-checker-1a:
303+
condition: service_healthy
304+
gateway-checker-1b:
305+
condition: service_healthy
306+
gateway-checker-2a:
307+
condition: service_healthy
308+
gateway-checker-2b:
309+
condition: service_healthy
310+
gateway-checker-3a:
311+
condition: service_healthy
312+
gateway-checker-3b:
313+
condition: service_healthy
305314

306315
wait_tyk_components:
307316
profiles: ["all", "master-datacenter"]
308317
image: hello-world:linux
309318
depends_on:
310-
gateway-checker:
311-
condition: service_healthy
312-
dashboard-checker:
313-
condition: service_healthy
319+
gateway-checker:
320+
condition: service_healthy
321+
dashboard-checker:
322+
condition: service_healthy

0 commit comments

Comments
 (0)