Skip to content

Improve podman compatibility on M1 for build test suites which use fabric8 docker-maven-plugin #25428

@holly-cummins

Description

@holly-cummins

Describe the bug

#25339 improved podman compatibility in some of the test suites which use fabric8 containers for databases. However, I'm still seeing failures on Mac M1 with podman.

Once I worked out I needed to do podman machine init -v $HOME:$HOME for podman < 4.1, most of the issues I've been seeing relate to filesystem mounting and health checks.

Volume mounts

The ':Z' SELinux access label seems to cause problems on M1. I think this is related to containers/podman#13631. (src/main/java/io/quarkus/deployment/pkg/steps/NativeImageBuildLocalContainerRunner.java also used :Z so I'm not sure why I didn't have to change anything there. )

Health checks

This is more troublesome. I'm struggling to get the docker maven plugin to successfully <wait> for mariadb to be up. I've tried a range of options.

For example, I could not find a wait of doing a (from http://dmp.fabric8.io/#build-healthcheck) that didn't treat the <time> as both a minimum and a maximum. Several of the options I tried always passed, even if the container wasn't ready, or always failed, even if the container was actually ready.

What about test containers?

The fabric8 plugin is not under super-active development, and we're starting to see some non-ideal behaviours. Longer term, we probably want to move away from the fabric8 docker-maven-plugin to test containers, but last time we looked into it, the fabric8 plugin gave us more flexibility to do things like define a sophisticated health check for container readiness, or inject a volume into the container with config to speed up startup.

Expected behavior

Tests should pass cleanly with TESTCONTAINERS_RYUK_DISABLED="true" ./mvnw -Dquickly -DskipTests=false -Dstart-containers

Actual behavior

SELinux access issues

holly@hcummins-mac quarkus % MYSQL_USER=hibernate_orm_test MYSQL_PASSWORD=hibernate_orm_test MYSQL_DATABASE=hibernate_orm_test MYSQL_RANDOM_ROOT_PASSWORD=true podman run --env MYSQL\*  -v ./integration-tests/hibernate-orm-tenancy/connection-resolver/custom-mariadbconfig/:/etc/mysql/conf.d:Z docker.io/mariadb:10.7
Error: error preparing container 0c92a88aedfb270b2c2c81aa9e98b025170295b2f7e0a1b8ac42bd6492bd42b9 for attach: setxattr /Users/holly/Code/quarkus/myfork/quarkus/integration-tests/hibernate-orm-tenancy/connection-resolver/custom-mariadbconfig: operation not supported

Health checks

I'm seeing a range of problematic behaviours, which mostly involve waits reporting themselves as failed when they should be successful, or reporting as failed when they should be successful.

How to Reproduce?

TESTCONTAINERS_RYUK_DISABLED="true" ./mvnw -Dquickly -DskipTests=false -Dstart-containers -f extensions/reactive-mysql-client/deployment 

on M1 without docker installed (only podman)

Output of uname -a or ver

Darwin hcummins-mac 21.4.0 Darwin Kernel Version 21.4.0: Fri Mar 18 00:46:32 PDT 2022; root:xnu-8020.101.4~15/RELEASE_ARM64_T6000 arm64

Output of java -version

No response

GraalVM version (if different from Java)

No response

Quarkus version or git rev

No response

Build tool (ie. output of mvnw --version or gradlew --version)

No response

Additional information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions