tartelet icon indicating copy to clipboard operation
tartelet copied to clipboard

Enable Tartelet to update the virtual machines from a registry.

Open jaylyerly opened this issue 1 year ago • 5 comments

We've just set up Tartelet and learned a lot about tart. This whole project is fantastic!

We're trying to figure out how to manage several physical machines running VMs with Tartelet and keep everything in sync.

We're using a registry to store our VM image which tart can access via pull / clone. But I'm not sure of the best way to propagate changes through the system automatically.

Would it be feasible to have Tartelet run a shell script before launching a runner when it's restarted? That would provide a hook to run some tart commands to pull the latest image from the registry.

Of course it would be nice to have a UI for this, but I'm afraid it's going to be specific to the registry. For example, we're using Amazon's ECR registry which requires authenticating via the aws cli tool before accessing the registry. It's simple enough to script, but impossible to build a UI around.

I think this is a feature request to be able to run a script between stopping a runner and restarting it.

jaylyerly avatar May 03 '23 21:05 jaylyerly

Tart supports Docker credentials helpers so you can install and configure one for ECR and Tart will call it automatically for pull. I think Tartelet can always just call tart pull before starting a worker to make sure the image is up-to-date.

We do it everywhere at Cirrus Labs for our CI and for Cirrus Runners.

fkorotkov avatar May 03 '23 21:05 fkorotkov

That sounds like a great solution!

jaylyerly avatar May 05 '23 13:05 jaylyerly

When setting up our host machines I looked into using tart push and tart pull to update images through an OCI registry, specifically GitHub Packages but I found that it took hours upon hours to update an image and decided not to proceed with it. Instead I am using the workflow build on tart export and tart import described in the wiki.

If anyone has any ideas as to how tart push and tart pull can be used without operations taking ages, I'd love to hear about it and build some functionality on top of this in Tartelet.

simonbs avatar May 10 '23 08:05 simonbs

With an AWS ECR registry, it does indeed take hours to pull a new update, but I just chalked that up to pushing a 40GB image over the internet. In our workflow, it wouldn't happen very frequently, so I'm not really concerned if it takes a while, as long as it was reliable.

@simonbs When you propagate changes using import/export, how does that fit into your process? Is that a manual step or is there a hook in Tartelet?

jaylyerly avatar May 10 '23 13:05 jaylyerly

@jaylyerly There is no hooks in Tartelet. Our workflow is described in the wiki.

simonbs avatar Jul 17 '23 12:07 simonbs