Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
ec75fa6
Microcks tests
mathieu-benoit Mar 13, 2026
acf9424
Add endpont provisioner for score-k8s
mathieu-benoit Mar 13, 2026
273a6e1
resources --> api-mocks folder support + _URL in trade-service for en…
mathieu-benoit Mar 14, 2026
1e9c225
doc
mathieu-benoit Mar 14, 2026
7353ae3
artifacts, name and version params
mathieu-benoit Mar 14, 2026
4473b20
fix new params in k8s provisioner
mathieu-benoit Mar 14, 2026
b7ae751
update ingress to use the mock endpoints
mathieu-benoit Mar 14, 2026
c13990d
Fix make doc
mathieu-benoit Mar 15, 2026
5ee21e5
microcks-uber - size: 65536
mathieu-benoit Mar 15, 2026
31c075d
Fix accountId: 52335
mathieu-benoit Mar 16, 2026
1415889
Fix restart: on-failure for each mock
mathieu-benoit Mar 16, 2026
46397d3
Add missing position-service Mock
mathieu-benoit Mar 16, 2026
96c46f0
Fix Mock endpoint in Ingress to http://microcks:8080 + add position-s…
mathieu-benoit Mar 16, 2026
f56a9ce
tmpfs.size: 655360, otherwise not able to import reference data
mathieu-benoit Mar 18, 2026
3dba720
../../.scripts/setup-kind-cluster.sh
mathieu-benoit Mar 18, 2026
55d23d5
PORT env var
mathieu-benoit Mar 19, 2026
4a23116
kubectl wait
mathieu-benoit Mar 19, 2026
1befbfe
Rename endpoint to service + more k8s wait commands
mathieu-benoit Mar 19, 2026
928f271
Fix url versus name with new service res type
mathieu-benoit Mar 19, 2026
2e41bdb
Merge branch 'main' into microcks-test
mathieu-benoit Mar 20, 2026
4f69ecc
trade-processor mock
mathieu-benoit Mar 20, 2026
ae96b49
Remove trade-processor from compose-mock-up
mathieu-benoit Mar 20, 2026
e12dd0d
make k8s-up tests for traderx (no mocks yet)
mathieu-benoit Mar 20, 2026
42c8c71
make k8s-mock-up
mathieu-benoit Mar 20, 2026
363b549
make k8s-mock-up
mathieu-benoit Mar 20, 2026
af85625
Use new upstream microcks patch template
mathieu-benoit Mar 21, 2026
88c5422
generic envsubst for ingress
mathieu-benoit Mar 21, 2026
594965f
Fix URL for make k8s-up
mathieu-benoit Mar 22, 2026
4eed58e
GET /People/GetMatchingPeople: dispatcher: null
mathieu-benoit Mar 23, 2026
68cbb71
demos
mathieu-benoit Mar 24, 2026
50aae19
update demos with .host
mathieu-benoit Mar 24, 2026
3e28c88
finalize demos
mathieu-benoit Mar 24, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
**/.score-compose
**/compose.yaml
**/manifests.yaml
**/demo-magic.sh
9 changes: 9 additions & 0 deletions .scripts/setup-kind-cluster.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,15 @@ helm install ngf oci://ghcr.io/nginxinc/charts/nginx-gateway-fabric \
--set service.type=NodePort \
--set-json 'service.ports=[{"port":80,"nodePort":31000}]'

kubectl wait deployments/ngf-nginx-gateway-fabric \
-n nginx-gateway \
--for condition=Available \
--timeout=90s
kubectl wait --namespace nginx-gateway \
--for=condition=ready pod \
--selector=app.kubernetes.io/name=nginx-gateway-fabric \
--timeout=120s

kubectl apply -f - <<EOF
apiVersion: gateway.networking.k8s.io/v1
kind: Gateway
Expand Down
2 changes: 1 addition & 1 deletion samples/aks-store-demo/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ manifests.yaml: makeline/score.yaml order/score.yaml product/score.yaml store-ad
## Create a local Kind cluster.
.PHONY: kind-create-cluster
kind-create-cluster:
./scripts/setup-kind-cluster.sh
../../.scripts/setup-kind-cluster.sh

