Re: setup-app not working for composite pylons app?
Previously Mike Orr wrote: On Fri, Feb 22, 2008 at 11:06 AM, Brian Granger [EMAIL PROTECTED] wrote: We have two pylons apps that we want to combine using a composite app. One of our pylons apps has a database that needs to be setup using the standard 'paster setup-app' command. I have doubts about whether setup-app is really worthwhile. An alternative is to make a scripts/ package in your application and run them with python -m. Or you can get fancy and set up entry points to make them normal executables. at this moment it still appears to be the documented way to do application setup, so either there should be a new documented best practice or this should be fixed. I just ran into the same problem (although it appears to break differently now) so I'ld expect this to be a fairly common issue. The problem with setup-app is it can only do one thing, and that thing may be wrong when copying an existing deployment or updating it. For instance, you may have to create the database tables, or reset the data to an initial state, or add a column or modify its type without disturbing existing data. Or you may have to reinitialize some tables but not others, or set up some data files, etc. if setup-app took arguments it could handle all these cases, but it doesn't. I get the imporession that you are talking about migration types of usage here. That is a very different problem than initial application setup and is indeed best served differently, most likely in a way that is much closer tied to the specific application. Initial setup is simple and predictable in most cases: create a database, create some tables, load some initial data, maybe create a file and directory or two. websetup/paster setup-app seems to be a good standard way to do that. Perhaps it can be extended with a flag to make it refuse to run if it has been run before, which will prevent people from accidentily zapping existing data. Wichert. -- Wichert Akkerman [EMAIL PROTECTED]It is simple to make things. http://www.wiggy.net/ It is hard to make things simple. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups pylons-discuss group. To post to this group, send email to pylons-discuss@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/pylons-discuss?hl=en -~--~~~~--~~--~--~---
Re: setup-app not working for composite pylons app?
On Mon, Mar 24, 2008 at 2:16 AM, Wichert Akkerman [EMAIL PROTECTED] wrote: I get the imporession that you are talking about migration types of usage here. That is a very different problem than initial application setup and is indeed best served differently, most likely in a way that is much closer tied to the specific application. Initial setup is simple and predictable in most cases: create a database, create some tables, load some initial data, maybe create a file and directory or two. websetup/paster setup-app seems to be a good standard way to do that. The one thing setup-app is good for is building a standard environment for a publicly-distributed egg. But if you're building an app and deploying it on a server, or updating a server, there are alternative strategies that may be equally valid if not more so. Perhaps it can be extended with a flag to make it refuse to run if it has been run before, which will prevent people from accidentily zapping existing data. At minimum setup-app needs command-line arguments, and I expect they'll be added in the next month or two. As for not running again, setup-app can do that itself by aborting if the database or directory it's creating exists or is not empty. You can also have it check an environment variable, although that's not very elegant for clobber/don't clobber. The docs also need to be beefed up, but there's a major initiative on that ramping up now. -- Mike Orr [EMAIL PROTECTED] --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups pylons-discuss group. To post to this group, send email to pylons-discuss@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/pylons-discuss?hl=en -~--~~~~--~~--~--~---
Re: setup-app not working for composite pylons app?
On Fri, Feb 22, 2008 at 11:06 AM, Brian Granger [EMAIL PROTECTED] wrote: We have two pylons apps that we want to combine using a composite app. One of our pylons apps has a database that needs to be setup using the standard 'paster setup-app' command. I have doubts about whether setup-app is really worthwhile. An alternative is to make a scripts/ package in your application and run them with python -m. Or you can get fancy and set up entry points to make them normal executables. The problem with setup-app is it can only do one thing, and that thing may be wrong when copying an existing deployment or updating it. For instance, you may have to create the database tables, or reset the data to an initial state, or add a column or modify its type without disturbing existing data. Or you may have to reinitialize some tables but not others, or set up some data files, etc. if setup-app took arguments it could handle all these cases, but it doesn't. In any case, I'm leery of running a setup-app that may stomp over stuff I forgot it did, so I'd rather run several individual scripts that each do one thing, and can take arguments. For instance, you may want to pass a different database URI on the command line than you'd normally use, to get extra admin privileges without putting the password in a config file. -- Mike Orr [EMAIL PROTECTED] --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups pylons-discuss group. To post to this group, send email to pylons-discuss@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/pylons-discuss?hl=en -~--~~~~--~~--~--~---