Skip to content
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

Unable to select custom launcher with the new CLI #2554

Closed
kelvin-olaiya opened this issue Aug 23, 2023 · 8 comments
Closed

Unable to select custom launcher with the new CLI #2554

kelvin-olaiya opened this issue Aug 23, 2023 · 8 comments
Labels

Comments

@kelvin-olaiya
Copy link
Contributor

I was trying to run Alchemist in server mode with the following configuration file:

incarnation: protelis
launcher:
  type: AlchemistServer

(here AlchemistServer refers to IgniteServerLauncher).

The problem is that it launches with the HeadlessSimulationLauncher which I understand is the default.

Here's the output

14:52:34.299 [alchemist-executor-0] WARN it.unibo.alchemist.boundary.loader.SimulationModel -- No seeds specified, defaulting to 0 for both scenario and simulation
LOGBACK: No context given for ch.qos.logback.core.ConsoleAppender[null]
14:52:34.322 [alchemist-executor-0] WARN it.unibo.alchemist.boundary.loader.SimulationModel -- No environment specified, defaulting to Continuous2DEnvironment
14:52:34.341 [alchemist-executor-0] WARN it.unibo.alchemist.boundary.loader.SimulationModel -- There are no displacements in the specification, the environment won't have any node
@DanySK
Copy link
Member

DanySK commented Aug 23, 2023

Can you run it in verbose mode?

@kelvin-olaiya
Copy link
Contributor Author

Sure,
here's the output

16:02:52.025 [main] DEBUG it.unibo.alchemist.boundary.loader.SimulationModel -- Visiting: {} searching for Constant
LOGBACK: No context given for ch.qos.logback.core.ConsoleAppender[null]
16:02:52.039 [main] DEBUG it.unibo.alchemist.boundary.loader.SimulationModel -- Could not replace nor iterate over incarnation
16:02:52.039 [main] DEBUG it.unibo.alchemist.boundary.loader.SimulationModel -- Could not replace nor iterate over protelis
16:02:52.039 [main] DEBUG it.unibo.alchemist.boundary.loader.SimulationModel -- Could not replace nor iterate over launcher
16:02:52.040 [main] DEBUG it.unibo.alchemist.boundary.loader.SimulationModel -- Could not replace nor iterate over type
16:02:52.040 [main] DEBUG it.unibo.alchemist.boundary.loader.SimulationModel -- Could not replace nor iterate over AlchemistServer
16:02:52.040 [main] DEBUG it.unibo.alchemist.boundary.loader.SimulationModel -- New model: {incarnation=protelis, launcher={type=AlchemistServer}}
16:02:52.040 [main] DEBUG it.unibo.alchemist.boundary.loader.SimulationModel -- 0 constants: {}
16:02:52.040 [main] INFO it.unibo.alchemist.boundary.loader.SimulationModel -- 0 constants: {}
16:02:52.041 [main] DEBUG it.unibo.alchemist.boundary.loader.SimulationModel -- Visiting: null searching for DependentVariable
16:02:52.041 [main] INFO it.unibo.alchemist.boundary.loader.SimulationModel -- Dependent variables: {}
16:02:52.041 [main] DEBUG it.unibo.alchemist.boundary.loader.SimulationModel -- Could not replace nor iterate over incarnation
16:02:52.041 [main] DEBUG it.unibo.alchemist.boundary.loader.SimulationModel -- Could not replace nor iterate over protelis
16:02:52.041 [main] DEBUG it.unibo.alchemist.boundary.loader.SimulationModel -- Could not replace nor iterate over launcher
16:02:52.041 [main] DEBUG it.unibo.alchemist.boundary.loader.SimulationModel -- Could not replace nor iterate over type
16:02:52.041 [main] DEBUG it.unibo.alchemist.boundary.loader.SimulationModel -- Could not replace nor iterate over AlchemistServer
16:02:52.041 [main] DEBUG it.unibo.alchemist.boundary.loader.SimulationModel -- New model: {incarnation=protelis, launcher={type=AlchemistServer}}
16:02:52.042 [main] DEBUG it.unibo.alchemist.boundary.loader.SimulationModel -- Visiting: null searching for Variable
16:02:52.042 [main] INFO it.unibo.alchemist.boundary.loader.SimulationModel -- Variables: {}
16:02:52.307 [main] DEBUG it.unibo.alchemist.boundary.loader.util.JVMConstructor -- Building a HeadlessSimulationLauncher with []
16:02:52.373 [main] INFO it.unibo.alchemist.boundary.loader.util.JVMConstructor -- Constructor HeadlessSimulationLauncher(int, List) failed for the following reasons: 
16:02:52.373 [main] INFO it.unibo.alchemist.boundary.loader.util.JVMConstructor --   - InstancingImpossibleException: Could not create an instance with public it.unibo.alchemist.boundary.launch.HeadlessSimulationLauncher(int,java.util.List): discarded because incompatible with provided parameters []
16:02:52.374 [main] INFO it.unibo.alchemist.boundary.loader.util.JVMConstructor -- Constructor HeadlessSimulationLauncher(int, List, int, DefaultConstructorMarker) failed for the following reasons: 
16:02:52.374 [main] INFO it.unibo.alchemist.boundary.loader.util.JVMConstructor --   - InstancingImpossibleException: Could not create an instance with public it.unibo.alchemist.boundary.launch.HeadlessSimulationLauncher(int,java.util.List,int,kotlin.jvm.internal.DefaultConstructorMarker): discarded because incompatible with provided parameters []
16:02:52.379 [main] DEBUG it.unibo.alchemist.boundary.loader.util.JVMConstructor -- Building a AlchemistServer with []
16:02:52.416 [main] DEBUG it.unibo.alchemist.boundary.loader.SimulationModel -- Could not replace nor iterate over incarnation
16:02:52.416 [main] DEBUG it.unibo.alchemist.boundary.loader.SimulationModel -- Could not replace nor iterate over protelis
16:02:52.416 [main] DEBUG it.unibo.alchemist.boundary.loader.SimulationModel -- Could not replace nor iterate over launcher
16:02:52.416 [main] DEBUG it.unibo.alchemist.boundary.loader.SimulationModel -- Could not replace nor iterate over type
16:02:52.416 [main] DEBUG it.unibo.alchemist.boundary.loader.SimulationModel -- Could not replace nor iterate over AlchemistServer
16:02:52.416 [main] DEBUG it.unibo.alchemist.boundary.loader.SimulationModel -- New model: {incarnation=protelis, launcher={type=AlchemistServer}}
16:02:52.417 [main] DEBUG it.unibo.alchemist.boundary.loader.SimulationModel -- Trying to build a String from {} (syntax: null)
16:02:52.417 [main] INFO it.unibo.alchemist.boundary.loader.SimulationModel -- Remote dependencies: []
16:02:52.427 [alchemist-executor-0] DEBUG it.unibo.alchemist.boundary.loader.SimulationModel -- Known values: {}
16:02:52.427 [alchemist-executor-0] DEBUG it.unibo.alchemist.boundary.loader.SimulationModel -- Could not replace nor iterate over incarnation
16:02:52.427 [alchemist-executor-0] DEBUG it.unibo.alchemist.boundary.loader.SimulationModel -- Could not replace nor iterate over protelis
16:02:52.427 [alchemist-executor-0] DEBUG it.unibo.alchemist.boundary.loader.SimulationModel -- Could not replace nor iterate over launcher
16:02:52.428 [alchemist-executor-0] DEBUG it.unibo.alchemist.boundary.loader.SimulationModel -- Could not replace nor iterate over type
16:02:52.428 [alchemist-executor-0] DEBUG it.unibo.alchemist.boundary.loader.SimulationModel -- Could not replace nor iterate over AlchemistServer
16:02:52.428 [alchemist-executor-0] DEBUG it.unibo.alchemist.boundary.loader.SimulationModel -- New model: {incarnation=protelis, launcher={type=AlchemistServer}}
16:02:52.428 [alchemist-executor-0] DEBUG it.unibo.alchemist.boundary.loader.SimulationModel -- Complete simulation model: {incarnation=protelis, launcher={type=AlchemistServer}}
16:02:52.435 [alchemist-executor-0] WARN it.unibo.alchemist.boundary.loader.SimulationModel -- No seeds specified, defaulting to 0 for both scenario and simulation
16:02:52.451 [alchemist-executor-0] WARN it.unibo.alchemist.boundary.loader.SimulationModel -- No environment specified, defaulting to Continuous2DEnvironment
16:02:52.464 [alchemist-executor-0] INFO it.unibo.alchemist.boundary.loader.SimulationModel -- Created environment: Continuous2DEnvironment
16:02:52.466 [alchemist-executor-0] DEBUG it.unibo.alchemist.boundary.loader.SimulationModel -- Trying to build a LinkingRule from {} (syntax: it.unibo.alchemist.boundary.loader.syntax.DocumentRoot$JavaType@71446e11)
16:02:52.468 [alchemist-executor-0] WARN it.unibo.alchemist.boundary.loader.SimulationModel -- There are no displacements in the specification, the environment won't have any node
16:02:52.491 [alchemist-executor-0] INFO it.unibo.alchemist.core.Engine -- No more reactions.
16:02:52.492 [alchemist-executor-0] INFO it.unibo.alchemist.boundary.launch.HeadlessSimulationLauncher -- Simulation with {} completed successfully

