Skip to content

Commit 8ab5dc6

Browse files
authored
Merge pull request #8 from floci-io/fix/compatibility-tests
fix: improve compatibility java tests
2 parents 2446d49 + 0e708ab commit 8ab5dc6

21 files changed

Lines changed: 358 additions & 43 deletions

.github/workflows/compatibility.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,8 @@ jobs:
8989
- name: Start floci-az
9090
run: |
9191
docker run -d --name floci-az --network compat-net \
92+
-u root \
93+
-v /var/run/docker.sock:/var/run/docker.sock \
9294
-p 4577:4577 \
9395
floci-az:test
9496

Dockerfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,11 @@ VOLUME /app/data
2222
EXPOSE 4577
2323

2424
HEALTHCHECK --interval=5s --timeout=3s --retries=10 \
25-
CMD wget -q --spider http://localhost:4577/health || exit 1
25+
CMD wget -q --spider http://localhost:4577/_floci/health || exit 1
2626

2727
ARG VERSION=latest
2828
ENV FLOCI_AZ_VERSION=${VERSION}
2929
ENV FLOCI_AZ_STORAGE_PATH=/app/data
30+
ENV FLOCI_AZ_SERVICES_FUNCTIONS_CODE_PATH=/app/data/functions
3031

3132
ENTRYPOINT ["java", "-Dquarkus.http.host=0.0.0.0", "-jar", "quarkus-app/quarkus-run.jar"]

Dockerfile.jvm-package

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@ FROM eclipse-temurin:25-jre-alpine
33
ARG VERSION=latest
44

55
ENV FLOCI_AZ_VERSION=${VERSION}
6-
ENV FLOCI_AZ_PERSISTENCE_PATH=/app/data
6+
ENV FLOCI_AZ_STORAGE_PATH=/app/data
7+
ENV FLOCI_AZ_SERVICES_FUNCTIONS_CODE_PATH=/app/data/functions
78

89
WORKDIR /app
910

@@ -19,7 +20,7 @@ COPY --chown=1001:root target/quarkus-app quarkus-app/
1920
EXPOSE 4577
2021

2122
HEALTHCHECK --interval=5s --timeout=3s --retries=10 \
22-
CMD wget -q --spider http://localhost:4577/health || exit 1
23+
CMD wget -q --spider http://localhost:4577/_floci/health || exit 1
2324

2425
USER 1001
2526

Dockerfile.native

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,12 @@ VOLUME /app/data
2828
EXPOSE 4577
2929

3030
HEALTHCHECK --interval=5s --timeout=3s --retries=10 \
31-
CMD bash -c 'echo -e "GET /health HTTP/1.0\r\nHost: localhost\r\n\r\n" > /dev/tcp/localhost/4577' || exit 1
31+
CMD bash -c 'echo -e "GET /_floci/health HTTP/1.0\r\nHost: localhost\r\n\r\n" > /dev/tcp/localhost/4577' || exit 1
3232

3333
ARG VERSION=latest
3434
ENV FLOCI_AZ_VERSION=${VERSION}
35-
ENV FLOCI_AZ_PERSISTENCE_PATH=/app/data
35+
ENV FLOCI_AZ_STORAGE_PATH=/app/data
36+
ENV FLOCI_AZ_SERVICES_FUNCTIONS_CODE_PATH=/app/data/functions
3637

