Ir al contenido
#0899
ContainersCron

Reset the lab to the instructor's machine, not to last week

Forty student containers were copied from the instructor's machine in week one. By week four they've drifted: broken virtualenvs, a deleted config, one student on a different Python. Monday 07:00, a cron loop sends POST /api/v1/containers/{id}/sync to all forty. Each copy is brought back to the source's current state: filesystem, packages, data: in ten seconds to three minutes. The copy keeps its ID, its URLs, its SSH key. The bookmark the student made in week one still works.

The instructor added week four's dataset on Sunday night. It's in every container by 07:03, because the reset is a sync from a live machine, not a restore of a frozen one.

This used to be a Vagrantfile, a 2GB box download, and vagrant destroy on forty laptops. Now the base image is a running container and the reset is a loop of forty requests.

The reset carries this week's material, because the source is a machine, not a file.