-
Notifications
You must be signed in to change notification settings - Fork 17
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
feat: update integrate.yaml env setup, debug logging #264
Open
ca-scribner
wants to merge
2
commits into
main
Choose a base branch
from
refactor-integration-test-setup
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -49,77 +49,91 @@ jobs: | |
- name: Check out repo | ||
uses: actions/checkout@v3 | ||
|
||
- uses: balchua/[email protected] | ||
- name: Setup operator environment | ||
uses: charmed-kubernetes/actions-operator@main | ||
with: | ||
# TODO: Pinned to <1.25 until we update to istio 1.16 | ||
channel: '1.24/stable' | ||
addons: '["dns", "storage", "rbac", "metallb:10.64.140.43-10.64.140.49"]' | ||
|
||
- name: Install dependencies | ||
run: | | ||
set -eux | ||
sudo snap install charmcraft --classic --channel=latest/candidate | ||
sudo snap install juju --classic | ||
sudo snap install juju-bundle --classic | ||
sudo snap install juju-wait --classic | ||
sudo apt update | ||
sudo apt install tox | ||
|
||
- name: Wait before bootstrap | ||
provider: microk8s | ||
channel: 1.24/stable | ||
charmcraft-channel: latest/candidate | ||
# TODO: Unpin this when this bug is resolved: https://bugs.launchpad.net/juju/+bug/1992833. | ||
# In particular, these tests failed deploying the prometheus-k8s charm where it gets an error in | ||
# the "metrics-endpoint-relation-changed" hook. | ||
bootstrap-options: --agent-version="2.9.34" | ||
microk8s-addons: "dns storage rbac metallb:10.64.140.43-10.64.140.49" | ||
# TODO: Remove once the actions-operator does this automatically | ||
- name: Configure kubectl | ||
run: | | ||
set -eux | ||
sg microk8s -c 'microk8s status --wait-ready' | ||
kubectl wait --for=condition=available --timeout=5m -nkube-system deployment/coredns deployment/hostpath-provisioner | ||
sg microk8s -c "microk8s config > ~/.kube/config" | ||
|
||
- name: Bootstrap | ||
- name: Add model | ||
run: | | ||
# Pinning juju agent to 2.9.42 to keep compatibility with pythonlib-juju<3 | ||
sg microk8s -c 'juju bootstrap microk8s uk8s --agent-version=2.9.42' | ||
sg microk8s -c 'juju add-model kubeflow' | ||
juju add-model kubeflow | ||
juju switch kubeflow | ||
|
||
# DEBUG: added keep-models to ensure our logs are available during dumping | ||
- run: sg microk8s -c 'KUBECONFIG=/home/runner/.kube/config tox -e integration | ||
-- --model kubeflow --destructive-mode' | ||
-- --model kubeflow --destructive-mode --keep-models' | ||
timeout-minutes: 80 | ||
|
||
- name: Setup Debug Artifact Collection | ||
run: mkdir tmp | ||
if: failure() | ||
if: always() | ||
|
||
- name: Collect juju-crashdump from pytest-operator | ||
run: | | ||
for f in `ls juju-crashdump-*`; do | ||
cp $f tmp | ||
done | ||
if: always() | ||
|
||
- name: Collect charmcraft logs | ||
if: failure() | ||
if: always() | ||
run: cat /home/runner/snap/charmcraft/common/cache/charmcraft/log/charmcraft-*.log | ||
| tee tmp/charmcraft.log | ||
|
||
- name: Collect Juju status | ||
if: failure() | ||
if: always() | ||
run: juju status | tee tmp/juju-status.txt | ||
|
||
- name: Collect Juju log | ||
if: failure() | ||
run: juju debug-log --replay --no-tail | tee tmp/juju-status.txt | ||
if: always() | ||
run: juju debug-log --replay --no-tail | tee tmp/juju-debug-log.txt | ||
|
||
- name: Collect Juju status log | ||
if: always() | ||
run: | | ||
juju show-status-log istio-pilot/0 | tee tmp/juju-status-log-istio-pilot.txt | ||
juju show-status-log istio-ingressgateway/0 | tee tmp/juju-status-log-istio-ingressgateway.txt | ||
|
||
- name: Collect Kube status | ||
if: failure() | ||
if: always() | ||
run: | | ||
kubectl get all -A | tee tmp/kube-summary.txt | ||
kubectl describe virtualservices -A | tee tmp/kube-virtualservices.txt | ||
kubectl describe gateways -A | tee tmp/kube-gateways.txt | ||
kubectl describe envoyfilters -A | tee tmp/kube-envoyfilters.txt | ||
kubectl describe deployments -A | tee tmp/kube-deployments.txt | ||
kubectl describe replicasets -A | tee tmp/kubectl-replicasets.txt | ||
kubectl exec -n kubeflow istio-pilot-0 --container charm -- agents/unit-istio-pilot-0/charm/istioctl analyze -n kubeflow | tee tmp/istioctl-analyze.txt | ||
|
||
- name: Collect Kube logs | ||
if: failure() | ||
if: always() | ||
run: | | ||
kubectl logs -n kubeflow --tail 1000 -lapp.kubernetes.io/name=istio-pilot -c charm | tee tmp/istio-pilot.log | ||
kubectl logs -n kubeflow --tail 1000 -lapp.kubernetes.io/name=istio-ingressgateway-operator -c charm | tee tmp/istio-ingressgateway-operator.log | ||
|
||
# This should get output by pytest-operator, but it is blocked by --keep-models until | ||
# https://github.com/charmed-kubernetes/pytest-operator/pull/108 is merged | ||
- name: Collect juju-crashdump explicitly | ||
run: juju-crashdump -o tmp | ||
|
||
- name: Upload debug artifacts | ||
if: failure() | ||
if: always() | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: test-run-artifacts | ||
path: tmp | ||
if-no-files-found: error | ||
|
||
integration-observability: | ||
name: Observability Integration Test | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's use your action?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah can do. I'll need to put it somewhere in our org first