Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

es: drop jobs-* indices #10857

Merged
merged 1 commit into from
Sep 28, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 4 additions & 33 deletions infra/es_cluster.tf
Original file line number Diff line number Diff line change
Expand Up @@ -714,7 +714,7 @@ emit_build_events() {
jq -c \
--slurpfile job_md "$job/job-md.json" \
--arg cmd "$cmd" \
--arg index "$(index "$job" events)" \
--arg index "$(index "$job")" \
--arg job "$job" \
< "$file" \
'
Expand All @@ -724,20 +724,6 @@ emit_build_events() {
buildEvent: .
}
'
jq -c \
--slurpfile job_md "$job/job-md.json" \
--arg cmd "$cmd" \
--arg index "$(index "$job" jobs)" \
--arg job "$job" \
< "$file" \
--slurp \
'
{ index: { _index: $index, _id: ($job + "-" + $cmd + "-events") } },
{ job: $job_md[0],
command: { name: $cmd },
buildEvent: .
}
'
}

emit_trace_events() {
Expand All @@ -748,7 +734,7 @@ emit_trace_events() {
jq -c \
--slurpfile job_md "$job/job-md.json" \
--arg cmd "$cmd" \
--arg index "$(index "$job" events)" \
--arg index "$(index "$job")" \
--arg job "$job" \
< "$file" \
'
Expand All @@ -760,19 +746,6 @@ emit_trace_events() {
traceEvent: .value
}
'
jq -c \
--slurpfile job_md "$job/job-md.json" \
--arg cmd "$cmd" \
--arg index "$(index "$job" jobs)" \
--arg job "$job" \
< "$file" \
'
{ index: { _index: $index, _id: ($job + "-" + $cmd + "-profile") } },
{ job: $job_md[0],
command: { name: $cmd },
traceEvent: .traceEvents
}
'
}

bulk_upload() {
Expand Down Expand Up @@ -839,8 +812,7 @@ push() {
index() {
local job prefix
job="$1"
prefix="$2"
echo "$prefix-$(echo $job | cut -c1-10)"
echo "events-$(echo $job | cut -c1-10)"
}

pid=$$
Expand Down Expand Up @@ -871,8 +843,7 @@ for tar in $todo; do
job=$(basename $${tar%.tar.gz})
cd $(dirname $tar)
if ! [ -f $DONE/$job ]; then
ensure_index "$job" "$(index "$job" jobs)"
ensure_index "$job" "$(index "$job" events)"
ensure_index "$job" "$(index "$job")"
tar --force-local -x -z -f "$(basename "$tar")"
patch "$job"
push "$job"
Expand Down