#
+# Copyright 2016 Telefónica Investigación y Desarrollo, S.A.U.
+#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# See the License for the specific language governing permissions and
# limitations under the License.
#
+# Authors:
+# - Gerardo Garcia - gerardo.garciadeblas@telefonica.com
#
# this variable holds the name of the container image needed to build or run this product
-export OSM_BASE_IMAGE=ubuntu:14.04
+export OSM_BASE_IMAGE=ubuntu:16.04
#
# this variable holds the name of the container to be used to build a package
# if this container already exists, the build process can skip the container build
#!/bin/bash
#
+# Copyright 2016 Telefónica Investigación y Desarrollo, S.A.U.
+#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# See the License for the specific language governing permissions and
# limitations under the License.
#
+# Authors:
+# - Gerardo Garcia - gerardo.garciadeblas@telefonica.com
#
HERE=$(realpath $(dirname $0))
INFO "starting build"
+INFO " cleaning .pyc"
rm *.pyc
+INFO " installing openmano packages and dependencies from current repo (--noclone)"
+./scripts/install_openmano.sh --noclone -q
+INFO " compiling *.py"
python -m py_compile *.py
RC=$?
-git checkout master #Cleaning the environment. It's also done at the beginning, but it's done just in case.
+#git checkout master #Cleaning the environment. It's also done at the beginning, but it's done just in case.
INFO "done, RC=$RC"
exit $RC
# This file is meant to be SOURCED
#
# Copyright 2016 RIFT.IO Inc
+# Copyright 2016 Telefónica Investigación y Desarrollo S.A.U.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
#
# container_funcs
# 24 June 2016 -- Jeremy Mordkoff -- Genesis
+# -- Gerardo García
container_exists() {
if [ $# -ne 1 ]; then
}
create_container() {
- if [ $# -ne 2 ]; then
- FATAL "args are image container"
+ if [ $# -lt 2 ]; then
+ FATAL "args are image container [options]"
fi
INFO "creating container $2 using image $1"
- DEBUG "lxc launch $1 $2"
- lxc launch "$1" "$2"
-}
-
-create_privileged_container() {
- if [ $# -ne 2 ]; then
- FATAL "args are image container"
- fi
- INFO "creating container $2 using image $1"
- DEBUG "lxc launch $1 $2"
- lxc launch "$1" "$2" -c security.privileged=true
+ image=$1
+ container=$2
+ shift 2
+ DEBUG "lxc launch $image $container $*"
+ lxc launch "$image" "$container" "$*"
}
container_exec() {
#!/bin/bash
# Copyright 2016 RIFT.IO Inc
+# Copyright 2016 Telefónica Investigación y Desarrollo S.A.U.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# start-build is run on a host to start a MDG build
#
# 24 June 2016 -- Jeremy Mordkoff -- Genesis
+# -- Gerardo Garcia
HERE=$(realpath $(dirname $0))
OSM_load_config
if ! container_exists $OSM_BUILD_CONTAINER; then
- if [[ "$OSM_BUILD_CONTAINER_PRIVILEGED" == yes ]]; then
- create_privileged_container $OSM_BASE_IMAGE $OSM_BUILD_CONTAINER
- else
- create_container $OSM_BASE_IMAGE $OSM_BUILD_CONTAINER
- fi
+ CONTAINER_OPTS=""
+ [[ "$OSM_BUILD_CONTAINER_PRIVILEGED" == yes ]] && CONTAINER_OPTS="$CONTAINER_OPTS -c security.privileged=true"
+ [[ "$OSM_BUILD_CONTAINER_ALLOW_NESTED" == yes ]] && CONTAINER_OPTS="$CONTAINER_OPTS -c security.nesting=true"
+ create_container $OSM_BASE_IMAGE $OSM_BUILD_CONTAINER $CONTAINER_OPTS
wait_container_up $OSM_BUILD_CONTAINER
RE="fedora|fc[0-9]"
if [[ $OSM_BASE_IMAGE =~ $RE ]]; then
# Copyright 2016 RIFT.IO Inc
+# Copyright 2016 Telefónica Investigación y Desarrollo, S.A.U.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
#
# sample SETTINGS file
#
-# 24 June 2016 -- Jeremy Mordkoff -- Genesis
+# Authors:
+# 24 June 2016 -- Jeremy Mordkoff -- Genesis
+# -- Gerardo Garcia
#
# this variable holds the name of the container image needed to build or run this product
export OSM_BASE_IMAGE=ubuntu:16.04
# this variable should be removed in the future when no privileged mode is required
#export OSM_BUILD_CONTAINER_PRIVILEGED=yes
#
+# this variable must be set to allow ensted containers in the build container
+#export OSM_BUILD_CONTAINER_ALLOW_NESTED=yes
+#
# this variable holds the name of the container to be used to run a package
# if this container already exists, the run processes can skip the container build
export OSM_RUNTIME_CONTAINER=container_name-runtime
# this variable must be set to allow creating the runtime container in privileged mode
# this variable should be removed in the future when no privileged mode is required
#export OSM_RUNTIME_CONTAINER_PRIVILEGED=yes
-
+#
+# this variable must be set to allow ensted containers in the build container
+#export OSM_RUNTIME_CONTAINER_ALLOW_NESTED=yes
+#