PySyft
PySyft copied to clipboard
Split Docker Launch into Pull / Build and Start
To provide more control over the output filtering and checking what step is working we should split docker launch into docker pull (if they use tag=latest etc) or docker build (if they are building), run those commands and then after they are complete run the next one to launch the domain.
During the output of docker compose pull or docker compose build we can try to filter the stdout / stderr using the non blocking threaded subprocess example we now use in hagrid cli.py to catch the jupyter url in the output, look for:
queue: Queue = Queue()
thread_1 = Thread(target=enqueue_output, args=(proc.stdout, queue))
thread_2 = Thread(target=enqueue_output, args=(proc.stderr, queue))
As these steps are completed lets output something like: ✅ pulling containers ✅ building containers ✅ deploying containers ✅ waiting for health checks
If possible some small animation or dots or progress would be good just to keep users engaged.
Then we can remove the print "success" which is unhelpful.
We can add the --check=True as a default arg so that we automatically verify that docker launches correctly as part of the launch command (unless turned off)
Once this works we can remove hagrid --silent from our example notebooks so that we always give output but dont break the notebook with the zillion lines of animation spam docker outputs. We can also remove the manual check example