Skip to content

Conversation

@oana-lolea
Copy link
Contributor

Changes proposed in this pull request

Context

Fixes #3496

Checklist

  • Related issues linked using fixes #number
  • Tests added/updated
  • Make sure that all checks pass
  • Bruno collection updated (if necessary)
  • Documentation issue created with user-docs label (if necessary)
  • OpenAPI specs updated (if necessary)

@github-actions
Copy link

github-actions bot commented Jul 7, 2025

🚀 Performance Test Results

Test Configuration:

  • VUs: 4
  • Duration: 1m0s

Test Metrics:

  • Requests/s: 42.33
  • Iterations/s: 14.14
  • Failed Requests: 0.00% (0 of 2545)
📜 Logs

> [email protected] run-tests:testenv /home/runner/work/rafiki/rafiki/test/performance
> ./scripts/run-tests.sh -e test "-k" "-q" "--vus" "4" "--duration" "1m"

Cloud Nine GraphQL API is up: http://localhost:3101/graphql
Cloud Nine Wallet Address is up: http://localhost:3100/
Happy Life Bank Address is up: http://localhost:4100/
cloud-nine-wallet-test-backend already set
cloud-nine-wallet-test-auth already set
happy-life-bank-test-backend already set
happy-life-bank-test-auth already set
     data_received..................: 919 kB 15 kB/s
     data_sent......................: 2.0 MB 33 kB/s
     http_req_blocked...............: avg=7.15µs   min=2.03µs   med=5.2µs   max=690.19µs p(90)=6.34µs   p(95)=6.83µs  
     http_req_connecting............: avg=422ns    min=0s       med=0s      max=500.17µs p(90)=0s       p(95)=0s      
     http_req_duration..............: avg=93.8ms   min=7.98ms   med=77.32ms max=565.45ms p(90)=165.78ms p(95)=192.6ms 
       { expected_response:true }...: avg=93.8ms   min=7.98ms   med=77.32ms max=565.45ms p(90)=165.78ms p(95)=192.6ms 
     http_req_failed................: 0.00%  ✓ 0         ✗ 2545
     http_req_receiving.............: avg=86.97µs  min=29.74µs  med=76.41µs max=2.23ms   p(90)=113.18µs p(95)=145.28µs
     http_req_sending...............: avg=36.29µs  min=10.66µs  med=28.2µs  max=1.33ms   p(90)=42.2µs   p(95)=58.46µs 
     http_req_tls_handshaking.......: avg=0s       min=0s       med=0s      max=0s       p(90)=0s       p(95)=0s      
     http_req_waiting...............: avg=93.67ms  min=7.83ms   med=77.24ms max=565.38ms p(90)=165.62ms p(95)=192.45ms
     http_reqs......................: 2545   42.325986/s
     iteration_duration.............: avg=282.52ms min=128.07ms med=266.6ms max=1.08s    p(90)=344.63ms p(95)=388.89ms
     iterations.....................: 850    14.13638/s
     vus............................: 4      min=4       max=4 
     vus_max........................: 4      min=4       max=4 

@oana-lolea oana-lolea marked this pull request as ready for review July 8, 2025 07:06
@oana-lolea oana-lolea requested a review from njlie July 8, 2025 07:06
Copy link
Contributor

@njlie njlie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM overall. Just one nitpick I left a comment for, and one more thing I'd like for you to add.

Let's also add the POS service to the docker-compose for cloud nine wallet and happy life bank, like we did for the card service.

cloud-nine-wallet-card-service:
hostname: cloud-nine-wallet-card-service
image: rafiki-card-service
build:
context: ../..
dockerfile: ./packages/card-service/Dockerfile.dev
restart: always
networks:
- rafiki
ports:
- '3007:3007'
volumes:
- type: bind
source: ../../packages/card-service/src
target: /home/rafiki/packages/card-service/src
read_only: true
environment:
NODE_ENV: ${NODE_ENV:-development}
INSTANCE_NAME: CLOUD-NINE
TRUST_PROXY: ${TRUST_PROXY}
LOG_LEVEL: debug
CARD_SERVICE_PORT: 3007
DATABASE_URL: postgresql://cloud_nine_wallet_card_service:cloud_nine_wallet_card_service@shared-database/cloud_nine_wallet_card_service
depends_on:
- shared-database
healthcheck:
test: ["CMD", "wget", "--spider", "http://localhost:3007/healthz"]
start_period: 60s
start_interval: 5s
interval: 30s
retries: 1
timeout: 3s

RUN chmod -R 750 /home/rafiki/packages

