Skip to content

Commit 2f52b8e

Browse files
authored
Merge pull request #1661 from nausikt/refactored-crabserver-helm-chart-for-argocd-n-cicd-integration
Refactored CRABServer helm chart for Argo CD monorepo-style and CI/CD integration readiness
2 parents 20f641c + 7cc7910 commit 2f52b8e

38 files changed

+460
-736
lines changed

helm/crabserver/Chart.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ type: application
1515
# This is the chart version. This version number should be incremented each time you make changes
1616
# to the chart and its templates, including the app version.
1717
# Versions are expected to follow Semantic Versioning (https://semver.org/)
18-
version: 0.2.1
18+
version: 1.0.0
1919

2020
# This is the version number of the application being deployed. This version number should be
2121
# incremented each time you make changes to the application. Versions are not expected to
2222
# follow Semantic Versioning. They should reflect the version the application is using.
23-
appVersion: "v3.240809"
23+
appVersion: "v3.250930"

helm/crabserver/apply_logstash.sh

Lines changed: 0 additions & 6 deletions
This file was deleted.
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
filebeat.inputs:
2+
- type: container
3+
paths:
4+
- /var/log/pods/crab_crabserver*/crabserver/*.log
5+
include_lines:
6+
- '\] (crabserver|crabserver-canary)-\w+-\w+ \d'
7+
tags:
8+
- "crabhttpcall"
9+
- type: container
10+
paths:
11+
- /var/log/pods/crab_crabserver*/crabserver/*.log
12+
include_lines:
13+
- 'MeasureTime:seconds - '
14+
- 'MeasureSize:bytes - '
15+
tags:
16+
- "crabrest"
17+
output.logstash:
18+
hosts: ["logstash:5044"]
19+
compression_level: 3
20+
bulk_max_size: 4096
21+
queue.mem:
22+
events: 65536
23+
logging.metrics.enabled: false
24+
logging.level: info
File renamed without changes.

helm/crabserver/config/test/logstash/logstash.conf renamed to helm/crabserver/config/preprod/crabtaskworker.conf

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -169,15 +169,10 @@ filter {
169169
"type" => "crabhttpcall"
170170
}
171171
}
172-
# parse log path to get pod name
173-
# /var/log/pods/crab_crabserver-test-5f9bd5f58d-5nfhc_5366ebdb-ee96-4641-8643-f3bbe63f808f/crabserver/0.log
174172
grok {
175-
match => { "[log][file][path]" => '/var/log/pods/crab_%{DATA:pod_name}_%{DATA}/%{GREEDYDATA}' }
176-
}
177-
178-
grok {
179-
# [07/Dec/2022:20:06:47] crabserver-56c69685b6-477jr 188.184.91.103:41924 "GET /crabserver/devthree/info HTTP/1.1" 200 OK [data: 9354 in 103 out 4870 us ] [auth: ok "/DC=ch/DC=cern/OU=Organic Units/OU=Users/CN=tseethon/CN=856006/CN=Thanayut Seethongchuen" "" ] [ref: "https://cmsweb-test12.cern.ch" "Mozilla/5.0 (X11; Linux x86_64; rv:107.0) Gecko/20100101 Firefox/107.0" ] - Podname=crabserver-6cf49bcfff-bxvb6 Type=cherrypylog
180-
match => { "message" => '\[%{NOTSPACE:timestamp_temp}\] %{DATA:backend} %{IPORHOST:clientip}(|:%{NUMBER}) "%{WORD:method} %{NOTSPACE:request} %{DATA:httpversion}" %{NUMBER:code:int} %{DATA} \[data: (-|%{NUMBER:bytes_sent:int}) in (-|%{NUMBER:bytes_received:int}) out (-|%{NUMBER:time_spent_ms:int}) us \] \[auth: %{DATA} "%{DATA:dn}".*\] \[ref: "%{DATA}.*" "%{DATA:client}" \]' }
173+
# RAW prod logs:
174+
# 2025-10-16T15:07:04.25650002Z stdout F [16/Oct/2025:17:07:04] crabserver-66d49b5bd-wd8gw 188.185.101.116:30450 "PUT /crabserver/prod/filemetadata HTTP/1.1" 200 OK [data: 2406 in 66 out 5013 us ] [auth: ok "/DC=ch/DC=cern/OU=Organic Units/OU=Users/CN=tseethon/CN=856006/CN=Thanayut Seethongchuen" "" ] [ref: "https://cmsweb.cern.ch" "CRABSchedd/v3.251002" ] - Podname=crabserver-66d49b5bd-wd8gw Type=cherrypylog
175+
match => { "message" => '\[%{NOTSPACE:timestamp_temp}\] %{DATA:backend} %{IPORHOST:clientip}(|:%{NUMBER}) "%{WORD:method} %{NOTSPACE:request} %{DATA:httpversion}" %{NUMBER:code:int} %{DATA} \[data: (-|%{NUMBER:bytes_sent:int}) in (-|%{NUMBER:bytes_received:int}) out (-|%{NUMBER:time_spent_ms:int}) us \] \[auth: %{DATA} "%{DATA:dn}".*\] \[ref: "%{DATA}.*" "%{DATA:client}" \] - Podname=%{DATA:pod_name} Type=%{WORD:log_type}$' }
181176
}
182177
grok {
183178
match => { "request" => '/%{WORD:system}%{UNIXPATH:uri_path}%{URIPARAM:uri_params}?' }
@@ -208,15 +203,9 @@ filter {
208203
"type" => "crabrest"
209204
}
210205
}
211-
# parse log path to get pod name
212-
# /var/log/pods/crab_crabserver-test-5f9bd5f58d-5nfhc_5366ebdb-ee96-4641-8643-f3bbe63f808f/crabserver/0.log
213-
grok {
214-
match => { "[log][file][path]" => '/var/log/pods/crab_%{DATA:pod_name}_%{DATA}/%{GREEDYDATA}' }
215-
}
216-
217206
if ( [message] =~ /.*MeasureTime:seconds.*/ ) {
218207
grok {
219-
match => { "message" => "%{TIMESTAMP_ISO8601:timestamp_temp}:%{NOTSPACE:trace_id}:%{NOTSPACE:log_level}:%{NOTSPACE}:MeasureTime:seconds - modulename=%{NOTSPACE:modulename} label='%{NOTSPACE:label}' tot=%{NUMBER:tot:float} proc=%{NUMBER:proc:float} thread=%{NUMBER:thread:float}" }
208+
match => { "message" => "%{TIMESTAMP_ISO8601:timestamp_temp}:%{NOTSPACE:trace_id}:%{NOTSPACE:log_level}:%{NOTSPACE}:MeasureTime:seconds - modulename=%{NOTSPACE:modulename} label='%{NOTSPACE:label}' tot=%{NUMBER:tot:float} proc=%{NUMBER:proc:float} thread=%{NUMBER:thread:float} - Podname=%{DATA:pod_name} Type=%{WORD:log_type}$" }
220209
add_field => {"log_type" => "measure_time"}
221210
}
222211
} else if ( [message] =~ /.*MeasureSize:bytes.*/ ) {

helm/crabserver/config/prod/config.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
data.backend = 'oracle'
3838
data.db = 'CRABServerAuth.dbconfig'
3939
data.s3 = 'CRABServerAuth.s3'
40+
data.s3_bucket = 'crabcache_prod'
4041
data.workflowManager = 'HTCondorDataWorkflow'
4142

4243
data.extconfigurl = 'http://gitlab.cern.ch/crab3/CRAB3ServerConfig/raw/master/cmsweb-rest-config.json'
@@ -45,4 +46,5 @@
4546
data.loggingFile = '%s/logs/crabserver/CRAB-%s.log' % (__file__.rsplit('/', 4)[0], myhost)
4647
data.keptLogDays = 7
4748

48-
data.delegateDN = "/DC=ch/DC=cern/OU=computers/CN=crab-(preprod|prod)-tw(01|02).cern.ch|/DC=ch/DC=cern/OU=computers/CN=crab-dev-tw(01|02|03|04).cern.ch|/DC=ch/DC=cern/OU=Organic Units/OU=Users/CN=cmscrab/CN=(817881|373708)/CN=Robot: cms crab|/DC=ch/DC=cern/OU=Organic Units/OU=Users/CN=crabint1/CN=373708/CN=Robot: CMS CRAB Integration 1"
49+
data.delegateDN = "/DC=ch/DC=cern/OU=Organic Units/OU=Users/CN=cmscrab/CN=(817881|373708)/CN=Robot: cms crab|/DC=ch/DC=cern/OU=Organic Units/OU=Users/CN=crabint1/CN=373708/CN=Robot: CMS CRAB Integration 1"
50+
data.compatibleClientVersions = ["v3", "development"]

helm/crabserver/config/preprod/logstash/logstash.conf renamed to helm/crabserver/config/prod/crabtaskworker.conf

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -169,15 +169,10 @@ filter {
169169
"type" => "crabhttpcall"
170170
}
171171
}
172-
# parse log path to get pod name
173-
# /var/log/pods/crab_crabserver-test-5f9bd5f58d-5nfhc_5366ebdb-ee96-4641-8643-f3bbe63f808f/crabserver/0.log
174172
grok {
175-
match => { "[log][file][path]" => '/var/log/pods/crab_%{DATA:pod_name}_%{DATA}/%{GREEDYDATA}' }
176-
}
177-
178-
grok {
179-
# [07/Dec/2022:20:06:47] crabserver-56c69685b6-477jr 188.184.91.103:41924 "GET /crabserver/devthree/info HTTP/1.1" 200 OK [data: 9354 in 103 out 4870 us ] [auth: ok "/DC=ch/DC=cern/OU=Organic Units/OU=Users/CN=tseethon/CN=856006/CN=Thanayut Seethongchuen" "" ] [ref: "https://cmsweb-test12.cern.ch" "Mozilla/5.0 (X11; Linux x86_64; rv:107.0) Gecko/20100101 Firefox/107.0" ] - Podname=crabserver-6cf49bcfff-bxvb6 Type=cherrypylog
180-
match => { "message" => '\[%{NOTSPACE:timestamp_temp}\] %{DATA:backend} %{IPORHOST:clientip}(|:%{NUMBER}) "%{WORD:method} %{NOTSPACE:request} %{DATA:httpversion}" %{NUMBER:code:int} %{DATA} \[data: (-|%{NUMBER:bytes_sent:int}) in (-|%{NUMBER:bytes_received:int}) out (-|%{NUMBER:time_spent_ms:int}) us \] \[auth: %{DATA} "%{DATA:dn}".*\] \[ref: "%{DATA}.*" "%{DATA:client}" \]' }
173+
# RAW prod logs:
174+
# 2025-10-16T15:07:04.25650002Z stdout F [16/Oct/2025:17:07:04] crabserver-66d49b5bd-wd8gw 188.185.101.116:30450 "PUT /crabserver/prod/filemetadata HTTP/1.1" 200 OK [data: 2406 in 66 out 5013 us ] [auth: ok "/DC=ch/DC=cern/OU=Organic Units/OU=Users/CN=tseethon/CN=856006/CN=Thanayut Seethongchuen" "" ] [ref: "https://cmsweb.cern.ch" "CRABSchedd/v3.251002" ] - Podname=crabserver-66d49b5bd-wd8gw Type=cherrypylog
175+
match => { "message" => '\[%{NOTSPACE:timestamp_temp}\] %{DATA:backend} %{IPORHOST:clientip}(|:%{NUMBER}) "%{WORD:method} %{NOTSPACE:request} %{DATA:httpversion}" %{NUMBER:code:int} %{DATA} \[data: (-|%{NUMBER:bytes_sent:int}) in (-|%{NUMBER:bytes_received:int}) out (-|%{NUMBER:time_spent_ms:int}) us \] \[auth: %{DATA} "%{DATA:dn}".*\] \[ref: "%{DATA}.*" "%{DATA:client}" \] - Podname=%{DATA:pod_name} Type=%{WORD:log_type}$' }
181176
}
182177
grok {
183178
match => { "request" => '/%{WORD:system}%{UNIXPATH:uri_path}%{URIPARAM:uri_params}?' }
@@ -208,15 +203,9 @@ filter {
208203
"type" => "crabrest"
209204
}
210205
}
211-
# parse log path to get pod name
212-
# /var/log/pods/crab_crabserver-test-5f9bd5f58d-5nfhc_5366ebdb-ee96-4641-8643-f3bbe63f808f/crabserver/0.log
213-
grok {
214-
match => { "[log][file][path]" => '/var/log/pods/crab_%{DATA:pod_name}_%{DATA}/%{GREEDYDATA}' }
215-
}
216-
217206
if ( [message] =~ /.*MeasureTime:seconds.*/ ) {
218207
grok {
219-
match => { "message" => "%{TIMESTAMP_ISO8601:timestamp_temp}:%{NOTSPACE:trace_id}:%{NOTSPACE:log_level}:%{NOTSPACE}:MeasureTime:seconds - modulename=%{NOTSPACE:modulename} label='%{NOTSPACE:label}' tot=%{NUMBER:tot:float} proc=%{NUMBER:proc:float} thread=%{NUMBER:thread:float}" }
208+
match => { "message" => "%{TIMESTAMP_ISO8601:timestamp_temp}:%{NOTSPACE:trace_id}:%{NOTSPACE:log_level}:%{NOTSPACE}:MeasureTime:seconds - modulename=%{NOTSPACE:modulename} label='%{NOTSPACE:label}' tot=%{NUMBER:tot:float} proc=%{NUMBER:proc:float} thread=%{NUMBER:thread:float} - Podname=%{DATA:pod_name} Type=%{WORD:log_type}$" }
220209
add_field => {"log_type" => "measure_time"}
221210
}
222211
} else if ( [message] =~ /.*MeasureSize:bytes.*/ ) {

0 commit comments

Comments
 (0)