run tests

This commit is contained in:
Adil Hafeez 2025-02-12 17:25:02 -08:00
parent 40b339b2e3
commit f18919ff15
No known key found for this signature in database
GPG key ID: 9B18EF7691369645
5 changed files with 60 additions and 5 deletions

View file

@ -0,0 +1,31 @@
name: e2e archgw tests
on:
push:
branches:
- main
pull_request:
jobs:
e2e_archgw_tests:
runs-on: ubuntu-latest
defaults:
run:
working-directory: .
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.12"
- name: build arch docker image
run: |
docker build -f arch/Dockerfile . -t katanemo/archgw
- name: validate arch config
run: |
sh arch/validate_arch_config.sh

View file

@ -24,8 +24,10 @@ RUN pip install -r requirements.txt
COPY arch/tools/cli/config_generator.py .
COPY arch/envoy.template.yaml .
COPY arch/arch_config_schema.yaml .
COPY arch/validate_schema.sh .
RUN pip install requests
RUN touch /var/log/envoy.log
RUN chmod a+x validate_schema.sh
ENTRYPOINT ["sh","-c", "python config_generator.py && envsubst < /etc/envoy/envoy.yaml > /etc/envoy.env_sub.yaml && envoy -c /etc/envoy.env_sub.yaml --component-log-level wasm:debug 2>&1 | tee /var/log/envoy.log"]

View file

@ -0,0 +1,20 @@
#!/bin/sh
failed_files=()
for file in $(find . -name arch_config.yaml -o -name arch_config_full_reference.yaml); do
echo "Validating $file..."
if ! docker run --rm -v "$(pwd)/$file:/app/arch_config.yaml:ro" --entrypoint /bin/sh katanemo/archgw:latest -c "python config_generator.py" 2>&1 > /dev/null ; then
echo "Validation failed for $file"
failed_files+=("$file")
fi
done
# Print summary of failed files
if [ ${#failed_files[@]} -ne 0 ]; then
echo -e "\nValidation failed for the following files:"
printf '%s\n' "${failed_files[@]}"
exit 1
else
echo -e "\nAll files validated successfully!"
fi

1
arch/validate_schema.sh Normal file
View file

@ -0,0 +1 @@
python config_generator.py

View file

@ -1,10 +1,11 @@
version: v0.1
listener:
address: 0.0.0.0
port: 10000
message_format: huggingface
connect_timeout: 0.005s
listeners:
prompt_gateway:
address: 0.0.0.0
port: 10000
message_format: openai
timeout: 30s
llm_providers:
- name: gpt-4o