mirror of
https://github.com/katanemo/plano.git
synced 2026-06-17 15:25:17 +02:00
run tests
This commit is contained in:
parent
40b339b2e3
commit
f18919ff15
5 changed files with 60 additions and 5 deletions
31
.github/workflows/validate_arch_config.yml
vendored
Normal file
31
.github/workflows/validate_arch_config.yml
vendored
Normal 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
|
||||
|
|
@ -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"]
|
||||
|
|
|
|||
20
arch/validate_arch_config.sh
Normal file
20
arch/validate_arch_config.sh
Normal 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
1
arch/validate_schema.sh
Normal file
|
|
@ -0,0 +1 @@
|
|||
python config_generator.py
|
||||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue