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

CI: make upgrades more robust and skip 1m precautionary sleep #1904

Merged
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 8 additions & 7 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ jobs:
helm install jupyterhub jupyterhub/jupyterhub --values dev-config.yaml
await_jupyterhub
await_autohttps_tls_cert_acquisition
await_autohttps_tls_cert_save

- name: Install JupyterHub dev chart
run: |
Expand All @@ -127,17 +128,17 @@ jobs:
await_jupyterhub
await_autohttps_tls_cert_acquisition

- name: Wait 1 minute for everything to be ready
# TODO: find out exactly which resources are slow and wait for thoses
# So far errors have included:
# - some pods not being ready
# - network policies not being ready
run: sleep 1m
- name: Run tests
run: |
. ./ci/common
# If you have problems with the tests add '--capture=no' to show stdout
pytest --verbose --exitfirst ./tests || (full_namespace_report && exit 1)
pytest --verbose --exitfirst --color=yes ./tests

- name: Provide info on failures
if: failure()
run: |
. ./ci/common
full_namespace_report


docs_linkcheck:
Expand Down
25 changes: 20 additions & 5 deletions ci/common
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ await_jupyterhub() {

await_autohttps_tls_cert_acquisition() {
i=0; while [ $i -ne 60 ]; do
kubectl logs deploy/pebble -c pebble | grep "Issued certificate" \
kubectl logs deploy/autohttps -c traefik | grep "Adding certificate" \
&& acquired_cert=true && break \
|| acquired_cert=false && sleep 0.5 && i=$((i + 1))
done
Expand All @@ -62,6 +62,25 @@ await_autohttps_tls_cert_acquisition() {
sleep 1
}

await_autohttps_tls_cert_save() {
i=0; while [ $i -ne 60 ]; do
kubectl logs deploy/autohttps -c secret-sync | grep "Created secret" \
&& saved_cert=true && break \
|| saved_cert=false && sleep 0.5 && i=$((i + 1))
done
if [ "$saved_cert" != "true" ]; then
echo "Certificate acquisition failed!"
kubectl get service,networkpolicy,configmap,pod
kubectl describe pod -l app.kubernetes.io/name=pebble
kubectl logs deploy/pebble --all-containers # --prefix
kubectl describe pod -l app.kubernetes.io/name=pebble-coredns
kubectl logs deploy/pebble-coredns --all-containers # --prefix
kubectl describe pod -l component=autohttps
kubectl logs deploy/autohttps --all-containers # --prefix
exit 1
fi
}

setup_kubeval () {
echo "setup kubeval ${KUBEVAL_VERSION}"
curl -sfL https://github.com/instrumenta/kubeval/releases/download/${KUBEVAL_VERSION}/kubeval-linux-amd64.tar.gz | tar xz kubeval
Expand Down Expand Up @@ -106,10 +125,6 @@ full_namespace_report () {
echo ""
echo "Just while debugging intermittent issue, lets output the logs of the proxy pod."
kubectl logs --all-containers deploy/proxy

echo ""
echo "Just while debugging intermittent issue, lets output the logs of the autohttps pod."
kubectl logs --all-containers deploy/autohttps
}

install_and_run_chartpress_and_pebble () {
Expand Down
2 changes: 1 addition & 1 deletion ci/publish
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,4 @@ fi

# Let us log the changes chartpress did, it should include replacements for
# fields in values.yaml, such as what tag for various images we are using.
git --no-pager diff
git --no-pager diff --color