USER rafiki
CMD ["node", "-r", "/home/rafiki/packages/point-of-sale/dist/telemetry/index.js", "/home/rafiki/packages/point-of-sale/dist/index.js"]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think the POS service will publish telemetry data for now

@oana-lolea oana-lolea requested a review from njlie July 8, 2025 07:39
INSTANCE_NAME: HAPPY-LIFE
TRUST_PROXY: ${TRUST_PROXY}
LOG_LEVEL: debug
CARD_SERVICE_PORT: 3007
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need to change the env variable name to match the pos service's config, as well as update the port number so it doesn't conflict with the card service.

networks:
- rafiki
ports:
- '3007:3007'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

happy-life-bank should expose the port in the 4000 range

INSTANCE_NAME: CLOUD-NINE
TRUST_PROXY: ${TRUST_PROXY}
LOG_LEVEL: debug
CARD_SERVICE_PORT: 3007
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ditto with the happy-life-bank comment, need to update the env var name and port number.

@oana-lolea oana-lolea requested a review from njlie July 8, 2025 08:57
Copy link
Contributor

@njlie njlie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thanks for picking this up!

@njlie njlie merged commit b66c944 into pos-card-services Jul 8, 2025
32 of 38 checks passed
@njlie njlie deleted the nl/3496/init-pos-service branch July 8, 2025 09:25
njlie added a commit that referenced this pull request Aug 18, 2025
* feat(wip): pos service

* Completed POS service init

* Added docker files and missing scripts

* Removed editor code after handling conflicts

* Updated docker-compose for cloud 9 localenv and removed unnecessary telemetry command from dockerfile

* Updated docker compose files for c9 and hlb

* Updated ports and env var names from config

* fix: install ts-node-dev, add main script to index.ts

---------

Co-authored-by: Nathan Lie <[email protected]>
njlie added a commit that referenced this pull request Aug 21, 2025
* feat(wip): pos service

* Completed POS service init

* Added docker files and missing scripts

* Removed editor code after handling conflicts

* Updated docker-compose for cloud 9 localenv and removed unnecessary telemetry command from dockerfile

* Updated docker compose files for c9 and hlb

* Updated ports and env var names from config

* fix: install ts-node-dev, add main script to index.ts

---------

Co-authored-by: Nathan Lie <[email protected]>
njlie added a commit that referenced this pull request Aug 26, 2025
* feat(wip): pos service

* Completed POS service init

* Added docker files and missing scripts

* Removed editor code after handling conflicts

* Updated docker-compose for cloud 9 localenv and removed unnecessary telemetry command from dockerfile

* Updated docker compose files for c9 and hlb

* Updated ports and env var names from config

* fix: install ts-node-dev, add main script to index.ts

---------

Co-authored-by: Nathan Lie <[email protected]>
njlie added a commit that referenced this pull request Aug 26, 2025
…backend (#3613)

* feat: created the backbone for the card service (#3508)

* Created the backbone for the card service

* Format fix

* feat: add card service to docker compose

---------

Co-authored-by: Nathan Lie <[email protected]>

* feat: initialize POS service (#3509)

* feat(wip): pos service

* Completed POS service init

* Added docker files and missing scripts

* Removed editor code after handling conflicts

* Updated docker-compose for cloud 9 localenv and removed unnecessary telemetry command from dockerfile

* Updated docker compose files for c9 and hlb

* Updated ports and env var names from config

* fix: install ts-node-dev, add main script to index.ts

---------

Co-authored-by: Nathan Lie <[email protected]>

* feat: Integrate Redis client in Card Service for (requestId, posServiceHost) mapping (#3524)

* Integrate Redis client in Card Service for (requestId, posServiceHost) mapping

* remove unused dep

* prettier fix

* Separate logging params from the message itself

* ttl

* prettier fix

* Rewrite redis service tests to use testcontainers instead of mocks

---------

Co-authored-by: Antoniu Neacsu <[email protected]>

* feat(point-of-sale): added route for registering a POS device (#3555)

* Route for registering a POS device

* Fixed issue addressed in comments, tried to fix the port issue of jest

* Changed test container port to 0, format fix

* feat(wip): merge pos-card-services

* feat(point-of-sale): handle incoming payment completed webhooks from backend

* fix: typo, expose incoming payment url in gql

* fix: typo & unintended changes

* chore: regenerate gql

* feat: clean up request map if wehbook times out

---------

Co-authored-by: oana-lolea <[email protected]>
Co-authored-by: zeppelin44 <[email protected]>
Co-authored-by: Antoniu Neacsu <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants