Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add svc-itest and svc-contact #44

Merged
merged 1 commit into from
Mar 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .cspell.project-words.txt
Original file line number Diff line number Diff line change
Expand Up @@ -90,3 +90,7 @@ Vertiports
vertiports
extname
extrelocatable
aeth
hoorn
wadden
itest
18 changes: 18 additions & 0 deletions local-dev/.env-example
Original file line number Diff line number Diff line change
Expand Up @@ -121,3 +121,21 @@ DISCOVERY_TAG=latest-develop
DISCOVERY_HOST_PORT_GRPC=50013
DISCOVERY_HOST_PORT_REST=8013
DISCOVERY_HOST_GRPC=svc-discovery

# -----------------------------------------------------------
# svc-contact
# -----------------------------------------------------------
CONTACT_IMAGE=ghcr.io/arrow-air/svc-contact
CONTACT_TAG=latest-develop
CONTACT_HOST_PORT_GRPC=50014
CONTACT_HOST_PORT_REST=8014
CONTACT_HOST_GRPC=svc-contact

# -----------------------------------------------------------
# svc-itest
# -----------------------------------------------------------
ITEST_IMAGE=ghcr.io/arrow-air/svc-itest
ITEST_TAG=latest-develop
ITEST_HOST_PORT_GRPC=50014
ITEST_HOST_PORT_REST=8099
ITEST_HOST_GRPC=svc-itest
118 changes: 118 additions & 0 deletions local-dev/demo.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
#!/bin/bash
source .env
BASE_URL="http://0.0.0.0:8014"
# echo "Running Population for $BASE_URL..."

VERTIPORT_ID=$(curl \
--request PUT \
-H "Content-Type: application/json" \
-d '{
"label": "Hoorn Hangar #1",
"vertices": [
[52.6387406, 5.1693605],
[52.6391572, 5.1751138],
[52.6366050, 5.1759725],
[52.6357195, 5.1696181],
[52.6387406, 5.1693605]
]
}' \
$BASE_URL/demo/vertiport
)

if [ -z "$VERTIPORT_ID" ]; then
echo "Failed to create vertiport"
exit 1
fi

echo "Vertiport ID: $VERTIPORT_ID"

AIRCRAFT=("Marauder" "Mantis" "Ghost" "RazorCrest")

echo "nickname,uuid,registration_number" > aircraft.csv
for i in "${!AIRCRAFT[@]}"; do
a=${AIRCRAFT[$i]}
REGISTRATION="AETH-CRAFT-$i"

VERTIPAD_ID=$(curl \
--request PUT \
-H "Content-Type: application/json" \
-d '{
"vertiport_id": '"$VERTIPORT_ID"',
"latitude": 52.6379593,
"longitude": 5.1716790,
"label": "pad-'"$i"'"
}' \
$BASE_URL/demo/vertipad
)

AIRCRAFT_ID=$(curl \
-q \
-X PUT -H "Content-Type: application/json" \
-d '{
"nickname": "'"$a"'",
"registration_number": "'"$REGISTRATION"'",
"hangar_id": '"$VERTIPORT_ID"',
"hangar_bay_id": '"$VERTIPAD_ID"'
}' \
http://0.0.0.0:$ITEST_HOST_PORT_REST/demo/aircraft)

echo "$a,$AIRCRAFT_ID,$REGISTRATION" >> aircraft.csv
done

#
# HOORN
#
HOORN_ID=$(curl \
--request PUT \
-H "Content-Type: application/json" \
-d '{
"label": "Hoorn Private #1",
"vertices": [
[52.6487268, 4.9891228],
[52.6480889, 4.9892300],
[52.6481410, 4.9901310],
[52.6487528, 4.9900881],
[52.6487268, 4.9891228]
]
}' \
$BASE_URL/demo/vertiport)

curl \
--request PUT \
-H "Content-Type: application/json" \
-d '{
"vertiport_id": '"$HOORN_ID"',
"latitude": 52.6484013,
"longitude": 4.9897020,
"label": "pad-1"
}' \
$BASE_URL/demo/vertipad

#
# MARKER WADDEN
#
WADDEN_ID=$(curl \
--request PUT \
-H "Content-Type: application/json" \
-d '{
"label": "Marker Wadden Private #1",
"vertices": [
[52.5841430, 5.3645049],
[52.5840615, 5.3645062],
[52.5840607, 5.3646658],
[52.5841463, 5.3646684],
[52.5841430, 5.3645049]
]
}' \
$BASE_URL/demo/vertiport)

curl \
--request PUT \
-H "Content-Type: application/json" \
-d '{
"vertiport_id": '"$WADDEN_ID"',
"latitude": 52.5841015,
"longitude": 5.3645814,
"label": "pad-1"
}' \
$BASE_URL/demo/vertipad
38 changes: 36 additions & 2 deletions local-dev/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -135,8 +135,6 @@ services:
condition: service_healthy
svc-storage:
condition: service_healthy
svc-compliance:
condition: service_healthy

svc-pricing:
image: ${PRICING_IMAGE}:${PRICING_TAG}
Expand All @@ -151,13 +149,17 @@ services:
extends:
file: docker-compose/arrow-svc.yml
service: server
ports:
- ${CARGO_HOST_PORT_REST}:8000
depends_on:
svc-storage:
condition: service_healthy
svc-scheduler:
condition: service_healthy
svc-pricing:
condition: service_healthy
svc-contact:
condition: service_healthy
environment:
- REQUEST_LIMIT_PER_SECOND=$REST_REQUEST_LIMIT_PER_SECOND

Expand All @@ -171,6 +173,18 @@ services:
svc-storage:
condition: service_healthy

svc-contact:
image: ${CONTACT_IMAGE}:${CONTACT_TAG}
container_name: arrow-svc-contact
ports:
- ${CONTACT_HOST_PORT_REST}:8000
extends:
file: docker-compose/arrow-svc.yml
service: server
depends_on:
svc-storage:
condition: service_healthy

svc-atc:
image: ${ATC_IMAGE}:${ATC_TAG}
container_name: arrow-svc-atc
Expand Down Expand Up @@ -214,3 +228,23 @@ services:
condition: service_healthy
svc-telemetry:
condition: service_healthy

svc-itest:
image: ${ITEST_IMAGE}:${ITEST_TAG}
container_name: arrow-svc-itest
ports:
- ${ITEST_HOST_PORT_REST}:8000
extends:
file: docker-compose/arrow-svc.yml
service: server
depends_on:
svc-telemetry:
condition: service_healthy
svc-cargo:
condition: service_healthy
svc-gis:
condition: service_healthy
svc-storage:
condition: service_healthy
svc-compliance:
condition: service_healthy
Loading