All new accounts created on Gitlab now require administrator approval. If you invite any collaborators, please let Flux staff know so they can approve the accounts.

Commit d1113b38 authored by David Johnson's avatar David Johnson

Handle Docker EXTIMAGE attr, and accept other VM_* attrs.

parent c434aa32
......@@ -2331,8 +2331,12 @@ sub vnodeCreate($$$$)
fatal("CreateVnodeLock()");
}
# XXX: just use a default Docker image for now.
$imagename = $image{'name'};
if (exists($attributes->{'DOCKER_EXTIMAGE'})) {
$imagename = $attributes->{'DOCKER_EXTIMAGE'};
}
else {
$imagename = $image{'name'};
}
my ($newimagename,$newcreateargs,$newcmd);
$rc = setupImage($vnode_id,$vnconfig,$private,$imagename,
......@@ -2429,14 +2433,22 @@ sub vnodeCreate($$$$)
# We allow the server to tell us how many VCPUs to allocate to the
# guest.
#
if (exists($attributes->{'VM_VCPUS'}) && $attributes->{'VM_VCPUS'} > 1) {
if (exists($attributes->{'DOCKER_VCPUS'})
&& $attributes->{'DOCKER_VCPUS'} > 1) {
$createargs .= " -c " . $attributes->{'DOCKER_VCPUS'};
}
elsif (exists($attributes->{'VM_VCPUS'}) && $attributes->{'VM_VCPUS'} > 1) {
$createargs .= " -c " . $attributes->{'VM_VCPUS'};
}
#
# Give the vnode some memory. The server usually tells us how much.
#
if (exists($attributes->{'VM_MEMSIZE'})) {
if (exists($attributes->{'DOCKER_MEMSIZE'})) {
# Better be MB.
$createargs .= " --memory=" . $attributes->{'DOCKER_MEMSIZE'} . "m";
}
elsif (exists($attributes->{'VM_MEMSIZE'})) {
# Better be MB.
$createargs .= " --memory=" . $attributes->{'VM_MEMSIZE'} . "m";
}
......
Markdown is supported
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