Skip to content
This repository has been archived by the owner on Jan 31, 2024. It is now read-only.

Commit

Permalink
Gather ODH logs
Browse files Browse the repository at this point in the history
  • Loading branch information
VaishnaviHire committed Oct 3, 2022
1 parent a1f1538 commit e187e03
Show file tree
Hide file tree
Showing 7 changed files with 91 additions and 0 deletions.
Binary file added must-gather/.DS_Store
Binary file not shown.
6 changes: 6 additions & 0 deletions must-gather/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
FROM quay.io/openshift/origin-cli:latest

# copy all collection scripts to /usr/bin
COPY collection-scripts/* /usr/bin/

ENTRYPOINT /usr/bin/gather
10 changes: 10 additions & 0 deletions must-gather/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
GATHER_IMG ?= must-gather
IMAGE_BUILDER ?= docker

build-must-gather:
${IMAGE_BUILDER} build . -t ${GATHER_IMG}

push-must-gather:
${IMAGE_BUILDER} push ${GATHER_IMG}

build-and-push-must-gather: build-must-gather push-must-gather
32 changes: 32 additions & 0 deletions must-gather/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# must-gather for Open Data Hub

The must-gather script allows a cluster admin to collect information about various key resources and namespaces
for Open Data Hub.

## Data Collected

The must-gather script currently collects data from all the namespaces that has -
- `KfDef` instances
- `Notebook` instances
- `Inferenceservice` instances


## Usage

```
oc adm must-gather --image=quay.io/opendatahub/must-gather:v1.0.0
```
## Developer Guide

To build custom image :

```
export GATHER_IMG= <image-name>
make build-and-push-must-gather
```

To collect data for custom repositories for Open Data Hub set the following variables:

```
export ODH_NAMESPACE= <name-for-odh-namespace>
18 changes: 18 additions & 0 deletions must-gather/collection-scripts/gather
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/bin/bash

kfdefs=$(oc get kfdefs --all-namespaces -o=jsonpath='{range .items[*]}{.metadata.namespace}{"\n"}{end}')

# Get logs from all KfDef namespaces
for i in $kfdefs;
do
# Get pod logs for all the pods in KfDef namespaces
oc adm inspect namespace/"$i" --dest-dir=must-gather || echo "Error getting logs from $i"

done

## Get Operator pod logs
mkdir must-gather/odh-operator || echo "Error creating odh-operator directory"
oc logs deployment/opendatahub-operator -n openshift-operators >> must-gather/odh-operator/pod.log

exit 0

12 changes: 12 additions & 0 deletions must-gather/collection-scripts/gather-model-mesh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/bin/bash

inferenceservices=$(oc get inferenceservice --all-namespaces -o=jsonpath='{range .items[*]}{.metadata.namespace}{"\n"}{end}')

# Get logs from all Inferenceservices namespaces
for i in $inferenceservices;
do
# Get pod logs for all the pods in Inferenceservices namespaces
oc adm inspect namespace/"$i" --dest-dir=must-gather || echo "Error getting logs from $i"

done

13 changes: 13 additions & 0 deletions must-gather/collection-scripts/gather-notebooks
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/bash

notebooks=$(oc get notebook --all-namespaces -o=jsonpath='{range .items[*]}{.metadata.namespace}{"\n"}{end}')

# Get logs from all notebook namespaces
for i in $notebooks;
do
# Get pod logs for all the pods in Notebook namespaces
mkdir must-gather/notebooks || echo "Error creating odh-operator directory"
oc adm inspect namespace/"$i" --dest-dir=must-gather/notebooks || echo "Error getting logs from $i"

done

0 comments on commit e187e03

Please sign in to comment.