C4 W3 Vertex Pipelines graded lab: notebook kernel keeps crashing

I​ attempted three times in three separate days to run the code related to the external graded exercise “Vertex Pipelines” on GCP. Past the first lines of code the notebook kernel (I am using the recommended Python 3 kernel - there is nothing else to choose from) dies on its own with this message:

Kernel restarting

The kernel for pipeline_gcp.ipynb appears to have died. It will restart automatically.

It keeps on doing that over and over again. In addition, i​t does not always happen with the same line of code. Sometimes it is earlier, sometimes it is later. However, I can’t get passed more than 20% completion for this exercise, so I am stuck.

I​s anyone else running into the same issue? What am I missing?

I​ have otherwise completed successfully all other GCP-based exercises for this entire specialization without a single problem. There is something special about this exercise somehow.

Were you able to see any traces in the logs?

I think I figured this out. I had left in:


import os
if not os.getenv("IS_TESTING"):
    # Automatically restart kernel after installs
    import IPython
    app = IPython.Application.instance()
    app.kernel.do_shutdown(True)

Uncommented after having run it once. It it that snippet of code that was causing the kernel to restart. State management in notebooks can be awkward at times.