mirror of
https://github.com/floci-io/floci.git
synced 2026-11-24 14:30:28 -05:00
43eace4e026ba088a6583baccc68a161663b0170
4
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
024bfa0a5c |
feat(docker): containers Floci launches trust the Floci CA (#3091)
* feat(tls): write a CA bundle for launched containers at boot
Containers Floci launches need to trust Floci's HTTPS endpoint from any runtime
without losing access to public HTTPS. A bundle that carries the JVM's public
roots followed by Floci's trust anchor makes that possible: the variables that
replace a runtime's trust store (SSL_CERT_FILE and friends) can then point at
it safely.
ContainerCaBundle writes {persistent-path}/tls/floci-ca-bundle.pem from the
JVM's default trust anchors plus the certificates in the anchor file: the local
CA, or the user-provided certificate file in custom-certificate mode. Only
certificates are copied out of that file, so a combined certificate-and-key
file never leaks its key into a container. The file is swapped in atomically
from a uniquely named temporary file. TlsConfigSource writes it in both
certificate modes; a failure is logged and never stops the boot.
hostPath(config) resolves the bundle in the directory the bootstrap used, so a
persistent path set only in application.yml cannot point it elsewhere, and
appendEnv(env) adds SSL_CERT_FILE, CURL_CA_BUNDLE, REQUESTS_CA_BUNDLE,
NODE_EXTRA_CA_CERTS and AWS_CA_BUNDLE without overriding a key the caller set.
The bootstrap now records its TLS directory in every TLS-on mode, not only when
it issues the leaf, so the CA producer and the bundle lookup read from the
directory the boot wrote to even when a persistent path is set in
application.yml alone. A missing bundle is reported once per process.
* feat(docker): every launched container gets the CA bundle and the trust variables
ContainerLifecycleManager.create is the single path every emulator-created
container passes through, so injecting trust there covers Lambda, ECS, MWAA,
Flink, RDS, ElastiCache, Batch and the rest at once.
With TLS on and the bundle present, create appends the five trust variables
after the spec's own environment (a value from a task or function definition
wins) and copies the bundle to /etc/floci-ca-bundle.pem in the created, not
yet started, container. A copy rather than a bind mount, because when Floci
itself runs in Docker its persistent path is not a host path the daemon can
mount. A failed copy is logged with its consequence and the container still
starts. With TLS off, or without a bundle, nothing changes.
* refactor(lambda): take container CA trust from the lifecycle manager bundle
The Lambda launcher no longer resolves, copies or announces the CA itself: the
lifecycle manager does that for every container. Its append-only policy
(NODE_EXTRA_CA_CERTS and AWS_CA_BUNDLE only, never SSL_CERT_FILE) existed
because a bare CA would have cut a function off from public HTTPS; the bundle
carries the public roots, so the policy and the test that guarded it go.
The Kubernetes launcher publishes the bundle in its ConfigMap instead of the
bare CA, mounts it at /etc/floci-ca-bundle.pem, and appends the trust
variables after the function's own environment so a function value wins, as
in the Docker launcher.
* test(docker): a launched container trusts Floci and public roots through the bundle
The unit tests pin the variables and the copy, not that a runtime reading them
actually trusts Floci and still reaches public HTTPS. A python:3.12-alpine
container launched through the lifecycle manager, with the image's own root
directory pointed away so only the bundle can supply roots, fetches
https://host.docker.internal:<port>/_floci/ca.pem and https://public.ecr.aws/
with no setup of its own. Skipped without a Docker daemon, like the other
*DockerIntegrationTest classes; the image is prefetched in CI with the
others.
* docs(tls): containers Floci launches trust the Floci CA
Describe the bundle every launched container receives, the five variables that
point at it, that a value set on the function or task definition wins, and
that the JVM ignores these variables so a Java workload still needs its own
trust store.
* fix(docker): recreate a container without the trust variables when the bundle cannot be copied
SSL_CERT_FILE, CURL_CA_BUNDLE and REQUESTS_CA_BUNDLE replace a runtime's trust
store, so a container whose bundle copy failed (an image without /etc) used to
start pointing them at a file that was not there, and lost every HTTPS
connection instead of only the ones to Floci. The lifecycle manager now removes
that container and creates it again without the variables, so it keeps the
image's own trust store. The host configuration, and with it any dynamic host
port, is built once and reused.
* fix(tls): serve only the certificate blocks of a user-provided file from ca.pem
In custom-certificate mode GET /_floci/ca.pem returned the configured
certificate file byte for byte, so a combined certificate-and-key file, the
form OpenSSL tooling produces, handed the server's private key to any caller.
The endpoint now goes through the same certificate-only parsing the container
bundle uses. TlsUserCertIntegrationTest boots on a combined file and asserts
the response holds the user certificate and the local CA and no key.
* test(cloudformation): wait for DeleteStack to finish before asserting on deleted resources
DeleteStack hands the work to an executor and answers at once. Seven tests in
CloudFormationIntegrationTest asserted on the deleted resources right after the
answer; one of them, deleteStack_ecs_leavesNoOrphans, failed shard 1 of this
pull request's CI 44 ms later with the cluster still ACTIVE, while the same
shard had passed on the previous push.
A shared awaitStackDeleted polls DescribeStacks until the stack reports
DELETE_COMPLETE or no longer exists, fails on DELETE_FAILED or after ten
seconds, and replaces the three inline copies of that loop as well.
* docs(tls): restore the learned-hostnames section and the ACM wording that #3079 dropped
#3079's docs commit (
|
||
|
|
65e1d506cc |
ci(compat): fail the build when compat-opentofu drifts from compat-terraform (#2898)
Adds a CI job comparing the resource address lists in the two configs' main.tf files, failing on any unlisted one-sided resource. The 11 resources already only in compat-terraform (Application Auto Scaling, RDS, the CloudWatch alarm, the IAM managed-policy-attach path, IAM tag coverage, and the GuardDuty org feature) are recorded as pre-existing gaps in a new tf-only allowlist rather than ported, so the check also flags an allowlist entry once it stops being one-sided. Allowlists are directional (separate tf-only / otf-only files) so a resource that flips sides -- dropped from one config and re-added to the other under the same address -- is still reported as unreviewed drift instead of silently matching a stale entry from the old side. Closes #2263 |
||
|
|
47034394d1 |
ci: surface per-class timings from the compatibility test legs (#2507)
* ci: surface per-class timings from the compatibility test legs The slowest compatibility leg (sdk-test-java, ~10 minutes) is a black box: the container entrypoint runs the build tool quietly, so the job log shows pass/fail but no per-class times, and the junit XMLs the suites already export to test-results/ are discarded after the summary step. - Report the slowest 25 classes (and the suite total) in the job log and step summary, parsed from the exported junit XMLs. - Upload test-results/ as a per-leg artifact so timings are machine-readable across runs. - Extend the leg's sparse checkout to include .github/ci for the parser. No test behavior changes; the report step never fails the job. * ci: retrigger compatibility legs when the timing parser changes * ci: make the timing reporter total and the report step non-fatal The reporter promised it never fails the job, but only ET.ParseError was caught: a locale-formatted time attribute (ValueError) or an unreadable path (OSError) would exit non-zero and fail an otherwise-green leg. Catch both with a stderr warning naming the file, and add continue-on-error to the report step so the property holds regardless of parser changes. |
||
|
|
257e004600 |
ci: shard Build and Test into a 4-way profile-grouped matrix (#2506)
The suite grew past its timeout: 7,855 tests in mid-July to 11,800 today, 19-20 minute runs against the (now 30-minute) cap, with 51 serialized Quarkus augmentations before any test executes. Sharding is the only >3x lever. - 4 shards, each a deterministic slice computed at runtime from the compiled test classes, so a new package can never silently fall outside every shard. - Group-by-profile partitioner: classes sharing a @TestProfile land in one shard atomically, since per-shard augmentation cost is distinct profiles times ~5.4s and a split group pays its augmentation once per shard. - ci-summary aggregation gate fails on any shard failure, any class assigned to two shards, or any class assigned to none, checked against the same commit's own class list rather than a hardcoded count. - The maven cache step is split into restore (all shards) / save (shard 1 only) so four shards do not race one save key. - Best-effort background Docker image prefetch per shard, pulling only the images that shard's tests use. - Per-shard timeout drops to 15 minutes; expected worst shard ~5.5-6.5 min. |