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

OADP-148 First attempt at speeding up must-gather. #1002

Merged
merged 2 commits into from
May 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 2 additions & 1 deletion must-gather/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ ARG VELERO_BRANCH=konveyor-dev
WORKDIR /build
RUN curl --location --output velero.tgz https://github.com/openshift/velero/archive/refs/heads/${VELERO_BRANCH}.tar.gz && \
tar -xzvf velero.tgz && cd velero-${VELERO_BRANCH} && \
CGO_ENABLED=0 GOOS=linux go build -a -mod=mod -ldflags '-extldflags "-static" -X github.com/vmware-tanzu/velero/pkg/buildinfo.Version=${VELERO_BRANCH}' -o /velero github.com/vmware-tanzu/velero/cmd/velero && \
VELERO_COMMIT=$(git ls-remote https://github.com/openshift/velero HEAD | awk '{printf $1}') && \
CGO_ENABLED=0 GOOS=linux go build -a -mod=mod -ldflags '-extldflags "-static" -X github.com/vmware-tanzu/velero/pkg/buildinfo.Version='"${VELERO_BRANCH}"' -X github.com/vmware-tanzu/velero/pkg/buildinfo.GitSHA='"${VELERO_COMMIT}" -o /velero github.com/vmware-tanzu/velero/cmd/velero && \
cd .. && rm -rf velero.tgz velero-${VELERO_BRANCH} && \
curl --location --output restic.tgz https://github.com/openshift/restic/archive/refs/heads/${RESTIC_BRANCH}.tar.gz && \
tar -xzvf restic.tgz && cd restic-${RESTIC_BRANCH} && \
Expand Down
4 changes: 2 additions & 2 deletions must-gather/collection-scripts/gather_versions
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,8 @@ fi


# DataProtectionApplications
dpas=$(oc get dpa --all-namespaces --insecure-skip-tls-verify=${skip_tls} -o jsonpath='{range .items[*]}{.metadata.name}{" "}{.metadata.namespace}')
if [ -z "${dpas}" -o "${dpas}" == " " ]; then
dpas=$(oc get dpa --all-namespaces --insecure-skip-tls-verify=${skip_tls} -o custom-columns=NAME:.metadata.name,NAMESPACE:.metadata.namespace --no-headers)
if [ -z "${dpas}" ]; then
log_command "DataProtectionApplication CRs" "echo No DPAs found in cluster"
else
while read dpa namespace; do
Expand Down
8 changes: 4 additions & 4 deletions must-gather/collection-scripts/logs/gather_logs_backup
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@ timeout=$7
skip_tls=$8

# Gather backup logs and description
mkdir -p "{object_collection_path}"
mkdir -p "${object_collection_path}"
echo "[cluster=${cluster}][ns=${ns}] Gathering 'velero backup describe ${backup}'"
if [ "$timeout" = "0s" ]; then
oc -n ${ns} exec $(oc -n ${ns} get po -l component=velero -o custom-columns=name:.metadata.name --no-headers) -- /bin/bash -c "timeout 30s /velero describe backup ${backup} --insecure-skip-tls-verify=${skip_tls} --details" &> "${object_collection_path}/backup-describe-${backup}.txt" &
timeout 30s velero describe backup ${backup} --insecure-skip-tls-verify=${skip_tls} --details &> "${object_collection_path}/backup-describe-${backup}.txt" &
else
oc -n ${ns} exec --request-timeout=${timeout} $(oc -n ${ns} get po -l component=velero -o custom-columns=name:.metadata.name --no-headers) -- /bin/bash -c "timeout ${timeout} /velero describe backup ${backup} --insecure-skip-tls-verify=${skip_tls} --details" &> "${object_collection_path}/backup-describe-${backup}.txt" &
timeout ${timeout} velero describe backup ${backup} --insecure-skip-tls-verify=${skip_tls} --details &> "${object_collection_path}/backup-describe-${backup}.txt" &
fi
echo "[cluster=${cluster}][ns=${ns}] Gathering 'velero backup logs ${backup}'"
oc -n ${ns} exec $(oc -n ${ns} get po -l component=velero -o custom-columns=name:.metadata.name --no-headers) -- /bin/bash -c "timeout 30s /velero backup logs ${backup} --insecure-skip-tls-verify=${skip_tls} --timeout=30s" &> "${object_collection_path}/backup-${backup}.log" &
timeout 30s velero backup logs ${backup} --insecure-skip-tls-verify=${skip_tls} --timeout=30s &> "${object_collection_path}/backup-${backup}.log" &

wait
6 changes: 3 additions & 3 deletions must-gather/collection-scripts/logs/gather_logs_restore
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ skip_tls=$8
mkdir -p "${object_collection_path}"
echo "[cluster=${cluster}][ns=${ns}] Gathering 'velero restore describe ${restore}'"
if [ "$timeout" = "0s" ]; then
oc -n ${ns} exec $(oc -n ${ns} get po -l component=velero -o custom-columns=name:.metadata.name --no-headers) -- /bin/bash -c "timeout 30s /velero describe restore ${restore} --insecure-skip-tls-verify=${skip_tls} --details" &> "${object_collection_path}/restore-describe-${restore}.txt" &
timeout 30s velero describe restore ${restore} --insecure-skip-tls-verify=${skip_tls} --details &> "${object_collection_path}/restore-describe-${restore}.txt" &
else
oc -n ${ns} exec --request-timeout=${timeout} $(oc -n ${ns} get po -l component=velero -o custom-columns=name:.metadata.name --no-headers) -- /bin/bash -c "timeout ${timeout} /velero describe restore ${restore} --insecure-skip-tls-verify=${skip_tls} --details" &> "${object_collection_path}/restore-describe-${restore}.txt" &
timeout ${timeout} velero describe restore ${restore} --insecure-skip-tls-verify=${skip_tls} --details &> "${object_collection_path}/restore-describe-${restore}.txt" &
fi
echo "[cluster=${cluster}][ns=${ns}] Gathering 'velero restore logs ${restore}'"
oc -n ${ns} exec $(oc -n ${ns} get po -l component=velero -o custom-columns=name:.metadata.name --no-headers) -- /bin/bash -c "timeout 30s /velero restore logs ${restore} --insecure-skip-tls-verify=${skip_tls} --timeout=30s" &> "${object_collection_path}/restore-${restore}.log" &
timeout 30s velero restore logs ${restore} --insecure-skip-tls-verify=${skip_tls} --timeout=30s &> "${object_collection_path}/restore-${restore}.log" &

wait