neshkeev / anti-fraud

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Anti-fraud research project

The anti-fraud research project aims to explore the tech that is suitable for malicious activities detection

Quickstart

  1. Download Amazon Corretto JDK 21:
curl -k -LO https://corretto.aws/downloads/latest/amazon-corretto-21-x64-linux-jdk.tar.gz
  1. Extract the archive:
tar -xf amazon-corretto-21-*.tar.gz
  1. Export JAVA_HOME:
export JAVA_HOME=./amazon-corretto-*/
  1. Clone the project:
git clone https://github.com/neshkeev/anti-fraud.git
  1. Enter the directory:
cd antifraud
  1. Run the project:
./mvnw compile -pl anti-fraud-drools exec:java -Dexec.mainClass=com.githib.neshkeev.antifraud.Main

Benchmarks

In order to run benchmarks execute:

./mvnw clean package -T 2C -PBenchmark &&
    java -XX:+HeapDumpOnOutOfMemoryError \
      -XX:HeapDumpPath=/tmp/DroolsRuleBenchmark-heapdump \
      -Xms2g \
      -Xmx2g \
      -jar benchmark/target/benchmarks.jar

Temporal Workflows

There is a hello world temporal workflow. In order to start it, please execute the following commands:

  1. Start a Temporal Server as a Docker service:
docker compose up -d
  1. Build the project:
./mvnw clean package -T 2C
  1. Start a worker:
./mvnw compile -pl anti-fraud-temporal-workflow exec:java -Dexec.mainClass=com.githib.neshkeev.antifraud.workflow.HelloWorldWorker
  1. Run a couple workflows
./mvnw compile -pl anti-fraud-temporal-workflow exec:java -Dexec.mainClass=com.githib.neshkeev.antifraud.workflow.WorkflowInitiator

Web Workflows

Workflows can be triggered with a REST API request. In order to start a web server, please execute the following commands:

  1. Start a Temporal Server as a Docker service:
docker compose up -d
  1. Build the project:
./mvnw clean package -T 2C
  1. Start a worker:
java -jar anti-fraud-worker/target/anti-fraud-worker-0.0.1-SNAPSHOT.jar
  1. Run the web server:
java -jar anti-fraud-web/target/anti-fraud-web-0.0.1-SNAPSHOT.jar
  1. Trigger a workflow:
curl -v http://localhost:18080/check -H 'Content-Type: application/json' -d '{}'
  1. Check the console with the worker

Performance Testing

Stop everything

docker compose down
docker compose --profile=base --profile=grpc --profile=rest --profile=perf --profile=worker -f ./docker-compose-perf.yml down

Start the temporal server and postgres

docker compose --profile=base -f ./docker-compose-perf.yml up --build -d

Start REST Workflow

TEMPORAL_ADDRESS=<TEMPORAL ADDRESS> docker compose --profile=rest -f ./docker-compose-perf.yml up --build -d

Start GRPC Workflow

TEMPORAL_ADDRESS=<TEMPORAL ADDRESS> docker compose --profile=grpc -f ./docker-compose-perf.yml up --build -d

Start Workers

TEMPORAL_ADDRESS=<TEMPORAL ADDRESS> POSTGRES_HOST=<POSTGRES HOST> docker compose --profile=worker -f ./docker-compose-perf.yml up --build -d

Start REST Performance Testing

docker compose --profile=perf -f ./docker-compose-perf.yml down
TEMPORAL_WORKFLOW_WEB_ADDRESS=<REST WORKFLOW HOST:PORT> TEMPORAL_WORKFLOW_GRPC_ADDRESS=<GRPC WORKFLOW HOST:PORT> docker compose --profile=perf -f ./docker-compose-perf.yml up --build -d
MSYS_NO_PATHCONV=1 docker compose -f ./docker-compose-perf.yml exec -it k6 k6 run --vus 100 --duration 30s /index.js

Start GRPC Performance Testing

docker compose --profile=perf down
TEMPORAL_WORKFLOW_WEB_ADDRESS=<REST WORKFLOW HOST:PORT> TEMPORAL_WORKFLOW_GRPC_ADDRESS=<GRPC WORKFLOW HOST:PORT> docker compose --profile=perf -f ./docker-compose-perf.yml up --build -d
MSYS_NO_PATHCONV=1 docker compose -f ./docker-compose-perf.yml exec -it k6 k6 run --vus 100 --duration 30s /grpc.js

Stop Everything

docker compose --profile=base --profile=grpc --profile=rest --profile=perf --profile=worker -f ./docker-compose-perf.yml down
docker compose down

About


Languages

Language:Java 88.5%Language:Dockerfile 7.2%Language:JavaScript 4.3%