From patchwork Thu Sep 19 20:44:57 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: aginwala aginwala X-Patchwork-Id: 1164870 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="UUFufLDq"; 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 46Z84608Gsz9sN1 for ; Fri, 20 Sep 2019 06:45:09 +1000 (AEST) Received: from mail.linux-foundation.org (localhost [127.0.0.1]) by mail.linuxfoundation.org (Postfix) with ESMTP id 7A5F0C00; Thu, 19 Sep 2019 20:45:05 +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 CD096BE4 for ; Thu, 19 Sep 2019 20:45:04 +0000 (UTC) X-Greylist: whitelisted by SQLgrey-1.7.6 Received: from mail-pl1-f196.google.com (mail-pl1-f196.google.com [209.85.214.196]) by smtp1.linuxfoundation.org (Postfix) with ESMTPS id 72DF2108 for ; Thu, 19 Sep 2019 20:45:03 +0000 (UTC) Received: by mail-pl1-f196.google.com with SMTP id b10so2155747plr.4 for ; Thu, 19 Sep 2019 13:45:03 -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=ya0x4oAm9hAbTy/mWa+d3WZyef62nvJ8Uf9bl9daWxM=; b=UUFufLDqD0Ov92hkVS62NVT8K07hxLEQTz5dDJQeLozsQ+PUIGp3C7LBYxk5iU18xt Zb8RvPdxWZU+c5hyz5K3a+shQ+20o6tdh8gzfuv4K9qKDfxALaM8sgjd0AURcGLOmq1z dHX3R4Zzcli+lasgT+sO9lHfYDDnvOpcaxj/FJVCM/QWLQl+Y9kEFTZX97X7PJLp8sSG y24HZFYm+v/lG8xVfDtiHhMvfa+qRLuihxq36lrv8M8UCMZl3zAAsV+B3oEwZYfriOdq mNj7ggQb4KML0Zo/+k8Hiu1stPROGGv2LE19pOD5ZbMbtSo9LNJtopDMK2QttEL3KgTl rCBw== 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=ya0x4oAm9hAbTy/mWa+d3WZyef62nvJ8Uf9bl9daWxM=; b=AABxKCSa1J20ObnXGef+hqGypWIAC0+lsLUXsiu72myum3tJTGqAM1AOJ4nq5MsUwr 8kfB91LJPNm1YR3NJkpQ2BUWE+wXO8QDCqiPKCPET7K4rn+/zCdPSF5Bwjd54jlE1AwW rVOg4uCdAg9oiyDC7vx0M6xZ5MDqnSIm6EwmNkFymd1zTMpFzpMHNXs2aDKZ2sF2p4um PgLMLxVAfuIMZQP5VAN0L3oWNLOkroF/5d5eOsDopLr/DrvzTQx5tZ064DV2h3aEg4Hl HQRRUo4qS26V0JnzcTS12AtlIQS88ceGiQYN8Lrf0BvRyqwU/Gy0otFVet/gLWqI5U/X CWtQ== X-Gm-Message-State: APjAAAUk9eHS/sPXHmBkZTx2jTLv/mUUj+8IxYrT66Rs2AfbtZheTGbM lgiUBTmkLwfWLo1cuTDuvrEHJG6S X-Google-Smtp-Source: APXvYqyWUI6A0m11TMQJ9SAK129hufPp3hyFJqZdkygaQeh1bXR3UcWIIKDIKXH1XF2WO0bEuXwsZw== X-Received: by 2002:a17:902:7045:: with SMTP id h5mr11882224plt.161.1568925902670; Thu, 19 Sep 2019 13:45:02 -0700 (PDT) Received: from LM-SJC-11015761.corp.ebay.com ([216.113.160.77]) by smtp.gmail.com with ESMTPSA id e6sm20140799pfl.146.2019.09.19.13.45.01 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 19 Sep 2019 13:45:02 -0700 (PDT) From: amginwal@gmail.com To: dev@openvswitch.org Date: Thu, 19 Sep 2019 13:44:57 -0700 Message-Id: <20190919204458.63231-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 v2 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/automake.mk | 1 - utilities/docker/create_ovn_dbs.sh | 18 ------------------ utilities/docker/debian/Dockerfile | 12 +++++------- utilities/docker/debian/build.sh | 20 +++++++++++++++++--- utilities/docker/start-ovn | 26 +++++++++++++------------- 5 files changed, 35 insertions(+), 42 deletions(-) delete mode 100755 utilities/docker/create_ovn_dbs.sh diff --git a/utilities/automake.mk b/utilities/automake.mk index ab0f6003a..197cc7011 100644 --- a/utilities/automake.mk +++ b/utilities/automake.mk @@ -35,7 +35,6 @@ EXTRA_DIST += \ utilities/checkpatch.py \ utilities/docker/Makefile \ utilities/docker/start-ovn \ - utilities/docker/create_ovn_dbs.sh \ utilities/docker/ovn_default_nb_port \ utilities/docker/ovn_default_sb_port \ utilities/docker/ovn_default_northd_host \ 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 From patchwork Thu Sep 19 20:44:58 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: aginwala aginwala X-Patchwork-Id: 1164871 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="CeBxy9g+"; 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 46Z84n2Kt1z9sN1 for ; Fri, 20 Sep 2019 06:45:45 +1000 (AEST) Received: from mail.linux-foundation.org (localhost [127.0.0.1]) by mail.linuxfoundation.org (Postfix) with ESMTP id 9C4E7C6E; Thu, 19 Sep 2019 20:45:07 +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 52C81C64 for ; Thu, 19 Sep 2019 20:45:06 +0000 (UTC) X-Greylist: whitelisted by SQLgrey-1.7.6 Received: from mail-pl1-f180.google.com (mail-pl1-f180.google.com [209.85.214.180]) by smtp1.linuxfoundation.org (Postfix) with ESMTPS id C3079108 for ; Thu, 19 Sep 2019 20:45:05 +0000 (UTC) Received: by mail-pl1-f180.google.com with SMTP id q15so2133908pll.11 for ; Thu, 19 Sep 2019 13:45:05 -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:in-reply-to:references :mime-version:content-transfer-encoding; bh=GSj9dxcE7dubFPLzWK1/KLCq86iM2Uo+bmzc3feUXUI=; b=CeBxy9g+20GFjSFn+ItojX/PMf/7FeKtuEQyBvbQpLHtSlO91dmbRGmZGTmZDhmglS 0HMKS80IIsg4EgZo4Qs7QtkjZlbGBmA3o4tidJAUvh/bkMJKeEMzaMIPfd3efRboyfLT UIg5lyHITtLljJ9qE/Vlbwdo6UrdOuGIItZr3C6X5qOShhvEJrr57+2/9uFf7MOr8C/F oXfa9A06LScHRCWuvE+QDF+22PTa8uaBDrhRTqeDrV3Fa61lU5oVywUav3jIu72HyIII yxJoJc5o9NO2R/mUm74/Dt18HgKIpAksKsRKnpcCpKrAuIWQUvUJl1FQEVjyuIW2/L0m 6zvg== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=GSj9dxcE7dubFPLzWK1/KLCq86iM2Uo+bmzc3feUXUI=; b=YfAb+1ZzyaGEXUfZZ7phWqOWuWUQ5xxWtcdSwOkf1suEXBekgphpSlvKB+v6dGKzy4 0tdkSEGDXfM/l+tbFcfoa7wNHWb35Ezf2EmDwgO/YMllc3RIJsQREjhV+HVZrxnDb+lc GgUCuhVp4cm6KBxqfRNsXQ3UmhybdpvB+qfcXDL9XJLhA89EGO+gc7Gp0GJNPXyFJ/MB VJsd2y0xFdYiayZFZBpPZSRnJKHIC0gW/xCg68ufKBolpQaRfrLfni+ooq588OvU/OcT /ji680cFG4P3/HKCIR81i5Oxm+VMMOi9EehD82b6ZBr5x1GzS5OWTDw4y3sL1Qg8wBYx FNKg== X-Gm-Message-State: APjAAAWCfGNSvn3SttJYN57h4NH22M8Qv8CmoaN2t61B0vzERQa5W0DD wb0qUBT/rMVmOpxuKKTaL3/H4Tp6 X-Google-Smtp-Source: APXvYqym2eCV+KmOdp5usvhUBVlJA0602l9iURWs7l5dM0sWP/BwvCoRm7p3FUdzO4YbkrGqBCQnsw== X-Received: by 2002:a17:902:904b:: with SMTP id w11mr11945608plz.177.1568925905078; Thu, 19 Sep 2019 13:45:05 -0700 (PDT) Received: from LM-SJC-11015761.corp.ebay.com ([216.113.160.77]) by smtp.gmail.com with ESMTPSA id e6sm20140799pfl.146.2019.09.19.13.45.04 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 19 Sep 2019 13:45:04 -0700 (PDT) From: amginwal@gmail.com To: dev@openvswitch.org Date: Thu, 19 Sep 2019 13:44:58 -0700 Message-Id: <20190919204458.63231-2-amginwal@gmail.com> X-Mailer: git-send-email 2.20.1 (Apple Git-117) In-Reply-To: <20190919204458.63231-1-amginwal@gmail.com> References: <20190919204458.63231-1-amginwal@gmail.com> 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 v2 2/2 ovn] Support starting containers with unix socket 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 Signed-off-by: Aliasgar Ginwala --- Documentation/intro/install/general.rst | 14 ++++++++++++++ utilities/docker/start-ovn | 9 +++++++++ 2 files changed, 23 insertions(+) diff --git a/Documentation/intro/install/general.rst b/Documentation/intro/install/general.rst index 4936540fb..bbf05723b 100644 --- a/Documentation/intro/install/general.rst +++ b/Documentation/intro/install/general.rst @@ -449,6 +449,20 @@ Start OVN containers using below command:: $ docker run -itd --net=host --name=ovn-northd \ : ovn-northd-tcp +Start OVN containers using unix socket:: + + $ docker run -itd --net=host --name=ovn-nb \ + -v /var/run/ovn/:/var/run/ovn/ \ + : ovn-nb + + $ docker run -itd --net=host --name=ovn-sb \ + -v /var/run/ovn/:/var/run/ovn/ + : ovn-sb + + $ docker run -itd --net=host --name=ovn-northd \ + -v /var/run/ovn/:/var/run/ovn/ + : ovn-northd + .. note:: Current ovn central components comes up in docker image in a standalone mode with protocol tcp. diff --git a/utilities/docker/start-ovn b/utilities/docker/start-ovn index 7457836fe..fbdd2af91 100755 --- a/utilities/docker/start-ovn +++ b/utilities/docker/start-ovn @@ -13,6 +13,15 @@ # limitations under the License. case $1 in + "ovn-nb") /usr/share/ovn/scripts/ovn-ctl run_nb_ovsdb + ;; + "ovn-sb") /usr/share/ovn/scripts/ovn-ctl run_sb_ovsdb + ;; + "ovn-northd") ovn-northd --pidfile \ + --ovnnb-db="unix:/var/run/ovn/ovnnb_db.sock" \ + --ovnsb-db="unix:/var/run/ovn/ovnsb_db.sock" \ + --log-file=/var/log/ovn/ovn-northd.log + ;; "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