Re: Deploying Tomcat on Snappy Ubuntu Core

2016-09-21 Thread Michael Hall

On 09/20/2016 05:44 PM, Martin Grigorov wrote:
> Hi Chris,
> 
> On Tue, Sep 20, 2016 at 10:51 PM, Christopher Schultz <
> ch...@christopherschultz.net> wrote:
> 
>> Martin,
>>
>> On 9/20/16 3:28 PM, Martin Grigorov wrote:
>>> Hi Michael,
>>>
>>> On Tue, Sep 20, 2016 at 9:11 PM, Michael Hall 
>> wrote:
>>>
 Hi Martin,


 On 09/20/2016 02:56 PM, Martin Grigorov wrote:
> Hi Michael,
>
> On Tue, Sep 20, 2016 at 3:10 PM, Michael Hall 
 wrote:
>
>> Hi Coty,
>>
>> Have you had an opportunity to try this yet? If you need help please
>> let
>> me know, or you could find help on #snappy on Freenode or
>> https://gitter.im/ubuntu/snappy-playpen (a new slack-like service
>> connected to github)
>>
>
> I am an Ubuntu user and I've tried once Snap.
> I've installed the featured Notes application and I was amazed to see
 that
> it downloaded 60Mb for such a simple application! After being unzipped
>> it
> is 196MB !!
> Then I removed it.
> I hope Canonical will keep .deb around for the near future!
>

 .deb package aren't going away, snaps are just a new option that bring a

>>>
>>> Yes, I know that .deb isn't going away.
>>> I just said it to express my frustration with those 196MB.
>>>
>>>
 lot of benefit. Desktop apps like Notes are currently quite large
 because they bundle the whole GUI toolkit that they use. This is
 something that has a solution underway, but it won't affect services
 like tomcat nearly as much,

 The Tomcat snap does include a JRE though, so you always know that one
 is available and that Tomcat will work with it. Even with that the

>>>
>>> What if I need different combination of Tomcat and JRE versions than what
>>> your Snap versions provide ?
>>> Let's say I experience some bug in the bundled JRE version (e.g. X) and
>>> your next Snap version bundles JRE X+1 but also Tomcat Y+1.
>>> What if I need JRE X+1 and Tomcat Y because there is a regression in Y+1
>> ?
>>> Just thinking loud here.
>>>
>>>
 resulting snap is only 48MB. Snaps are never "unzipped", instead they
 are loop-mounted into your filesystem, so the download size is the

>>>
>>> I haven't read about squashfs, so I'm not sure how exactly it works.
>>> 196MB is what "du" program reports.
>>> If it is not disk size then I hope this 60MB download is not unzipped in
>>> the RAM.
>>> http://snapcraft.io/ says "That directory will be compressed into a
>>> squashfs - a zipped directory - and then it will be mounted at
>>> /snap//current when the snap is installed."
>>
>> It's like an executable JAR file, except that the kernel loads the thing
>> as a filesystem. So 'du' will tell you it's bigger than it actually is
>> (it's bigger on the inside than it is on the outside).
> 
> 
>> That 60MiB download isn't being uncompressed elsewhere on the disk or
>> into RAM. It's being decompressed on the fly as necessary, just like a
>> remotely-mounted filesystem isn't copied locally whenever you access
>> files. Sore, a file or two might have some parts cached locally, but you
>> aren't sucking-down your entire multi-petabyte SAN contents when you
>> login to your corporate network.
>>
> 
> Thanks for the explanation!
> But I think the example with reading data from SAN is not exactly the same
> as executing a process in the kernel.
> To start the process the kernel needs to load (big?!) part of the zipped
> bundle. Everything else might be loaded if needed later.
> 
> 1) Dealing with compressed data is definitely slower than dealing with
> uncompressed data, and this is valid both for startup time and runtime.

Squashfs is actually very fast at read operations, it trades off a
slower compression time for a faster decompression time. It's been used
for years in Ubuntu Live CD/DVD images, and the compression algorithm is
also used in AppImage (and I think FlatPak).

> 2) Snaps share nothing, by design. So if more than one app needs the same
> dependency then it is not just about the disk space but also duplicated
> stuff in memory. This is advertized as Pros but for me is Cons.

It's possible for snaps to share content with each other, but currently
only if both snaps are from the same developer. You will usually be
bundling your own copies of dependencies though. But, as previous
stated, that's more of a problem for desktop apps than services, and
combined with the squashfs compression doesn't have that much of an
impact on disk space used.

> 3) I cannot find any information about a running Notes app (I've installed
> it again for the testing!) neither with 'ps', nor with 'htop', nor with
> 'snap'. All I can find is a parent 'snapd' process with several forks. If I
> need to install a spy software I'll pack it as a Snap :-)
> 

Was it running? I installed the Notes app and launched it, after that I
could see "Notes" in ps. Snap processes are run just 

Re: Deploying Tomcat on Snappy Ubuntu Core

2016-09-21 Thread Christopher Schultz
Martin,

On 9/20/16 5:44 PM, Martin Grigorov wrote:
> Hi Chris,
> 
> On Tue, Sep 20, 2016 at 10:51 PM, Christopher Schultz <
> ch...@christopherschultz.net> wrote:
> 
>> Martin,
>>
>> On 9/20/16 3:28 PM, Martin Grigorov wrote:
>>> Hi Michael,
>>>
>>> On Tue, Sep 20, 2016 at 9:11 PM, Michael Hall 
>> wrote:
>>>
 Hi Martin,


 On 09/20/2016 02:56 PM, Martin Grigorov wrote:
> Hi Michael,
>
> On Tue, Sep 20, 2016 at 3:10 PM, Michael Hall 
 wrote:
>
>> Hi Coty,
>>
>> Have you had an opportunity to try this yet? If you need help please
>> let
>> me know, or you could find help on #snappy on Freenode or
>> https://gitter.im/ubuntu/snappy-playpen (a new slack-like service
>> connected to github)
>>
>
> I am an Ubuntu user and I've tried once Snap.
> I've installed the featured Notes application and I was amazed to see
 that
> it downloaded 60Mb for such a simple application! After being unzipped
>> it
> is 196MB !!
> Then I removed it.
> I hope Canonical will keep .deb around for the near future!
>

 .deb package aren't going away, snaps are just a new option that bring a

>>>
>>> Yes, I know that .deb isn't going away.
>>> I just said it to express my frustration with those 196MB.
>>>
>>>
 lot of benefit. Desktop apps like Notes are currently quite large
 because they bundle the whole GUI toolkit that they use. This is
 something that has a solution underway, but it won't affect services
 like tomcat nearly as much,

 The Tomcat snap does include a JRE though, so you always know that one
 is available and that Tomcat will work with it. Even with that the

>>>
>>> What if I need different combination of Tomcat and JRE versions than what
>>> your Snap versions provide ?
>>> Let's say I experience some bug in the bundled JRE version (e.g. X) and
>>> your next Snap version bundles JRE X+1 but also Tomcat Y+1.
>>> What if I need JRE X+1 and Tomcat Y because there is a regression in Y+1
>> ?
>>> Just thinking loud here.
>>>
>>>
 resulting snap is only 48MB. Snaps are never "unzipped", instead they
 are loop-mounted into your filesystem, so the download size is the

>>>
>>> I haven't read about squashfs, so I'm not sure how exactly it works.
>>> 196MB is what "du" program reports.
>>> If it is not disk size then I hope this 60MB download is not unzipped in
>>> the RAM.
>>> http://snapcraft.io/ says "That directory will be compressed into a
>>> squashfs - a zipped directory - and then it will be mounted at
>>> /snap//current when the snap is installed."
>>
>> It's like an executable JAR file, except that the kernel loads the thing
>> as a filesystem. So 'du' will tell you it's bigger than it actually is
>> (it's bigger on the inside than it is on the outside).
> 
> 
>> That 60MiB download isn't being uncompressed elsewhere on the disk or
>> into RAM. It's being decompressed on the fly as necessary, just like a
>> remotely-mounted filesystem isn't copied locally whenever you access
>> files. Sore, a file or two might have some parts cached locally, but you
>> aren't sucking-down your entire multi-petabyte SAN contents when you
>> login to your corporate network.
>>
> 
> Thanks for the explanation!
> But I think the example with reading data from SAN is not exactly the same
> as executing a process in the kernel.
> To start the process the kernel needs to load (big?!) part of the zipped
> bundle. Everything else might be loaded if needed later.

ZIP files store their catalog at the end of the file, and most
filesystems store their catalogs at the beginning of the "file". Both
have a structure which describes the file names and where the data can
be found. I think it's a reasonable analogy.

> 1) Dealing with compressed data is definitely slower than dealing with
> uncompressed data, and this is valid both for startup time and runtime.

Agreed. I was using the SAN as an example of something that "takes time"
much in the same way as reading from a ZIP file "takes time". Of course,
for the SAN example, the CPU isn't doing any work waiting for the data
to become available while in the ZIP case it's being used to decompress
the content.

> 2) Snaps share nothing, by design. So if more than one app needs the same
> dependency then it is not just about the disk space but also duplicated
> stuff in memory.

Possibly. I know that VM hypervisors perform page-merging but I have no
idea if "normal" OSs do that. It's possible that loading libcrypt in 10
processes only gets you a single copy of libcrypt in memory, even if
they were loaded from separate Snaps. (Same versions of libcrypt, of
course.)

> This is advertized as Pros but for me is Cons.

