-
Notifications
You must be signed in to change notification settings - Fork 46
Introduce inter-process communication between utbot
and utbot-spring-analyzer
#2085
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
4d529b9
Add SpringAnalyzerProcess with RD
IlyaMuravjov a884f5c
Start Spring analyzer process from engine process to use RD logger
IlyaMuravjov 8ffdeb4
Refactor RD processes
IlyaMuravjov 0a85c54
Resolve issues with SpringAnalyzerProcess
IlyaMuravjov 18473ad
Move Spring analyzer model to utbot-rd module
IlyaMuravjov f1f36a5
Fix typos in UtSettings docs
IlyaMuravjov aeed41d
Refactor RD processes
IlyaMuravjov fde68bf
Set runSpringAnalyzerProcessWithDebug to false
IlyaMuravjov 1bcd321
[utbot-spring]
Domonion f407b3d
Merge remote-tracking branch 'origin/ilya_m/spring_analyzer_rd' into …
IlyaMuravjov 6bcf204
Extract dependency versions to gradle.properties
IlyaMuravjov 73e17d1
Replace InstrumentedProcessRunner with InstrumentedProcess in docs
IlyaMuravjov 7918617
[utbot-spring]
Domonion c9abeab
Do more RD processes refactoring
IlyaMuravjov 3283582
Do not memorise process specific command line args
IlyaMuravjov File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<component name="ProjectRunConfigurationManager"> | ||
<configuration default="false" name="Debug Spring Analyzer Process" type="CompoundRunConfigurationType"> | ||
<toRun name="Run IDEA" type="GradleRunConfiguration" /> | ||
<toRun name="Listen for Spring Analyzer Process" type="Remote" /> | ||
<method v="2" /> | ||
</configuration> | ||
</component> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<component name="ProjectRunConfigurationManager"> | ||
<configuration default="false" name="Listen for Spring Analyzer Process" type="Remote" folderName="Utility Configurations"> | ||
<option name="USE_SOCKET_TRANSPORT" value="true" /> | ||
<option name="SERVER_MODE" value="true" /> | ||
<option name="SHMEM_ADDRESS" /> | ||
<option name="HOST" value="localhost" /> | ||
<option name="PORT" value="5007" /> | ||
<option name="AUTO_RESTART" value="true" /> | ||
<RunnerSettings RunnerId="Debug"> | ||
<option name="DEBUG_PORT" value="5007" /> | ||
<option name="LOCAL" value="false" /> | ||
</RunnerSettings> | ||
<method v="2" /> | ||
</configuration> | ||
</component> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
38 changes: 38 additions & 0 deletions
38
...t-framework-api/src/main/kotlin/org/utbot/framework/process/AbstractRDProcessCompanion.kt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
package org.utbot.framework.process | ||
|
||
import org.utbot.common.osSpecificJavaExecutable | ||
import org.utbot.framework.plugin.services.JdkInfoService | ||
import org.utbot.rd.rdPortArgument | ||
import java.io.File | ||
import kotlin.io.path.pathString | ||
|
||
abstract class AbstractRDProcessCompanion( | ||
private val debugPort: Int, | ||
private val runWithDebug: Boolean, | ||
private val suspendExecutionInDebugMode: Boolean | ||
) { | ||
private val javaExecutablePathString get() = | ||
JdkInfoService.provide().path.resolve("bin${File.separatorChar}${osSpecificJavaExecutable()}") | ||
|
||
protected abstract fun obtainProcessSpecificCommandLineArgs(): List<String> | ||
|
||
protected fun obtainProcessCommandLine(port: Int): List<String> = buildList { | ||
addAll(obtainCommonProcessCommandLineArgs()) | ||
addAll(obtainProcessSpecificCommandLineArgs()) | ||
add(rdPortArgument(port)) | ||
} | ||
|
||
private fun obtainCommonProcessCommandLineArgs(): List<String> = buildList { | ||
val suspendValue = if (suspendExecutionInDebugMode) "y" else "n" | ||
val debugArgument = | ||
"-agentlib:jdwp=transport=dt_socket,server=n,suspend=${suspendValue},quiet=y,address=$debugPort" | ||
.takeIf { runWithDebug } | ||
|
||
add(javaExecutablePathString.pathString) | ||
val javaVersionSpecificArgs = OpenModulesContainer.javaVersionSpecificArguments | ||
if (javaVersionSpecificArgs.isNotEmpty()) { | ||
addAll(javaVersionSpecificArgs) | ||
} | ||
debugArgument?.let { add(it) } | ||
} | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.