NAMESPACE ?= default
## Generate a manifests.yaml file from the score spec and apply it in Kubernetes.
Expand Down
2 changes: 1 addition & 1 deletion samples/onlineboutique/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ manifests.yaml: ad/score.yaml cart/score.yaml currency/score.yaml email/score.ya
## Create a local Kind cluster.
.PHONY: kind-create-cluster
kind-create-cluster:
./scripts/setup-kind-cluster.sh
../../.scripts/setup-kind-cluster.sh

## Load the local container image in the current Kind cluster.
.PHONY: kind-load-image
Expand Down
50 changes: 47 additions & 3 deletions samples/traderx/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ help:
.score-compose/state.yaml:
score-compose init \
--no-sample \
--provisioners https://raw.githubusercontent.com/score-spec/community-provisioners/refs/heads/main/service/score-compose/10-service.provisioners.yaml
--patch-templates https://raw.githubusercontent.com/score-spec/community-patchers/refs/heads/main/score-compose/microcks.tpl \
--provisioners ./score-provisioners/compose/10-service-with-microcks.provisioners.yaml

compose.yaml: account-service/score.yaml database/score.yaml ingress/score.yaml people-service/score.yaml position-service/score.yaml reference-data/score.yaml trade-feed/score.yaml trade-processor/score.yaml trade-service/score.yaml web-frontend/score.yaml .score-compose/state.yaml Makefile
score-compose generate \
Expand Down Expand Up @@ -42,6 +43,21 @@ compose-test: compose-up
sleep 5
curl $$(score-compose resources get-outputs 'dns.default#ingress.dns' --format '{{ .host }}:8080')

compose-mock.yaml: database/score.yaml ingress/score.yaml trade-feed/score.yaml trade-service/score.yaml web-frontend/score.yaml .score-compose/state.yaml Makefile
score-compose generate \
database/score.yaml \
trade-feed/score.yaml \
trade-service/score.yaml \
web-frontend/score.yaml
score-compose generate \
ingress/score.yaml \
--build 'ingress={"context":"ingress/", "tags":["ingress:local"]}'

## Generate a compose.yaml file from the score specs and launch it.
.PHONY: compose-mock-up
compose-mock-up: compose-mock.yaml
docker compose up --build -d --remove-orphans

## Delete the containers running via compose down.
.PHONY: compose-down
compose-down:
Expand All @@ -50,7 +66,8 @@ compose-down:
.score-k8s/state.yaml:
score-k8s init \
--no-sample \
--provisioners https://raw.githubusercontent.com/score-spec/community-provisioners/refs/heads/main/service/score-k8s/10-service.provisioners.yaml
--provisioners https://raw.githubusercontent.com/score-spec/community-provisioners/refs/heads/main/route/score-k8s/10-ingress-route.provisioners.yaml \
--provisioners ./score-provisioners/k8s/10-service-with-microcks-cli.provisioners.yaml

manifests.yaml: account-service/score.yaml database/score.yaml ingress/score.yaml people-service/score.yaml position-service/score.yaml reference-data/score.yaml trade-feed/score.yaml trade-processor/score.yaml trade-service/score.yaml web-frontend/score.yaml .score-k8s/state.yaml Makefile
score-k8s generate \
Expand All @@ -62,6 +79,18 @@ manifests.yaml: account-service/score.yaml database/score.yaml ingress/score.yam
trade-feed/score.yaml \
trade-processor/score.yaml \
trade-service/score.yaml \
web-frontend/score.yaml \
-o manifests.yaml
score-k8s generate \
ingress/score.yaml \
--image ingress:local \
-o manifests.yaml

manifests-mock.yaml: database/score.yaml ingress/score.yaml trade-feed/score.yaml trade-service/score.yaml web-frontend/score.yaml .score-k8s/state.yaml Makefile
score-k8s generate \
database/score.yaml \
trade-feed/score.yaml \
trade-service/score.yaml \
web-frontend/score.yaml
score-k8s generate \
ingress/score.yaml \
Expand All @@ -70,11 +99,12 @@ manifests.yaml: account-service/score.yaml database/score.yaml ingress/score.yam
## Create a local Kind cluster.
.PHONY: kind-create-cluster
kind-create-cluster:
./scripts/setup-kind-cluster.sh
./setup-kind-cluster.sh

## Load the local container image in the current Kind cluster.
.PHONY: kind-load-image
kind-load-image:
docker build -t ingress:local ingress/
kind load docker-image ingress:local

