You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by Mark Thomas <ma...@apache.org> on 2018/07/03 16:27:10 UTC

makebase script and webapps

Hi,

I've been looking at the makebase script and thinking about potential
use cases.

Currently, we copy conf recursively but create an empty webapps. This is
inconsistent as any directories under conf will (nearly always) be web
application specific config.

I think we should either copy web applications and config or not copy both.

My suggestion is not to copy web applications and config (i.e. sub dirs
of /conf) by default and to add a -webapps option (or similar) to the
makebase script and only copy them when the option is present.

Thoughts?

I've been trying to think of other use cases and all the ones I can come
up with are either covered by what we have (with the above) or are
getting into the realm of editing config files which is - I think -
further than we want to go.

Can anyone think of any other options we might want to consider?

Mark

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


Re: makebase script and webapps

Posted by Igal Sapir <is...@apache.org>.
On 7/3/2018 9:27 AM, Mark Thomas wrote:
> <snip/>
>
> Currently, we copy conf recursively but create an empty webapps. This is
> inconsistent as any directories under conf will (nearly always) be web
> application specific config.
>
> I think we should either copy web applications and config or not copy both.
>
> My suggestion is not to copy web applications and config (i.e. sub dirs
> of /conf) by default and to add a -webapps option (or similar) to the
> makebase script and only copy them when the option is present.
>
> Thoughts?

I think that it's a good idea to add a switch.  I considered something 
like that but wanted to get some feedback before I get too deep into the 
scripts.  I will add that.

Igal

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


Re: makebase script and webapps

Posted by Igal Sapir <is...@apache.org>.
On 7/3/2018 1:48 PM, Michael Osipov wrote:
> Am 2018-07-03 um 22:37 schrieb Igal Sapir:
>> On 7/3/2018 1:15 PM, Michael Osipov wrote:
>>> Am 2018-07-03 um 22:12 schrieb Mark Thomas:
>>>> On 03/07/18 21:10, Michael Osipov wrote:
>>>>> Am 2018-07-03 um 22:07 schrieb Mark Thomas:
>>>>>> On 03/07/18 21:02, Michael Osipov wrote:
>>>>>>> Am 2018-07-03 um 18:27 schrieb Mark Thomas:
>>>>>>>> Hi,
>>>>>>>>
>>>>>>>> I've been looking at the makebase script and thinking about 
>>>>>>>> potential
>>>>>>>> use cases.
>>>>>>>>
>>>>>>>> Currently, we copy conf recursively but create an empty webapps.
>>>>>>>> This is
>>>>>>>> inconsistent as any directories under conf will (nearly always) 
>>>>>>>> be web
>>>>>>>> application specific config.
>>>>>>>>
>>>>>>>> I think we should either copy web applications and config or 
>>>>>>>> not copy
>>>>>>>> both.
>>>>>>>>
>>>>>>>> My suggestion is not to copy web applications and config (i.e. 
>>>>>>>> sub dirs
>>>>>>>> of /conf) by default and to add a -webapps option (or similar) 
>>>>>>>> to the
>>>>>>>> makebase script and only copy them when the option is present.
>>>>>>>>
>>>>>>>> Thoughts?
>>>>>>>
>>>>>>> First of all, I don't like the '-a' approach because you make
>>>>>>> assumptions about the target you don't know while other 
>>>>>>> operations don't
>>>>>>> do it. I'd simply do "-r".
>>>>>>>
>>>>>>> I do agree with your that it is somewhat inconsistent, but we 
>>>>>>> need to
>>>>>>> consider a very important point which must be true for our 
>>>>>>> script to
>>>>>>> work properly: CATALINA_HOME has to remain unmodified, i.e., 
>>>>>>> contents of
>>>>>>> conf, webapps.
>>>>>>> Though, the new CATALINA_BASE needs to be complete to start a 
>>>>>>> Tomcat
>>>>>>> instance, and it is complete with an empty webapps/ dir. conf/ is
>>>>>>> mandatory.
>>>>>>
>>>>>> The start will be unnecessarily messy if there are context.xml 
>>>>>> files in
>>>>>> sub-directories of conf but not corresponding application in 
>>>>>> webapps.
>>>>>
>>>>> Then why not copy only the necessary files which Tomcat needs to 
>>>>> start?
>>>>
>>>> That is the point of -webapps. Only copy the context.xml files if you
>>>> are going to copy the contents of webapps.
>>>>
>>>>>>> Given that you want to add "--webapps", which will you copy? 
>>>>>>> Manager?
>>>>>>> Host Manager? All of them?
>>>>>>
>>>>>> All of them. I think it has to be all or nothing. Anything else 
>>>>>> will get
>>>>>> very complicated very quickly for a script. I think most cases won't
>>>>>> want to copy (hence the default) but I can think of a few scenarios
>>>>>> where it could be useful.
>>>>>
>>>>> So even if it contains some user deployed apps?
>>>>
>>>> Yes.
>>>
>>> I think that it completely contradicts the spirit of make base: Give 
>>> me a fully working, but minimal Tomcat instance. At the end your are 
>>> trying to write a rsync for that. I think that this will add little 
>>> benefit. It will only workout if people never work with 
>>> CATALINA_HOME, but only with _BASE like I do at work.
>>
>> I agree with Mark.
>>
>> Copying user deployed apps will be very useful if you want to scale 
>> out your application and deploy multiple servers for the app for high 
>> availability etc.
>
> $ rsync -auhh src target
>
> done. I don't need a script for that.

By that token the whole script is unnecessary, just copy all of the 
directories recursively and that's it.

> Someone who scales will *never* operate from CATALINA_HOME because 
> this makes upgrades pain in the ass.

Then perhaps it'd be a good idea to allow to specify a source directory, 
so that the files are not necessarily copied from CATALINA_HOME, but 
from another CATALINA_BASE.

Igal


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


Re: makebase script and webapps

Posted by Michael Osipov <mi...@apache.org>.
Am 2018-07-03 um 22:37 schrieb Igal Sapir:
> On 7/3/2018 1:15 PM, Michael Osipov wrote:
>> Am 2018-07-03 um 22:12 schrieb Mark Thomas:
>>> On 03/07/18 21:10, Michael Osipov wrote:
>>>> Am 2018-07-03 um 22:07 schrieb Mark Thomas:
>>>>> On 03/07/18 21:02, Michael Osipov wrote:
>>>>>> Am 2018-07-03 um 18:27 schrieb Mark Thomas:
>>>>>>> Hi,
>>>>>>>
>>>>>>> I've been looking at the makebase script and thinking about 
>>>>>>> potential
>>>>>>> use cases.
>>>>>>>
>>>>>>> Currently, we copy conf recursively but create an empty webapps.
>>>>>>> This is
>>>>>>> inconsistent as any directories under conf will (nearly always) 
>>>>>>> be web
>>>>>>> application specific config.
>>>>>>>
>>>>>>> I think we should either copy web applications and config or not 
>>>>>>> copy
>>>>>>> both.
>>>>>>>
>>>>>>> My suggestion is not to copy web applications and config (i.e. 
>>>>>>> sub dirs
>>>>>>> of /conf) by default and to add a -webapps option (or similar) to 
>>>>>>> the
>>>>>>> makebase script and only copy them when the option is present.
>>>>>>>
>>>>>>> Thoughts?
>>>>>>
>>>>>> First of all, I don't like the '-a' approach because you make
>>>>>> assumptions about the target you don't know while other operations 
>>>>>> don't
>>>>>> do it. I'd simply do "-r".
>>>>>>
>>>>>> I do agree with your that it is somewhat inconsistent, but we need to
>>>>>> consider a very important point which must be true for our script to
>>>>>> work properly: CATALINA_HOME has to remain unmodified, i.e., 
>>>>>> contents of
>>>>>> conf, webapps.
>>>>>> Though, the new CATALINA_BASE needs to be complete to start a Tomcat
>>>>>> instance, and it is complete with an empty webapps/ dir. conf/ is
>>>>>> mandatory.
>>>>>
>>>>> The start will be unnecessarily messy if there are context.xml 
>>>>> files in
>>>>> sub-directories of conf but not corresponding application in webapps.
>>>>
>>>> Then why not copy only the necessary files which Tomcat needs to start?
>>>
>>> That is the point of -webapps. Only copy the context.xml files if you
>>> are going to copy the contents of webapps.
>>>
>>>>>> Given that you want to add "--webapps", which will you copy? Manager?
>>>>>> Host Manager? All of them?
>>>>>
>>>>> All of them. I think it has to be all or nothing. Anything else 
>>>>> will get
>>>>> very complicated very quickly for a script. I think most cases won't
>>>>> want to copy (hence the default) but I can think of a few scenarios
>>>>> where it could be useful.
>>>>
>>>> So even if it contains some user deployed apps?
>>>
>>> Yes.
>>
>> I think that it completely contradicts the spirit of make base: Give 
>> me a fully working, but minimal Tomcat instance. At the end your are 
>> trying to write a rsync for that. I think that this will add little 
>> benefit. It will only workout if people never work with CATALINA_HOME, 
>> but only with _BASE like I do at work.
> 
> I agree with Mark.
> 
> Copying user deployed apps will be very useful if you want to scale out 
> your application and deploy multiple servers for the app for high 
> availability etc.

