Commit 07dc86e3 authored by Mike Hibler's avatar Mike Hibler
Browse files

Add DOWNSERVER parameter to create-image so that subboss is used.

Downloading signature direct from boss is great...except when it isn't.
In Apt, we cannot multicast download from boss so we MUST use subboss.
So differentiate upload server from download.

Required fixing a bug in the proxy mfrisbeed that runs on subboss.
parent d88b614e
......@@ -48,10 +48,16 @@ use Getopt::Std;
# but currently that would just be a choice for downloading.
#
# SERVER=<name>
# Server to use for uploading image and up/downloading metadata.
# If METHOD=file, this won't be set or will be ignored by the client.
# Otherwise it is the name or IP to use with the frisupload or frisbee
# -S option.
# Server to use for uploading image and metadata. May also be used
# for downloading metadata if DOWNSERVER is not set. If METHOD=file,
# SERVER won't be set or will be ignored by the client. Otherwise it
# is the name or IP to use with the frisupload -S option.
#
# DOWNSERVER=<name>
# Server to use for downloading metadata. If not set SERVER is used
# instead. If METHOD=file, DOWNSERVER won't be set or will be ignored
# by the client. Otherwise it is the name or IP to use with the
# frisbee -S option.
#
# IMAGENAME=<string>
# Context-sensitive name of the image to create. If the SERVER is set
......@@ -213,6 +219,10 @@ sub parse_params(@)
$iinfo{$iid}{'server'} = $val;
next;
}
if ($key eq "downserver") {
$iinfo{$iid}{'downserver'} = $val;
next;
}
if ($key eq "imagename") {
$iinfo{$iid}{'iname'} = $val;
next;
......@@ -441,14 +451,18 @@ sub fetch($$)
}
elsif ($iinfo{$iid}{'method'} eq "frisbee") {
my $srv = $iinfo{$iid}{'server'};
my $srv = $iinfo{$iid}{'downserver'};
if (!defined($srv)) {
$srv = $iinfo{$iid}{'server'};
}
#
# Since we are fetching small files into an MFS, there is
# not much need for lots of buffer memory. We also don't
# randomize requests.
#
my $opts = "-O -W 1 -C 32";
if (mysystem("$frisbee $opts -N -S $srv -F $ifile $lfile")) {
if (mysystem("$frisbee $opts -B 5 -N -S $srv -F $ifile $lfile")) {
return -1;
}
}
......
......@@ -503,7 +503,8 @@ null_get_host_authinfo(struct in_addr *req, struct in_addr *host,
/*
* We seriously limit what chars can be in an imageid since we
* use it as a file name. This check is based on the Emulab
* regex for image paths: "^[-_\w\.\/:+]+$"
* regex for image paths: "^[-_\w\.\/:+]+$". We need ',' as
* well to allow download of image signatures.
*/
idlen = strlen(imageid);
if (idlen == 0 || idlen >= PATH_MAX) {
......@@ -514,7 +515,7 @@ null_get_host_authinfo(struct in_addr *req, struct in_addr *host,
for (cp = imageid; *cp != '\0'; cp++) {
if (isalnum(*cp) || *cp == '-' || *cp == '_' ||
*cp == '.' || *cp == '/' || *cp == ':' ||
*cp == '+')
*cp == '+' || *cp == ',')
continue;
if (debug)
fprintf(stderr,
......
......@@ -879,6 +879,14 @@ else {
my $id;
if ($usefup) {
$command .= " METHOD=frisbee SERVER=$BOSSIP";
# if the node has a subboss, use that for downloads
my $subboss;
$node->GetSubboss("frisbee", \$subboss);
if (defined($subboss)) {
$command .= " DOWNSERVER=$subboss";
}
if ($usepath) {
$id = $filename;
} else {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment