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 AppCDS generation when using podman #38644

Merged
merged 1 commit into from
Feb 7, 2024
Merged

Conversation

geoand
Copy link
Contributor

@geoand geoand commented Feb 7, 2024

We use the same trick as used in native-image
building

Fixes: quarkusio#38616
Copy link
Contributor

@zakkak zakkak left a comment

Choose a reason for hiding this comment

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

LGTM, but this is the third place we use this, so perhaps it's worth extracting it in a method and reusing it.

  • String uid = getLinuxID("-ur");
    String gid = getLinuxID("-gr");
    if (uid != null && gid != null && !uid.isEmpty() && !gid.isEmpty()) {
    Collections.addAll(commandLine, "--user", uid + ":" + gid);
    if (containerRuntime.isPodman() && containerRuntime.isRootless()) {
    // Needed to avoid AccessDeniedExceptions
    commandLine.add("--userns=keep-id");
    }
    }
  • if (containerRuntime.isDocker() && containerRuntime.isRootless()) {
    Collections.addAll(containerRuntimeArgs, "--user", String.valueOf(0));
    } else {
    String uid = getLinuxID("-ur");
    String gid = getLinuxID("-gr");
    if (uid != null && gid != null && !uid.isEmpty() && !gid.isEmpty()) {
    Collections.addAll(containerRuntimeArgs, "--user", uid + ":" + gid);
    if (containerRuntime.isPodman() && containerRuntime.isRootless()) {
    // Needed to avoid AccessDeniedExceptions
    containerRuntimeArgs.add("--userns=keep-id");
    }
    }
    }

I am also wondering whether we would need to include the WSL work around as well:

            if (containerRuntime.isInWindowsWSL()) {
                containerRuntimeArgs.add("--interactive");
            }

@geoand
Copy link
Contributor Author

geoand commented Feb 7, 2024

LGTM, but this is the third place we use this, so perhaps it's worth extracting it in a method and reusing it.

Where would you put it?

@zakkak
Copy link
Contributor

zakkak commented Feb 7, 2024

LGTM, but this is the third place we use this, so perhaps it's worth extracting it in a method and reusing it.

Where would you put it?

There is io.quarkus.deployment.pkg.steps.LinuxIDUtil, we could either rename and extend it or create a similar class in the same package. For the time being it looks like this is only used by build steps.

@geoand
Copy link
Contributor Author

geoand commented Feb 7, 2024

Seems like a reasonable follow-up task

Copy link

quarkus-bot bot commented Feb 7, 2024

Status for workflow Quarkus CI

This is the status report for running Quarkus CI on commit 692a640.

✅ The latest workflow run for the pull request has completed successfully.

It should be safe to merge provided you have a look at the other checks in the summary.


Flaky tests - Develocity

⚙️ JVM Tests - JDK 17

📦 extensions/smallrye-reactive-messaging-kafka/deployment

io.quarkus.smallrye.reactivemessaging.kafka.deployment.dev.KafkaDevServicesDevModeTestCase.sseStream - History

  • Assertion condition defined as a io.quarkus.smallrye.reactivemessaging.kafka.deployment.dev.KafkaDevServicesDevModeTestCase Expecting size of: [] to be greater than or equal to 2 but was 0 within 10 seconds. - org.awaitility.core.ConditionTimeoutException
org.awaitility.core.ConditionTimeoutException: 
Assertion condition defined as a io.quarkus.smallrye.reactivemessaging.kafka.deployment.dev.KafkaDevServicesDevModeTestCase 
Expecting size of:
  []
to be greater than or equal to 2 but was 0 within 10 seconds.
	at org.awaitility.core.ConditionAwaiter.await(ConditionAwaiter.java:167)
	at org.awaitility.core.AssertionCondition.await(AssertionCondition.java:119)
	at org.awaitility.core.AssertionCondition.await(AssertionCondition.java:31)

@geoand geoand merged commit 90f1c28 into quarkusio:main Feb 7, 2024
49 checks passed
@quarkus-bot quarkus-bot bot added this to the 3.9 - main milestone Feb 7, 2024
@geoand geoand deleted the #38616 branch February 7, 2024 17:46
@gsmet gsmet modified the milestones: 3.9 - main, 3.7.2 Feb 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants