mirror of
https://github.com/invariantlabs-ai/invariant-gateway.git
synced 2026-05-21 06:26:47 +02:00
Rename containers
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
services:
|
||||
explorer-proxy:
|
||||
container_name: explorer-proxy
|
||||
invariant-proxy:
|
||||
container_name: invariant-proxy
|
||||
build:
|
||||
context: ./proxy
|
||||
dockerfile: ../proxy/Dockerfile.proxy
|
||||
@@ -20,9 +20,9 @@ services:
|
||||
labels:
|
||||
# For access via Traefik
|
||||
- "traefik.enable=true"
|
||||
- "traefik.http.routers.explorer-proxy-api.rule=(Host(`localhost`) && PathPrefix(`/api/v1/proxy/`)) || (Host(`127.0.0.1`) && PathPrefix(`/api/v1/proxy/`))"
|
||||
- "traefik.http.routers.explorer-proxy-api.entrypoints=invariant-explorer-web"
|
||||
- "traefik.http.services.explorer-proxy-api.loadbalancer.server.port=8000"
|
||||
- "traefik.http.routers.invariant-proxy-api.rule=(Host(`localhost`) && PathPrefix(`/api/v1/proxy/`)) || (Host(`127.0.0.1`) && PathPrefix(`/api/v1/proxy/`))"
|
||||
- "traefik.http.routers.invariant-proxy-api.entrypoints=invariant-explorer-web"
|
||||
- "traefik.http.services.invariant-proxy-api.loadbalancer.server.port=8000"
|
||||
- "traefik.docker.network=invariant-explorer-web"
|
||||
|
||||
networks:
|
||||
|
||||
@@ -47,22 +47,22 @@ tests() {
|
||||
docker compose -f tests/docker-compose.test.yml build
|
||||
docker compose -f tests/docker-compose.test.yml up -d
|
||||
|
||||
until [ "$(docker inspect -f '{{.State.Health.Status}}' explorer-proxy-test-app-api)" = "healthy" ]; do
|
||||
echo "explorer-proxy-test-app-api container starting..."
|
||||
until [ "$(docker inspect -f '{{.State.Health.Status}}' invariant-proxy-test-explorer-app-api)" = "healthy" ]; do
|
||||
echo "Explorer backend app-api instance container starting..."
|
||||
sleep 2
|
||||
done
|
||||
|
||||
until [ "$(docker inspect -f '{{.State.Health.Status}}' explorer-proxy-test)" = "healthy" ]; do
|
||||
echo "explorer-proxy-test container starting..."
|
||||
until [ "$(docker inspect -f '{{.State.Health.Status}}' invariant-proxy-test)" = "healthy" ]; do
|
||||
echo "Invariant proxy test instance container starting..."
|
||||
sleep 2
|
||||
done
|
||||
|
||||
echo "app-api and proxy are available. Running tests..."
|
||||
echo "Running tests..."
|
||||
|
||||
# Make call to signup endpoint
|
||||
curl -k -X POST http://127.0.0.1/api/v1/user/signup
|
||||
|
||||
docker build -t 'explorer-proxy-tests' -f ./tests/Dockerfile.test ./tests
|
||||
docker build -t 'invariant-proxy-tests' -f ./tests/Dockerfile.test ./tests
|
||||
|
||||
docker run \
|
||||
--mount type=bind,source=./tests,target=/tests \
|
||||
@@ -70,7 +70,7 @@ tests() {
|
||||
-e OPENAI_API_KEY="$OPENAI_API_KEY" \
|
||||
-e ANTHROPIC_API_KEY="$ANTHROPIC_API_KEY"\
|
||||
--env-file ./tests/.env.test \
|
||||
explorer-proxy-tests $@
|
||||
invariant-proxy-tests $@
|
||||
}
|
||||
|
||||
# -----------------------------
|
||||
|
||||
+2
-2
@@ -1,8 +1,8 @@
|
||||
# To push traces to the local instance of the explorer app-api
|
||||
# from the proxy. Both proxy and app-api are on the same network:
|
||||
# invariant-proxy-web-test
|
||||
INVARIANT_API_URL=http://explorer-proxy-test-app-api:8000
|
||||
INVARIANT_PROXY_API_URL=http://explorer-proxy-test:8000
|
||||
INVARIANT_API_URL=http://invariant-proxy-test-explorer-app-api:8000
|
||||
INVARIANT_PROXY_API_URL=http://invariant-proxy-test:8000
|
||||
|
||||
POSTGRES_USER=postgres
|
||||
POSTGRES_PASSWORD=postgres
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
name: explorer-proxy-test-stack
|
||||
name: invariant-proxy-test-stack
|
||||
services:
|
||||
traefik:
|
||||
image: traefik:v2.0
|
||||
container_name: "explorer-proxy-test-traefik"
|
||||
container_name: "invariant-proxy-test-traefik"
|
||||
command:
|
||||
- --providers.docker=true
|
||||
# Enable the API handler in insecure mode,
|
||||
@@ -21,8 +21,8 @@ services:
|
||||
- "traefik.enable=true"
|
||||
- "traefik.http.routers.traefik-http.entrypoints=invariant-proxy-web-test"
|
||||
|
||||
explorer-proxy:
|
||||
container_name: explorer-proxy-test
|
||||
invariant-proxy:
|
||||
container_name: invariant-proxy-test
|
||||
build:
|
||||
context: ../proxy
|
||||
dockerfile: ../proxy/Dockerfile.proxy
|
||||
@@ -43,9 +43,9 @@ services:
|
||||
ports: []
|
||||
labels:
|
||||
- "traefik.enable=true"
|
||||
- "traefik.http.routers.explorer-proxy-api.rule=(Host(`localhost`) && PathPrefix(`/api/v1/proxy/`)) || (Host(`127.0.0.1`) && PathPrefix(`/api/v1/proxy/`))"
|
||||
- "traefik.http.routers.explorer-proxy-api.entrypoints=invariant-proxy-web-test"
|
||||
- "traefik.http.services.explorer-proxy-api.loadbalancer.server.port=8000"
|
||||
- "traefik.http.routers.invariant-proxy-api.rule=(Host(`localhost`) && PathPrefix(`/api/v1/proxy/`)) || (Host(`127.0.0.1`) && PathPrefix(`/api/v1/proxy/`))"
|
||||
- "traefik.http.routers.invariant-proxy-api.entrypoints=invariant-proxy-web-test"
|
||||
- "traefik.http.services.invariant-proxy-api.loadbalancer.server.port=8000"
|
||||
- "traefik.docker.network=invariant-proxy-web-test"
|
||||
healthcheck:
|
||||
test: curl -X GET -I http://localhost:8000/api/v1/proxy/health --fail
|
||||
@@ -53,7 +53,7 @@ services:
|
||||
timeout: 5s
|
||||
|
||||
app-api:
|
||||
container_name: explorer-proxy-test-app-api
|
||||
container_name: invariant-proxy-test-explorer-app-api
|
||||
image: ghcr.io/invariantlabs-ai/explorer/app-api:latest
|
||||
platform: linux/amd64
|
||||
depends_on:
|
||||
@@ -78,9 +78,9 @@ services:
|
||||
- /tmp/invariant-proxy-test/configs/explorer.test.yml:/config/explorer.config.yml
|
||||
labels:
|
||||
- "traefik.enable=true"
|
||||
- "traefik.http.routers.explorer-test-api.rule=(Host(`localhost`) && PathPrefix(`/api/`)) || (Host(`127.0.0.1`) && PathPrefix(`/api/`))"
|
||||
- "traefik.http.routers.explorer-test-api.entrypoints=invariant-proxy-web-test"
|
||||
- "traefik.http.services.explorer-test-api.loadbalancer.server.port=8000"
|
||||
- "traefik.http.routers.invariant-test-api.rule=(Host(`localhost`) && PathPrefix(`/api/`)) || (Host(`127.0.0.1`) && PathPrefix(`/api/`))"
|
||||
- "traefik.http.routers.invariant-test-api.entrypoints=invariant-proxy-web-test"
|
||||
- "traefik.http.services.invariant-test-api.loadbalancer.server.port=8000"
|
||||
- "traefik.docker.network=invariant-proxy-web-test"
|
||||
healthcheck:
|
||||
test: curl -X GET -I http://localhost:8000/api/v1/ --fail
|
||||
@@ -88,7 +88,7 @@ services:
|
||||
timeout: 5s
|
||||
|
||||
database:
|
||||
container_name: explorer-proxy-test-database
|
||||
container_name: invariant-proxy-test-database
|
||||
image: postgres:16
|
||||
env_file:
|
||||
- .env.test
|
||||
|
||||
Reference in New Issue
Block a user