$ rsync -auhh src target

done. I don't need a script for that.

Someone who scales will *never* operate from CATALINA_HOME because this 
makes upgrades pain in the ass.

Michael

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


Re: makebase script and webapps

Posted by Igal Sapir <is...@apache.org>.
On 7/3/2018 1:15 PM, Michael Osipov wrote:
> Am 2018-07-03 um 22:12 schrieb Mark Thomas:
>> On 03/07/18 21:10, Michael Osipov wrote:
>>> Am 2018-07-03 um 22:07 schrieb Mark Thomas:
>>>> On 03/07/18 21:02, Michael Osipov wrote:
>>>>> Am 2018-07-03 um 18:27 schrieb Mark Thomas:
>>>>>> Hi,
>>>>>>
>>>>>> I've been looking at the makebase script and thinking about 
>>>>>> potential
>>>>>> use cases.
>>>>>>
>>>>>> Currently, we copy conf recursively but create an empty webapps.
>>>>>> This is
>>>>>> inconsistent as any directories under conf will (nearly always) 
>>>>>> be web
>>>>>> application specific config.
>>>>>>
>>>>>> I think we should either copy web applications and config or not 
>>>>>> copy
>>>>>> both.
>>>>>>
>>>>>> My suggestion is not to copy web applications and config (i.e. 
>>>>>> sub dirs
>>>>>> of /conf) by default and to add a -webapps option (or similar) to 
>>>>>> the
>>>>>> makebase script and only copy them when the option is present.
>>>>>>
>>>>>> Thoughts?
>>>>>
>>>>> First of all, I don't like the '-a' approach because you make
>>>>> assumptions about the target you don't know while other operations 
>>>>> don't
>>>>> do it. I'd simply do "-r".
>>>>>
>>>>> I do agree with your that it is somewhat inconsistent, but we need to
>>>>> consider a very important point which must be true for our script to
>>>>> work properly: CATALINA_HOME has to remain unmodified, i.e., 
>>>>> contents of
>>>>> conf, webapps.
>>>>> Though, the new CATALINA_BASE needs to be complete to start a Tomcat
>>>>> instance, and it is complete with an empty webapps/ dir. conf/ is
>>>>> mandatory.
>>>>
>>>> The start will be unnecessarily messy if there are context.xml 
>>>> files in
>>>> sub-directories of conf but not corresponding application in webapps.
>>>
>>> Then why not copy only the necessary files which Tomcat needs to start?
>>
>> That is the point of -webapps. Only copy the context.xml files if you
>> are going to copy the contents of webapps.
>>
>>>>> Given that you want to add "--webapps", which will you copy? Manager?
>>>>> Host Manager? All of them?
>>>>
>>>> All of them. I think it has to be all or nothing. Anything else 
>>>> will get
>>>> very complicated very quickly for a script. I think most cases won't
>>>> want to copy (hence the default) but I can think of a few scenarios
>>>> where it could be useful.
>>>
>>> So even if it contains some user deployed apps?
>>
>> Yes.
>
> I think that it completely contradicts the spirit of make base: Give 
> me a fully working, but minimal Tomcat instance. At the end your are 
> trying to write a rsync for that. I think that this will add little 
> benefit. It will only workout if people never work with CATALINA_HOME, 
> but only with _BASE like I do at work.

I agree with Mark.

Copying user deployed apps will be very useful if you want to scale out 
your application and deploy multiple servers for the app for high 
availability etc.

Igal


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


Re: makebase script and webapps

Posted by Michael Osipov <mi...@apache.org>.
Am 2018-07-03 um 22:12 schrieb Mark Thomas:
> On 03/07/18 21:10, Michael Osipov wrote:
>> Am 2018-07-03 um 22:07 schrieb Mark Thomas:
>>> On 03/07/18 21:02, Michael Osipov wrote:
>>>> Am 2018-07-03 um 18:27 schrieb Mark Thomas:
>>>>> Hi,
>>>>>
>>>>> I've been looking at the makebase script and thinking about potential
>>>>> use cases.
>>>>>
>>>>> Currently, we copy conf recursively but create an empty webapps.
>>>>> This is
>>>>> inconsistent as any directories under conf will (nearly always) be web
>>>>> application specific config.
>>>>>
>>>>> I think we should either copy web applications and config or not copy
>>>>> both.
>>>>>
>>>>> My suggestion is not to copy web applications and config (i.e. sub dirs
>>>>> of /conf) by default and to add a -webapps option (or similar) to the
>>>>> makebase script and only copy them when the option is present.
>>>>>
>>>>> Thoughts?
>>>>
>>>> First of all, I don't like the '-a' approach because you make
>>>> assumptions about the target you don't know while other operations don't
>>>> do it. I'd simply do "-r".
>>>>
>>>> I do agree with your that it is somewhat inconsistent, but we need to
>>>> consider a very important point which must be true for our script to
>>>> work properly: CATALINA_HOME has to remain unmodified, i.e., contents of
>>>> conf, webapps.
>>>> Though, the new CATALINA_BASE needs to be complete to start a Tomcat
>>>> instance, and it is complete with an empty webapps/ dir. conf/ is
>>>> mandatory.
>>>
>>> The start will be unnecessarily messy if there are context.xml files in
>>> sub-directories of conf but not corresponding application in webapps.
>>
>> Then why not copy only the necessary files which Tomcat needs to start?
> 
> That is the point of -webapps. Only copy the context.xml files if you
> are going to copy the contents of webapps.
> 
>>>> Given that you want to add "--webapps", which will you copy? Manager?
>>>> Host Manager? All of them?
>>>
>>> All of them. I think it has to be all or nothing. Anything else will get
>>> very complicated very quickly for a script. I think most cases won't
>>> want to copy (hence the default) but I can think of a few scenarios
>>> where it could be useful.
>>
>> So even if it contains some user deployed apps?
> 
> Yes.

I think that it completely contradicts the spirit of make base: Give me 
a fully working, but minimal Tomcat instance. At the end your are trying 
to write a rsync for that. I think that this will add little benefit. It 
will only workout if people never work with CATALINA_HOME, but only with 
_BASE like I do at work.

Michael

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


Re: makebase script and webapps

Posted by Mark Thomas <ma...@apache.org>.
On 03/07/18 21:10, Michael Osipov wrote:
> Am 2018-07-03 um 22:07 schrieb Mark Thomas:
>> On 03/07/18 21:02, Michael Osipov wrote:
>>> Am 2018-07-03 um 18:27 schrieb Mark Thomas:
>>>> Hi,
>>>>
>>>> I've been looking at the makebase script and thinking about potential
>>>> use cases.
>>>>
>>>> Currently, we copy conf recursively but create an empty webapps.
>>>> This is
>>>> inconsistent as any directories under conf will (nearly always) be web
>>>> application specific config.
>>>>
>>>> I think we should either copy web applications and config or not copy
>>>> both.
>>>>
>>>> My suggestion is not to copy web applications and config (i.e. sub dirs
>>>> of /conf) by default and to add a -webapps option (or similar) to the
>>>> makebase script and only copy them when the option is present.
>>>>
>>>> Thoughts?
>>>
>>> First of all, I don't like the '-a' approach because you make
>>> assumptions about the target you don't know while other operations don't
>>> do it. I'd simply do "-r".
>>>
>>> I do agree with your that it is somewhat inconsistent, but we need to
>>> consider a very important point which must be true for our script to
>>> work properly: CATALINA_HOME has to remain unmodified, i.e., contents of
>>> conf, webapps.
>>> Though, the new CATALINA_BASE needs to be complete to start a Tomcat
>>> instance, and it is complete with an empty webapps/ dir. conf/ is
>>> mandatory.
>>
>> The start will be unnecessarily messy if there are context.xml files in
>> sub-directories of conf but not corresponding application in webapps.
> 
> Then why not copy only the necessary files which Tomcat needs to start?

That is the point of -webapps. Only copy the context.xml files if you
are going to copy the contents of webapps.

>>> Given that you want to add "--webapps", which will you copy? Manager?
>>> Host Manager? All of them?
>>
>> All of them. I think it has to be all or nothing. Anything else will get
>> very complicated very quickly for a script. I think most cases won't
>> want to copy (hence the default) but I can think of a few scenarios
>> where it could be useful.
> 
> So even if it contains some user deployed apps?

Yes.

Mark

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


Re: makebase script and webapps

Posted by Michael Osipov <mi...@apache.org>.
Am 2018-07-03 um 22:07 schrieb Mark Thomas:
> On 03/07/18 21:02, Michael Osipov wrote:
>> Am 2018-07-03 um 18:27 schrieb Mark Thomas:
>>> Hi,
>>>
>>> I've been looking at the makebase script and thinking about potential
>>> use cases.
>>>
>>> Currently, we copy conf recursively but create an empty webapps. This is
>>> inconsistent as any directories under conf will (nearly always) be web
>>> application specific config.
>>>
>>> I think we should either copy web applications and config or not copy
>>> both.
>>>
>>> My suggestion is not to copy web applications and config (i.e. sub dirs
>>> of /conf) by default and to add a -webapps option (or similar) to the
>>> makebase script and only copy them when the option is present.
>>>
>>> Thoughts?
>>
>> First of all, I don't like the '-a' approach because you make
>> assumptions about the target you don't know while other operations don't
>> do it. I'd simply do "-r".
>>
>> I do agree with your that it is somewhat inconsistent, but we need to
>> consider a very important point which must be true for our script to
>> work properly: CATALINA_HOME has to remain unmodified, i.e., contents of
>> conf, webapps.
>> Though, the new CATALINA_BASE needs to be complete to start a Tomcat
>> instance, and it is complete with an empty webapps/ dir. conf/ is
>> mandatory.
> 
> The start will be unnecessarily messy if there are context.xml files in
> sub-directories of conf but not corresponding application in webapps.

Then why not copy only the necessary files which Tomcat needs to start?

> 
>> Given that you want to add "--webapps", which will you copy? Manager?
>> Host Manager? All of them?
> 
> All of them. I think it has to be all or nothing. Anything else will get
> very complicated very quickly for a script. I think most cases won't
> want to copy (hence the default) but I can think of a few scenarios
> where it could be useful.

So even if it contains some user deployed apps?

Michael

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


Re: makebase script and webapps

Posted by Mark Thomas <ma...@apache.org>.
On 03/07/18 21:02, Michael Osipov wrote:
> Am 2018-07-03 um 18:27 schrieb Mark Thomas:
>> Hi,
>>
>> I've been looking at the makebase script and thinking about potential
>> use cases.
>>
>> Currently, we copy conf recursively but create an empty webapps. This is
>> inconsistent as any directories under conf will (nearly always) be web
>> application specific config.
>>
>> I think we should either copy web applications and config or not copy
>> both.
>>
>> My suggestion is not to copy web applications and config (i.e. sub dirs
>> of /conf) by default and to add a -webapps option (or similar) to the
>> makebase script and only copy them when the option is present.
>>
>> Thoughts?
> 
> First of all, I don't like the '-a' approach because you make
> assumptions about the target you don't know while other operations don't
> do it. I'd simply do "-r".
> 
> I do agree with your that it is somewhat inconsistent, but we need to
> consider a very important point which must be true for our script to
> work properly: CATALINA_HOME has to remain unmodified, i.e., contents of
> conf, webapps.
> Though, the new CATALINA_BASE needs to be complete to start a Tomcat
> instance, and it is complete with an empty webapps/ dir. conf/ is
> mandatory.

The start will be unnecessarily messy if there are context.xml files in
sub-directories of conf but not corresponding application in webapps.

> Given that you want to add "--webapps", which will you copy? Manager?
> Host Manager? All of them?

All of them. I think it has to be all or nothing. Anything else will get
very complicated very quickly for a script. I think most cases won't
want to copy (hence the default) but I can think of a few scenarios
where it could be useful.

Mark

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


Re: makebase script and webapps

Posted by Michael Osipov <mi...@apache.org>.
Am 2018-07-03 um 18:27 schrieb Mark Thomas:
> Hi,
> 
> I've been looking at the makebase script and thinking about potential
> use cases.
> 
> Currently, we copy conf recursively but create an empty webapps. This is
> inconsistent as any directories under conf will (nearly always) be web
> application specific config.
> 
> I think we should either copy web applications and config or not copy both.
> 
> My suggestion is not to copy web applications and config (i.e. sub dirs
> of /conf) by default and to add a -webapps option (or similar) to the
> makebase script and only copy them when the option is present.
> 
> Thoughts?

First of all, I don't like the '-a' approach because you make 
assumptions about the target you don't know while other operations don't 
do it. I'd simply do "-r".

I do agree with your that it is somewhat inconsistent, but we need to 
consider a very important point which must be true for our script to 
work properly: CATALINA_HOME has to remain unmodified, i.e., contents of 
conf, webapps.
Though, the new CATALINA_BASE needs to be complete to start a Tomcat 
instance, and it is complete with an empty webapps/ dir. conf/ is mandatory.

Given that you want to add "--webapps", which will you copy? Manager? 
Host Manager? All of them?

Michael

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