Version 9 (modified by 13 years ago) (diff) | ,
---|
Ideas for handling package installation on MyPLC PlanetLab nodes
Introduction
Out of the box, MyPLC PlanetLab nodes can't run yum to install packages. This is because they use their MyPLC as a repository, and MyPLCs do not, by default, operate correctly as yum repositories for their nodes.
The cleanest solution is to install the noderepo
package on the MyPLC. If you're interested in installing noderepo, ask GPO infra what we had to do to configure it on our testbed (and we'll try to get some documentation up here soon).
However, if you don't have noderepo, here are some other things to try.
Use yumdownloader to download packages and dependencies on the MyPLC
Suppose you are trying to install one or more packages both on the MyPLC host and on the PlanetLab nodes controlled by that MyPLC, and you don't want to have to find all the packages and all their dependencies by hand. You may be able to use a utility called yumdownloader
to download RPMs and dependencies on the MyPLC before you install the package on that MyPLC.
Install yum-utils
The yumdownloader
utility is part of the yum-utils
package. Install this on your MyPLC:
sudo yum install yum-utils
Download the package(s) on the MyPLC first
If the package(s) you want to install are not yet on the MyPLC, you can download both packages and dependencies by doing something like:
rpm_cache_dir=~/rpms rm -r ${rpm_cache_dir} mkdir ${rpm_cache_dir} sudo yumdownloader --destdir ${rpm_cache_dir} --resolve <package1> <package2> ...
This will download all RPMs you specify on the command line, and any dependencies which are not yet installed on the MyPLC. (So do this before you install the packages on the MyPLC itself, or you'll only download the packages you asked for, and not their dependencies.)
Install the RPMs on each node
- Copy
${rpm_cache_dir}
and its contents over to each node - On each node, try installing the packages:
rpm_cache_dir=~/rpms cd ${rpm_cache_dir} sudo rpm -iv *.rpm
- Keep an eye out for errors, and check afterwards to make sure the packages you asked for are actually now installed:
rpm -q <package1> <package2> ...
Installed dependencies may be different on different systems, and this may not work.
Debugging monitoring package dependencies
This section contains specific tips for downloading the five dependency packages required by the Plastic Slices monitoring configuration on MyPLC PlanetLab nodes, which are:
rrdtool-python rrdtool-perl perl-File-Find-Rule perl-XML-Writer perl-libwww-perl
Try yumdownloader
IF you used yumdownloader to cache the RPMs on your MyPLC, copy them over now, install them by hand, and check that it worked:
cd ~/rpms sudo rpm -iv *.rpm rpm -q rrdtool-python rrdtool-perl perl-File-Find-Rule perl-XML-Writer perl-libwww-perl
Note that these RPMs were collected on a different machine, so there may still be dependency problems you need to resolve by hand.
Try noderepo
In principle, you should be able to install noderepo on your MyPLC very simply, and this should allow PlanetLab nodes attached to that MyPLC to get PlanetLab-related packages directly from the MyPLC, and other packages from a Fedora repository. However, we have found a number of issues with this, such as:
- On some MyPLC versions, it doesn't work, because the stock
.repo
files distributed on the PlanetLab nodes are missing or incorrect, so even when they can get the PL-specific repository from the server, they still can't get other packages. - If you have made any manual changes to your nodes, such as force-downgrading a package, you will lose those changes once the node can successfully upgrade. If this applies to you and you don't know how to forcibly hold packages versions in yum, ask GPO.
That notwithstanding, if this works, it is easy: on your MyPLC host itself, run:
sudo yum install noderepo-planetlab-<osver>-<arch>
(e.g. noderepo-planetlab-f12-i386
).
If that allows you to install packages on the nodes via yum, great.
Patch noderepo failure to install repo files
If that doesn't work, we speculate that some MyPLC versions are failing to download the actual repository files onto the nodes, after installing them on the MyPLC node. We speculate that one might be able to patch around this on the node, by trying (on an F12 node):
sudo wget -O /etc/yum.conf http://<myplc_fqdn>/yum/f12/yum.conf sudo wget -O /etc/yum.myplc.d/stock.repo http://<myplc_fqdn>/yum/f12/yum.myplc.d/stock.repo
This might allow your nodes to get public repositories, but no one has tried it.
Patch yum PHP files (for F12 nodes)
The above patching method only works temporarily, until the MyPLC controller restores the files to their original. For a permanent solution, you will need to modify some PHP scripts that the MyPLC controller uses to configure yum on the nodes.
In /var/www/html/yum/yum.php
on the MyPLC controller, comment out the existing assignment to the fcdistro
variable and add the following line beneath it:
$fcdistro=f12;
In /var/www/html/yum/myplc.repo.php
on the MyPLC controller, comment out the existing assignment to the nodefamily
variable and add the following line beneath it:
$nodefamily='planetlab-f12-i386';
Also, comment out the existing assignment to the topurl
variable and add the following line beneath it:
$topurl="https://$PLC_BOOT_HOST" . "/install-rpms/" . $nodefamily;
Lastly, add the following line after the the gpgcheck=$gpgcheck
line:
sslverify=0
Try configuring yum without noderepo
If noderepo doesn't work for you out of the box, Aaron Rosen suggested the following steps for getting a node to run yum successfully without the PlanetLab repos. He tried these on a node running F12 with relevant package versions:
kernel-2.6.27.54-28.planetlab.i686 NodeManager-2.0-21.planetlab.i686 vserver-planetlab-f12-i386-5.0-3.2010.10.14.i686
If your node looks similar, this may work for you too. GPO has not tested this.
- Create the stock
yum.repos.d
:mkdir /etc/yum.repos.d/
- Copy the
fedora.repo
file from your myplc to the node, creating/etc/yum.repos.d/fedora.repo
- Download and install some newer versions of perl by hand to resolve discrepancies:
wget ftp://ftp.pbone.net/mirror/archive.fedoraproject.org/fedora/linux/releases/12/Fedora/x86_64/os/Packages/perl-5.10.0-82.fc12.i686.rpm wget ftp://ftp.pbone.net/mirror/archive.fedoraproject.org/fedora/linux/releases/12/Fedora/x86_64/os/Packages/perl-libs-5.10.0-82.fc12.i686.rpm rpm -e --nodeps perl-5.10.0-91.fc12.i686 perl-libs-5.10.0-91.fc12.i686 rpm -i perl-5.10.0-82.fc12.i686.rpm perl-libs-5.10.0-82.fc12.i686.rpm
After that, he was able to use yum install
to install the monitoring dependencies.
Install all package dependencies by hand
We believe that the full set of packages needed to get the five monitoring dependencies is:
- On an F8 node:
cairo dejavu-lgc-fonts expat fontconfig freetype glib2 libpng libthai libX11 libXau libxcb libXdmcp libXext libXft libXrender libxml2 pango perl perl-Compress-Raw-Zlib perl-Compress-Zlib perl-File-Find-Rule perl-HTML-Parser perl-HTML-Tagset perl-IO-Compress-Base perl-IO-Compress-Zlib perl-Number-Compare perl-Test-Mock-LWP perl-Text-Glob perl-URI perl-XML-Writer perl-libs perl-libwww-perl rrdtool rrdtool-perl rrdtool-python xorg-x11-filesystem
- On an F12 node:
cairo dejavu-fonts-common dejavu-lgc-sans-mono-fonts dejavu-sans-mono-fonts fontconfig fontpackages-filesystem freetype libX11 libX11-common libXau libXft libXrender libthai libxcb pango perl-Compress-Raw-Zlib perl-Compress-Zlib perl-File-Find-Rule perl-HTML-Parser perl-HTML-Tagset perl-IO-Compress-Base perl-IO-Compress-Zlib perl-Number-Compare perl-Text-Glob perl-URI perl-XML-Writer perl-libwww-perl pixman rrdtool rrdtool-perl rrdtool-python
You should be able to download these by hand on your myplc node, using e.g. yumdownloader
, and install them on each plnode using rpm -iv *.rpm
. If the only dependency errors you see are minor perl versions, e.g.:
# rpm -iv *.rpm error: Failed dependencies: perl = 4:5.10.0-96.fc12 is needed by perl-Compress-Zlib-0:2.008-96.fc12.i686 perl = 4:5.10.0-96.fc12 is needed by perl-IO-Compress-Base-0:2.015-96.fc12.i686 perl = 4:5.10.0-96.fc12 is needed by perl-IO-Compress-Zlib-0:2.015-96.fc12.i686
and if you have some similar perl-5.10.0
subversion installed, you can try using --nodeps
to ignore the discrepancy (or you could download the newer perl version).