hydra-python-agent-gui icon indicating copy to clipboard operation
hydra-python-agent-gui copied to clipboard

Server URL input as a dropdown

Open gustavodemorais opened this issue 6 years ago • 13 comments

Deploy hydrus servers and input them in the Server URL input as a dropdown so when the user launches the UI he can already try some online ready server. Similar to how we have one already deployed now.

gustavodemorais avatar Aug 25 '19 15:08 gustavodemorais

@Guttz Can we use database to store the URLs when they are deployed or hosted, and then fetch them in the client . Or is there any other approach to this?

thrishik7 avatar Mar 19 '20 07:03 thrishik7

For now, as I think we have only 1, a simple array in the source code would be ok.. We can change it in the future if necessary.

gustavodemorais avatar Mar 23 '20 03:03 gustavodemorais

Maybe something important would be to have a checking function when the demo initializes so it actually checks if the servers are up, before showing to the user, as the servers might not always be available.

gustavodemorais avatar Mar 23 '20 03:03 gustavodemorais

okay @Guttz , so it's like having an array of urls harded coded and checking if it is hosted or not?

thrishik7 avatar Mar 23 '20 06:03 thrishik7

Greetings @Guttz . I am willing to work on this issue. I currently am facing an issue with running the development server of "hydra-python-agent-gui". I have read the installation guide and have set up both client and Hydrus server. However, I am getting a blank page on localhost:3000. I believe this is due to the following errors:

error-hydrus-update

The blank page appears because of the following variables being null in the render function of app.js:

render() {
    const { classes } = this.props;

    if(this.state.classes && this.state.apidocGraph.nodes ){    //both are null in the component's state
      return ( <template> );
    }

The root of the issue is when the request is made to hydra-docs and adidoc-graph and 404 error occurs. That's why both of the above variables are not being set

  componentDidMount() {
    axios.get(this.agentEndpoint + "/hydra-doc")
      .then(res => {

        this.setState({
          //for this.supportedClass > if @id="vocab:EntryPoint" then supportedProperty.property.labe
          classes: res.data.supportedClass,
          serverURL: res.data.serverURL.replace(/\/$/, "") + "/"
        }, () => this.render())
      });

      axios.get(this.agentEndpoint + "/apidoc-graph")
      .then(res => {
        this.setState({
          //for this.supportedClass > if @id="vocab:EntryPoint" then supportedProperty.property.labe
          apidocGraph: res.data
        }, () => this.render())
      });
  }

Could you please guide a bit about what might've went wrong?

I also tried to solve the matter by replacing this.agentEndpoint with "http://localhost:8080" because of the hydrus server running on 8080 port but it didn't change anything.

I tried by peeking into the hydra_doc_writer to create a new hydraDoc too but I think that wouldn't be necessary as sample hydrodoc is being used as default. The following output line by running hydrus serve gave me this thought:

No hydradoc specified, using sample hydradoc as default.

Haysam-Bin-Tahir avatar Mar 23 '20 19:03 Haysam-Bin-Tahir

@Haysam-Bin-Tahir , hello may I know how are you running the client , are you running app.py . and if you are using hydrus server then the entrypoint should be http://localhost:8080/serverapi

thrishik7 avatar Mar 23 '20 19:03 thrishik7

@Haysam-Bin-Tahir , hello may I know how are you running the client , are you running app.py . and if you are using hydrus server then the entrypoint should be http://localhost:8080/serverapi

I am currently running the app by "npm start" into the folder "console-frontend".

I also changed the entrypoint to "http://localhost:8080/serverapi" but that gave authentication error (401).

Haysam-Bin-Tahir avatar Mar 23 '20 19:03 Haysam-Bin-Tahir

@Haysam-Bin-Tahir okay instead running app through npm start, try running python app.py outside the console-frontend directory ,this will run static files which is build by react app, under port 3000.

thrishik7 avatar Mar 23 '20 19:03 thrishik7

@Haysam-Bin-Tahir , hello may I know how are you running the client , are you running app.py . and if you are using hydrus server then the entrypoint should be http://localhost:8080/serverapi

I am currently running the app by "npm start" into the folder "console-frontend".

I also changed the entrypoint to "http://localhost:8080/serverapi" but that gave authentication error (401).

for authenication error instead running hydrus serve run hydrus serve --no-auth.

thrishik7 avatar Mar 23 '20 19:03 thrishik7

It resolved the authorization error but still, the resources( hydra-doc and apidoc-graph ) are not found and 404 error is being generated. Does redis_setup.sh have a role in it? Because that is the only file that is not being run currently due to a docker error of "docker daemon not running".

P.S. I am still running npm start to run the GUI because of app.py not running due to connection error with "/serverapi/vocab" and I tried so many times with method variations that now I get the following error on running python app.py:

raise-error

I understand this might be a problem with my setup because I don't see other users complaining about it. So, it is okay if you are not able to detect the problem with this; I won't be taking any more time of yours on this. It is just a last try to see if we can reach somewhere. Thanks for your patience and kindness.

Haysam-Bin-Tahir avatar Mar 24 '20 11:03 Haysam-Bin-Tahir

Hey @Haysam-Bin-Tahir, to run the GUI you need RedisGraph running, hydrus running and then run the gui(python app.py). I would suggest that for these errors you interact with the community through our slack channel: https://join.slack.com/t/hydraecosystem/shared_invite/zt-9eudw2gz-5SN92uyOhYDBnFQHAAx9nw Thanks!

gustavodemorais avatar Mar 24 '20 15:03 gustavodemorais

okay @Guttz , so it's like having an array of urls harded coded and checking if it is hosted or not?

Yes, I think that's a ok solution for now.

gustavodemorais avatar Mar 24 '20 15:03 gustavodemorais

Hey @Haysam-Bin-Tahir, to run the GUI you need RedisGraph running, hydrus running and then run the gui(python app.py). I would suggest that for these errors you interact with the community through our slack channel: https://join.slack.com/t/hydraecosystem/shared_invite/zt-9eudw2gz-5SN92uyOhYDBnFQHAAx9nw Thanks!

Thank you so much.

Haysam-Bin-Tahir avatar Mar 25 '20 09:03 Haysam-Bin-Tahir