New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Split configure.pl into installation and configuration scripts #15
Comments
I contacted Ludovic Drolez. Let's hope he will be available. As far as Docker is concerned the requirements are:
The latter is the only thing that has any impact on installation/configuration. Following from ML:
That is another, possibly huge, chapter. This could be architected together with splitting work. In general I have the feeling all user interface should be rethought from a different vantage point: what needs to be done instead of how to do it, but that is a very long term item What do You think? |
Or maybe add two options to configure.pl like --update-conf-only and --without-update-conf, to be able to skip the config phase? |
I agree, I think |
This adds ability to skip installation phase and intended for using mostly by packagers. It is assumed that the OS distribution package should install configure.pl somewhere and provide a wrapper script for users like: ```sh PERL5LIB=/usr/local/lib perl %%PREFIX%%/libexec/backuppc/configure.pl \ --config-only --bin-path perl=%%PREFIX%%/bin/perl \ --config-dir %%ETCDIR%% \ --cgi-dir %%CGIDIR%% \ --data-dir /var/db/BackupPC \ --fhs \ --html-dir %%WWWDIR%% \ --html-dir-url /backuppc \ --install-dir %%PREFIX%% \ --log-dir /var/log/BackupPC ```
configure.pl: Introduce --config-only option (#15)
I want to propose to distribute BackupPC as source code instead of an installer.
The Since there is no distribution tarball, a new release is just a git tag and a constant (or variable) with version number (or might be 3 constants: major, minor, patch) in the Makefile. So users could install any backuppc version (release, HEAD or any commit) in the same way:
|
I would like to share with you some insights about configuration in the point of view of Docker image building, like @mcondarelli. Recently I published a new Docker image adferrand/backuppc because:
Basically, the use of a monolithic script for both installation (which is a compile phase), and upgrade (which is a runtime phase), can be problematic. Indeed, Docker clearly separates the compile time (building of an image) and runtime (instanciation of this image), and then it is a good study case. To build a BackupPC Docker image, one can install BackupPC from the available package of the underlying distribution during the image building. Great, but what about the instantiation of a new version of the container ? As BackupPC has been installed during image building, For my case, I solved the problem by deferring the BackupPC installation on the first instantiation of the container in its entrypoint. Consequently
But this approach should be replaced by the more elegant solution proposed by @moisseev in its first post. The And in fact, we have already this kind of runtime upgrade process for another matter, the pool : However, I disagree with the As a side note, I have also some doubts about the two-containers approach of @mcondarelli : the admin web ui, which is a part of BackupPC, is a set of CGI scripts so it needs a web executor. So a web executor is mandatory requirement for BackupPC. Docker is not always "one process by container", but more "one purpose by container". I think it is perfectly acceptable to execute an init system like supervisord to start few processes which servers one common purpose in a Docker container. In my case, I used supervisord to start BackupPC and lighttpd to expose the web admin ui. What you are doing of this web admin UI is indeed outside of the BackupPC container purpose, and should be delegated to other containers (like proxying, HTTPs on so on). |
You don't need sources anymore. |
Thanks for your reply. It is indeed a good start, because for the update process, only configure.pl need to be kept in the image. However, problems still reside in the installation phase, because configure.pl is not stateless : it needs to know about the config dir and the pool dir. But theses directories should not be accessed during docker image build, because they are part of the docker state : they may be mounted as data volumes, and their content will change between the image build process and the container instantiation. Is there any way to make configure.pl acts as a pure install script? I mean copy only binaries, cgi, config template, without doing anything for the actual config and actual pool. Then config and pool would be handled at runtime with --config-only option. |
You can use |
configure.pl
is highly interactive and makes some modifications in source and configuraton files. For this reason porting of the BackupPC is complicated and nearly impossible to create "binary" packages without major changes in the source code.To simplify packaging I propose to split
configure.pl
into two different scripts:that will make all required modifications in source files, configure distribution specific parameters like directories locations and install files.
that will make modifications in configuration files only.
Il 16/05/2016 20:37, Alexander Moisseev ha scritto:
On 16.05.16 22:40, Mauro Condarelli wrote:
I'm definitely interested in working to provide a patch. Otherwise I'll have to maintain that patch in the port anyway.
I believe we should invite debian backuppc package maintainer Ludovic Drolez not only to discussion on this particular issue, but to the backuppc organization. His contacts are available at the debian package tracker.
I'm not familiar with Docker and do not plan to use or study it in the nearest future. It there any specific requirements?
Just to illustrate what the FreeBSD sysutils/backuppc port is doing for now. This allows to create bre-built package and keep ability to automatically update configuration files on version update.
At staging (installation) phase it invokes configure.pl in
--batch
mode:After installation user should run update.sh script that just passes options to
update.pl
script:update.pl
isconfigure.pl
script with stripped out installation directives:https://svnweb.freebsd.org/ports/head/sysutils/backuppc/files/patch-update.pl?revision=377862&view=markup
The text was updated successfully, but these errors were encountered: