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

Add gradle-oci to implementations.md #1156

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

SgtSilvio
Copy link

@SgtSilvio SgtSilvio commented Jan 8, 2024

As the author of the Gradle OCI plugin I want to ask if it can be included in the list of implementations.

It is a Gradle plugin to ease using and producing (multi-arch) OCI images without requiring external tools.

The plugin allows:

Please let me know if any additional information is required.

@sudo-bmitch
Copy link
Contributor

Hi @SgtSilvio, I'm not a Java / Gradle / Kotlin dev, so this is out of my expertise. But that's not really needed to approve this. Do you have an example image created by this project on a public repo that we could review?

@SgtSilvio
Copy link
Author

SgtSilvio commented Jan 9, 2024

Thanks for your answer.
The hivemq/hivemq-swarm is a public image that has been built with gralde-oci since December. (example tag: 4.23.0).
The project source is private, but I can share the image definition below.
In short,

  • it has distroless/java11-debian11:latest as parent image and
  • adds 3 layers (called "libs", "jar" and "resources")
  • for the platforms linux/amd64 and linux/arm64/v8
Full Image Definition
oci {
    imageDefinitions.register("main") {
        allPlatforms {
            parentImages {
                add("distroless:java11-debian11:latest") { isChanging = true }
            }
            config {
                entryPoint.add("java")
                entryPoint.addAll(application.applicationDefaultJvmArgs)
                entryPoint.addAll(
                    "-XX:+UnlockExperimentalVMOptions",
                    "-XX:+UseG1GC",
                    "-XX:InitialRAMPercentage=60",
                    "-XX:MaxRAMPercentage=70",
                    "-XX:MinRAMPercentage=40",
                    "-Dswarm.home=/",
                    "-cp",
                    "/app/classpath/*:/app/libs/*",
                )
                entryPoint.add(application.mainClass)
                environment.put("LOG_LEVEL", "INFO")
            }
            layers {
                layer("libs") {
                    contents {
                        from(configurations.runtimeClasspath)
                        into("app/libs")
                    }
                }
                layer("jar") {
                    contents {
                        from(proguardJar.flatMap { it.inputOutputGroups[0].outputs[0].archiveFile })
                        into("app/classpath")
                        rename(".*", "${project.name}-${project.version}.jar")
                    }
                }
                layer("resources") {
                    contents {
                        from("src/distribution")
                        from("src/main/resources/logback.xml") { into("config") }
                        from(standardExtensions) { into("extensions") }
                        filter.exclude("config/config.xml", "scenario/scenario.xml", "**/Readme.md")
                    }
                }
            }
        }
        specificPlatform(platform("linux", "amd64"))
        specificPlatform(platform("linux", "arm64", "v8"))
    }
}

Copy link
Contributor

@sudo-bmitch sudo-bmitch left a comment

Choose a reason for hiding this comment

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

LGTM

@SgtSilvio
Copy link
Author

In addition to hivemq-swarm, the Gradle OCI plugin is now used in more places, for example:

@SgtSilvio
Copy link
Author

What is missing to get this merged?

@sudo-bmitch
Copy link
Contributor

What is missing to get this merged?

It's waiting on a second review from @opencontainers/image-spec-maintainers

Copy link

@kzys kzys left a comment

Choose a reason for hiding this comment

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

Looks good to me, but I'm not the maintainer :)

@tianon
Copy link
Member

tianon commented Jan 11, 2025

Sorry, I should've commented earlier. 🙇

My hesitation is that it's a relatively new project, and despite that it might be interesting/useful, I'd like to avoid becoming a list of every individual "hobby"/"weekend" project, since that will get quite unwieldy and hard to maintain/prune over time -- along that vein, we've probably already got a few projects on here we ought to consider removing. 🙈

Are there any other projects (besides your own ❤️) using this today?

@SgtSilvio
Copy link
Author

SgtSilvio commented Jan 12, 2025

Thanks for your responses.

Are there any other projects (besides your own ❤️) using this today?

Strictly speaking, the projects that I linked are not my own. They are projects of a company that I work for. Sure, I influenced these projects to use the Gradle OCI plugin.
But I guess you are looking for a more diverse user base. The only thing I can say here is that 53% of the GitHub stars are from people that I don't know at all, and I can only guess that some of those have used it. I admit 32 stars is not a good data base for statistics, but everything needs to start small 😉. Also, these stars mean a lot (at least to me ❤️) because they are fully "inbound" without the project being well-known, or marketed, or even using technologies the typical target group of container technology is familiar with (Gradle).

Apart from the above, I do not only maintain this project, but also move it forward. Don't expect it to be abandoned soon.
Although this promise may not be of a lot of worth for you, I put a lot of focus on standards compliance regarding the OCI Image and also the Distribution specification. That's why I initially submitted it for inclusion in the list of implementations of the OCI spec.

@sudo-bmitch
Copy link
Contributor

This is one of those places where @tianon and I respectfully disagree. My own criteria is whether the spec is implemented by the project, and the project is updated for new versions of the spec when appropriate. Projects that are unmaintained could be moved to a historical list if we wanted to track maintenance, though that requires specifying criteria for maintenance. I have a strong aversion to exclusivity in the spec that would keep out new projects.

As a potential consumer of various OCI implementations, it's nice to have lots of options listed in one place. Often I may be searching for a solution that isn't quite provided by the major implementations, but is being provided by a new project that is looking for more users. Without discovering those alternatives, I'm more likely to create a new project of my own rather than collaborate with others.

@tianon
Copy link
Member

tianon commented Jan 13, 2025

All fair arguments! I don't feel strongly enough to block this. 👍🙇❤️

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.

4 participants