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 -XX:UseSVE=0 for non ARM JVM #2

Open
wants to merge 16 commits into
base: javasdk-modularize
Choose a base branch
from

Conversation

jcsirot
Copy link

@jcsirot jcsirot commented Jan 20, 2025

The JVM option -XX:UseSVE=0 does not seem to exist for x64 JVM which prevents the JVM to start

jcsirot and others added 16 commits January 17, 2025 18:41
… skeleton

This annotation processor will collect type info into a file in order to register objects and functions when the module is called.

Signed-off-by: Jean-Christophe Sirot <jcsirot@gmail.com>
Only in case `description` field of the annotation is not set.
That way it's still possible to override it, specifically for Dagger,
but on the other hand it's now possible to only use Java features and
not provide fields so there's no duplication.

Before:

    @ModuleFunction(value="echo", description="Returns a contain...")
    public Container containerEcho(String stringArg) {

After:
    /// Returns a container that echoes...
    @ModuleFunction
    public Container echo(String stringArg) {

Signed-off-by: Yves Brissaud <gh@lgtd.io>
Rename annotation classes so they are simpler: Module, Object, Function.
As close as possible to the Dagger wording.

I also moved the info objects (the ones used to generate the json file)
to the dagger-java-sdk part so they can also be used to read the json
file.

Almost created the registry part of the entrypoint: it creates the right
dagger module structure, but now it needs to create the right JSON
output.
This entrypoint can be used as the entrypoint of a module. It's intended
to be generic (based on the json file for now, maybe on the annotation
in the future). So the module side only needs to declare the mainClass
to io.dagger.module.Entrypoint

For instance by adding this to the pom.xml:

      <dependencies>
        <dependency>
          <groupId>io.dagger</groupId>
          <artifactId>dagger-java-sdk</artifactId>
          <version>1.0.0-SNAPSHOT</version>
        </dependency>
        <dependency>
          <groupId>io.dagger</groupId>
          <artifactId>dagger-java-annotation-processor</artifactId>
          <version>1.0.0-SNAPSHOT</version>
          <scope>provided</scope>
        </dependency>
      </dependencies>
      <build>
        <pluginManagement>
          <plugin>
            <artifactId>maven-compiler-plugin</artifactId>
            <version>3.13.0</version>
            <configuration>
              <verbose>false</verbose>
              <annotationProcessorPaths>
                <path>
                  <groupId>io.dagger</groupId>
                  <artifactId>dagger-java-annotation-processor</artifactId>
                  <version>1.0.0-SNAPSHOT</version>
                </path>
              </annotationProcessorPaths>
              <annotationProcessors>
                <annotationProcessor>io.dagger.annotation.processor.DaggerModuleAnnotationProcessor</annotationProcessor>
              </annotationProcessors>
            </configuration>
          </plugin>
        </pluginManagement>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-shade-plugin</artifactId>
            <version>3.5.0</version>
            <executions>
              <execution>
                <phase>package</phase>
                <goals>
                  <goal>shade</goal>
                </goals>
                <configuration>
                  <transformers>
                    <transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
                      <mainClass>io.dagger.module.Entrypoint</mainClass>
                    </transformer>
                  </transformers>
                </configuration>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>

This should be good to create a jar with all the dependencies:

    ./mvnw clean package

This includes the management of the annotations.

And then the generated jar declares the right entrypoint, so this should
be good to run with:

    dagger run java -jar dagger-module.jar

This will not completely work as the module part is not done, so the
dagger engine doesn't know about the module and so the registration
can't be done.
But that's a different story. The goal here was to be able to:

 - document with annotations
 - create a first basic entrypoint
 - declare as much as possible in the SDK so it's easy to integrate

Signed-off-by: Yves Brissaud <gh@lgtd.io>
This is a very simple one, just provided so that modules don't have
define the `dag` field.
In some way this is just to enforce some conventions.

Signed-off-by: Yves Brissaud <gh@lgtd.io>
Signed-off-by: Yves Brissaud <gh@lgtd.io>
I'm using gson, but I'll have a second look to avoid it and keep
dependencies minimal. But for now it solves the issue.

Signed-off-by: Yves Brissaud <gh@lgtd.io>
Signed-off-by: Yves Brissaud <gh@lgtd.io>
start dealing with types, but needs more work to ensure everything is
compatible

Signed-off-by: Yves Brissaud <gh@lgtd.io>
make the Scalar.convert method public to be able to convert to JSON.
Not sure that's the best way, but at least for now it unblocks it.

Signed-off-by: Yves Brissaud <gh@lgtd.io>
Signed-off-by: Yves Brissaud <gh@lgtd.io>
As of 2020-10-10, Square's JavaPoet project is deprecated

Signed-off-by: Yves Brissaud <gh@lgtd.io>
Signed-off-by: Yves Brissaud <gh@lgtd.io>
Signed-off-by: Yves Brissaud <gh@lgtd.io>
add comments, clean build and final image

Signed-off-by: Yves Brissaud <gh@lgtd.io>
Signed-off-by: Yves Brissaud <gh@lgtd.io>
Signed-off-by: Jean-Christophe Sirot <jcsirot@gmail.com>
@jcsirot jcsirot marked this pull request as ready for review January 20, 2025 17:00
@eunomie eunomie force-pushed the javasdk-modularize branch 7 times, most recently from 19eaedb to b996ee1 Compare January 24, 2025 21:42
@eunomie eunomie force-pushed the javasdk-modularize branch 5 times, most recently from f4a5149 to d75a52f Compare January 31, 2025 10:43
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