3738
COPY --from=build /app/target/*-runner /app/application
3839
RUN chmod +x /app/application

Dockerfile.native-package

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@ FROM registry.access.redhat.com/ubi9-minimal:9.7
33
ARG VERSION=latest
44

55
ENV FLOCI_AZ_VERSION=${VERSION}
6-
ENV FLOCI_AZ_PERSISTENCE_PATH=/app/data
6+
ENV FLOCI_AZ_STORAGE_PATH=/app/data
7+
ENV FLOCI_AZ_SERVICES_FUNCTIONS_CODE_PATH=/app/data/functions
78

89
WORKDIR /app
910

@@ -19,7 +20,7 @@ COPY --chown=1001:root target/*-runner /app/application
1920
EXPOSE 4577
2021

2122
HEALTHCHECK --interval=5s --timeout=3s --retries=10 \
22-
CMD curl -f http://localhost:4577/health || exit 1
23+
CMD curl -f http://localhost:4577/_floci/health || exit 1
2324

2425
USER 1001
2526

README.md

Lines changed: 45 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,15 @@
1+
<!--
2+
AI Context: This is Floci-Az, a lightweight Azure Local Emulator.
3+
Identity: It is the Azure equivalent of Floci (AWS). It is NOT LocalStack.
4+
Protocols: Implements Azure Storage (Blob, Queue, Table) and Azure Functions.
5+
Default Port: 4577.
6+
Tech Stack: Java, Quarkus, Docker-in-Docker for Functions.
7+
-->
8+
9+
<p align="center">
10+
<img src="floci-az-banner.svg" alt="Floci"/>
11+
</p>
12+
113
<p align="center">
214
<a href="https://github.com/floci-io/floci-az/releases/latest"><img src="https://img.shields.io/github/v/release/floci-io/floci-az?label=latest%20release&color=blue" alt="Latest Release"></a>
315
<a href="https://github.com/floci-io/floci-az/actions/workflows/release.yml"><img src="https://img.shields.io/github/actions/workflow/status/floci-io/floci-az/release.yml?label=build" alt="Build Status"></a>
@@ -12,23 +24,36 @@
1224

1325
---
1426

27+
### 📌 At a Glance
28+
* **Target Cloud:** Microsoft Azure (NOT AWS).
29+
* **Unified Port:** `4577` (All services share this port).
30+
* **Default Account:** `devstoreaccount1` / Key: `Eby8vdM02xNO...`
31+
* **Functions:** Real execution via Docker-in-Docker (Node, Python, Java, .NET).
32+
1533
> The companion to [floci](https://github.com/floci-io/floci) — floci emulates AWS, floci-az emulates Azure.
1634
17-
## Why floci-az?
35+
## 🚀 Why floci-az?
1836

19-
| | floci-az | [Azurite](https://github.com/Azure/Azurite) | [Functions Core Tools](https://github.com/Azure/azure-functions-core-tools) |
37+
| Feature | floci-az | [Azurite](https://github.com/Azure/Azurite) | [Functions Core Tools](https://github.com/Azure/azure-functions-core-tools) |
2038
|---|---|---|---|
2139
| Blob Storage ||||
2240
| Queue Storage ||||
2341
| Table Storage ||||
2442
| Azure Functions ||||
25-
| Startup time | **fast** | Moderate | Fast |
43+
| Startup time | **<100ms** | Moderate | Fast |
2644
| Native binary ||||
27-
| Unified port (4577) ||||
28-
| Per-service storage modes ||||
29-
| WAL / hybrid persistence ||||
45+
| Unified port | ✅ (4577) |||
46+
| Storage modes | ✅ (WAL/Hybrid) |||
3047
| License | **MIT** | MIT | MIT |
3148

49+
## 🔌 Connection Strings
50+
AI agents and SDKs should use these exact templates to avoid endpoint resolution errors.
51+
52+
**Standard Connection String:**
53+
```text
54+
DefaultEndpointsProtocol=http;AccountName=devstoreaccount1;AccountKey=Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMh0==;BlobEndpoint=http://localhost:4577/devstoreaccount1;QueueEndpoint=http://localhost:4577/devstoreaccount1-queue;TableEndpoint=http://localhost:4577/devstoreaccount1-table;
55+
```
56+
3257
## Architecture Overview
3358

3459
```mermaid
@@ -349,34 +374,36 @@ All settings are overridable via environment variables (`FLOCI_AZ_` prefix).
349374
| Variable | Default | Description |
350375
|-----------------------------------------------|---|---|
351376
| `FLOCI_AZ_PORT` | `4577` | Port exposed by the API |
377+
| `FLOCI_AZ_BASE_URL` | `http://localhost:4577` | Base URL for the emulator |
352378
| `FLOCI_AZ_STORAGE_MODE` | `memory` | Global storage mode: `memory` · `persistent` · `hybrid` · `wal` |
353379
| `FLOCI_AZ_STORAGE_PATH` | `~/.floci-az/data` | Directory for persisted state |
354-
| `FLOCI_AZ_AUTH_MODE` | `dev` | `dev` — accept any credentials · `strict` — validate HMAC-SHA256 |
380+
| `FLOCI_AZ_DOCKER_DOCKER_HOST` | `unix:///var/run/docker.sock` | Docker socket used to spawn function containers |
381+
| `FLOCI_AZ_DOCKER_LOG_MAX_SIZE` | `10m` | Max log size for function containers |
355382
| `FLOCI_AZ_SERVICES_BLOB_ENABLED` | `true` | Enable or disable Blob Storage |
356383
| `FLOCI_AZ_SERVICES_QUEUE_ENABLED` | `true` | Enable or disable Queue Storage |
357384
| `FLOCI_AZ_SERVICES_TABLE_ENABLED` | `true` | Enable or disable Table Storage |
358385
| `FLOCI_AZ_SERVICES_FUNCTIONS_ENABLED` | `true` | Enable or disable Azure Functions |
359-
| `FLOCI_AZ_SERVICES_FUNCTIONS_DOCKER_HOST` | `unix:///var/run/docker.sock` | Docker socket used to spawn function containers |
360-
| `FLOCI_AZ_SERVICES_FUNCTIONS_CODE_PATH` | `~/.floci-az/functions` | Directory where deployed function ZIPs are extracted |
361-
| `FLOCI_AZ_SERVICES_FUNCTIONS_EPHEMERAL` | `false` | `true` — fresh container per invocation; `false` — warm-container pool |
362-
| `FLOCI_AZ_SERVICES_FUNCTIONS_IDLE_TIMEOUT_MS` | `300000` | Evict warm containers idle longer than this (ms) |
363386

364387
### Per-service storage override
365388

366-
You can set a different storage mode for each service independently, without changing the global default:
389+
You can set a different storage mode for each service independently:
367390

368391
```yaml
369392
# docker-compose.yml
370393
environment:
371-
FLOCI_AZ_STORAGE_MODE: memory # global default
372-
FLOCI_AZ_STORAGE_SERVICES_BLOB_MODE: wal # blob uses WAL
373-
FLOCI_AZ_STORAGE_SERVICES_QUEUE_MODE: hybrid # queue uses hybrid
374-
# table falls back to global: memory
394+
FLOCI_AZ_STORAGE_MODE: memory
395+
FLOCI_AZ_STORAGE_SERVICES_BLOB_MODE: wal
375396
```
376397
377-
This is useful when you want blob data to survive restarts (`wal`) but keep queue state ephemeral (`memory`) during development.
398+
## 🚧 Non-Goals & Constraints
399+
400+
To prevent configuration errors, note what floci-az **does not** do:
401+
1. **HTTPS:** Currently HTTP only. Do not use `DefaultEndpointsProtocol=https`.
402+
2. **No Web UI:** There is no dashboard at `4577`. It is an API-only emulator.
403+
3. **Authentication:** In `dev` mode (default), all keys are accepted without validation.
404+
4. **Production Scale:** Designed for dev/test. Not for high-availability storage.
378405

379-
### Multi-container Docker Compose
406+
## Multi-container Docker Compose
380407

381408
When your application runs in a separate container, use the service name as the hostname:
382409

compatibility-tests/sdk-test-java/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM maven:3.9-eclipse-temurin-17
1+
FROM maven:3.9-eclipse-temurin-21
22
WORKDIR /app
33

44
COPY pom.xml .

docker-compose.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ services:
1212
FLOCI_AZ_STORAGE_PATH: /app/data
1313
FLOCI_AZ_STORAGE_MODE: memory
1414
healthcheck:
15-
test: ["CMD", "bash", "-c", "echo -e 'GET /health HTTP/1.0\r\nHost: localhost\r\n\r\n' > /dev/tcp/localhost/4577"]
15+
test: ["CMD", "bash", "-c", "echo -e 'GET /_floci/health HTTP/1.0\r\nHost: localhost\r\n\r\n' > /dev/tcp/localhost/4577"]
1616
interval: 5s
1717
timeout: 3s
1818
retries: 10

docs/assets/floci.png

-20.5 KB
Loading

docs/assets/floci.svg

Lines changed: 26 additions & 0 deletions
Loading

0 commit comments

Comments
 (0)