How Do You Manage a Product Based on Linux?
Ryan writes "Following my advice, my company has decided to base it's new appliance on Linux. So far, it's worked out great. Linux gave us a huge jumpstart on development because of it's open nature and the information we've garnered from public mailing lists. We've added software, modified startup files, and have built our own kernel. Now the question is: How do you manage it all? Do you put it all in CVS or Subversion? Do you use the distro's packaging system (we're using Debian)? What does your build system look like?"
You really should be stopping and look at what you are doing. How you want to manage it should be part of the strategy, and actually should have been part of deciding to use Linux (not in detail, but strategically).
So my advice, hold on, sit down and look at what you expect to produce and what you would need to get there. From there you can find out what you would need.
You will probably run into some issues, but that's just what happens, there is no ideal situation.
You're building a whole new appliance, but your software engineers don't know how to manage a development process?
I mean... I'm not being nasty here, but you're in trouble, and I don't even know where anybody could start to give you advice. It would be one thing if you were looking for guidance on a regular small scale software project, but if you're jumping in feet first with a whole new large scale application and no idea how to guide the process...
You should definitely put your code under some kind of revision control. We currently use cvs but are looking at switching to git or mercurial. One thing thats nice about cvs is the import feature that lets you bring in new copies of the open source programs you've modified and migrate your changes forward into the new copy. With regards to the packaging, its definitely worth the effort to put them into the distro's packaging system. We use debian as well and its nice to be able to have a repository that customers can just apt-get from to get the lastest for their appliance. We also have debian source packages to make it easy for the customers to get access to the source in a way thats easy for them to make changes and create new debian packages.
Your build should be in some sort of Versioning system (CVS, whatever). SOMETHING that allows you to cover your butt with you `rm` that folder and realize you just tanked the whole thing. Somehow you should be able to rebuild any version of your project back to day 1.
meh
Actually even with 1 developer SVN or CVS are huge benefits, what if that developer introduces a bug? with subversion you can go through and look to see when that bug was introduced and roll it back. You'd be hard pressed to roll it back with just tarballs.
If you're releasing a product to the public, the one word you need to keep in the back of your mind at all times is "reproducability".
.deb file). You can provide "answers" files for debconf so that no questions are asked during installation, and you can tweak various settings as you go along. If you've taken the VMWare approach, you can always login to the image and make final adjustments (just make sure they're scripted and version controlled) after the Debian install is complete.
:-)
e ment) is what you want to search for. Librarianship for software systems, kind of dry and boring, but oh-so-necessary.
Can you, at any point in the future, reproduce whatever version it is that customer X is having trouble with?
There are many ways to do this, ranging from taking complete snapshots of each "build" (requires lots of space, but fast to reproduce), to keeping a short list of the Debian packages installed (not much space, but slower to reproduce). It's a classic space-vs-time tradeoff.
I'd suggest you attempt to automate the system build as much as you can. Use virtualization tools like VMWare to help perform "builds" of your OS images. Most Linux distros have automated install processes. RedHat has "kickstart", Debian has "fai" (http://www.informatik.uni-koeln.de/fai/). At the minimum, you should version control the script you use to build your vmaware images, and the configuration script for fai/kickstart. This should let you re-build everything at some later stage.
When it comes to customising Debian systems, customised Debian packages are the way to go. If you're adding new files, package them up and deploy them as part of the automated install. If you're customising existing packages, edit their source and rebuild them with
customised version numbers, and list those versions of the packages in your fai script. You'll need to go through the whole version control process with each customised package too. (i.e. check it's source into a version control tool, tag it, apply your changes, tag it again, then build your
Do a search for "customized debian", there are quite a few people doing similar things already.
Basically, make sure that the end product requires nothing more than a button push to produce. Anything less and you'll introduce the risk of someone forgetting to perform a step, or doing it wrong. That'll create a support nightmare down the track.
If you can reproduce easily what your customer has, you can also easily make a minimally invasive fix for them. That'll make them happy
If you're looking for resources on this stuff in general, "configuration mangement" (http://en.wikipedia.org/wiki/Configuration_manag
For distribution to the end-user, you will definitely want a package of some kind. I'm assuming that your end users won't be able to log in with a prompt, but may have some kind of web-based management, right? If you distribute your upgrades/patches as .deb packages (maybe renamed to .bin since that's what users have been conditionned to expect), then it makes things a whole lot easier... among other things, it would facilitate downloading the upgrade from a location other than where the product is: not all users have Internet connections at home, even in this day and age. You may also want to look into implementing something like Slackpackages, since they ignore dependancy. (They're basically just a tarball... you can install them manually by unzipping/tarring the file from / and then looking in the /install directory and manually executing any scripts there)
For actual development... you're gonna *need* to use SubVersion or CVS. Cover your ass. Also, not having it makes managing a project a royal pain in the ass.
If you believe everything you read, you'd better not read. - Japanese proverb
...but if you're using Debian, I would highly recommend that you spend a quality week or two *READING* the wonderful documentation debian has and read / ask a few questions on their mailing lists.
.../testing/ .../nightly/, etc. and integrate that with your testing / deployment infrastucture. ...but most of all, please READ the documentation that Debian has put together. In few words, it allows mostly volunteers in their spare time to do exactly what you are trying to do and with a high degree of reliability. The documentation in Debian Policy is the first stop (and most likely the last) for almost anything you are trying to do. When you see the types of bug-reports that are filed against packages that go against policy (ie: incorrect depends, provides, etc) you will see what types of mistakes are possible, and you should seriously consider how to check the work that you've done to make it more likely that your work would not have the same types of bugs filed against it.
Once you understand the package-management system of the SOFTWARE YOU ARE BASING YOUR BUSINESS OFF OF, the answer to your question will become clear... nay- simple.
- MyCompanySoftware-1_0.deb, MyCompanyKernel-1_0.deb, MyCompanyOtherStuff-1_0.deb
- Generous use of depends, requires, conflicts, provides, etc. (or maybe up-rev eg: kernel-image-2.6.8-1.deb to kernel-image-2.6.8-1-MyCompany-1.deb, these are the things you can ask for advice on Debian / Ubuntu lists).
- Source control all files used in any of those *.deb packages, and make an automated build process that can take your source-control tree and generate your packages at any time of the day or night.
- Set up internal repositories, ie: http://apt.mycompany.com/stable/
--Robert
No no no no no. :)
Whether you're working in a team or working by yourself: Use Subversion Anyway. Or svk. Or Darcs. Any reputable revision control system will kick the pants out of any ad-hoc solution you come up with. Revision control should be automatic and easy. The value of being able to easily merge changesets alone is reason enough for any non-trivial project. Keeping track of branches for experimental/delicate changes, tagging releases, LOG MESSAGES for all your changes - all of these things, use them, learn to love them. It's a bitch to get in the habit, but when you do it's absolutely worth it.
It's taken me over seven years to truly learn the worth of version control. These days I'd dare not live without it. It really is that good. Honest!
I don't work for them and haven't used their product much, but there's a company called R-Path (founded by former Red Hat early employees) that seems like its designed for "appliances" just like yours.
The idea is that you build your platform on thier system, then you add your programs on top. The system merges updates from them and your system and places it onto the target system. The system they've built is called Conary. Conary itself is Free Software, but RPath sells services along with it that seem attractive.
It looks very well put together and if I were looking at building an appliance, it's certainly something I'd be considering.
http://www.rpath.com
I work for an ASP. We've got a web application (built with Perl), running on Debian. At the moment we've about 15 servers (some dedicated to one large customer, some with over 50 customers) live, have 4 full time developers on the product, 15 people in total, and are quite succesful in our niche.
:)
This is the short version of how we do things.
* We looked for an ISP where we rent the servers. They administer the servers (Debian stable), and install the perl modules, apache, etc. We don't have (want) root access to these machines: the ISP is responsible for the stability, and they do a good job. We ask them for changes/additional perl modules to be installed when needed. We've less than satisfactory experiences with several ISPs, make sure you find a good one.
* For a repository we use cvs. This is flexible enough for our needs, and there was some experience with the app. If you haven't got any experience with cvs, also take a look at subversion or mercurial, as you could benefit from the improvements there.
* As a cvs client we use eclipse. Great product, but unfortunately it is Java, and therefore slow. Some of the developers use the editor of eclipse, others use external editors (vi baby
* Our work environment is mixed. We all have a windows workstation, but for the actual development we have a server with a dedicated debian VPS for each developer. We connect to the VPS (which is hosted on our lan, and not accessible externally) through ssh, samba and x. The VPS are UML based, but nowadays when setting things up, we'd probably use Xen. The advantage of using VPSs is that it's easy to set up a clean developement/test environment.
* Have a release cycle, and try to stick with it. Most bugs are introduced when improperly tested code is implemented on live servers. Never edit directly on a live machine.
Our current shortcomings (i.e. pitfalls):
* Hardly any automated testing, and no formal testing procedures. Testing the application takes a lot of work, so it is often skimped. This is a risk, and introduced bugs are occasionnally missed.
* The release policy is not always honored due to deadlines. This puts a strain on the organisation, because, as noted above, it needs to be tested manually. This is when testing is skipped most of the times, and most bugs are introduced. It's a commercial tradeoff: let a customer wait, or take the risk. Depending on who and when you ask you get different answers.
the pun is mightier than the sword
I would definitely put everything you do into Debian packages -- nothing should be done on testing and production systems by hand and the package manager provides a known good framework. There's a bit of a learning curve on how to produce Debian packages, but I believe there are some 'hardening' packages that can be used as models for how to handle the type of sysadmin tasks you're looking at.
... you are using make-kpkg, right?
You're using make-kpkg to build your kernel, of course, so it's already kicking out packages for your locally-built kernels.
I have to agree with the others that the fact that you're asking about version control tools is scary. That's something that should have been decided a long time ago.
For every complex problem there is an answer that is clear, simple, and wrong. -- H L Mencken
No points today, and I loathe "mod parent up" postings, but that's the perfect response.
Nobody is going to be able to provide any reasonable advice, other than perhaps for the submitter to hire a consultant (or employee) that has proven experience in large scale software development projects.
To submitter Ryan: This is highly non-trivial; you don't seem to have any idea how very much you're missing. If you don't know what you don't know, you need outside help. And because you've already started down the path without a plan, you need help fast. Very fast.
One important point not yet raised is that you need to control the platform for your appliance. Every customer should be on a release of your code, tested and deployed on a release of the platform - hardware as well as OS configuration.
Security and features patches are helpful, but can also bring complexity and confusion when it comes to troubleshooting.
Your best bet is to tweak a build of the OS (shut down unneeded services, automatic updates, etc) then GHOST (or equivalent) the disk so that EVERY customer gets the same thing.
If you choose to rev the hardware or the OS, how will you make sure that your installed base has the same stuff? I can't emphasize enough how important this is to long-term support.
You'll need to consider how to slipstream patches in (connection to your website, flash drive, CD, etc) for both the OS and your code.
You'll need to design it so that you can upgrade the OS install without affecting your application (perhaps a separate filesystem?) What will happen after your customer has installed and used your application for 12 months and you decide to upgrade your code? Do they have customizations? Will your upgrade work?
Hope these ideas help.
Regards,
Anomaly
But Herr Heisenberg, how does the electron know when I'm looking?
What you're really saying, is "use version control discipline", hypothetically independent of the tool. That's the real point, one I've seen made elsewhere in this topic. The submitter is asking for tools, but really I think he's asking for process advice.
The tool won't make you do the smart things you talk about--tagging, change tracking, etc. Every tool can be circumvented, pencil-whipped, or otherwise reduced to "going through the motions".
The real advice here: come up with your project management goals and philosophy, then decide on methods and select tools to support those goals and philosophy.
That said, I've used and liked subversion myself. But the temptation to bypass the onerous parts of the process is always there. We developers are a lazy bunch, aren't we?
Welcome to the Panopticon. Used to be a prison, now it's your home.
Does your PXE process automatically partition/format the disk with the OS?
.tar.gz of each filesystem.
I used PXE boot on Linux a few years ago with great success, but when I was considering doing an appliance-type solution, I created a customized system rescue CD which included a
This would have allowed me to script the partitioning process, as well as the extraction of the filesystems to end up with a bootable CD which would create an appliance hands-free. (At least that is what I was on target to complete when the project was cancelled by management.) Our original goal was to be able to distribute the media to a remote location and have unskilled people create applicances from commodity hardware.
Theoretically the same thing could be done with a PXE and a boot menu. Is that what you've done?
Regards,
Anomaly
But Herr Heisenberg, how does the electron know when I'm looking?
I have written extensively on this problem at my Blog. I use Morphix which is a system for building live cd's. They provide a core and you build on top of it. I have lightly modified the core (with a custom kernel and custom modules). Then you create a main module (which is just an xml file of debian packages). Morphix tools work out all the dependiences etc. I do all of my development in VmWare as it gives me a separate process space/machine to do all my work in. I will be presenting on it this Saturday at the Cerroitos Lug and the SFVLUG. It will be recorded and I will put the (video)podcast online. Along with notes and configs. Its mostly on VmWare but also how I am using it for development work. Feel free to reply to this post with questions and I will be more then happy to answer them. So vmware+morphix(highly customized) = great results. I am also building an appliance (an exchange replacement with MAPI support). See my signature for links.
Charles Wyble System Engineer
Why didn't you just say "STFU and RTFM!!!!!!!!1" ('1' intended) and get back to your <sarcasm>thrilling</sarcasm> life? People come here, ask a serious question that's troubling them, and once they make it past the editorial interest filter, they get this bull. This isn't just one more stupid forum, this is Slashdot.
What examples can you provide of these "some issues" you're talking about? The asker is trying to understand the whole process, and you're just telling him to expect trouble? What a worthless comment!