Meh. This solves a particular problem and the use case is valid. If you
can do everything without Snaps (e.g. a typical server configuration)
then go for it. If Snaps solve a problem for you ("DLL 

Re: Deploying Tomcat on Snappy Ubuntu Core

2016-09-20 Thread Martin Grigorov
Hi Chris,

On Tue, Sep 20, 2016 at 10:51 PM, Christopher Schultz <
ch...@christopherschultz.net> wrote:

> Martin,
>
> On 9/20/16 3:28 PM, Martin Grigorov wrote:
> > Hi Michael,
> >
> > On Tue, Sep 20, 2016 at 9:11 PM, Michael Hall 
> wrote:
> >
> >> Hi Martin,
> >>
> >>
> >> On 09/20/2016 02:56 PM, Martin Grigorov wrote:
> >>> Hi Michael,
> >>>
> >>> On Tue, Sep 20, 2016 at 3:10 PM, Michael Hall 
> >> wrote:
> >>>
>  Hi Coty,
> 
>  Have you had an opportunity to try this yet? If you need help please
> let
>  me know, or you could find help on #snappy on Freenode or
>  https://gitter.im/ubuntu/snappy-playpen (a new slack-like service
>  connected to github)
> 
> >>>
> >>> I am an Ubuntu user and I've tried once Snap.
> >>> I've installed the featured Notes application and I was amazed to see
> >> that
> >>> it downloaded 60Mb for such a simple application! After being unzipped
> it
> >>> is 196MB !!
> >>> Then I removed it.
> >>> I hope Canonical will keep .deb around for the near future!
> >>>
> >>
> >> .deb package aren't going away, snaps are just a new option that bring a
> >>
> >
> > Yes, I know that .deb isn't going away.
> > I just said it to express my frustration with those 196MB.
> >
> >
> >> lot of benefit. Desktop apps like Notes are currently quite large
> >> because they bundle the whole GUI toolkit that they use. This is
> >> something that has a solution underway, but it won't affect services
> >> like tomcat nearly as much,
> >>
> >> The Tomcat snap does include a JRE though, so you always know that one
> >> is available and that Tomcat will work with it. Even with that the
> >>
> >
> > What if I need different combination of Tomcat and JRE versions than what
> > your Snap versions provide ?
> > Let's say I experience some bug in the bundled JRE version (e.g. X) and
> > your next Snap version bundles JRE X+1 but also Tomcat Y+1.
> > What if I need JRE X+1 and Tomcat Y because there is a regression in Y+1
> ?
> > Just thinking loud here.
> >
> >
> >> resulting snap is only 48MB. Snaps are never "unzipped", instead they
> >> are loop-mounted into your filesystem, so the download size is the
> >>
> >
> > I haven't read about squashfs, so I'm not sure how exactly it works.
> > 196MB is what "du" program reports.
> > If it is not disk size then I hope this 60MB download is not unzipped in
> > the RAM.
> > http://snapcraft.io/ says "That directory will be compressed into a
> > squashfs - a zipped directory - and then it will be mounted at
> > /snap//current when the snap is installed."
>
> It's like an executable JAR file, except that the kernel loads the thing
> as a filesystem. So 'du' will tell you it's bigger than it actually is
> (it's bigger on the inside than it is on the outside).


> That 60MiB download isn't being uncompressed elsewhere on the disk or
> into RAM. It's being decompressed on the fly as necessary, just like a
> remotely-mounted filesystem isn't copied locally whenever you access
> files. Sore, a file or two might have some parts cached locally, but you
> aren't sucking-down your entire multi-petabyte SAN contents when you
> login to your corporate network.
>

Thanks for the explanation!
But I think the example with reading data from SAN is not exactly the same
as executing a process in the kernel.
To start the process the kernel needs to load (big?!) part of the zipped
bundle. Everything else might be loaded if needed later.

1) Dealing with compressed data is definitely slower than dealing with
uncompressed data, and this is valid both for startup time and runtime.
2) Snaps share nothing, by design. So if more than one app needs the same
dependency then it is not just about the disk space but also duplicated
stuff in memory. This is advertized as Pros but for me is Cons.
3) I cannot find any information about a running Notes app (I've installed
it again for the testing!) neither with 'ps', nor with 'htop', nor with
'snap'. All I can find is a parent 'snapd' process with several forks. If I
need to install a spy software I'll pack it as a Snap :-)

So far I see more drawbacks than benefits. But I am a developer with a
desktop. I guess the points above might not be a problem for server
administrators.


>
> -chris
>
>


Re: Deploying Tomcat on Snappy Ubuntu Core

2016-09-20 Thread Christopher Schultz
Martin,

On 9/20/16 3:28 PM, Martin Grigorov wrote:
> Hi Michael,
> 
> On Tue, Sep 20, 2016 at 9:11 PM, Michael Hall  wrote:
> 
>> Hi Martin,
>>
>>
>> On 09/20/2016 02:56 PM, Martin Grigorov wrote:
>>> Hi Michael,
>>>
>>> On Tue, Sep 20, 2016 at 3:10 PM, Michael Hall 
>> wrote:
>>>
 Hi Coty,

 Have you had an opportunity to try this yet? If you need help please let
 me know, or you could find help on #snappy on Freenode or
 https://gitter.im/ubuntu/snappy-playpen (a new slack-like service
 connected to github)

>>>
>>> I am an Ubuntu user and I've tried once Snap.
>>> I've installed the featured Notes application and I was amazed to see
>> that
>>> it downloaded 60Mb for such a simple application! After being unzipped it
>>> is 196MB !!
>>> Then I removed it.
>>> I hope Canonical will keep .deb around for the near future!
>>>
>>
>> .deb package aren't going away, snaps are just a new option that bring a
>>
> 
> Yes, I know that .deb isn't going away.
> I just said it to express my frustration with those 196MB.
> 
> 
>> lot of benefit. Desktop apps like Notes are currently quite large
>> because they bundle the whole GUI toolkit that they use. This is
>> something that has a solution underway, but it won't affect services
>> like tomcat nearly as much,
>>
>> The Tomcat snap does include a JRE though, so you always know that one
>> is available and that Tomcat will work with it. Even with that the
>>
> 
> What if I need different combination of Tomcat and JRE versions than what
> your Snap versions provide ?
> Let's say I experience some bug in the bundled JRE version (e.g. X) and
> your next Snap version bundles JRE X+1 but also Tomcat Y+1.
> What if I need JRE X+1 and Tomcat Y because there is a regression in Y+1 ?
> Just thinking loud here.
> 
> 
>> resulting snap is only 48MB. Snaps are never "unzipped", instead they
>> are loop-mounted into your filesystem, so the download size is the
>>
> 
> I haven't read about squashfs, so I'm not sure how exactly it works.
> 196MB is what "du" program reports.
> If it is not disk size then I hope this 60MB download is not unzipped in
> the RAM.
> http://snapcraft.io/ says "That directory will be compressed into a
> squashfs - a zipped directory - and then it will be mounted at
> /snap//current when the snap is installed."

It's like an executable JAR file, except that the kernel loads the thing
as a filesystem. So 'du' will tell you it's bigger than it actually is
(it's bigger on the inside than it is on the outside).

That 60MiB download isn't being uncompressed elsewhere on the disk or
into RAM. It's being decompressed on the fly as necessary, just like a
remotely-mounted filesystem isn't copied locally whenever you access
files. Sore, a file or two might have some parts cached locally, but you
aren't sucking-down your entire multi-petabyte SAN contents when you
login to your corporate network.

-chris



signature.asc
Description: OpenPGP digital signature


Re: Deploying Tomcat on Snappy Ubuntu Core

2016-09-20 Thread Martin Grigorov
Hi Michael,

On Tue, Sep 20, 2016 at 9:11 PM, Michael Hall  wrote:

> Hi Martin,
>
>
> On 09/20/2016 02:56 PM, Martin Grigorov wrote:
> > Hi Michael,
> >
> > On Tue, Sep 20, 2016 at 3:10 PM, Michael Hall 
> wrote:
> >
> >> Hi Coty,
> >>
> >> Have you had an opportunity to try this yet? If you need help please let
> >> me know, or you could find help on #snappy on Freenode or
> >> https://gitter.im/ubuntu/snappy-playpen (a new slack-like service
> >> connected to github)
> >>
> >
> > I am an Ubuntu user and I've tried once Snap.
> > I've installed the featured Notes application and I was amazed to see
> that
> > it downloaded 60Mb for such a simple application! After being unzipped it
> > is 196MB !!
> > Then I removed it.
> > I hope Canonical will keep .deb around for the near future!
> >
>
> .deb package aren't going away, snaps are just a new option that bring a
>

Yes, I know that .deb isn't going away.
I just said it to express my frustration with those 196MB.


> lot of benefit. Desktop apps like Notes are currently quite large
> because they bundle the whole GUI toolkit that they use. This is
> something that has a solution underway, but it won't affect services
> like tomcat nearly as much,
>
> The Tomcat snap does include a JRE though, so you always know that one
> is available and that Tomcat will work with it. Even with that the
>

What if I need different combination of Tomcat and JRE versions than what
your Snap versions provide ?
Let's say I experience some bug in the bundled JRE version (e.g. X) and
your next Snap version bundles JRE X+1 but also Tomcat Y+1.
What if I need JRE X+1 and Tomcat Y because there is a regression in Y+1 ?
Just thinking loud here.


> resulting snap is only 48MB. Snaps are never "unzipped", instead they
> are loop-mounted into your filesystem, so the download size is the
>

I haven't read about squashfs, so I'm not sure how exactly it works.
196MB is what "du" program reports.
If it is not disk size then I hope this 60MB download is not unzipped in
the RAM.
http://snapcraft.io/ says "That directory will be compressed into a
squashfs - a zipped directory - and then it will be mounted at
/snap//current when the snap is installed."


> installed size.
>
> > About your package:
> > I see it uses "plugs: [network-bind]" to be able to bind the ports, but
> > does this also allow to make connections to external resources like a
> > remote DB for example ?
> >
>
> I would have to double check. There is a "network" interface that allows
> only out-bound connection, which can be added if "network-bind" doesn't
> already do that.
>

Thanks!


>
> >
> > Martin Grigorov
> > Wicket Training and Consulting
> > https://twitter.com/mtgrigorov
> >
> >
> >
> >>
> >> Michael Hall
> >> mhall...@gmail.com
> >>
> >> On 09/15/2016 10:06 AM, Michael Hall wrote:
> >>> Hi Coty,
> >>>
> >>> To learn more about snaps in general and how to make them you can go to
> >>> http://snapcraft.io/
> >>>
> >>> The tl;dr is that they are self-contained application bundles,
> including
> >>> dependencies, that are packed into a squashfs that is then loop-mounted
> >>> when installed. This means that the application's own files are
> >>> read-only and isolated from other apps and the system, which makes
> >>> updating them safe and simple. For Tomcat this means it includes a JRE,
> >>> OpenSSL, and anything else needed for Tomcat to run.
> >>>
> >>> I have attached the files needed to build a Tomcat snap using the the
> >>> Snapcraft tool (only available on Ubuntu currently), just run
> "snapcraft
> >>> snap" in the same directory as these files. The snapcrafy.yaml will
> pull
> >>> Tomcat 8.5.5 binary tarball as it's source, so no re-compiling is
> >>> needed. The run.sh simply sets some environment variables to their
> >>> proper snap-environment locations, copies the server.xml into
> >>> CATALINE_BASE (if it's not there), and starts Tomcat.
> >>>
> >>> Because the snapcraft.yaml declares this to be a daemon, it will create
> >>> a systemd service file upon installation and start it automatically.
> >>> Then you can copy a .war files into $CATALINA_BASE/webapps/ and Tomcat
> >>> will pick it up. I tested with the sample.war from
> >>> https://tomcat.apache.org/tomcat-8.0-doc/appdev/sample/ and it works
> >>> with the servlet portion, but not the JSP (I suspect the JSP
> compilation
> >>> is trying write to use a read-only space, but haven't dug too far into
> >> it).
> >>>
> >>> If you don't run Ubuntu the easiest way to build the snap is in a VM or
> >>> container that has Ubuntu 16.04, just install the snapcraft package
> from
> >>> the archive. If you just want to try a pre-built binary, you can
> >>> download mine from http://people.ubuntu.com/~mhall119/snaps/
> >>>
> >>> You can install it on Ubuntu 16.04 or a derivative right away with
> "snap
> >>> install $snapfile --force-dangerous". The --force-dangerous is required
> >>> because the resulting snap won't 

Re: Deploying Tomcat on Snappy Ubuntu Core

2016-09-20 Thread Christopher Schultz
Martin,

On 9/20/16 2:56 PM, Martin Grigorov wrote:
> Hi Michael,
> 
> On Tue, Sep 20, 2016 at 3:10 PM, Michael Hall  wrote:
> 
>> Hi Coty,
>>
>> Have you had an opportunity to try this yet? If you need help please let
>> me know, or you could find help on #snappy on Freenode or
>> https://gitter.im/ubuntu/snappy-playpen (a new slack-like service
>> connected to github)
>>
> 
> I am an Ubuntu user and I've tried once Snap.
> I've installed the featured Notes application and I was amazed to see that
> it downloaded 60Mb for such a simple application! After being unzipped it
> is 196MB !!
> Then I removed it.
> I hope Canonical will keep .deb around for the near future!

If Ubuntu scraps .deb, then it won't really be Debian at the core and
will lose a lot of its appeal. I don't think that's going to happen.

I completely understand the "fat app" model, here. Honestly, it's
*exactly* like the "fat web app" model that we usually recommend around
here. If you try to use the same shared dependencies for all
applications, things quickly become mired in dependency hell: upgrading
one component breaks one app while leaving it on an older version
prohibits another app from running properly.

Using fat apps where the only system-wide libraries being used are e.g.
glibc makes for a much "easier" experience for a lot of people. Don't
forget that Ubuntu is focused on the end-user and not the administrator
(even though they'd be perfectly happy to have Ubuntu running servers
everywhere, too). Users just want stuff to work.

Of course, bundling libraries with applications means that every time a
security fix comes out for a particular library, every app using that
lib needs an update. Boo. It's hard to strike a balance between these
two irritating situations. Perhaps that's why Ubuntu offers both
traditional .deb packages as well as Snaps.

> About your package:
> I see it uses "plugs: [network-bind]" to be able to bind the ports, but
> does this also allow to make connections to external resources like a
> remote DB for example ?

Web services, JMS queues, non-JDBC Data sources, etc.

Honestly, I have no idea why anyone would want to install Tomcat as a
"Snap"... it's a server daemon. Is there a Snap for httpd? MySQL? *shrug*

-chris



signature.asc
Description: OpenPGP digital signature


Re: Deploying Tomcat on Snappy Ubuntu Core

2016-09-20 Thread Michael Hall
Hi Martin,


On 09/20/2016 02:56 PM, Martin Grigorov wrote:
> Hi Michael,
> 
> On Tue, Sep 20, 2016 at 3:10 PM, Michael Hall  wrote:
> 
>> Hi Coty,
>>
>> Have you had an opportunity to try this yet? If you need help please let
>> me know, or you could find help on #snappy on Freenode or
>> https://gitter.im/ubuntu/snappy-playpen (a new slack-like service
>> connected to github)
>>
> 
> I am an Ubuntu user and I've tried once Snap.
> I've installed the featured Notes application and I was amazed to see that
> it downloaded 60Mb for such a simple application! After being unzipped it
> is 196MB !!
> Then I removed it.
> I hope Canonical will keep .deb around for the near future!
> 

.deb package aren't going away, snaps are just a new option that bring a
lot of benefit. Desktop apps like Notes are currently quite large
because they bundle the whole GUI toolkit that they use. This is
something that has a solution underway, but it won't affect services
like tomcat nearly as much,

The Tomcat snap does include a JRE though, so you always know that one
is available and that Tomcat will work with it. Even with that the
resulting snap is only 48MB. Snaps are never "unzipped", instead they
are loop-mounted into your filesystem, so the download size is the
installed size.

> About your package: 
> I see it uses "plugs: [network-bind]" to be able to bind the ports, but
> does this also allow to make connections to external resources like a
> remote DB for example ?
> 

I would have to double check. There is a "network" interface that allows
only out-bound connection, which can be added if "network-bind" doesn't
already do that.

> 
> Martin Grigorov
> Wicket Training and Consulting
> https://twitter.com/mtgrigorov
> 
> 
> 
>>
>> Michael Hall
>> mhall...@gmail.com
>>
>> On 09/15/2016 10:06 AM, Michael Hall wrote:
>>> Hi Coty,
>>>
>>> To learn more about snaps in general and how to make them you can go to
>>> http://snapcraft.io/
>>>
>>> The tl;dr is that they are self-contained application bundles, including
>>> dependencies, that are packed into a squashfs that is then loop-mounted
>>> when installed. This means that the application's own files are
>>> read-only and isolated from other apps and the system, which makes
>>> updating them safe and simple. For Tomcat this means it includes a JRE,
>>> OpenSSL, and anything else needed for Tomcat to run.
>>>
>>> I have attached the files needed to build a Tomcat snap using the the
>>> Snapcraft tool (only available on Ubuntu currently), just run "snapcraft
>>> snap" in the same directory as these files. The snapcrafy.yaml will pull
>>> Tomcat 8.5.5 binary tarball as it's source, so no re-compiling is
>>> needed. The run.sh simply sets some environment variables to their
>>> proper snap-environment locations, copies the server.xml into
>>> CATALINE_BASE (if it's not there), and starts Tomcat.
>>>
>>> Because the snapcraft.yaml declares this to be a daemon, it will create
>>> a systemd service file upon installation and start it automatically.
>>> Then you can copy a .war files into $CATALINA_BASE/webapps/ and Tomcat
>>> will pick it up. I tested with the sample.war from
>>> https://tomcat.apache.org/tomcat-8.0-doc/appdev/sample/ and it works
>>> with the servlet portion, but not the JSP (I suspect the JSP compilation
>>> is trying write to use a read-only space, but haven't dug too far into
>> it).
>>>
>>> If you don't run Ubuntu the easiest way to build the snap is in a VM or
>>> container that has Ubuntu 16.04, just install the snapcraft package from
>>> the archive. If you just want to try a pre-built binary, you can
>>> download mine from http://people.ubuntu.com/~mhall119/snaps/
>>>
>>> You can install it on Ubuntu 16.04 or a derivative right away with "snap
>>> install $snapfile --force-dangerous". The --force-dangerous is required
>>> because the resulting snap won't be signed. On non-Ubuntu distros you
>>> can get snaps running by following the instructions on
>>> http://snapcraft.io/docs/core/install
>>>
>>>
>>> Michael Hall
>>> mhall...@ubuntu.com
>>>
>>> On 09/14/2016 11:23 PM, Coty Sutherland wrote:
 Hi Micheal,

 I hadn't heard of snaps (or used Ubuntu much) but the concept seems
 interesting to me. Would you be able to send me links to what you have
 so far so I can check it out? I have a few questions, but I'll reserve
 those until I get a chance to review what you have.

 Thanks!


 On Sep 14, 2016 3:51 PM, "Michael Hall" > wrote:

 Hi everyone,

 Ubuntu has developed a new platform for deploying applications using
 bundled packages called "snaps". These make it easier to deploy and
 update on Ubuntu independently of it's release cycle (and on
>> non-Ubuntu
 distros too for that matter). I would like to make Tomcat available
>> in
 this format so it can be more easily used on lightweight 

Re: Deploying Tomcat on Snappy Ubuntu Core

2016-09-20 Thread Martin Grigorov
Hi Michael,

On Tue, Sep 20, 2016 at 3:10 PM, Michael Hall  wrote:

> Hi Coty,
>
> Have you had an opportunity to try this yet? If you need help please let
> me know, or you could find help on #snappy on Freenode or
> https://gitter.im/ubuntu/snappy-playpen (a new slack-like service
> connected to github)
>

I am an Ubuntu user and I've tried once Snap.
I've installed the featured Notes application and I was amazed to see that
it downloaded 60Mb for such a simple application! After being unzipped it
is 196MB !!
Then I removed it.
I hope Canonical will keep .deb around for the near future!

About your package:
I see it uses "plugs: [network-bind]" to be able to bind the ports, but
does this also allow to make connections to external resources like a
remote DB for example ?


Martin Grigorov
Wicket Training and Consulting
https://twitter.com/mtgrigorov



>
> Michael Hall
> mhall...@gmail.com
>
> On 09/15/2016 10:06 AM, Michael Hall wrote:
> > Hi Coty,
> >
> > To learn more about snaps in general and how to make them you can go to
> > http://snapcraft.io/
> >
> > The tl;dr is that they are self-contained application bundles, including
> > dependencies, that are packed into a squashfs that is then loop-mounted
> > when installed. This means that the application's own files are
> > read-only and isolated from other apps and the system, which makes
> > updating them safe and simple. For Tomcat this means it includes a JRE,
> > OpenSSL, and anything else needed for Tomcat to run.
> >
> > I have attached the files needed to build a Tomcat snap using the the
> > Snapcraft tool (only available on Ubuntu currently), just run "snapcraft
> > snap" in the same directory as these files. The snapcrafy.yaml will pull
> > Tomcat 8.5.5 binary tarball as it's source, so no re-compiling is
> > needed. The run.sh simply sets some environment variables to their
> > proper snap-environment locations, copies the server.xml into
> > CATALINE_BASE (if it's not there), and starts Tomcat.
> >
> > Because the snapcraft.yaml declares this to be a daemon, it will create
> > a systemd service file upon installation and start it automatically.
> > Then you can copy a .war files into $CATALINA_BASE/webapps/ and Tomcat
> > will pick it up. I tested with the sample.war from
> > https://tomcat.apache.org/tomcat-8.0-doc/appdev/sample/ and it works
> > with the servlet portion, but not the JSP (I suspect the JSP compilation
> > is trying write to use a read-only space, but haven't dug too far into
> it).
> >
> > If you don't run Ubuntu the easiest way to build the snap is in a VM or
> > container that has Ubuntu 16.04, just install the snapcraft package from
> > the archive. If you just want to try a pre-built binary, you can
> > download mine from http://people.ubuntu.com/~mhall119/snaps/
> >
> > You can install it on Ubuntu 16.04 or a derivative right away with "snap
> > install $snapfile --force-dangerous". The --force-dangerous is required
> > because the resulting snap won't be signed. On non-Ubuntu distros you
> > can get snaps running by following the instructions on
> > http://snapcraft.io/docs/core/install
> >
> >
> > Michael Hall
> > mhall...@ubuntu.com
> >
> > On 09/14/2016 11:23 PM, Coty Sutherland wrote:
> >> Hi Micheal,
> >>
> >> I hadn't heard of snaps (or used Ubuntu much) but the concept seems
> >> interesting to me. Would you be able to send me links to what you have
> >> so far so I can check it out? I have a few questions, but I'll reserve
> >> those until I get a chance to review what you have.
> >>
> >> Thanks!
> >>
> >>
> >> On Sep 14, 2016 3:51 PM, "Michael Hall"  >> > wrote:
> >>
> >> Hi everyone,
> >>
> >> Ubuntu has developed a new platform for deploying applications using
> >> bundled packages called "snaps". These make it easier to deploy and
> >> update on Ubuntu independently of it's release cycle (and on
> non-Ubuntu
> >> distros too for that matter). I would like to make Tomcat available
> in
> >> this format so it can be more easily used on lightweight cloud
> instances
> >> or devices like the Raspberry Pi.
> >>
> >> I have a working example of Tomcat as a snap, and it works really
> well
> >> with a separate read-only CATALINE_HOME and a writable, versioned
> >> CATALINA_BASE that will allow for atomic updates and rollbacks
> without
> >> breaking application data, and it's very easy to use.
> >>
> >> The next step is to contribute this to upstream, where it can be
> >> improved (I've only scratched the surface of what can be done with
> it)
> >> and integrated with the CI system so that snap package can be
> >> automatically created and uploaded for testers and users. This is
> where
> >> I need help from somebody on this list, so please let me know if
> you are
> >> interested and I will provide you the packaging files (there are
> only 2)
> >> and a working binary 

Re: Deploying Tomcat on Snappy Ubuntu Core

2016-09-20 Thread Michael Hall
Hi Coty,

Have you had an opportunity to try this yet? If you need help please let
me know, or you could find help on #snappy on Freenode or
https://gitter.im/ubuntu/snappy-playpen (a new slack-like service
connected to github)

Michael Hall
mhall...@gmail.com

On 09/15/2016 10:06 AM, Michael Hall wrote:
> Hi Coty,
> 
> To learn more about snaps in general and how to make them you can go to
> http://snapcraft.io/
> 
> The tl;dr is that they are self-contained application bundles, including
> dependencies, that are packed into a squashfs that is then loop-mounted
> when installed. This means that the application's own files are
> read-only and isolated from other apps and the system, which makes
> updating them safe and simple. For Tomcat this means it includes a JRE,
> OpenSSL, and anything else needed for Tomcat to run.
> 
> I have attached the files needed to build a Tomcat snap using the the
> Snapcraft tool (only available on Ubuntu currently), just run "snapcraft
> snap" in the same directory as these files. The snapcrafy.yaml will pull
> Tomcat 8.5.5 binary tarball as it's source, so no re-compiling is
> needed. The run.sh simply sets some environment variables to their
> proper snap-environment locations, copies the server.xml into
> CATALINE_BASE (if it's not there), and starts Tomcat.
> 
> Because the snapcraft.yaml declares this to be a daemon, it will create
> a systemd service file upon installation and start it automatically.
> Then you can copy a .war files into $CATALINA_BASE/webapps/ and Tomcat
> will pick it up. I tested with the sample.war from
> https://tomcat.apache.org/tomcat-8.0-doc/appdev/sample/ and it works
> with the servlet portion, but not the JSP (I suspect the JSP compilation
> is trying write to use a read-only space, but haven't dug too far into it).
> 
> If you don't run Ubuntu the easiest way to build the snap is in a VM or
> container that has Ubuntu 16.04, just install the snapcraft package from
> the archive. If you just want to try a pre-built binary, you can
> download mine from http://people.ubuntu.com/~mhall119/snaps/
> 
> You can install it on Ubuntu 16.04 or a derivative right away with "snap
> install $snapfile --force-dangerous". The --force-dangerous is required
> because the resulting snap won't be signed. On non-Ubuntu distros you
> can get snaps running by following the instructions on
> http://snapcraft.io/docs/core/install
> 
> 
> Michael Hall
> mhall...@ubuntu.com
> 
> On 09/14/2016 11:23 PM, Coty Sutherland wrote:
>> Hi Micheal,
>>
>> I hadn't heard of snaps (or used Ubuntu much) but the concept seems
>> interesting to me. Would you be able to send me links to what you have
>> so far so I can check it out? I have a few questions, but I'll reserve
>> those until I get a chance to review what you have.
>>
>> Thanks!
>>
>>
>> On Sep 14, 2016 3:51 PM, "Michael Hall" > > wrote:
>>
>> Hi everyone,
>>
>> Ubuntu has developed a new platform for deploying applications using
>> bundled packages called "snaps". These make it easier to deploy and
>> update on Ubuntu independently of it's release cycle (and on non-Ubuntu
>> distros too for that matter). I would like to make Tomcat available in
>> this format so it can be more easily used on lightweight cloud instances
>> or devices like the Raspberry Pi.
>>
>> I have a working example of Tomcat as a snap, and it works really well
>> with a separate read-only CATALINE_HOME and a writable, versioned
>> CATALINA_BASE that will allow for atomic updates and rollbacks without
>> breaking application data, and it's very easy to use.
>>
>> The next step is to contribute this to upstream, where it can be
>> improved (I've only scratched the surface of what can be done with it)
>> and integrated with the CI system so that snap package can be
>> automatically created and uploaded for testers and users. This is where
>> I need help from somebody on this list, so please let me know if you are
>> interested and I will provide you the packaging files (there are only 2)
>> and a working binary package if you want to give it a try.
>>
>> Thanks.
>>
>> --
>> Michael Hall
>> mhall...@ubuntu.com 
>>
>> -
>> To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
>> 
>> For additional commands, e-mail: dev-h...@tomcat.apache.org
>> 
>>

-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



Re: Deploying Tomcat on Snappy Ubuntu Core

2016-09-15 Thread Michael Hall
Hi Coty,

To learn more about snaps in general and how to make them you can go to
http://snapcraft.io/

The tl;dr is that they are self-contained application bundles, including
dependencies, that are packed into a squashfs that is then loop-mounted
when installed. This means that the application's own files are
read-only and isolated from other apps and the system, which makes
updating them safe and simple. For Tomcat this means it includes a JRE,
OpenSSL, and anything else needed for Tomcat to run.

I have attached the files needed to build a Tomcat snap using the the
Snapcraft tool (only available on Ubuntu currently), just run "snapcraft
snap" in the same directory as these files. The snapcrafy.yaml will pull
Tomcat 8.5.5 binary tarball as it's source, so no re-compiling is
needed. The run.sh simply sets some environment variables to their
proper snap-environment locations, copies the server.xml into
CATALINE_BASE (if it's not there), and starts Tomcat.

Because the snapcraft.yaml declares this to be a daemon, it will create
a systemd service file upon installation and start it automatically.
Then you can copy a .war files into $CATALINA_BASE/webapps/ and Tomcat
will pick it up. I tested with the sample.war from
https://tomcat.apache.org/tomcat-8.0-doc/appdev/sample/ and it works
with the servlet portion, but not the JSP (I suspect the JSP compilation
is trying write to use a read-only space, but haven't dug too far into it).

If you don't run Ubuntu the easiest way to build the snap is in a VM or
container that has Ubuntu 16.04, just install the snapcraft package from
the archive. If you just want to try a pre-built binary, you can
download mine from http://people.ubuntu.com/~mhall119/snaps/

You can install it on Ubuntu 16.04 or a derivative right away with "snap
install $snapfile --force-dangerous". The --force-dangerous is required
because the resulting snap won't be signed. On non-Ubuntu distros you
can get snaps running by following the instructions on
http://snapcraft.io/docs/core/install


Michael Hall
mhall...@ubuntu.com

On 09/14/2016 11:23 PM, Coty Sutherland wrote:
> Hi Micheal,
> 
> I hadn't heard of snaps (or used Ubuntu much) but the concept seems
> interesting to me. Would you be able to send me links to what you have
> so far so I can check it out? I have a few questions, but I'll reserve
> those until I get a chance to review what you have.
> 
> Thanks!
> 
> 
> On Sep 14, 2016 3:51 PM, "Michael Hall"  > wrote:
> 
> Hi everyone,
> 
> Ubuntu has developed a new platform for deploying applications using
> bundled packages called "snaps". These make it easier to deploy and
> update on Ubuntu independently of it's release cycle (and on non-Ubuntu
> distros too for that matter). I would like to make Tomcat available in
> this format so it can be more easily used on lightweight cloud instances
> or devices like the Raspberry Pi.
> 
> I have a working example of Tomcat as a snap, and it works really well
> with a separate read-only CATALINE_HOME and a writable, versioned
> CATALINA_BASE that will allow for atomic updates and rollbacks without
> breaking application data, and it's very easy to use.
> 
> The next step is to contribute this to upstream, where it can be
> improved (I've only scratched the surface of what can be done with it)
> and integrated with the CI system so that snap package can be
> automatically created and uploaded for testers and users. This is where
> I need help from somebody on this list, so please let me know if you are
> interested and I will provide you the packaging files (there are only 2)
> and a working binary package if you want to give it a try.
> 
> Thanks.
> 
> --
> Michael Hall
> mhall...@ubuntu.com 
> 
> -
> To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
> 
> For additional commands, e-mail: dev-h...@tomcat.apache.org
> 
> 


snapcraft.yaml
Description: application/yaml


run.sh
Description: application/shellscript

-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org

Re: Deploying Tomcat on Snappy Ubuntu Core

2016-09-14 Thread Coty Sutherland
Hi Micheal,

I hadn't heard of snaps (or used Ubuntu much) but the concept seems
interesting to me. Would you be able to send me links to what you have so
far so I can check it out? I have a few questions, but I'll reserve those
until I get a chance to review what you have.

Thanks!

On Sep 14, 2016 3:51 PM, "Michael Hall"  wrote:

> Hi everyone,
>
> Ubuntu has developed a new platform for deploying applications using
> bundled packages called "snaps". These make it easier to deploy and
> update on Ubuntu independently of it's release cycle (and on non-Ubuntu
> distros too for that matter). I would like to make Tomcat available in
> this format so it can be more easily used on lightweight cloud instances
> or devices like the Raspberry Pi.
>
> I have a working example of Tomcat as a snap, and it works really well
> with a separate read-only CATALINE_HOME and a writable, versioned
> CATALINA_BASE that will allow for atomic updates and rollbacks without
> breaking application data, and it's very easy to use.
>
> The next step is to contribute this to upstream, where it can be
> improved (I've only scratched the surface of what can be done with it)
> and integrated with the CI system so that snap package can be
> automatically created and uploaded for testers and users. This is where
> I need help from somebody on this list, so please let me know if you are
> interested and I will provide you the packaging files (there are only 2)
> and a working binary package if you want to give it a try.
>
> Thanks.
>
> --
> Michael Hall
> mhall...@ubuntu.com
>
> -
> To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: dev-h...@tomcat.apache.org
>
>