summaryrefslogtreecommitdiffstats
path: root/build
diff options
context:
space:
mode:
Diffstat (limited to 'build')
-rwxr-xr-xbuild/f_isoroot/f_repobuild/select_ubuntu_repo.sh63
1 files changed, 14 insertions, 49 deletions
diff --git a/build/f_isoroot/f_repobuild/select_ubuntu_repo.sh b/build/f_isoroot/f_repobuild/select_ubuntu_repo.sh
index 4bca6bd9b..7b134e73c 100755
--- a/build/f_isoroot/f_repobuild/select_ubuntu_repo.sh
+++ b/build/f_isoroot/f_repobuild/select_ubuntu_repo.sh
@@ -1,67 +1,32 @@
#!/bin/bash
##############################################################################
-# Copyright (c) 2015 Ericsson AB and others.
+# Copyright (c) 2015,2016 Ericsson AB and others.
# mskalski@mirantis.com
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Apache License, Version 2.0
# which accompanies this distribution, and is available at
# http://www.apache.org/licenses/LICENSE-2.0
##############################################################################
-RSYNC="rsync -4 --contimeout 5 --no-motd --list-only"
-# try to choose close ubuntu mirror which support rsync protocol
-# https://bugs.launchpad.net/fuel/+bug/1459252
-
-# A minor modificiation of Michal Skalski's original Makefile version
-# to only consider repos where no repo updates are in progress (as
-# that may have us hanging quite a while otherwise). If no suitable
-# local mirror can be found after four attempts, the default archive
-# is returned instead.
+# Try to choose close ubuntu mirror
# Some Ubuntu mirrors seem less reliable for this type of mirroring -
# as they are discoved they can be added to the blacklist below in order
# for them not to be considered.
BLACKLIST="mirrors.se.eu.kernel.org mirror.its.dal.ca"
-return_url=0
-
-while [ "$1" != "" ]; do
- case $1 in
- -u | --url ) shift
- return_url=1
- ;;
- # Shift all the parameters down by one
- esac
- shift
-done
-
-cnt=0
-while [ $cnt -lt 4 ]
+for url in $(curl -s http://mirrors.ubuntu.com/mirrors.txt)
do
- for url in $(curl -s http://mirrors.ubuntu.com/mirrors.txt)
- do
- host=$(echo $url | cut -d'/' -f3)
- echo ${BLACKLIST} | grep -q ${host} && continue
- if $RSYNC "${host}::ubuntu/." &> /dev/null
- then
- if ! $RSYNC "${host}::ubuntu/Archive-Update-in-Progress*" &> /dev/null
- then
- if [ "$return_url" = "1" ]; then
- echo "$url"
- exit 0
- else
- echo "$host"
- exit 0
- fi
- fi
- fi
- done
- cnt=$[cnt + 1]
- sleep 15
+ host=$(echo $url | cut -d'/' -f3)
+ echo ${BLACKLIST} | grep -q ${host} && continue
+ if curl -s -o /dev/null --head --fail "$url"; then
+ echo $url
+ exit 0
+ else
+ continue
+ fi
done
-if [ "$return_url" = "1" ]; then
- echo "http://archive.ubuntu.com/ubuntu/"
-else
- echo "archive.ubuntu.com"
-fi
+# If no suitable local mirror can be found,
+# the default archive is returned instead.
+echo "http://archive.ubuntu.com/ubuntu/"
/* Keyword.Type */ .highlight .m { color: #0000DD; font-weight: bold } /* Literal.Number */ .highlight .s { color: #dd2200; background-color: #fff0f0 } /* Literal.String */ .highlight .na { color: #336699 } /* Name.Attribute */ .highlight .nb { color: #003388 } /* Name.Builtin */ .highlight .nc { color: #bb0066; font-weight: bold } /* Name.Class */ .highlight .no { color: #003366; font-weight: bold } /* Name.Constant */ .highlight .nd { color: #555555 } /* Name.Decorator */ .highlight .ne { color: #bb0066; font-weight: bold } /* Name.Exception */ .highlight .nf { color: #0066bb; font-weight: bold } /* Name.Function */ .highlight .nl { color: #336699; font-style: italic } /* Name.Label */ .highlight .nn { color: #bb0066; font-weight: bold } /* Name.Namespace */ .highlight .py { color: #336699; font-weight: bold } /* Name.Property */ .highlight .nt { color: #bb0066; font-weight: bold } /* Name.Tag */ .highlight .nv { color: #336699 } /* Name.Variable */ .highlight .ow { color: #008800 } /* Operator.Word */ .highlight .w { color: #bbbbbb } /* Text.Whitespace */ .highlight .mb { color: #0000DD; font-weight: bold } /* Literal.Number.Bin */ .highlight .mf { color: #0000DD; font-weight: bold } /* Literal.Number.Float */ .highlight .mh { color: #0000DD; font-weight: bold } /* Literal.Number.Hex */ .highlight .mi { color: #0000DD; font-weight: bold } /* Literal.Number.Integer */ .highlight .mo { color: #0000DD; font-weight: bold } /* Literal.Number.Oct */ .highlight .sa { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Affix */ .highlight .sb { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Backtick */ .highlight .sc { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Char */ .highlight .dl { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Delimiter */ .highlight .sd { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Doc */ .highlight .s2 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Double */ .highlight .se { color: #0044dd; background-color: #fff0f0 } /* Literal.String.Escape */ .highlight .sh { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Heredoc */ .highlight .si { color: #3333bb; background-color: #fff0f0 } /* Literal.String.Interpol */ .highlight .sx { color: #22bb22; background-color: #f0fff0 } /* Literal.String.Other */ .highlight .sr { color: #008800; background-color: #fff0ff } /* Literal.String.Regex */ .highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */ .highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */ .highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #336699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */ }
--
-- Copyright (c) 2010-2017 Intel Corporation
--
-- 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
--
--     http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
--

dofile("bundle_maker.lua")

if (test_system_id == nil) then
   error("test_system_id not set")
end

offset = 8 * test_system_id

c_2s0, s_3s0   = setup_bundles(128 + offset, ss)
c_4s0, s_5s0   = setup_bundles(129 + offset, ss)
c_2s0h, s_3s0h = setup_bundles(130 + offset, ss)
c_4s0h, s_5s0h = setup_bundles(131 + offset, ss)

c_6s0, s_7s0   = setup_bundles(132 + offset, ss)
c_8s0, s_9s0   = setup_bundles(133 + offset, ss)
c_6s0h, s_7s0h = setup_bundles(134 + offset, ss)
c_8s0h, s_9s0h = setup_bundles(135 + offset, ss)

----------------

c_2s1, s_3s1   = setup_bundles(64 + offset, ss)
c_4s1, s_5s1   = setup_bundles(65 + offset, ss)
c_2s1h, s_3s1h = setup_bundles(66 + offset, ss)
c_4s1h, s_5s1h = setup_bundles(67 + offset, ss)

c_6s1, s_7s1   = setup_bundles(68 + offset, ss)
c_8s1, s_9s1   = setup_bundles(69 + offset, ss)
c_6s1h, s_7s1h = setup_bundles(70 + offset, ss)
c_8s1h, s_9s1h = setup_bundles(71 + offset, ss)

if (max_setup_rate == nil) then
   error("max_setup_rate not set")
end

if (connections == nil) then
   error("connections not set")
end

port_a_clients="2s0,4s0,2s0h,4s0h,6s0,8s0,6s0h,8s0h"
port_b_servers="3s0,5s0,3s0h,5s0h,7s0,9s0,7s0h,9s0h"


port_c_clients="2s1,4s1,2s1h,4s1h,6s1,8s1,6s1h,8s1h"
port_d_servers="3s1,5s1,3s1h,5s1h,7s1,9s1,7s1h,9s1h"

all_clients = port_a_clients
   .. "," .. port_c_clients

all_servers = port_b_servers
   .. "," .. port_d_servers

all_workers =  all_clients .. "," .. all_servers

all_ld = "1s0,1s0h,1s1,1s1h"

client_port_count = 2;

bps = 1250000000/task_count(port_a_clients)
msr = max_setup_rate/client_port_count/task_count(port_a_clients)
conn = connections/client_port_count/task_count(port_a_clients)

mempool_size = connections
if (mempool_size > 100000) then
   mempool_size = 100000
elseif (mempool_size < 2048) then
   mempool_size = 2048
end