From patchwork Thu Sep 12 00:06:33 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: aginwala aginwala X-Patchwork-Id: 1161317 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=openvswitch.org (client-ip=140.211.169.12; helo=mail.linuxfoundation.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="cAPj8Amu"; dkim-atps=neutral Received: from mail.linuxfoundation.org (mail.linuxfoundation.org [140.211.169.12]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 46TJwP222Yz9s7T for ; Thu, 12 Sep 2019 10:06:44 +1000 (AEST) Received: from mail.linux-foundation.org (localhost [127.0.0.1]) by mail.linuxfoundation.org (Postfix) with ESMTP id C2A65A95; Thu, 12 Sep 2019 00:06:40 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@mail.linuxfoundation.org Received: from smtp1.linuxfoundation.org (smtp1.linux-foundation.org [172.17.192.35]) by mail.linuxfoundation.org (Postfix) with ESMTPS id 59240A49 for ; Thu, 12 Sep 2019 00:06:40 +0000 (UTC) X-Greylist: whitelisted by SQLgrey-1.7.6 Received: from mail-pg1-f176.google.com (mail-pg1-f176.google.com [209.85.215.176]) by smtp1.linuxfoundation.org (Postfix) with ESMTPS id 8566682B for ; Thu, 12 Sep 2019 00:06:38 +0000 (UTC) Received: by mail-pg1-f176.google.com with SMTP id u17so12377353pgi.6 for ; Wed, 11 Sep 2019 17:06:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=hjbSI+Um1NRjr1YIatguy2ptsrByIb38fz4P9aWSl3U=; b=cAPj8Amu1zboXCey48gJJNGIDKluEl5FZ1GruB0F5NKVGZ8mY6WRi3xI7VxWl8fQA6 2RPGm9mEiKSRcriBl6Aad5XTqMXdHeMmwWu5jGEGwEPTGaP0POM31lNeq9pcElFc1MCP 1ge1PY+iDnS/+O4XKZsa62dkSRVJ/Jca9nCzaDFwdRlmKVffBV6sWHySy9c3flXddan5 xT1SfRRAzZAu7TTC/L8VK6q5DsSy8R1wuvzHY00MFdsECQKiyP+KHTeH0iAJVW+NByCh JFZJ0X5mGPr457bhUisB2DzU8ghMLxDi54+ss6N+sJcwfzZODyH33PqDdyPUmPYpiLa0 PzBQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=hjbSI+Um1NRjr1YIatguy2ptsrByIb38fz4P9aWSl3U=; b=AwnhswWy+4P4r4ZeMreF+EiiApF/lYYOY4FSQ8AAe2sLzBtCTnJElJHPoAuzLIjtz4 hChMo/BTRo6+lRZAu3DSyJ0hnxV3RabbPbJkHZMeM2sN4jvnlEO6P0+mQQZbfny/FoUo 39GMyIP9lubbUdeHcNCroK2cP33LJM2XT7+dJ3RdeJeD+GL9/DH+dBB0HqiM6jyvpzXR b2QqLXJUvfcWhrQDckwKySYeG21rwQrunsX4/XVcfr5vm0ALgQIAOi6Bd1UR4psXu0T1 XnXTF84bibN/FiuUHv/IAJhAQAecGu8cmywfVjtQHx3K9sEmAmxqIbMk+zN0CFqT1gME srDA== X-Gm-Message-State: APjAAAUydyXlY8F0imjQ0j/VmrGfP0m1I1oKjhyyXUK56X00TVzORsmo 1Ci7hf8aOHJF6zd7zIMVOP6dcI/I X-Google-Smtp-Source: APXvYqzfgIf/zxFfGX4DzRH1lg6xBYxV25obOygoDbvCMi0JU7Q8Q6PGnbAmR28+9Y1+AVK6N3qt/A== X-Received: by 2002:aa7:8acb:: with SMTP id b11mr44390282pfd.109.1568246797955; Wed, 11 Sep 2019 17:06:37 -0700 (PDT) Received: from LM-SJC-11015761.corp.ebay.com ([216.113.160.77]) by smtp.gmail.com with ESMTPSA id 20sm27193219pfh.72.2019.09.11.17.06.37 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 11 Sep 2019 17:06:37 -0700 (PDT) From: amginwal@gmail.com To: dev@openvswitch.org Date: Wed, 11 Sep 2019 17:06:33 -0700 Message-Id: <20190912000634.64928-1-amginwal@gmail.com> X-Mailer: git-send-email 2.20.1 (Apple Git-117) MIME-Version: 1.0 X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on smtp1.linux-foundation.org Cc: Aliasgar Ginwala Subject: [ovs-dev] [PATCH 1/2 ovn] OVN: Fix container build. X-BeenThere: ovs-dev@openvswitch.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: ovs-dev-bounces@openvswitch.org Errors-To: ovs-dev-bounces@openvswitch.org From: Aliasgar Ginwala Current code changes in ovs/ovn split replaced openvswitch with ovn and caused container patches to break. Also, as per ff4439d, one should build ovn specifying ovs source. This patch fixes the same. Signed-off-by: Aliasgar Ginwala --- utilities/docker/create_ovn_dbs.sh | 18 ------------------ utilities/docker/debian/Dockerfile | 12 +++++------- utilities/docker/debian/build.sh | 20 +++++++++++++++++--- utilities/docker/start-ovn | 26 +++++++++++++------------- 4 files changed, 35 insertions(+), 41 deletions(-) delete mode 100755 utilities/docker/create_ovn_dbs.sh diff --git a/utilities/docker/create_ovn_dbs.sh b/utilities/docker/create_ovn_dbs.sh deleted file mode 100755 index 43ab367d6..000000000 --- a/utilities/docker/create_ovn_dbs.sh +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/sh -# -# 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. - -ovsdb-tool create /etc/openvswitch/ovnnb_db.db \ -/usr/share/openvswitch/ovn-nb.ovsschema -ovsdb-tool create /etc/openvswitch/ovnsb_db.db \ -/usr/share/openvswitch/ovn-sb.ovsschema diff --git a/utilities/docker/debian/Dockerfile b/utilities/docker/debian/Dockerfile index fe72c3a33..30504480d 100644 --- a/utilities/docker/debian/Dockerfile +++ b/utilities/docker/debian/Dockerfile @@ -9,14 +9,12 @@ ARG DISTRO copy $DISTRO/build.sh /build.sh RUN /build.sh $KERNEL_VERSION $OVN_BRANCH $GITHUB_SRC -COPY create_ovn_dbs.sh /etc/openvswitch/create_ovn_dbs.sh -RUN /etc/openvswitch/create_ovn_dbs.sh - -COPY ovn_default_nb_port /etc/openvswitch/ovn_default_nb_port -COPY ovn_default_sb_port /etc/openvswitch/ovn_default_sb_port -COPY ovn_default_northd_host /etc/openvswitch/ovn_default_northd_host +COPY ovn_default_nb_port /etc/ovn/ovn_default_nb_port +COPY ovn_default_sb_port /etc/ovn/ovn_default_sb_port +COPY ovn_default_northd_host /etc/ovn/ovn_default_northd_host COPY start-ovn /bin/start-ovn VOLUME ["/var/log/openvswitch", \ -"/var/lib/openvswitch", "/var/run/openvswitch", "/etc/openvswitch"] +"/var/lib/openvswitch", "/var/run/openvswitch", "/etc/openvswitch", \ +"/var/log/ovn", "/var/lib/ovn", "/var/run/ovn", "/etc/ovn"] ENTRYPOINT ["start-ovn"] diff --git a/utilities/docker/debian/build.sh b/utilities/docker/debian/build.sh index fd26a8aa8..3c404bc39 100755 --- a/utilities/docker/debian/build.sh +++ b/utilities/docker/debian/build.sh @@ -25,20 +25,34 @@ dh-autoreconf openssl" apt-get update apt-get install -y ${linux} ${build_deps} -# get the source +# get ovs source always from master as its needed as dependency mkdir /build; cd /build +git clone --depth 1 -b master https://github.com/openvswitch/ovs.git +cd ovs; +mkdir _gcc; + +# build and install +./boot.sh +cd _gcc +../configure --localstatedir="/var" --sysconfdir="/etc" --prefix="/usr" \ +--with-linux=/lib/modules/$KERNEL_VERSION/build --enable-ssl +cd ..; make -C _gcc install; cd .. + + +# get ovn source git clone --depth 1 -b $OVN_BRANCH $GITHUB_SRC cd ovn # build and install ./boot.sh ./configure --localstatedir="/var" --sysconfdir="/etc" --prefix="/usr" \ ---with-linux=/lib/modules/$KERNEL_VERSION/build --enable-ssl +--with-linux=/lib/modules/$KERNEL_VERSION/build --enable-ssl \ +--with-ovs-source=/build/ovs/ --with-ovs-build=/build/ovs/_gcc make -j8; make install # remove deps to make the container light weight. apt-get remove --purge -y ${build_deps} apt-get autoremove -y --purge -cd ..; rm -rf ovn +cd ..; rm -rf ovn; rm -rf ovs basic_utils="vim kmod net-tools uuid-runtime iproute2" apt-get install -y ${basic_utils} diff --git a/utilities/docker/start-ovn b/utilities/docker/start-ovn index 7f87e65a3..7457836fe 100755 --- a/utilities/docker/start-ovn +++ b/utilities/docker/start-ovn @@ -13,28 +13,28 @@ # limitations under the License. case $1 in - "ovn-nb-tcp") source /etc/openvswitch/ovn_default_nb_port - /usr/share/openvswitch/scripts/ovn-ctl start_ovsdb + "ovn-nb-tcp") source /etc/ovn/ovn_default_nb_port + /usr/share/ovn/scripts/ovn-ctl start_ovsdb ovn-nbctl set-connection ptcp:$nb_db_port - /usr/share/openvswitch/scripts/ovn-ctl stop_ovsdb - /usr/share/openvswitch/scripts/ovn-ctl run_nb_ovsdb + /usr/share/ovn/scripts/ovn-ctl stop_ovsdb + /usr/share/ovn/scripts/ovn-ctl run_nb_ovsdb ;; - "ovn-sb-tcp") source /etc/openvswitch/ovn_default_sb_port - /usr/share/openvswitch/scripts/ovn-ctl start_ovsdb + "ovn-sb-tcp") source /etc/ovn/ovn_default_sb_port + /usr/share/ovn/scripts/ovn-ctl start_ovsdb ovn-sbctl set-connection ptcp:$sb_db_port - /usr/share/openvswitch/scripts/ovn-ctl stop_ovsdb - /usr/share/openvswitch/scripts/ovn-ctl run_sb_ovsdb + /usr/share/ovn/scripts/ovn-ctl stop_ovsdb + /usr/share/ovn/scripts/ovn-ctl run_sb_ovsdb ;; - "ovn-northd-tcp") source /etc/openvswitch/ovn_default_northd_host - source /etc/openvswitch/ovn_default_nb_port - source /etc/openvswitch/ovn_default_sb_port + "ovn-northd-tcp") source /etc/ovn/ovn_default_northd_host + source /etc/ovn/ovn_default_nb_port + source /etc/ovn/ovn_default_sb_port ovn-northd --pidfile \ --ovnnb-db="tcp:$northd_host:$nb_db_port" \ --ovnsb-db="tcp:$northd_host:$sb_db_port" \ - --log-file=/var/log/openvswitch/ovn-northd.log + --log-file=/var/log/ovn/ovn-northd.log ;; "ovn-controller") ovn-controller --pidfile \ - --log-file=/var/log/openvswitch/ovn-controller.log + --log-file=/var/log/ovn/ovn-controller.log ;; *) echo "$0 [ovn-nb-tcp|ovn-sb-tcp|ovn-northd-tcp|ovn-controller]" esac