/
config.yml
94 lines (90 loc) · 3.47 KB
/
config.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
version: 2.1
# Define custom commands for this config
# See https://circleci.com/docs/reusing-config/#authoring-reusable-commands
commands:
check-python:
steps:
- run:
command: source ./venv/bin/activate && python3 --version
name: Check Python version
- run:
command: source ./venv/bin/activate && pip3 --version
name: Check Pip version
install-venv:
steps:
- run:
command: source ./tools/install-venv.sh
name: Enter virtual env and install dependencies
# Define custom jobs for this config
# See: https://circleci.com/docs/jobs-steps/
jobs:
run-unit-tests:
machine: # Executor type
# For a full list of Linux VM execution environments, see
# https://circleci.com/developer/images?imageType=machine
image: ubuntu-2204:2023.07.2
steps:
- checkout # Check out the code in the project directory
- install-venv
- check-python # Invoke command "check-python" after entering venv
- run:
command: source ./venv/bin/activate && pytest -s
name: Test rag unit tests
# For use in part 2 of the tutorial - uncomment to use
# See https://circleci.com/blog/deploy-reevaluate-llm-apps-langsmith/
# run-nightly-tests:
# machine: # Executor type
# # For a full list of Linux VM execution environments, see
# # https://circleci.com/developer/images?imageType=machine
# image: ubuntu-2204:2023.07.2
# steps:
# - checkout # Check out the code in the project directory
# - install-venv
# - check-python # Invoke command "check-python" after entering venv
# - run:
# command: source ./venv/bin/activate && pytest -s
# name: Run nightly tests
# deploy:
# # For running on CircleCI's self-hosted runners
# machine: true
# resource_class: user/sample-project # TODO add self-hosted runner resource class details
# steps:
# - checkout
# - install-venv
# - check-python # Invoke command "check-python" after entering venv
# - run:
# command: timeout --preserve-status --foreground 90 bash -c "source ./venv/bin/activate ; flask --app rag/app run" || true # Run the server for 90 seconds to test
# name: Deploy application on self-hosted runner
# Invoke jobs via workflows
# See: https://circleci.com/docs/workflows/
workflows:
integration-tests:
jobs:
- run-unit-tests:
context: rag-context # This contains environment variables (https://circleci.com/docs/contexts/)
filters:
branches:
only:
- rag-pipeline # Only run the job when this branch is updated
# For use in part 2 of the tutorial - uncomment to use
# See https://circleci.com/blog/deploy-reevaluate-llm-apps-langsmith/
# deployment-tests:
# # Trigger on a schedule or when retrain branch is updated
# triggers:
# - schedule:
# cron: "0 0 * * *" # Daily at midnight
# filters:
# branches:
# only:
# - main
# jobs:
# - run-nightly-tests:
# context: rag-context # This contains environment variables
# - hold: # A job that will require manual approval in the CircleCI web application.
# requires:
# - run-nightly-tests
# type: approval # This key-value pair will set your workflow to a status of "On Hold"
# - deploy:
# context: rag-context # This contains environment variables
# requires:
# - hold