@DanySK
Copy link
Member

DanySK commented Aug 23, 2023

Definitely a bug. Can you please open a PR with a test that "fails correctly"?
Thanks

@DanySK
Copy link
Member

DanySK commented Aug 24, 2023

@kelvin-olaiya the test looks partially broken:

        java.lang.IllegalArgumentException: Illegal Alchemist specification: Could not create IgniteServerLauncher(), requested as instance of IgniteServerLauncher.
        Actual parameters: []
          - constructor: IgniteServerLauncher(String)
            failure message 1 of InstancingImpossibleException: Could not create an instance with public i.u.a.boundary.launchers.IgniteServerLauncher(String): discarded because incompatible with provided parameters []

You are missing a string parameter. Still, the system should fail and not fallback to headless silently

@kelvin-olaiya
Copy link
Contributor Author

I see, I'll add the configuration file with another PR.

Anyway, IgniteServerLauncher expects the parameter with type String?, shouldn't the loading-system default it to null if missing?

@DanySK
Copy link
Member

DanySK commented Aug 24, 2023

Only if the constructor is annotated with @JvmOverloads and the default is null. If desirable, leave the test as is and update the constructor instead

@kelvin-olaiya
Copy link
Contributor Author

kelvin-olaiya commented Aug 24, 2023

Since very likely I'll move away from Ignite, I'll add the config file to fix the test. I'll consider this aspect for the new implementation.
Thanks

@DanySK DanySK closed this as completed in 6c52d55 Aug 24, 2023
DanySK pushed a commit that referenced this issue Aug 24, 2023
## [28.0.0](27.0.0...28.0.0) (2023-08-24)

### ⚠ BREAKING CHANGES

* fix #2554 and contextually refactor the launchers

### Bug Fixes

* fix [#2554](#2554) and contextually refactor the launchers ([6c52d55](6c52d55))
* **loading:** improve the explanation of loading errors ([a240c8c](a240c8c))

### Dependency updates

* **deps:** update dependency com.soywiz.korlibs.korim:korim to v4.0.10 ([5248e72](5248e72))
* **deps:** update kotlin to v1.9.10 ([8b7c9f4](8b7c9f4))
* **deps:** update react to v18.2.0-pre.620 ([05a5c0a](05a5c0a))

### Tests

* **alchemist-grid:** launcher should be correctly selected ([a0cfc71](a0cfc71))
* **grid:** add a trailing newline ([7b9f94c](7b9f94c))

### Build and continuous integration

* **deps:** update actions/checkout action to v3.6.0 ([83193b3](83193b3))
* **loading:** sort dependencies ([8980737](8980737))
@DanySK
Copy link
Member

DanySK commented Aug 24, 2023

🎉 This issue has been resolved in version 28.0.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants