Embedding prodigy as an iframe in a python app

@ines @honnibal

Hey guys, I have a flask app in which prodigy is embedded as an iframe. This is to provide the user with an UI.
everything works fine locally. But when i try deploying it using a docker container I am getting issues. Let me show you how I have it set up

  1. This is the iframe logic
    image
    When done locally, '0.0.0.0' is 'localhost'

  2. Prodigy.json is edited with 'host':'0.0.0.0'

  3. the flask app also set with host = 0.0.0.0
    image

When it is setup as such, I am getting the following error which is fairly new and I am a bit lost. What is interesting is that, my code works and opens prodigy to annotate perfectly fine locally( without the docker container)

Is there a potential solution you see to get the prodigy iframe open when deployed usinf docker container

Also, is there an example that you can point me to where the prodigy.json file is set with host = 0.0.0.0
Thanks in advance

Hi! It looks like the error here is a JSON error raised when it's trying to load your prodigy.json config. Maybe you have a formatting error in there somewhere?

Oh yes, you were right. There was an issue with the prodigy.json.

Thank you for replying.

1 Like

@ines
There is also an error that i am facing now. Prodigy runs on 0.0.0.0:8000 now. So when i have to route it to the embedded iframe what will be the ip address to use in this case.
image

The adress for the iframe connecting to the prodigy server is given like this
image

But the iframe is not able to ping prodigy.

Any thought on this? how to i access the prodigy server and embed it in the iframe

Are you embedding the iframe on the same domain? If not, it's likely your browser blocking cross-domain iframes and you might need to double-check that you're setting the CORS headers correctly.

Yes. I have a flask app that has a prodigy iframe within . This flask app is deployed using docker.
I still have not figured it out. It CORs headers might be messed up too. I will dig deeper to trouble shooting that. But looks like prodigy kicks off fine. I might have to route it to the iframe.

Anyways, thank you so much for the response.

1 Like