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

Fix dependencies to run TcpServerBM from command line #280

Merged
merged 7 commits into from
Jun 20, 2023

Conversation

akrambek
Copy link
Contributor

Description

Please include a summary of the changes and the related issue. Please also include relevant motivation and context. List any dependencies that are required for this change.

Fixes # (issue)

@@ -25,4 +25,7 @@

provides io.aklivity.zilla.runtime.engine.config.ConditionConfigAdapterSpi
with io.aklivity.zilla.runtime.binding.tcp.internal.config.TcpConditionConfigAdapter;

provides jakarta.json.spi.JsonProvider
with org.leadpony.joy.yaml.YamlProvider;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should not be necessary because we don't use modules for the shaded test jar.

@@ -0,0 +1 @@
org.leadpony.joy.yaml.YamlProvider
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Replicating this here doesn't seem correct, it should be coming from the engine JAR when shading instead.

<include>org.leadpony.joy:joy-yaml</include>
<include>org.leadpony.joy:joy-core</include>
<include>org.snakeyaml:snakeyaml-engine</include>
<include>com.ibm.icu:icu4j</include>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there any shade plugin configuration to pull transitive dependencies implicitly?
Otherwise this will be brittle as we change the dependencies in engine over time.

runtime/binding-tcp/pom.xml Show resolved Hide resolved
{
System.out.println("warning: json syntax is deprecated, migrate to yaml");
}
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't need to replicate this backwards compatibility code from zilla start in the benchmark, please remove it.

The integration with OpenJMH will add support for picking up a configuration similar to ITs, so it won't be coming from command line or be file based.

Properties properties = new Properties();
properties.setProperty(ENGINE_DIRECTORY.name(), "target/zilla-benchmarks");
properties.setProperty(ENGINE_STREAMS_BUFFER_CAPACITY.name(), Long.toString(1024L * 1024L * 16L));
Properties props = new Properties();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please revert this rename back to properties.

<include>org.openjdk.jmh:jmh-core</include>
<include>net.sf.jopt-simple:jopt-simple</include>
<include>org.apache.commons:commons-math3</include>
<include>commons-cli:commons-cli</include>
<include>com.github.biboudis:jmh-profilers</include>
</includes>
</artifactSet>
<includeDependencies>true</includeDependencies>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If this picks up dependencies transitively, can we trim the list above to no longer need to include any engine dependencies explicitly?

That would be better to implicitly keep the engine dependencies in sync.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, suggest moving this configuration to top level pom.xml instead, with the rest of the default configuration for shade plugin as each project will need the same configuration.

@@ -65,6 +65,9 @@
properties.setProperty(ENGINE_DIRECTORY.name(), "target/zilla-benchmarks");
properties.setProperty(ENGINE_STREAMS_BUFFER_CAPACITY.name(), Long.toString(1024L * 1024L * 16L));

properties.setProperty(ENGINE_DIRECTORY.name(), "target/zilla-benchmarks");
properties.setProperty(ENGINE_STREAMS_BUFFER_CAPACITY.name(), Long.toString(1024L * 1024L * 16L));

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These lines can now be removed as they duplicate the lines above, right?

@@ -0,0 +1 @@
org.leadpony.joy.yaml.YamlProvider
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file is already present in joy-yaml JAR, and not required by engine project otherwise.

If dependencies are being picked up correctly by shade plugin, shouldn't joy-yaml dependency cause this to be included in the shaded JAR without having to explicitly put it into our sources?

jfallows
jfallows previously approved these changes Jun 20, 2023
@jfallows jfallows merged commit ea61811 into aklivity:develop Jun 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants