* feat(core): add io.floci.* resource-identity labels
Introduces ContainerStorageHelper.resourceIdentityLabels(service,
resourceId, accountId, region), so a container manager can tag its
spawned container with the emulated resource's identity. Additive to
the existing floci/floci_emulator/floci_namespace labels.
Relates to #1818
Signed-off-by: Matheus Oliveira <matheus.6148@gmail.com>
* feat(rds): label RDS containers with resource identity
RDS backing containers now carry io.floci.service=rds,
io.floci.resource-id=<instanceId>, io.floci.account, and io.floci.region
so a spawned container can be mapped back to the DBInstanceIdentifier
it emulates without empirical docker exec probing.
Account/region reuse the same ARN parsing already done for log-stream
routing; extracted into resolveRuntimeIdentity so both call sites share
one source of truth.
Closes#1818
Signed-off-by: Matheus Oliveira <matheus.6148@gmail.com>
* feat(docdb): label DocDB containers with resource identity
DocDB backing containers now carry io.floci.service=docdb and
io.floci.resource-id=<clusterId> alongside account/region.
Relates to #1818
Signed-off-by: Matheus Oliveira <matheus.6148@gmail.com>
* feat(elasticache): label ElastiCache Redis/Valkey containers with resource identity
Backing containers now carry io.floci.service=elasticache and
io.floci.resource-id=<groupId> alongside account/region.
Relates to #1818
Signed-off-by: Matheus Oliveira <matheus.6148@gmail.com>
* feat(elasticache): label ElastiCache Memcached containers with resource identity
Backing containers now carry io.floci.service=elasticache and
io.floci.resource-id=<clusterId> alongside account/region.
Relates to #1818
Signed-off-by: Matheus Oliveira <matheus.6148@gmail.com>
* feat(memorydb): label MemoryDB containers with resource identity
Backing containers now carry io.floci.service=memorydb and
io.floci.resource-id=<clusterName> alongside account/region.
Relates to #1818
Signed-off-by: Matheus Oliveira <matheus.6148@gmail.com>
* feat(neptune): label Neptune containers with resource identity
Backing containers now carry io.floci.service=neptune and
io.floci.resource-id=<clusterId> alongside account/region.
Relates to #1818
Signed-off-by: Matheus Oliveira <matheus.6148@gmail.com>
* feat(msk): label MSK containers with resource identity
Redpanda backing containers now carry io.floci.service=msk and
io.floci.resource-id=<clusterName> alongside account/region.
Relates to #1818
Signed-off-by: Matheus Oliveira <matheus.6148@gmail.com>
* feat(opensearch): label OpenSearch containers with resource identity
Backing containers now carry io.floci.service=opensearch and
io.floci.resource-id=<domainName> alongside account/region.
RegionResolver is now injected into OpenSearchDomainManager.
Relates to #1818
Signed-off-by: Matheus Oliveira <matheus.6148@gmail.com>
* feat(ecs): label ECS task containers with resource identity
Backing containers now carry io.floci.service=ecs and
io.floci.resource-id=<taskId> alongside account/region.
Relates to #1818
Signed-off-by: Matheus Oliveira <matheus.6148@gmail.com>
* feat(eks): label EKS k3s containers with resource identity
Backing containers now carry io.floci.service=eks and
io.floci.resource-id=<clusterName> alongside account/region.
RegionResolver is now injected into EksClusterManager.
Relates to #1818
Signed-off-by: Matheus Oliveira <matheus.6148@gmail.com>
* feat(amazonmq): label AmazonMQ containers with resource identity
RabbitMQ backing containers now carry io.floci.service=amazonmq and
io.floci.resource-id=<brokerId> alongside account/region.
Relates to #1818
Signed-off-by: Matheus Oliveira <matheus.6148@gmail.com>
* feat(mwaa): label MWAA containers with resource identity
Both the Postgres metadata container and the Airflow container now
carry io.floci.service=mwaa and io.floci.resource-id=<environmentName>
alongside account/region. RegionResolver is now injected into
MwaaEnvironmentManager.
Relates to #1818
Signed-off-by: Matheus Oliveira <matheus.6148@gmail.com>
* feat(kinesisanalytics): label Flink containers with resource identity
Both the JobManager and TaskManager containers now carry
io.floci.service=kinesisanalytics and io.floci.resource-id=<applicationName>
alongside account/region.
Relates to #1818
Signed-off-by: Matheus Oliveira <matheus.6148@gmail.com>
* feat(batch): label Batch job containers with resource identity
Job containers now carry io.floci.service=batch and
io.floci.resource-id=<jobId>, using the job's own account/region
(already carried on BatchJob) rather than RegionResolver.
Relates to #1818
Signed-off-by: Matheus Oliveira <matheus.6148@gmail.com>
* feat(codebuild): label CodeBuild job containers with resource identity
Build containers now carry io.floci.service=codebuild and
io.floci.resource-id=<buildId> alongside account/region.
No new unit test: the container-spawn call site lives inside the
private multi-phase runBuild() method, entangled with real filesystem
and source-download side effects with no existing seam for unit
testing in isolation (CodeBuild's only coverage today is the
QuarkusTest-based CodeBuildIntegrationTest, which would need a real
Docker daemon and a full build run to assert container labels).
Relates to #1818
Signed-off-by: Matheus Oliveira <matheus.6148@gmail.com>
* feat(lambda): label function containers with resource identity
Lambda containers now carry io.floci.service=lambda and
io.floci.resource-id=<functionName>, reusing the existing
ARN-based region resolution and adding the equivalent account lookup.
Relates to #1818
Signed-off-by: Matheus Oliveira <matheus.6148@gmail.com>
* feat(ec2): label EC2 instance containers with resource identity
Backing containers now carry io.floci.service=ec2 and
io.floci.resource-id=<instanceId>, using the already-passed region
parameter and a new RegionResolver dependency for the account id.
Relates to #1818
Signed-off-by: Matheus Oliveira <matheus.6148@gmail.com>
* feat(ecr): label the shared registry container with resource identity
The registry:2 container carries io.floci.service=ecr with no
resource-id, since it is a shared singleton, not a per-resource
container.
Relates to #1818
Signed-off-by: Matheus Oliveira <matheus.6148@gmail.com>
* docs(core): document io.floci.* resource-identity labels
Relates to #1818
Signed-off-by: Matheus Oliveira <matheus.6148@gmail.com>
* style(tests): use imports instead of inline FQCN in resource-identity label tests
Cleans up the Batch, EKS, and OpenSearch label tests added earlier in
this branch, which used fully-qualified names inline instead of imports.
Relates to #1818
Signed-off-by: Matheus Oliveira <matheus.6148@gmail.com>
* fix(kinesisanalytics): restore Mockito import and awsEnv param in Flink label test
Silently dropped by the rebase's clean auto-merge; the test no longer compiled
without them.
Signed-off-by: Matheus Oliveira <matheus.6148@gmail.com>
* docs(core): note ECR keeps every identity label except resource-id
EcrRegistryManager still passes account/region for the shared registry
container; only resourceId is omitted. Docs previously said the opposite.
Signed-off-by: Matheus Oliveira <matheus.6148@gmail.com>
* test(elasticache): log swallowed IOException in label test cleanup
Matches the pattern already used in the DocDB/Neptune/MemoryDB label tests.
Signed-off-by: Matheus Oliveira <matheus.6148@gmail.com>
---------
Signed-off-by: Matheus Oliveira <matheus.6148@gmail.com>
Floci defaults docker-host to unix:///var/run/docker.sock, which has
no equivalent on native Windows. Since this hardcoded default always
overrides docker-java's own OS-aware detection, every Docker-backed
operation failed at container-start time on Windows with a low-level
socket error — including Lambda-invoked CloudFormation custom
resources such as CDK's Custom::S3BucketNotifications.
When docker-host is still unmodified and DOCKER_HOST isn't set, fall
back to Docker Desktop's named pipe (npipe:////./pipe/docker_engine)
on Windows, mirroring what docker-java already does correctly on its
own. Linux/macOS behavior is unchanged. An explicit docker-host or
DOCKER_HOST always takes priority over the fallback.
Verified end-to-end: a CDK-shaped stack (S3 bucket + Lambda +
Custom::S3BucketNotifications) went from CREATE_FAILED to
CREATE_COMPLETE after this fix.
Fixes#2006.
Pressing 'Open Floci UI' under Podman (docker-socket compat) reports every
failure as a missing image and tells the user to 'docker pull floci-ui' — even
when the image is present. The real causes (an unreachable Docker/Podman socket,
a port clash, a daemon error) are hidden, which is especially confusing on
SELinux hosts where the bind-mounted socket connect fails with
'java.net.BindException: Permission denied'.
Classify the failure in FlociUiManager.describeStartFailure:
- only a genuinely unavailable image (NotFoundException / docker-java's
'Could not pull image: ...' wrapper) keeps the 'docker pull' guidance;
- an unreachable runtime (SocketException/BindException/ConnectException) points
at the socket mount and SELinux relabeling;
- any other daemon error is surfaced as-is (e.g. 'address already in use').
Also fix the Podman docs: use ':z' (shared relabel) rather than ':Z' on the
shared Podman API socket, note it applies to the UI sidecar, and mention the
'--security-opt label=disable' fallback.
Add unit tests for the four classifications.
Adds a 'Running on Podman (rootless)' section to the Docker configuration
docs with the known-working container config, and documents the existing
FLOCI_SERVICES_LAMBDA_DOCKER_HOST_OVERRIDE escape hatch for when Runtime
API host auto-detection picks an unreachable address.
Closes#876
Automatically detect the Docker network of the running Floci container and use it for spawned containers when no explicit Docker network is configured. This lets Lambda containers reach Floci’s Runtime API in Docker Compose setups without requiring users to manually set FLOCI_SERVICES_LAMBDA_DOCKER_NETWORK.
Also update Lambda/Docker docs to clarify the automatic network inheritance behavior.
Tested with:
./mvnw -q -Dtest=ContainerBuilderTest,CurrentContainerNetworkResolverTest,DockerHostResolverTest,ContainerLauncherTest test