Skip to content

Commit

Permalink
Only display running pod logs in CI
Browse files Browse the repository at this point in the history
Signed-off-by: Sivanantham Chinnaiyan <[email protected]>
  • Loading branch information
sivanantha321 committed Mar 7, 2024
1 parent b621a28 commit 7b8cfc3
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 8 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/scheduled-image-scan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ jobs:

- name: Upload sarif file to Github Code Scanning
if: always()
uses: github/codeql-action/upload-sarif@v2
uses: github/codeql-action/upload-sarif@v3
with:
sarif_file: application/${{ matrix.image.name }}/docker.snyk.sarif

Expand Down Expand Up @@ -81,7 +81,7 @@ jobs:

- name: Upload sarif file to Github Code Scanning
if: always()
uses: github/codeql-action/upload-sarif@v2
uses: github/codeql-action/upload-sarif@v3
with:
sarif_file: application/${{ matrix.image.name }}/docker.snyk.sarif

Expand Down Expand Up @@ -115,6 +115,6 @@ jobs:

- name: Upload sarif file to Github Code Scanning
if: always()
uses: github/codeql-action/upload-sarif@v2
uses: github/codeql-action/upload-sarif@v3
with:
sarif_file: application/${{ matrix.image.name }}/docker.snyk.sarif
Original file line number Diff line number Diff line change
Expand Up @@ -483,7 +483,7 @@ func probeIngress(url string) (bool, error) {
defer cancel()
req, err := http.NewRequestWithContext(ctx, http.MethodGet, target, nil)
if err != nil {
return isReady, errors.Wrapf(err, "failed to probe ingress %s", target)
return isReady, errors.Wrapf(err, "failed to create ingress probe request %s", target)
}
// ProbeKey is the name of a header that can be added to requests to probe the ingress.
// Requests with this header will not be passed to the user container or included in request metrics.
Expand All @@ -497,6 +497,8 @@ func probeIngress(url string) (bool, error) {
}
if resp.StatusCode == http.StatusOK {
isReady = true
} else {
log.V(1).Error(fmt.Errorf("failed to probe ingress"), "Failed to probe ingress", "url", target)
}
return isReady, nil
}
Expand Down
4 changes: 4 additions & 0 deletions test/scripts/gh-actions/setup-deps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,14 @@ DEPLOYMENT_MODE="${1:-'serverless'}"
ISTIO_VERSION="1.19.4"
CERT_MANAGER_VERSION="v1.5.0"
YQ_VERSION="v4.28.1"
JQ_VERSION="1.7.1"

echo "Installing yq ..."
wget https://github.com/mikefarah/yq/releases/download/${YQ_VERSION}/yq_linux_amd64 -O /usr/local/bin/yq && chmod +x /usr/local/bin/yq

echo "Installing jq ..."
wget https://github.com/jqlang/jq/releases/download/jq-${JQ_VERSION}/jq-linux-amd64 -O /usr/local/bin/jq && chmod +x /usr/local/bin/jq

echo "Installing Istio ..."
mkdir istio_tmp
pushd istio_tmp >/dev/null
Expand Down
16 changes: 12 additions & 4 deletions test/scripts/gh-actions/status-check.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,31 +31,39 @@ kubectl logs -l control-plane=kserve-controller-manager -n kserve -c manager --t
echo "::endgroup::"

echo "::group::Predictor Pod logs"
for pod in $(kubectl get pods -l 'component in (predictor)' -o jsonpath='{.items[*].metadata.name}' -n kserve-ci-e2e-test); do
# Get only pods that are not being deleted.
predictor_pods=$(kubectl get pods -l 'component in (predictor)' -o json -n kserve-ci-e2e-test | jq -r '.items[] | select(.metadata.deletionTimestamp == null) | .metadata.name')
for pod in $predictor_pods; do
echo "===================================== Logs for Predictor Pod: $pod ========================================="
kubectl logs "$pod" -c kserve-container -n kserve-ci-e2e-test --tail 500
echo "================================================================================================================"
done
echo "::endgroup::"

echo "::group::Transformer Pod logs"
for pod in $(kubectl get pods -l 'component in (transformer)' -o jsonpath='{.items[*].metadata.name}' -n kserve-ci-e2e-test); do
# Get only pods that are not being deleted.
transformer_pods=$(kubectl get pods -l 'component in (transformer)' -o json -n kserve-ci-e2e-test | jq -r '.items[] | select(.metadata.deletionTimestamp == null) | .metadata.name')
for pod in $transformer_pods; do
echo "===================================== Logs for Transformer Pod: $pod ======================================="
kubectl logs "$pod" -c kserve-container -n kserve-ci-e2e-test --tail 500
echo "================================================================================================================"
done
echo "::endgroup::"

echo "::group::Explainer Pod logs"
for pod in $(kubectl get pods -l 'component in (explainer)' -o jsonpath='{.items[*].metadata.name}' -n kserve-ci-e2e-test); do
# Get only pods that are not being deleted.
explainer_pods=$(kubectl get pods -l 'component in (explainer)' -o json -n kserve-ci-e2e-test | jq -r '.items[] | select(.metadata.deletionTimestamp == null) | .metadata.name')
for pod in $explainer_pods; do
echo "===================================== Logs for Explainer Pod: $pod ========================================="
kubectl logs "$pod" -c kserve-container -n kserve-ci-e2e-test --tail 500
echo "================================================================================================================"
done
echo "::endgroup::"

echo "::group::InferenceGraph Pod logs"
for pod in $(kubectl get pods -l 'serving.kserve.io/inferencegraph=model-chainer' -o jsonpath='{.items[*].metadata.name}' -n kserve-ci-e2e-test); do
# Get only pods that are not being deleted.
graph_pods=$(kubectl get pods -l 'serving.kserve.io/inferencegraph=model-chainer' -o json -n kserve-ci-e2e-test | jq -r '.items[] | select(.metadata.deletionTimestamp == null) | .metadata.name')
for pod in $graph_pods; do
echo "===================================== Logs for Graph Pod: $pod ========================================="
kubectl logs "$pod" -c user-container -n kserve-ci-e2e-test --tail 500
echo "================================================================================================================"
Expand Down

0 comments on commit 7b8cfc3

Please sign in to comment.