Managing the LCFG website

The LCFG website is a combination of static HTML and templated pages plus dynamically generated pages. It is all managed through the lcfgweb component. This ships a set of scripts which are used to process release data into an intermediate format, cache packages, mirror CD images and extract documentation. This data is then used to drive the website, it could also be used to generate the LCFG guide. Here are a few tips on how to use the component, I've taken fc6 as an example throughout:

Location of configuration data

Most of the configuration data is in the header dice/options/lcfgweb.h, some of it might be in the source profile for the current LCFG webserver, polecat, though.

Publishing static pages to the website

The static files, templates and images all live in /afs/inf.ed.ac.uk/group/lcfg/web/ You can edit these files from anywhere with AFS access and then, providing you are on the Informatics network, you can just run the publish.sh script in /afs/inf.ed.ac.uk/group/lcfg. Alternatively you could logon to polecat and do om lcfgweb publish

Adding a new platform

Typically you will first need to modify the lcfgweb.oslist resource to add in the id for the os of your new platform:

!lcfgweb.oslist         mADD(fc6)

You should also briefly describe the new operating system:

lcfgweb.osdesc_fc6 mSETQ("Fedora Core release 6 (Zod)")
lcfgweb.osdistrib_fc6 fedora
lcfgweb.osrelease_fc6 6
lcfgweb.pkgtype_fc6 rpm

Next you need to specify the list of supported architectures:

lcfgweb.arches_fc6      i386 x86_64

You can then configure each platform (os/arch combination) separately:

lcfgweb.cppopts_fc6_i386 -DINCLUDE_CONTRIB -DLCFG_SERVER
lcfgweb.pkglists_fc6_i386 lcfg/lcfg_fc6_lcfg.rpms lcfg/lcfg-defaults.rpms lcfg/lcfg_fc6_extras.rpms \
lcfg/lcfg_fc6_lcfg_installroot.rpms
!lcfgweb.cdpath_fc6_i386             mSETQ("/afs/inf.ed.ac.uk/group/mp-unit/cdroms/lcfginstall-fc6-*")

The cppopts resource should be the same on every platform but you may have good reason to make modifications. The pkgpath and srcpath resources below are done in a very similar way to how the updaterpms component is configured.

!lcfgweb.pkgpath_fc6_i386            mSET(_REPOSITORY)
!lcfgweb.pkgpath_fc6_i386            mCONCATQ("/fc6/base,")
!lcfgweb.pkgpath_fc6_i386            mCONCAT(_REPOSITORY)
!lcfgweb.pkgpath_fc6_i386            mCONCATQ("/fc6/updates,")
!lcfgweb.pkgpath_fc6_i386            mCONCAT(_REPOSITORY)
!lcfgweb.pkgpath_fc6_i386            mCONCATQ("/fc6/extras,")
!lcfgweb.pkgpath_fc6_i386            mCONCAT(_REPOSITORY)
!lcfgweb.pkgpath_fc6_i386            mCONCATQ("/fc6/lcfg,")
!lcfgweb.pkgpath_fc6_i386            mCONCAT(_REPOSITORY)
!lcfgweb.pkgpath_fc6_i386            mCONCATQ("/fc6/ed,")
!lcfgweb.pkgpath_fc6_i386            mCONCAT(_REPOSITORY)
!lcfgweb.pkgpath_fc6_i386            mCONCATQ("/fc6/autolcfg,")

!lcfgweb.srcpath_fc6_i386            mSET(_SRC_REPOSITORY)
!lcfgweb.srcpath_fc6_i386            mCONCATQ("/fc6/lcfg,")
!lcfgweb.srcpath_fc6_i386            mCONCAT(_SRC_REPOSITORY)
!lcfgweb.srcpath_fc6_i386            mCONCATQ("/fc6/ed,")
!lcfgweb.srcpath_fc6_i386            mCONCAT(_SRC_REPOSITORY)
!lcfgweb.srcpath_fc6_i386            mCONCATQ("/fc6/autolcfg,")

The 64-bit platform is very similar but there are a couple of key differences. It is necessary to set the id resource here, this means that it has a different platform name to the default (i.e. fc6_64 rather than fc6). If you don't do this it won't appear separately on the website. I've also not bothered to add in lcfg/lcfg-defaults.rpms as we do not really support running the LCFG server on 64bit platforms and many of the defaults files are not in that repository.

!lcfgweb.id_fc6_x86_64               mSET(fc6_64)
lcfgweb.cppopts_fc6_x86_64 -DINCLUDE_CONTRIB -DLCFG_SERVER
lcfgweb.pkglists_fc6_x86_64 lcfg/lcfg_fc6_lcfg.rpms lcfg/lcfg_fc6_extras.rpms lcfg/lcfg_fc6_lcfg_installroot.rpms
!lcfgweb.cdpath_fc6_x86_64           mSETQ("/afs/inf.ed.ac.uk/group/mp-unit/cdroms/lcfginstall-fc6_64-*")

!lcfgweb.pkgpath_fc6_x86_64            mSET(_REPOSITORY)
!lcfgweb.pkgpath_fc6_x86_64            mCONCATQ("/fc6_64/base,")
!lcfgweb.pkgpath_fc6_x86_64            mCONCAT(_REPOSITORY)
!lcfgweb.pkgpath_fc6_x86_64            mCONCATQ("/fc6_64/updates,")
!lcfgweb.pkgpath_fc6_x86_64            mCONCAT(_REPOSITORY)
!lcfgweb.pkgpath_fc6_x86_64            mCONCATQ("/fc6_64/extras,")
!lcfgweb.pkgpath_fc6_x86_64            mCONCAT(_REPOSITORY)
!lcfgweb.pkgpath_fc6_x86_64            mCONCATQ("/fc6_64/lcfg,")
!lcfgweb.pkgpath_fc6_x86_64            mCONCAT(_REPOSITORY)
!lcfgweb.pkgpath_fc6_x86_64            mCONCATQ("/fc6_64/autolcfg,")
!lcfgweb.pkgpath_fc6_x86_64            mCONCAT(_REPOSITORY)
!lcfgweb.pkgpath_fc6_x86_64            mCONCATQ("/fc6_64/ed,")

!lcfgweb.srcpath_fc6_x86_64            mSET(_SRC_REPOSITORY)
!lcfgweb.srcpath_fc6_x86_64            mCONCATQ("/fc6_64/lcfg,")
!lcfgweb.srcpath_fc6_x86_64            mSET(_SRC_REPOSITORY)
!lcfgweb.srcpath_fc6_x86_64            mCONCATQ("/fc6_64/autolcfg,")
!lcfgweb.srcpath_fc6_x86_64            mCONCAT(_SRC_REPOSITORY)
!lcfgweb.srcpath_fc6_x86_64            mCONCATQ("/fc6_64/ed,")

Generating data products without showing support

Sometimes it is useful to cache packages and generate data products for platforms without showing any indication of "support" for the platform on the website. This is particularly useful when developing new platforms. The web pages will be there for people who know where to look but they will not be linked from the front page. To achieve this you need to use the visible boolean resource. For example:

!lcfgweb.visible_fc6_i386    mSET(no)

Perl modules

The lcfgweb component ships with a set of Perl modules, that do most of the website generation work. The most externally useful of these is LCFG::Web::Utils. The rest (LCFG::Web::DownloadHandler, LCFG::Web::Handler, LCFG::Web::InfoHandler, LCFG::Web::RSSHandler, LCFG::Web::Template) are primarily associated with generating the dynamic web pages but only LCFG::Web::Handler is actually web specific so the routines in the other modules could be reused elsewhere. They are all documented and that can be browsed on the LCFG webserver using perldoc.

Updating Perl code

If it is necessary to ship new or updated Perl modules for the website then because it is all done through mod_perl it is necessary to restart the web server, i.e. you will need to do this:

om apacheconf restart

You should then check all the apache logs to make sure nothing broke.

-- StephenQuinney - 01 Oct 2007

Topic revision: r5 - 13 Feb 2014 - 12:00:09 - ChrisCooke
 
This site is powered by the TWiki collaboration platformCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback
This Wiki uses Cookies