NAMESPACE ?= default
Expand All @@ -94,6 +124,20 @@ k8s-up: manifests.yaml kind-load-image
--for condition=Ready \
--timeout=90s

k8s-mock-up: manifests-mock.yaml kind-load-image
kubectl apply \
-f manifests.yaml \
-n ${NAMESPACE}
kubectl wait deployments/ingress \
-n ${NAMESPACE} \
--for condition=Available \
--timeout=90s
kubectl wait pods \
-n ${NAMESPACE} \
-l app.kubernetes.io/name=ingress \
--for condition=Ready \
--timeout=90s

## Expose the container deployed in Kubernetes via port-forward.
.PHONY: k8s-test
k8s-test: k8s-up
Expand Down
1 change: 0 additions & 1 deletion samples/traderx/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ flowchart TD
trade-processor-->trade-feed
trade-processor-->database
trade-service-->account-service
trade-service-->database
trade-service-->people-service
trade-service-->reference-data
trade-service-->trade-feed
Expand Down
8 changes: 7 additions & 1 deletion samples/traderx/account-service/score.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@ containers:
account-service:
image: ghcr.io/finos/traderx/account-service:latest
variables:
ACCOUNT_SERVICE_PORT: '18088'
DATABASE_TCP_HOST: "${resources.database.name}"
PEOPLE_SERVICE_HOST: "${resources.people-service.name}"
PEOPLE_SERVICE_URL: "${resources.people-service.url}"
service:
ports:
web:
Expand All @@ -17,5 +18,10 @@ service:
resources:
people-service:
type: service
params:
port: 18089
artifacts: api-mocks/people-service-openapi.json:true,api-mocks/people-service-metadata.yaml:false,api-mocks/people-service-examples.yaml:false
name: FINOS TraderX People Service
version: v1
database:
type: service
2 changes: 2 additions & 0 deletions samples/traderx/api-mocks/people-service-metadata.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,5 @@ operations:
return mockRequest.getRequest().parameters.LoginId[0];
}
return "789";
GET /People/GetMatchingPeople:
dispatcher: null
14 changes: 7 additions & 7 deletions samples/traderx/api-mocks/position-service-examples.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,30 +5,30 @@ metadata:
version: 0.1.0
operations:
GET /trades/{accountId}:
'52355':
'52335':
request:
parameters:
accountId: 52355
accountId: 52335
response:
mediaType: application/json
body:
- id: TRADE-52355-AABBCC
accountId: 52355
- id: TRADE-52335-AABBCC
accountId: 52335
security: BAC
side: Sell
state: Settled
quantity: 2400
updated: 2026-03-11T08:57:54.758+00:00
created: 2026-03-11T08:57:54.758+00:00
GET /positions/{accountId}:
'52355':
'52335':
request:
parameters:
accountId: 52355
accountId: 52335
response:
mediaType: application/json
body:
- accountId: 52355
- accountId: 52335
security: BAC
quantity: -2400
updated: 2026-03-11T08:57:54.763+00:00
Expand Down
2 changes: 1 addition & 1 deletion samples/traderx/api-mocks/trade-processor-examples.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,4 @@ operations:
quantity: 100
side: Buy
state: Processing
createdAt: {{ now()}}
createdAt: '{{ now()}}'
23 changes: 23 additions & 0 deletions samples/traderx/demo-0.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/bin/bash

# setup
if [ ! -f demo-magic.sh ]; then
curl -LO https://github.com/paxtonhare/demo-magic/raw/master/demo-magic.sh
fi
. demo-magic.sh -d #-n
clear

# Demo setup
alias k=kubectl
make k8s-down
make compose-down
rm -rf .score-compose
rm -rf .score-k8s
clear

# Demo #0
pe "echo \"Demo #0 - score-k8s\""
pe "make k8s-up"
pe "kubectl get all"
pe "kubectl get pods"
pe "score-k8s resources get-outputs dns.default#ingress.dns --format 'http://{{ .host }}'"
28 changes: 28 additions & 0 deletions samples/traderx/demo-1-2.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#!/bin/bash

# setup
if [ ! -f demo-magic.sh ]; then
curl -LO https://github.com/paxtonhare/demo-magic/raw/master/demo-magic.sh
fi
. demo-magic.sh -d #-n
clear

# Demo #1
pe "echo \"Demo #1 - score-k8s\""
pe "code trade-service/score.yaml"
pe "code -g Makefile:72"
pe "code manifests.yaml"
pe "kubectl get all"
pe "kubectl get pods"
pe "score-k8s resources get-outputs dns.default#ingress.dns --format 'http://{{ .host }}'"

# Demo #2
pe "echo \"Demo #2 - score-compose\""
clear
pe "code trade-service/score.yaml"
pe "code -g Makefile:21"
pe "make compose-up"
pe "code compose.yaml"
pe "docker ps"
pe "echo http://localhost:8080"

24 changes: 24 additions & 0 deletions samples/traderx/demo-3.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#!/bin/bash

# setup
if [ ! -f demo-magic.sh ]; then
curl -LO https://github.com/paxtonhare/demo-magic/raw/master/demo-magic.sh
fi
. demo-magic.sh -d #-n
clear

# Demo setup
make compose-down
rm -rf .score-compose
clear

# Demo #3
pe "echo \"Demo #3 - score-compose (Mocks)\""
pe "code trade-service/score.yaml"
pe "code -g Makefile:47"
pe "make compose-mock-up"
pe "code compose.yaml"
pe "docker ps"
pe "echo http://localhost:8080"
pe "echo http://localhost:9090"

27 changes: 27 additions & 0 deletions samples/traderx/demo-4.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#!/bin/bash

# setup
if [ ! -f demo-magic.sh ]; then
curl -LO https://github.com/paxtonhare/demo-magic/raw/master/demo-magic.sh
fi
. demo-magic.sh -d #-n
clear

# Demo setup
alias k=kubectl
make k8s-down
rm -rf .score-k8s
clear

# Demo #4
clear
pe "echo \"Demo #4 - score-k8s (Mocks)\""
pe "code trade-service/score.yaml"
pe "code -g Makefile:88"
pe "make k8s-mock-up"
pe "code manifests.yaml"
pe "kubectl get all"
pe "kubectl get pods"
pe "score-k8s resources get-outputs dns.default#ingress.dns --format 'http://{{ .host }}'"
pe "echo https://microcks.127.0.0.1.nip.io/"

32 changes: 27 additions & 5 deletions samples/traderx/ingress/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,13 +1,35 @@
FROM nginx:alpine-slim

EXPOSE 8080

ARG NGINX_HOST="localhost"
ENV NGINX_HOST=$NGINX_HOST

# This is a workaround for the dollar sign in the envsubst command
ARG DOLLAR="$"
ENV DOLLAR=$DOLLAR
ARG DATABASE_URL="http://database:18084/"
ENV DATABASE_URL=$DATABASE_URL

ARG TRADE_PROCESSOR_URL="http://trade-processor:18091/"
ENV TRADE_PROCESSOR_URL=$TRADE_PROCESSOR_URL

ARG ACCOUNT_SERVICE_URL="http://account-service:18088/"
ENV ACCOUNT_SERVICE_URL=$ACCOUNT_SERVICE_URL

ARG PEOPLE_SERVICE_URL="http://people-service:18089/"
ENV PEOPLE_SERVICE_URL=$PEOPLE_SERVICE_URL

ARG POSITION_SERVICE_URL="http://position-service:18090/"
ENV POSITION_SERVICE_URL=$POSITION_SERVICE_URL

ARG REFERENCE_DATA_URL="http://reference-data:18085/"
ENV REFERENCE_DATA_URL=$REFERENCE_DATA_URL

ARG TRADE_FEED_URL="http://trade-feed:18086/"
ENV TRADE_FEED_URL=$TRADE_FEED_URL

ARG WEB_FRONTEND_URL="http://web-frontend:18093/"
ENV WEB_FRONTEND_URL=$WEB_FRONTEND_URL

COPY nginx.traderx.conf.template /etc/nginx/conf.d/nginx.traderx.conf.template
ARG TRADE_SERVICE_URL="http://trade-service:18092/"
ENV TRADE_SERVICE_URL=$TRADE_SERVICE_URL

RUN envsubst < /etc/nginx/conf.d/nginx.traderx.conf.template > /etc/nginx/conf.d/default.conf
COPY nginx.traderx.conf.template /etc/nginx/templates/
Loading
Loading