Skip to content

feat: shared core with a cloud descriptor; AWS module moves to floci.aws - #11

Merged
hectorvent merged 4 commits into
mainfrom
feat/multi-cloud-core
Oct 10, 2026
Merged

hectorvent merged 4 commits into
mainfrom
feat/multi-cloud-core

Conversation

@hectorvent

Copy link
Copy Markdown
Member

What – First step of the multi-cloud layout: floci.core holds the cloud descriptor and FlociBaseContainer (readiness via HttpWaitStrategy on the health path, Docker socket decided from the final env with a with_docker_socket() override, dedicated network, a unique FLOCI_DOCKER_RESOURCE_NAMESPACE per container, log level, reset(), get_endpoint()). The AWS module moves to floci.aws, its configs to floci.aws.config.

Why – One repo per language, one package per cloud, one shared core, so Azure, GCP and OCI reuse the lifecycle. Also fixes BL-001 (a real wait strategy and socket detection).

Area – floci.core, floci.aws, aliases in floci, floci.container, floci.config; testcontainers>=4.13.0 (the first release with HttpWaitStrategy; uv.lock already resolves it).

Compatibility – Non-breaking: floci, floci.container and floci.config stay as aliases. Behaviour change: the Docker socket is mounted only while an enabled, non-mocked service spawns sibling containers (Java's rules); the default container still gets it.

Tests – ruff, mypy; unit tests incl. new core tests; integration suite against real Floci.

Refs – BL-001

First step of the multi-cloud layout: a cloud-independent core plus one
package per cloud, with AWS as the first.

- floci.core: CloudDescriptor (image, port, env prefix, health/reset
  paths, log-level env, socket services) and FlociBaseContainer, which
  owns readiness (HttpWaitStrategy on the health path), Docker socket
  detection from the final env with a with_docker_socket() override, a
  dedicated network, a unique FLOCI_DOCKER_RESOURCE_NAMESPACE per
  container, log level, reset() and get_endpoint().
- floci.aws: FlociContainer on the core with the AWS descriptor; the
  service configs move to floci.aws.config.
- floci, floci.container and floci.config stay as aliases, so existing
  imports keep working.
- The Docker socket is no longer mounted unconditionally: only while an
  enabled, non-mocked service spawns sibling containers (the Java
  module's rules). The default container still gets it.
- testcontainers >= 4.13.0, the first release with HttpWaitStrategy and
  the lowest version uv.lock already resolves.

Signed-off-by: Hector Ventura <hectorvent@gmail.com>
@greptile-apps

greptile-apps Bot commented Oct 10, 2026 •

Copy link
Copy Markdown

RetriggerConfidence Score: 5/5

[High impact] The changes since the previous review appear safe to merge.

Summary

Moves the AWS module into floci.aws and shares container setup through floci.core. Existing import paths remain aliases.

  • Floci containers share readiness, reset, and network tools.
  • The container mounts the Docker socket only when a service needs it.
  • AWS containers and settings live under the floci.aws package.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart LR
    A["Existing floci imports"] --> B["floci.aws"]
    B --> C["FlociBaseContainer"]
    D["AWS CloudDescriptor"] --> C
    C --> E["Socket and environment setup"]
    E --> F["DockerContainer starts"]
    F --> G["HTTP health check"]
    G --> H["Ready endpoint"]
Loading

Reviews (3) · Last reviewed commit: "test: accept str or int port keys in the..." · Reviewed by Greptile

Comment thread floci/core/container.py Resolved
Comment thread floci/core/container.py Resolved
Review fixes for the shared core:

- The core's fluent methods (start, with_service_config,
  with_docker_socket, with_dedicated_network, with_resource_namespace,
  with_log_level) return the caller's own type through a bound TypeVar,
  so FlociContainer().with_dedicated_network().with_region(...) type
  checks again. This works on every supported Python (3.9+).
- Neptune joins the services that need the Docker socket, as in the Java
  module; it has no typed config yet.
- Tests: the fluent chain keeps FlociContainer, and an integration test
  creates a queue, resets, and checks the queue is gone and the emulator
  still serves requests.

Signed-off-by: Hector Ventura <hectorvent@gmail.com>
…er service

Neptune now needs the Docker socket and has no typed config, so the helper that turns off every
container-backed service sets FLOCI_SERVICES_NEPTUNE_ENABLED=false.

Signed-off-by: Hector Ventura <hectorvent@gmail.com>
testcontainers keys exposed ports by str in some versions and by int in others; the versions CI
resolves on Python 3.9 and 3.13 use int, so compare the ports as strings.

Signed-off-by: Hector Ventura <hectorvent@gmail.com>
@hectorvent
hectorvent merged commit cb8119b into main Oct 10, 2026
9 checks passed
@hectorvent
hectorvent deleted the feat/multi-cloud-core branch October 10, 2026 14:48
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.

1 participant