Re: [systemd-devel] How to deploy systemd-nspawn containers and use for deployment

2016-10-28 Thread Juanjo Presa
What about rkt with systemd?

https://coreos.com/rkt/docs/latest/using-rkt-with-systemd.html

Any experiences?

On Thu, Oct 20, 2016 at 2:02 PM, Lennart Poettering 
wrote:

> On Thu, 20.10.16 12:35, Juanjo Presa (juan...@gmail.com) wrote:
>
> > I am comfortable with machinectl nowadays but maybe I miss some kind of
> > versioning of images generated. Do you have any advice or recommendation
> > about this?
>
> Versioning is hard. We have no concept for that in nspawn/machined,
> and right now I have no good suggeston about it, except maybe that you
> could include a version identifier in the container's name, the same
> way deb/rpm packages do it...
>
> Lennart
>
> --
> Lennart Poettering, Red Hat
>
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] How to deploy systemd-nspawn containers and use for deployment

2016-10-20 Thread Lennart Poettering
On Thu, 20.10.16 12:35, Juanjo Presa (juan...@gmail.com) wrote:

> I am comfortable with machinectl nowadays but maybe I miss some kind of
> versioning of images generated. Do you have any advice or recommendation
> about this?

Versioning is hard. We have no concept for that in nspawn/machined,
and right now I have no good suggeston about it, except maybe that you
could include a version identifier in the container's name, the same
way deb/rpm packages do it...

Lennart

-- 
Lennart Poettering, Red Hat
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] How to deploy systemd-nspawn containers and use for deployment

2016-10-20 Thread Juanjo Presa
I am comfortable with machinectl nowadays but maybe I miss some kind of
versioning of images generated. Do you have any advice or recommendation
about this?

On Thu, Oct 20, 2016 at 2:41 AM, Nathan Williams 
wrote:

> Fwiw, if you're using Chef, the impending release of v3 of the systemd
> cookbook has a machine_image and a machine resource, which use importd and
> nspawn under the hood.
>
> On Wed, Oct 19, 2016, 3:45 PM Lennart Poettering 
> wrote:
>
>> On Thu, 13.10.16 01:09, Brian Kroth (bpkr...@gmail.com) wrote:
>>
>> > Seems really dependent upon the container layout as to what's the most
>> > appropriate way of doing that. For instance, if the underlying fs of the
>> > source container is something like btrfs or zfs you could imagine doing
>> a
>> > send/recv of a golden snapshot. Possibly also for an lvm
>> volume/snapshot.
>> > For others rsync might be best. For others maybe it's just a deployment
>> > script or tar or git repo.
>>
>> Yeah, to make this clear: I doubt we should really be in the
>> deployment business too much. That's for other people to solve, for
>> example rkt.
>>
>> However, I do think the most basic bits should probably be available,
>> simply to get developers off the ground for the most basic testing. I
>> figure that means "machinectl migrate" (as suggested in the other
>> mail) is really as good as it might get, and anything fancier should
>> really be left to other projects.
>>
>> Lennart
>>
>> --
>> Lennart Poettering, Red Hat
>> ___
>> systemd-devel mailing list
>> systemd-devel@lists.freedesktop.org
>> https://lists.freedesktop.org/mailman/listinfo/systemd-devel
>>
>
> ___
> systemd-devel mailing list
> systemd-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/systemd-devel
>
>
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] How to deploy systemd-nspawn containers and use for deployment

2016-10-19 Thread Nathan Williams
Fwiw, if you're using Chef, the impending release of v3 of the systemd
cookbook has a machine_image and a machine resource, which use importd and
nspawn under the hood.

On Wed, Oct 19, 2016, 3:45 PM Lennart Poettering 
wrote:

> On Thu, 13.10.16 01:09, Brian Kroth (bpkr...@gmail.com) wrote:
>
> > Seems really dependent upon the container layout as to what's the most
> > appropriate way of doing that. For instance, if the underlying fs of the
> > source container is something like btrfs or zfs you could imagine doing a
> > send/recv of a golden snapshot. Possibly also for an lvm volume/snapshot.
> > For others rsync might be best. For others maybe it's just a deployment
> > script or tar or git repo.
>
> Yeah, to make this clear: I doubt we should really be in the
> deployment business too much. That's for other people to solve, for
> example rkt.
>
> However, I do think the most basic bits should probably be available,
> simply to get developers off the ground for the most basic testing. I
> figure that means "machinectl migrate" (as suggested in the other
> mail) is really as good as it might get, and anything fancier should
> really be left to other projects.
>
> Lennart
>
> --
> Lennart Poettering, Red Hat
> ___
> systemd-devel mailing list
> systemd-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/systemd-devel
>
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] How to deploy systemd-nspawn containers and use for deployment

2016-10-19 Thread Lennart Poettering
On Thu, 13.10.16 10:22, Samuel Williams (space.ship.travel...@gmail.com) wrote:

> I'm not sure if this belongs in machinectl, but it would be interesting to
> explore some kind of deployment mechanism. e.g. machinectl deploy
> local-container-name ssh://remote-server:container-name because I'm sure
> this is going to be a really common use case, and there are enough details
> (e.g. stopping and starting the remote machine) that it would be nice to
> keep it easy for new users.

There's a TODO list item somewhere, to add "machinectl migrate
$CONTAINER $HOST" which would basically be a combination of
"export-tar"  locally, then an ssh link, and an "import-tar"
remotely or so.

Lennart

-- 
Lennart Poettering, Red Hat
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] How to deploy systemd-nspawn containers and use for deployment

2016-10-19 Thread Lennart Poettering
On Wed, 12.10.16 15:29, Samuel Williams (space.ship.travel...@gmail.com) wrote:

> Hello.
> 
> I've been thinking about how I could use systemd-nspawn containers.
> 
> Ideally, we have a local container which can then be pushed to one or more
> VPS instances.
> 
> An example workflow might look like this:
> 
> - Step 1: On development box, update some software in a container and test.
> It's okay.
> - Step 2: Push the container to several VPSs, some procedure to minimise
> downtime while updating.



> - Step 3: ...
> - Step 4: Profit.
> 
> For step 2, what would be the best practice. Rsync the local container to
> the remote container?

That's one option. Another one is to do "machinectl export-tar foo |
ssh someothermachine machinectl import-tar foo"...

You can also upload a tarball generated like that to some web server and then 
issue
"machinectl pull-tar" with the URL to download it on the host you want
to run it on.

Another way to generate images for deployment is to use the new
"mkiso" tool, which spits out signatures and shasums too, which make
it easy to place the stuff on a http server that machinectl pull-tar
can make use of...

-- 
Lennart Poettering, Red Hat
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] How to deploy systemd-nspawn containers and use for deployment

2016-10-19 Thread Lennart Poettering
On Thu, 13.10.16 01:09, Brian Kroth (bpkr...@gmail.com) wrote:

> Seems really dependent upon the container layout as to what's the most
> appropriate way of doing that. For instance, if the underlying fs of the
> source container is something like btrfs or zfs you could imagine doing a
> send/recv of a golden snapshot. Possibly also for an lvm volume/snapshot.
> For others rsync might be best. For others maybe it's just a deployment
> script or tar or git repo.

Yeah, to make this clear: I doubt we should really be in the
deployment business too much. That's for other people to solve, for
example rkt.

However, I do think the most basic bits should probably be available,
simply to get developers off the ground for the most basic testing. I
figure that means "machinectl migrate" (as suggested in the other
mail) is really as good as it might get, and anything fancier should
really be left to other projects.

Lennart

-- 
Lennart Poettering, Red Hat
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] How to deploy systemd-nspawn containers and use for deployment

2016-10-12 Thread Brian Kroth
Seems really dependent upon the container layout as to what's the most
appropriate way of doing that. For instance, if the underlying fs of the
source container is something like btrfs or zfs you could imagine doing a
send/recv of a golden snapshot. Possibly also for an lvm volume/snapshot.
For others rsync might be best. For others maybe it's just a deployment
script or tar or git repo.



Cheers,
Brian

On Wed, Oct 12, 2016, 16:23 Samuel Williams 
wrote:

> I'm not sure if this belongs in machinectl, but it would be interesting to
> explore some kind of deployment mechanism. e.g. machinectl deploy
> local-container-name ssh://remote-server:container-name because I'm sure
> this is going to be a really common use case, and there are enough details
> (e.g. stopping and starting the remote machine) that it would be nice to
> keep it easy for new users.
>
> On 13 October 2016 at 02:10, Chris Bell  wrote:
>
> On 2016-10-11 22:29, Samuel Williams wrote:
>
>
> For step 2, what would be the best practice. Rsync the local container
> to the remote container?
>
>
> That's worked fine for me so far. Just to state the obvious: makes sure
> the container is stopped before using rsync.
>
>
> ___
> systemd-devel mailing list
> systemd-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/systemd-devel
>
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] How to deploy systemd-nspawn containers and use for deployment

2016-10-12 Thread Samuel Williams
I'm not sure if this belongs in machinectl, but it would be interesting to
explore some kind of deployment mechanism. e.g. machinectl deploy
local-container-name ssh://remote-server:container-name because I'm sure
this is going to be a really common use case, and there are enough details
(e.g. stopping and starting the remote machine) that it would be nice to
keep it easy for new users.

On 13 October 2016 at 02:10, Chris Bell  wrote:

> On 2016-10-11 22:29, Samuel Williams wrote:
>
>>
>> For step 2, what would be the best practice. Rsync the local container
>> to the remote container?
>>
>>
> That's worked fine for me so far. Just to state the obvious: makes sure
> the container is stopped before using rsync.
>
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] How to deploy systemd-nspawn containers and use for deployment

2016-10-12 Thread Chris Bell

On 2016-10-11 22:29, Samuel Williams wrote:


For step 2, what would be the best practice. Rsync the local container
to the remote container?



That's worked fine for me so far. Just to state the obvious: makes sure 
the container is stopped before using rsync.

___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/systemd-devel