Commit 82bd879b authored by Nikos Skalkotos's avatar Nikos Skalkotos
Browse files

Merge branch 'release-0.16' into debian-release-0.16

parents 8f340f6a e76d271a
2014-09-01, v0.16rc1
* Add support for archipelago images
* Update the documentation
2014-07-18, v0.15.2
* Fix configure.ac to work with newer versions of automake
......
......@@ -39,12 +39,12 @@ the post install phase of the package installation.
Ubuntu
^^^^^^
For Ubuntu 12.04 LTS we provide packages in our APT repository. To use our
For Ubuntu 14.04 LTS we provide packages in our APT repository. To use our
repository add the following lines to file ``/etc/apt/sources.list``:
``deb http://apt.dev.grnet.gr precise/``
``deb http://apt.dev.grnet.gr trusty/``
``deb-src http://apt.dev.grnet.gr precise/``
``deb-src http://apt.dev.grnet.gr trusty/``
After you update ``/etc/apt/sources.list`` import the repo's GPG key:
......
......@@ -138,7 +138,7 @@ Optional properties
* **DO_SYNC=yes**
By default in ResizeUnmounted task, when ``resize2fs`` is executed to
enlarge a ext[234] file system, ``fsync()`` is disabled to speed up the
whole process. I for some reason you need to disable this behavior, use the
whole process. If for some reason you need to disable this behavior, use the
*DO_SYNC* image property.
* **PASSWORD_HASHING_METHOD=md5|sha1|blowfish|sha256|sha512**
......
__version__ = "0.15.2"
__version__ = "0.16rc1"
......@@ -60,7 +60,7 @@ def main():
infh = sys.stdin if input_file is None else open(input_file, 'r')
outfh = open(output_file, 'w')
properties = json.load(infh)
properties = json.load(infh, strict=False)
for key, value in properties.items():
os.environ['SNF_IMAGE_PROPERTY_' + str(key).upper()] = value
......
......@@ -73,7 +73,7 @@ def parse_arguments(input_args):
def main():
(input_file, target, decode) = parse_arguments(sys.argv[1:])
files = json.load(input_file)
files = json.load(input_file, strict=False)
if decode:
manifest = open(target + '/manifest', 'w')
......
Nikos Skalkotos <skalkoto@grnet.gr>
Dimitris Aragiorgis <dimara@grnet.gr>
Constantinos Venetsanopoulos <cven@grnet.gr>
Vangelis Koukis <vkoukis@grnet.gr>
Giorgos Verigakis <verigak@grnet.gr>
Christos Stavrakakis <cstavr@grnet.gr>
Chrysostomos Nanakos <cnanakos@grnet.gr>
Nikos Skalkotos
Dimitris Aragiorgis
Constantinos Venetsanopoulos
Vangelis Koukis
Giorgos Verigakis
Christos Stavrakakis
Chrysostomos Nanakos
Brian Candler
......@@ -27,6 +27,7 @@ TIMEOUT="timeout"
CURL="curl"
TAR="tar"
DATE="date -u" # Time in UTC
KVM="kvm"
# Temporary use stderr as monitoring file descriptor.
# `create' will overwrite this
......@@ -429,6 +430,7 @@ fi
: ${PITHOS_RADOS_CEPH_CONF:="@sysconfdir@/ceph/ceph.conf"}
: ${PITHOS_RADOS_POOL_MAPS:="maps"}
: ${PITHOS_RADOS_POOL_BLOCKS:="blocks"}
: ${PITHOS_ARCHIPELAGO_CONF:="@sysconfdir@/archipelago/archipelago.conf"}
: ${PROGRESS_MONITOR:="@PROGRESS_MONITOR@"}
: ${UNATTEND:="@UNATTEND@"}
: ${XEN_SCRIPTS_DIR="@sysconfdir@/xen/scripts"}
......
......@@ -116,12 +116,13 @@ case $BACKEND_TYPE in
pithos)
# For security reasons pass the various options to pithcat as
# environment variables.
export PITHCAT_INPUT_DB="$PITHOS_DB"
export PITHCAT_INPUT_DATA="$PITHOS_DATA"
export PITHCAT_DB="$PITHOS_DB"
export PITHCAT_DATA="$PITHOS_DATA"
export PITHCAT_BACKEND_STORAGE="$PITHOS_BACKEND_STORAGE"
export PITHCAT_RADOS_CEPH_CONF="$PITHOS_RADOS_CEPH_CONF"
export PITHCAT_RADOS_POOL_MAPS="$PITHOS_RADOS_POOL_MAPS"
export PITHCAT_RADOS_POOL_BLOCKS="$PITHOS_RADOS_POOL_BLOCKS"
export PITHCAT_ARCHIPELAGO_CONF="$PITHOS_ARCHIPELAGO_CONF"
cmd_args="$(printf "%q" "${IMAGE_NAME}")"
image_cmd="./pithcat $cmd_args"
image_size=$(./pithcat -s $cmd_args)
......
......@@ -68,6 +68,9 @@
# PITHOS_RADOS_POOL_BLOCKS: RADOS pool for storing Pithos blocks
# PITHOS_RADOS_POOL_BLOCKS="blocks"
# PITHOS_ARCHIPELAGO_CONF: Archipelago configuration file
# PITHOS_ARCHIPELAGO_CONF="@sysconfdir@/archipelago/archipelago.conf"
#
# PROGRESS_MONITOR: External program that monitors the progress of the image
# deployment. The snf-image monitor messages will be redirected to the standard
# input of this program.
......@@ -81,6 +84,7 @@
# Paths for needed programs. Uncomment and change the variables below if you
# don't want to use the default one.
# KVM="kvm"
# LOSETUP="losetup"
# KPARTX="kpartx"
# SFDISK="sfdisk"
......
......@@ -34,8 +34,8 @@ fi
# Export disk's predicted size to Ganeti.
# Used to provide a time estimate of the export process to the user.
if [ -z "$EXP_SIZE_FD" ]; then
blockdev --getsize64 $blockdev >&$EXP_SIZE_FD
if [ -n "$EXP_SIZE_FD" ]; then
blockdev --getsize64 "$blockdev" >&$EXP_SIZE_FD
fi
dd if="$blockdev" bs=4M
......
......@@ -34,11 +34,11 @@ launch_helper() {
set +e
$TIMEOUT -k "$HELPER_HARD_TIMEOUT" "$HELPER_SOFT_TIMEOUT" \
kvm -runas "$HELPER_USER" -drive file="$HELPER_DIR/image",format=raw,if=virtio,readonly \
$KVM -runas "$HELPER_USER" -drive file="$HELPER_DIR/image",format=raw,if=virtio,readonly \
-drive file="$blockdev",format=raw,if=virtio,cache=none -m "$HELPER_MEMORY" \
-boot c -serial stdio -serial "file:$(printf "%q" "$result_file")" \
-serial file:>(./helper-monitor.py ${MONITOR_FD}) \
-fda "$floppy" -vga none -nographic -parallel none -monitor null \
-drive file="$floppy",if=floppy -vga none -nographic -parallel none -monitor null \
-kernel "$HELPER_DIR/kernel" -initrd "$HELPER_DIR/initrd" \
-append "quiet ro root=/dev/vda1 console=ttyS0,9600n8 \
hypervisor=$HYPERVISOR snf_image_activate_helper \
......
......@@ -40,19 +40,27 @@ except ImportError:
exit(2)
SELECTABLE_BE_VER = "0.15.1"
MB_NO_ARCHIPELAGO_VER = 0
MB_ARCHIPELAGO_VER = 1
note = """
NOTE: You can pass all arguments through environment variables instead of
the command line: Setting the environment variable PITHCAT_INPUX_XXX to
the command line: Setting the environment variable PITHCAT_XXX to
VALUE is equivalent to passing a '--xxx VALUE' argument.
Using the --db argument directly is dangerous, because it may
expose sensitive information in the output of 'ps'. Consider passing
the DB URI through the environment variable PITHOS_INPUT_DB instead.\n"""
the DB URI through the environment variable PITHCAT_DB instead.\n"""
try:
mb_version = ModularBackend._class_version
except AttributeError:
mb_version = MB_NO_ARCHIPELAGO_VER
OptionParser.format_epilog = lambda self, formattxt: self.epilog
parser = OptionParser(usage='%prog [options] <URL>', epilog=note)
if parse_version(pithos_backend_version) >= parse_version(SELECTABLE_BE_VER):
if parse_version(pithos_backend_version) >= parse_version(SELECTABLE_BE_VER) \
and mb_version == MB_NO_ARCHIPELAGO_VER:
backend_group = OptionGroup(
parser, "Backend-specific Options",
"The backend-specific options depend on the specific "
......@@ -75,9 +83,13 @@ if parse_version(pithos_backend_version) >= parse_version(SELECTABLE_BE_VER):
help='path to the directory where data are stored'
)
parser.add_option_group(backend_group)
else:
elif parse_version(pithos_backend_version) < parse_version(SELECTABLE_BE_VER) \
and mb_version == MB_NO_ARCHIPELAGO_VER:
parser.add_option('--data', dest='data', metavar='DIR',
help='path to the directory where data are stored')
elif mb_version == MB_ARCHIPELAGO_VER:
parser.add_option('--archipelago-conf', dest='archipconf', metavar='ACONF',
help='Archipelago configuration file to use')
parser.add_option('-s', action='store_true', dest='size', default=False,
help='print file size and exit')
......@@ -120,12 +132,21 @@ def print_data(backend, url):
if type(url) is LocationURL:
account, container, object = url
size, hashmap = backend.get_object_hashmap(account, account, container,
object)
if mb_version == MB_NO_ARCHIPELAGO_VER:
size, hashmap = backend.get_object_hashmap(account, account,
container,
object)
else:
_, size, hashmap = backend.get_object_hashmap(account, account,
container,
object)
elif type(url) is HashmapURL:
hashmap = [hexlify(x)
for x in backend.store.map_get(unhexlify(url.hash))]
size = int(url.size)
if mb_version == MB_NO_ARCHIPELAGO_VER:
hashmap = [hexlify(x)
for x in backend.store.map_get(unhexlify(url.hash))]
else:
hashmap = [x for x in backend.store.map_get(url.hash, size)]
else:
raise Exception("Invalid URL")
......@@ -148,7 +169,8 @@ def main():
data_path = None
if parse_version(pithos_backend_version) >= \
parse_version(SELECTABLE_BE_VER):
parse_version(SELECTABLE_BE_VER) and \
mb_version == MB_NO_ARCHIPELAGO_VER:
if not options.backend and 'PITHCAT_BACKEND_STORAGE' not in environ:
stderr.write(
......@@ -161,43 +183,44 @@ def main():
if options.backend == 'nfs' or \
environ.get('PITHCAT_BACKEND_STORAGE') == 'nfs':
if not options.data and 'PITHCAT_INPUT_DATA' not in environ:
if not options.data and 'PITHCAT_DATA' not in environ:
stderr.write(
"Pithos data directory path is missing.\n"
"Use the PITHCAT_INPUT_DATA environment variable "
"Use the PITHCAT_DATA environment variable "
"(recommended) "
"or the --data command line option to define it.\n")
exit(1)
data_path = environ['PITHCAT_INPUT_DATA'] if not options.data else \
data_path = environ['PITHCAT_DATA'] if not options.data else \
options.data
else:
if not options.data and 'PITHCAT_INPUT_DATA' not in environ:
elif parse_version(pithos_backend_version) < \
parse_version(SELECTABLE_BE_VER):
if not options.data and 'PITHCAT_DATA' not in environ:
stderr.write(
"Pithos data directory path is missing.\n"
"Use the PITHCAT_INPUT_DATA environment variable "
"Use the PITHCAT_DATA environment variable "
"(recommended) "
"or the --data command line option to define it.\n")
exit(1)
data_path = environ['PITHCAT_INPUT_DATA'] if not options.data else \
data_path = environ['PITHCAT_DATA'] if not options.data else \
options.data
if options.db is None and 'PITHCAT_INPUT_DB' not in environ and \
if options.db is None and 'PITHCAT_DB' not in environ and \
type(url) is LocationURL:
stderr.write(
"Pithos database URI is missing.\n"
"Use the PITHCAT_INPUT_DB environment variable (recommended) "
"Use the PITHCAT_DB environment variable (recommended) "
"or the --db command line option to define it.\n")
exit(1)
if type(url) is HashmapURL:
db_uri = None
else:
db_uri = environ['PITHCAT_INPUT_DB'] if not options.db else options.db
db_uri = environ['PITHCAT_DB'] if not options.db else options.db
if parse_version(pithos_backend_version) >= \
parse_version(SELECTABLE_BE_VER):
parse_version(SELECTABLE_BE_VER) and \
mb_version == MB_NO_ARCHIPELAGO_VER:
block_params = {'mappool': None, 'blockpool': None}
rados_ceph_conf = None
......@@ -252,16 +275,42 @@ def main():
data_path, block_params=block_params,
backend_storage=backend_storage,
rados_ceph_conf=rados_ceph_conf)
elif mb_version >= MB_ARCHIPELAGO_VER:
if not options.archipconf and 'PITHCAT_ARCHIPELAGO_CONF' not \
in environ:
stderr.write(
"Archipelago configuration file is missing.\n"
"Use the PITHCAT_ARCHIPELAGO_CONF environment variable "
"(recommended) "
"or the --archipelago-conf command line option to define it.\n"
)
exit(1)
archipelago_conf_file = environ['PITHCAT_ARCHIPELAGO_CONF'] if not \
options.archipconf else options.archipconf
backend = ModularBackend(None,
db_uri if type(url) is LocationURL else None,
None,
archipelago_conf_file=archipelago_conf_file)
else:
backend = ModularBackend(None,
db_uri if type(url) is LocationURL else None,
None,
data_path)
if options.size:
print_size(backend, url)
else:
print_data(backend, url)
try:
if options.size:
print_size(backend, url)
else:
print_data(backend, url)
finally:
if mb_version >= MB_ARCHIPELAGO_VER:
if backend.ioctx_pool:
backend.ioctx_pool._shutdown_pool()
else:
pass
if __name__ == '__main__':
main()
......
m4_define([devflow_version], [0.15.2])
m4_define([devflow_version], [0.16rc1])
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