gorules / jdm-editor

JDM Editor is an open-source React component for crafting and designing JDM (JSON Decision model) files.
https://gorules.io
MIT License
123 stars 36 forks source link

trying to access my JDM editor from EC2 instance #41

Open himasai9712 opened 4 months ago

himasai9712 commented 4 months ago

I deployed my docker container in ec2 machine and trying to create a decision tree but i cant drag my request dialog into my canvas , how to resolve it?

image

And this is my containers

image

And this is my docker container logs:

image

ivanmiletic commented 4 months ago

Hi @himasai9712 , do you have any browser / UI errors? Which version of BRMS image are you using?

himasai9712 commented 4 months ago

Hi @ivanmiletic thanks for replying, I got why this issue is coming I think its not supported by linux ig, when i tried same in my local windows its running fine but i came to another issue while doing so, now the issue is Im trying to communicate with my decision tree using node here is the screen shot of my decision tree:

image

my node code is :

const axios = require('axios');
let data = JSON.stringify({
  "context": {
    "num": 14
  },
  "trace": false
});

let config = {
  method: 'post',
maxBodyLength: Infinity,
  url: 'http://localhost:9080/api/projects/6509ad41-5b2e-40e6-a68f-38559272999d/evaluate/test.json',
  headers: { 
    'Content-Type': 'application/json', 
    'Accept': 'application/json', 
    'X-Access-Token': 'my token'
  },
  data : data
};

axios(config)
.then((response) => {
  console.log(JSON.stringify(response.data));
})
.catch((error) => {
  console.log(error);
});

but Im getting output is :

{"performance":"456.831µs","result":{}}

my function login in decision tree is :

/**
 * @param input
 * @param {{
 *  dayjs: import('dayjs')
 *  Big: import('big.js').BigConstructor
 * }} helpers
 */
const handler = (input, { dayjs, Big }) => {
  console.log(input.num)

  return input.num;
};

I can get output in my simulator but not when i run using code:

image

Can you please help me resolve this issue?

ivanmiletic commented 4 months ago

Hi, did you save and publish latest decision model?

himasai9712 commented 4 months ago

Yes i did @ivanmiletic

himasai9712 commented 4 months ago

@ivanmiletic And what type of os you suggest for running editor in ec2? as it doesnt support linux

ivanmiletic commented 4 months ago

Hi @himasai9712 , we do support Linux, both x86_64 and arm but not musl - just gnu libraries. Our compilers are set for: x86_64-unknown-linux-gnu and aarch64-unknown-linux-gnu for linux.

What ec2 machine are you using? Also, do you use just ec2 or some managed services such as EKS or ECS with EC2?

EDIT: Core libraries support ARM - as for BRMS we only support x86_64-unknown-linux-gnu

ivanmiletic commented 4 months ago

I believe your EC2 should not be of m7g group (those are ARM machines) but either "a" or "i" such as m7i (intel) or m7a (amd).

himasai9712 commented 4 months ago

@ivanmiletic hi I'm using t3.medium machine

himasai9712 commented 4 months ago

I'm using this AMI:

image

ivanmiletic commented 4 months ago

Can you try with default Amazon Linux 2 - or Ubuntu image? Can you also send some error trace from docker if you have?

Next, your machine must have access to a portal.gorules.io for license check - please check if you have any firewall.

Note you can't use same license key as you have locally - you will need either to create a new key or to remove / previous one and create it. One license key can only be used on a single stack / DB.

himasai9712 commented 4 months ago

@ivanmiletic ok let me try this..

himasai9712 commented 4 months ago

@ivanmiletic Hi i tried with machine type:T3.medium

My AMI :

image

my docker images logs:

image

I'm getting same issue as previous I couldn't drag and drop my core components into the canvas, any other ways to fix this?

himasai9712 commented 4 months ago

And I have access to the portal.gorules.io

here is the screenshot:

image

ivanmiletic commented 4 months ago

@himasai9712 From what i can see BRMS is working, if Drag and Drop is the only issue - it seems it is Frontend only related. What browser are you using and can you send me your console log from the browser?

himasai9712 commented 4 months ago

@ivanmiletic Im using Brave

EDIT: i tried in chrome too same issue, it couldn't be frontend issue ig cause in local setup in brave its working fine