ruby-type-inference icon indicating copy to clipboard operation
ruby-type-inference copied to clipboard

Add a Dockerfile

Open jwsloan opened this issue 6 years ago • 6 comments

I wanted to give this a try, and thought I would provide the Dockerfile I used to try to get the server up and running.

It's not quite there... I get this far:

> Task :contract-creator:runServer
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
Oct 26, 2017 4:35:36 PM org.jetbrains.ruby.runtime.signature.server.SignatureServer runServer
INFO: Starting server
<=<============-> 93% EXECUTING [4m 31s]
> :contract-creator:runServer
> IDLE

At that point, it never progresses. I've attempted to fix the logger class issue, but have not figured it out. Maybe someone can help?

jwsloan avatar Oct 26 '17 16:10 jwsloan

Oh, that may be actually useful, however some stuff might be fixed at project level, I think. Actually, there is a big PR (#7) with review in progress which fixes some issues.

On idle server: that's normal; server listens for incoming data from arg-scanner runs to store them into a DB. However, in master, it still uses in-memory storage which is not really helpful (this is fixed in #7). Still, in the current implementation the server flushes data into DB 5seconds after ruby process has stopped sending the data to it so it can be freely killed.

Later on this data might be queried from different tools (we currently develop only IJ/RubyMine plugin for that).

What is your use case?

valich avatar Oct 26 '17 17:10 valich

Thanks for the quick reply, @valich.

I'm working on a gem that will generate sequence diagrams from ruby code, and am interested in seeing how this effort might help inform the other.

The very small beginning of that gem can be found here: https://github.com/nash-rb/sequence-diagram-rb

That gem was inspired by the ability to generate sequence diagrams from markdown, which IntelliJ Ultimate supports pretty nicely.

Would some portion of this Dockerfile be something you'd merge if I modified it?

jwsloan avatar Oct 26 '17 20:10 jwsloan

@jwsloan That's interesting, thanks! So, you may want to use such info to include parameters info to your diagrams, right?

Would some portion of this Dockerfile be something you'd merge if I modified it?

Sure, it's just I would like to discuss/understand how to use it. From my perspective it might be used as a "server" which accepts incoming data from arg-scanner runs — then we might like to open a port and conceive a way to retrieve the collected data. Since the currently recommended way to persist the collected data is using mysql, we might also like to open a way to query the container about the data.

So, at this particular moment I have the following suggestions:

  • Let's remove logger fixes since they should be done at build.gradle level;
  • Let's add mysql server installation and setting up (like in .travis.yml)
  • Let's wait for #7 to be merged because it fixes much stuff, enables mysql in runServer task and allows for port/user/etc. customization.

valich avatar Oct 26 '17 21:10 valich

What I'm struggling with currently is to determine the sender of a message. It's fairly straightforward to know who received a given message, but the sender seems to be tricky.

I'm also not sure how we'll detect and accurately represent any iteration that occurs.

My thought on the Dockerfile was mainly a way for someone interested to quickly have the server up and running, or even just an environment they could spin up to easily start developing/contributing.

Those sound like great fixes. I'll watch for #7 to get complete, and then finish this PR. Would you like me to close it until then?

jwsloan avatar Oct 26 '17 22:10 jwsloan

Would you like me to close it until then?

That's up to you, but I would be glad to accept such contribution since configuring stuff can be cumbersome indeed.

@ViugiNick Do you have any thoughts on the sender calculation?

valich avatar Oct 27 '17 06:10 valich

@jwsloan https://github.com/ViugiNick/RubyCallGraph/blob/master/main.rb

ViugiNick avatar Oct 27 '17 12:10 ViugiNick