finos / legend

The Legend project
https://legend.finos.org
Apache License 2.0
1.23k stars 194 forks source link

Issue with Legend Pure IDE and Omnibus Variant Feedback #796

Closed reyes-michael closed 4 months ago

reyes-michael commented 7 months ago

Hi FINOS Team!

I am currently working on crafting a Legend metamodel on the OWL 2 Web Ontology Language. I was able to get the Legend Omnibus - slim version working, but I want to run the Legend Pure IDE to write Pure Code to help create validations on the meta model as I am building it.

Side Note: A great variant to have is the slim with the Legend Pure IDE! I think it looks sick and it would be awesome to have that included with the slim.

When I try the run the full version, I am able to navigate to the Legend Pure IDE, but I get the following error message:

404 Not Found

404 Not Found


nginx/1.18.0 (Ubuntu)

image

I also get this message when I try to run commands in the Legend Pure IDE terminal. I am running the docker build and run scripts from the Legend Omnibus for the full variant using the .env arguments as on the Github repo. I am also on Windows11 with WSL using git-bash to run the scripts.

I'm not quite sure where the issue is in the setup? I looked at the Github questions and previous issues and I did not find anything. If there is something I am missing or this is an issue, please let me know.

finos-admin commented 6 months ago

This issue is stale because it has been open for 30 days with no activity. Please remove stale label or add any comment to keep this open. Otherwise this will be closed in 5 days.

reyes-michael commented 6 months ago

Adding a comment to keep this open.

The Legend Pure IDE would be really helpful for writing scripts in the Pure Language as well as allow for integration testing of data structures and logical consistency across the OWL ontologies. Ontologies such as CDNO, are complex and it would be valuable to have the data models used for user queries to match what is currently being leveraged by the scientific community at large.

reyes-michael commented 5 months ago

Updating the thread:

After looking into the Nginx configs, turns out I was accessing the Pure IDE from the wrong port number. I am able to use the Legend Pure IDE and I am able to run the Welcome.pure go() function, so that's awesome. Also, I seem to be getting an error when trying to create a new directory or file via the terminal. Currently investigating if it related to Docker Permissions, but the logging in the Engine or the IDE doesn't capture this.

java.lang.IllegalArgumentException: Cannot create folder /owlFolder at org.finos.legend.pure.m3.serialization.filesystem.usercodestorage.composite.CompositeCodeStorage.createFolder(CompositeCodeStorage.java:428) at org.finos.legend.pure.ide.light.api.FileManagement.newFolder(FileManagement.java:129) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:566) at org.glassfish.jersey.server.model.internal.ResourceMethodInvocationHandlerFactory$1.invoke(ResourceMethodInvocationHandlerFactory.java:81) at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher$1.run(AbstractJavaResourceMethodDispatcher.java:144) at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.invoke(AbstractJavaResourceMethodDispatcher.java:161) at org.glassfish.jersey.server.model.internal.JavaResourceMethodDispatcherProvider$ResponseOutInvoker.doDispatch(JavaResourceMethodDispatcherProvider.java:160) at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.dispatch(AbstractJavaResourceMethodDispatcher.java:99) at org.glassfish.jersey.server.model.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:389) at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:347) at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:102) at org.glassfish.jersey.server.ServerRuntime$2.run(ServerRuntime.java:326) at org.glassfish.jersey.internal.Errors$1.call(Errors.java:271) at org.glassfish.jersey.internal.Errors$1.call(Errors.java:267) at org.glassfish.jersey.internal.Errors.process(Errors.java:315) at org.glassfish.jersey.internal.Errors.process(Errors.java:297) at org.glassfish.jersey.internal.Errors.process(Errors.java:267) at org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:317) at org.glassfish.jersey.server.ServerRuntime.process(ServerRuntime.java:305) at org.glassfish.jersey.server.ApplicationHandler.handle(ApplicationHandler.java:1154) at org.glassfish.jersey.servlet.WebComponent.serviceImpl(WebComponent.java:473) at org.glassfish.jersey.servlet.WebComponent.service(WebComponent.java:427) at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:388) at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:341) at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:228) at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:799) at org.eclipse.jetty.servlet.ServletHandler$ChainEnd.doFilter(ServletHandler.java:1631) at io.dropwizard.servlets.ThreadNameFilter.doFilter(ThreadNameFilter.java:35) at org.eclipse.jetty.servlet.FilterHolder.doFilter(FilterHolder.java:193) at org.eclipse.jetty.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1601) at io.dropwizard.jersey.filter.AllowedMethodsFilter.handle(AllowedMethodsFilter.java:45) at io.dropwizard.jersey.filter.AllowedMethodsFilter.doFilter(AllowedMethodsFilter.java:39) at org.eclipse.jetty.servlet.FilterHolder.doFilter(FilterHolder.java:193) at org.eclipse.jetty.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1601) at org.eclipse.jetty.servlets.CrossOriginFilter.handle(CrossOriginFilter.java:319) at org.eclipse.jetty.servlets.CrossOriginFilter.doFilter(CrossOriginFilter.java:273) at org.eclipse.jetty.servlet.FilterHolder.doFilter(FilterHolder.java:193) at org.eclipse.jetty.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1601) at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:548) at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:233) at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1434) at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:188) at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:501) at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:186) at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1349) at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141) at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:127) at com.codahale.metrics.jetty9.InstrumentedHandler.handle(InstrumentedHandler.java:313) at io.dropwizard.jetty.ContextRoutingHandler.handle(ContextRoutingHandler.java:37) at org.eclipse.jetty.server.handler.gzip.GzipHandler.handle(GzipHandler.java:713) at io.dropwizard.jetty.BiDiGzipHandler.handle(BiDiGzipHandler.java:67) at org.eclipse.jetty.server.handler.StatisticsHandler.handle(StatisticsHandler.java:179) at org 324602414-9ff66f45-cef2-4859-b812-01bb84342de0

reyes-michael commented 5 months ago

After finding that it was not a docker container permissions issue, I checked out the legend-engine project in IntelliJ and built the project locally. After dealing with some build failures due to asserts failing (I suspect that it has to due with Linux and Windows char diffs), I built and ran the project locally and still the encountered the issue. As it turns out, the Omnibus uses the following object PureIDELight_NoExtension to launch the IDE. This object loads in the core and pure_ide Code Repositories using a ClassLoaderCodeStorage object that implements an ImmutableRepositoryCodeStorage, this explains why the CompositeCodeStorage was throwing an issue when creating a folder.

After some investigating, it turns out that there is another IDE object we can run that gives not only the full Legend packages to use but also allows for creation of files and folders for the project for certain directories. The PureIDELight object uses a MutableFSCodeStorage object to load and store all the code repositories. Pure_IDE

So a change could be done with how the Omnibus packages the script for the IDE, if it can be changed to using the PureIDELight object, this would allow for people to experiment more in-depth with the language by running the Docker script outright. It is worth noting that when checking out the legend-engine project, you can add your own Code Repositories. Adding a custom CodeRepositoryProvider to the PureIDELight buildRepositories function and the required resources like any Pure Code and definition.json needed, would allow the IDE to load in the code you are writing.

finos-admin commented 4 months ago

This issue is stale because it has been open for 30 days with no activity. Please remove stale label or add any comment to keep this open. Otherwise this will be closed in 5 days.

finos-admin commented 4 months ago

This issue was closed because it has been inactive for 35 days. Please re-open if this issue is still relevant.