diff --git a/.github/workflows/integrate.yaml b/.github/workflows/integrate.yaml index 982cadc4..067c7b65 100644 --- a/.github/workflows/integrate.yaml +++ b/.github/workflows/integrate.yaml @@ -103,6 +103,31 @@ jobs: uses: canonical/kubeflow-ci/actions/dump-charm-debug-artifacts@main if: always() + - name: Get juju status + run: juju status + if: failure() + + - name: Save relevant debug artifacts + if: always() + run: | + mkdir ~/kfp-operators-debug-logs + juju debug-log --replay | tee ~/kfp-operators-debug-logs/juju-debug-log.log + juju status | tee ~/kfp-operators-debug-logs/juju-status.log + bash -c "cp ~/.local/state/charmcraft/log/* ~/kfp-operators-debug-logs/" + bash -c "df -h | tee ~/kfp-operators-debug-logs/df.log" + bash -c "free -h | tee ~/kfp-operators-debug-logs/free.log" + sg microk8s -c "microk8s.kubectl describe deployments -A | tee ~/kfp-operators-debug-logs/deployments.log" + sg microk8s -c "microk8s.kubectl describe nodes | tee ~/kfp-operators-debug-logs/deployments.log" + sg microk8s -c "microk8s.kubectl describe pods -A | tee ~/kfp-operators-debug-logs/pods.log" + sg microk8s -c "microk8s.kubectl describe workloads -A | tee ~/kfp-operators-debug-logs/workloads.log" + + - name: Upload debug artifacts + if: always() + uses: actions/upload-artifact@v3 + with: + name: kfp-operators-debug-logs + path: ~/kfp-operators-debug-logs + test-bundle: name: Test the bundle runs-on: ubuntu-20.04 @@ -157,6 +182,23 @@ jobs: run: juju status if: failure() - - name: Collect charm debug artifacts - uses: canonical/kubeflow-ci/actions/dump-charm-debug-artifacts@main + - name: Save relevant debug artifacts if: always() + run: | + mkdir ~/kfp-operators-debug-logs + juju debug-log --replay | tee ~/kfp-operators-debug-logs/juju-debug-log.log + juju status | tee ~/kfp-operators-debug-logs/juju-status.log + bash -c "cp ~/.local/state/charmcraft/log/* ~/kfp-operators-debug-logs/" + bash -c "df -h | tee ~/kfp-operators-debug-logs/df.log" + bash -c "free -h | tee ~/kfp-operators-debug-logs/free.log" + sg microk8s -c "microk8s.kubectl describe deployments -A | tee ~/kfp-operators-debug-logs/deployments.log" + sg microk8s -c "microk8s.kubectl describe nodes | tee ~/kfp-operators-debug-logs/deployments.log" + sg microk8s -c "microk8s.kubectl describe pods -A | tee ~/kfp-operators-debug-logs/pods.log" + sg microk8s -c "microk8s.kubectl describe workloads -A | tee ~/kfp-operators-debug-logs/workloads.log" + + - name: Upload debug artifacts + if: always() + uses: actions/upload-artifact@v3 + with: + name: kfp-operators-debug-logs + path: ~/kfp-operators-debug-logs diff --git a/tests/integration/test_kfp_functional.py b/tests/integration/test_kfp_functional.py index f5d73f75..07f4baa5 100644 --- a/tests/integration/test_kfp_functional.py +++ b/tests/integration/test_kfp_functional.py @@ -193,3 +193,16 @@ async def test_viz_server_healthcheck(ops_test: OpsTest): result_status, result_text = await fetch_response(url=f"http://{url}:8888", headers=headers) assert result_status == 200 + + +# ---- KFP UI focused test cases +async def test_ui_server_healthcheck(ops_test: OpsTest): + """Run a healthcheck on the ui server endpoint.""" + status = await ops_test.model.get_status() + units = status["applications"]["kfp-ui"]["units"] + url = units["kfp-ui/0"]["address"] + headers = {"kubeflow-userid": "user"} + import pdb; pdb.set_trace() + result_status, result_text = await fetch_response(url=f"http://{url}:3000", headers=headers) + + assert result_status == 200