-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathJenkinsfile.eval
More file actions
106 lines (94 loc) · 3.78 KB
/
Jenkinsfile.eval
File metadata and controls
106 lines (94 loc) · 3.78 KB
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
95
96
97
98
99
100
101
102
103
104
105
106
pipeline {
agent any
options {
disableConcurrentBuilds()
buildDiscarder(logRotator(numToKeepStr: '10'))
}
triggers {
githubPush()
}
tools {
nodejs 'Node24'
}
environment {
TEST_LOCALE = 'en'
OLLAMA_URL = 'http://192.168.68.80:11434/v1'
OLLAMA_MODEL = 'mistral-small3.2:24b-instruct-2506-q8_0'
DOCKER_HOST_IP = '172.17.0.1'
MONGODB_URI = 'mongodb://172.17.0.1:27017/cognito-eval'
WEAVIATE_HTTP_HOST = '172.17.0.1'
WEAVIATE_HTTP_PORT = '8081'
WEAVIATE_GRPC_HOST = '172.17.0.1'
WEAVIATE_GRPC_PORT = '50052'
WEAVIATE_SECURE = 'false'
WEAVIATE_API_KEY = 'eval-test-key'
ENABLE_VECTORIZERS = 'true'
}
stages {
stage('Checkout') {
steps {
checkout scm
withCredentials([string(credentialsId: 'github-cognito-webhook', variable: 'GITHUB_TOKEN')]) {
sh '''
curl -s -X POST \
-H "Authorization: token $GITHUB_TOKEN" \
-H "Accept: application/vnd.github.v3+json" \
"https://api.github.com/repos/KoderFPV/Cognito/statuses/$GIT_COMMIT" \
-d '{"state":"pending","context":"CI / Evaluation tests","description":"Evaluation tests running..."}'
'''
}
}
}
stage('Start Infrastructure') {
steps {
sh '''
docker compose -f docker-compose.eval.yml down -v 2>/dev/null || true
docker compose -f docker-compose.eval.yml up -d --force-recreate
echo "Waiting for MongoDB..."
timeout 60 bash -c 'until docker exec cognito-eval-mongo mongosh --eval "db.runCommand({ ping: 1 })" > /dev/null 2>&1; do sleep 2; done'
echo "Waiting for Weaviate..."
timeout 120 bash -c 'until curl -s http://172.17.0.1:8081/v1/.well-known/ready > /dev/null 2>&1; do sleep 2; done'
echo "Infrastructure ready!"
'''
}
}
stage('Install Dependencies') {
steps {
sh 'npm ci'
}
}
stage('Run Evaluation Tests') {
steps {
sh 'npm run test:eval'
}
}
}
post {
always {
archiveArtifacts artifacts: 'agents/__tests__/evaluation/last-run/*.json', allowEmptyArchive: true
sh 'docker compose -f docker-compose.eval.yml down -v || true'
}
failure {
withCredentials([string(credentialsId: 'github-cognito-webhook', variable: 'GITHUB_TOKEN')]) {
sh '''
curl -s -X POST \
-H "Authorization: token $GITHUB_TOKEN" \
-H "Accept: application/vnd.github.v3+json" \
"https://api.github.com/repos/KoderFPV/Cognito/statuses/$GIT_COMMIT" \
-d '{"state":"failure","context":"CI / Evaluation tests","description":"Evaluation tests failed"}'
'''
}
}
success {
withCredentials([string(credentialsId: 'github-cognito-webhook', variable: 'GITHUB_TOKEN')]) {
sh '''
curl -s -X POST \
-H "Authorization: token $GITHUB_TOKEN" \
-H "Accept: application/vnd.github.v3+json" \
"https://api.github.com/repos/KoderFPV/Cognito/statuses/$GIT_COMMIT" \
-d '{"state":"success","context":"CI / Evaluation tests","description":"Evaluation tests passed"}'
'''
}
}
}
}