Re: [netmod] submodules the hidden benefits

Andy Bierman <andy@yumaworks.com> Mon, 10 August 2020 21:20 UTC

Return-Path: <andy@yumaworks.com>
X-Original-To: netmod@ietfa.amsl.com
Delivered-To: netmod@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 9CBF63A0D99 for <netmod@ietfa.amsl.com>; Mon, 10 Aug 2020 14:20:01 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.887
X-Spam-Level:
X-Spam-Status: No, score=-1.887 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, HTML_MESSAGE=0.001, SPF_HELO_NONE=0.001, T_SPF_PERMERROR=0.01, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=yumaworks-com.20150623.gappssmtp.com
Received: from mail.ietf.org ([4.31.198.44]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id mbLbmfmhuo6v for <netmod@ietfa.amsl.com>; Mon, 10 Aug 2020 14:19:59 -0700 (PDT)
Received: from mail-lf1-x130.google.com (mail-lf1-x130.google.com [IPv6:2a00:1450:4864:20::130]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 4F69D3A0D57 for <netmod@ietf.org>; Mon, 10 Aug 2020 14:19:59 -0700 (PDT)
Received: by mail-lf1-x130.google.com with SMTP id c15so5507764lfi.3 for <netmod@ietf.org>; Mon, 10 Aug 2020 14:19:59 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yumaworks-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=GudgLVky5B6sDR/ZOu54rxHw8UbRvOahqSs+S0C0j4U=; b=osTsAeL5KQ+hkTJiu8KM7kvKvuVFFqJV1JKjY1SqCsTvCKYyTIrz2W5kkYXwomEhxm /HkekDHU2EuzhgHptK4pEvLA+eAcbyE+mcrRN/KMeasY9U5E+j64m0rk7RdJ9KdtxE9c l4hPKv5nWBiVvpnuGzKHQ1u3Q7bGCMGISpRvQtHgExwJoxpyMo082QiZz1YsnCBEUXDQ WSHe8Cp6NG0DPAl5XVezMbknzRlYC+7yR2CbkR/aLyE7z4y60TvpeUSwRfd6/KAGuB7H vzeMZ9ejzkt7hQRzfMItl2MzvcU13cgeCeUfHuNgvngyJ96rnCNiYp8bHdpegFBRCIuJ sxjQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=GudgLVky5B6sDR/ZOu54rxHw8UbRvOahqSs+S0C0j4U=; b=iaTFIT6uAP2zCiF+pxcJbhlqbOUfGzMacKM7wtfQxKupT3mVr26aVGqi9E3QnwCYFj aGKLTLGTOxv458ZDrGkf/8ihJh9ti71z0Rl3atxnmw6N5Ivf5sKGZiCvTq6x7ZRdil+t Jfj5/b9QlTFicm+AbJ67ja49sQ0kxTwXdbsHYvttiyeu3qdMHAuUwSbe+B4e35K4S73x 11CGyucEGLiDxlaXGEXEJzqqoPZ7l6CijBEduaFXFGsK2lGpzX10Lb1kiDzxO1wnDX0u e4Za11Zoebx/8bNx7qP9NqphncpRPR5OG2VxtuBpuQkJFxBEj3CIhPAimkDhenqhvcqb D9xg==
X-Gm-Message-State: AOAM533xJd1U+5GUsvqnGfYAo2lFRinXIOM0ZYpjjir70P07rUk/5vLF T89Z5bOXEfERdF9acW1/JdEaEZb1xKEe6wAIEMfUvQ==
X-Google-Smtp-Source: ABdhPJxH/HqS+G5GBqm+yKu4jMDCitUXmM9vfKrQrri07ZDctemW3mR08ksVVJAWQCkw40evRQWJFL2ViDHTtKwMYus=
X-Received: by 2002:a19:3f87:: with SMTP id m129mr1467533lfa.44.1597094397138; Mon, 10 Aug 2020 14:19:57 -0700 (PDT)
MIME-Version: 1.0
References: <AM7PR07MB6248D2079B3637B626198C43A04B0@AM7PR07MB6248.eurprd07.prod.outlook.com> <20200805164820.rv35b74xhc4v7qrx@anna.jacobs.jacobs-university.de> <6125f3e3-0caf-ed25-92b7-bdb644c54d08@lightside-instruments.com> <9F39EC3C-CCEB-4079-BF83-D9C163773757@cisco.com> <FC05AC44-6BFF-49FC-85E0-BB9692C210AC@gmail.com> <MWHPR08MB26371DDCCC2EDFB48B20E6389B490@MWHPR08MB2637.namprd08.prod.outlook.com> <AM7PR07MB6248EC738F85099B58FAAE82A0440@AM7PR07MB6248.eurprd07.prod.outlook.com> <CY4PR08MB2632EEF50D014D7F0FB2FD8D9B440@CY4PR08MB2632.namprd08.prod.outlook.com> <20200810205638.ltwgumpuwohfz5vg@anna.jacobs.jacobs-university.de>
In-Reply-To: <20200810205638.ltwgumpuwohfz5vg@anna.jacobs.jacobs-university.de>
From: Andy Bierman <andy@yumaworks.com>
Date: Mon, 10 Aug 2020 14:19:45 -0700
Message-ID: <CABCOCHRddTYfkDOk9OdaNEYCeMpVSrbFnYUwpRyTwPN4SMHb2Q@mail.gmail.com>
To: Juergen Schoenwaelder <j.schoenwaelder@jacobs-university.de>, "Sterne, Jason (Nokia - CA/Ottawa)" <jason.sterne@nokia.com>, tom petch <ietfc@btconnect.com>, Mahesh Jethanandani <mjethanandani@gmail.com>, "netmod@ietf.org" <netmod@ietf.org>
Content-Type: multipart/alternative; boundary="00000000000036f2d405ac8c84b0"
Archived-At: <https://mailarchive.ietf.org/arch/msg/netmod/Et7gkSvN_bw7faHPYrAueT9Ob_g>
Subject: Re: [netmod] submodules the hidden benefits
X-BeenThere: netmod@ietf.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: NETMOD WG list <netmod.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/netmod>, <mailto:netmod-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/netmod/>
List-Post: <mailto:netmod@ietf.org>
List-Help: <mailto:netmod-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/netmod>, <mailto:netmod-request@ietf.org?subject=subscribe>
X-List-Received-Date: Mon, 10 Aug 2020 21:20:02 -0000

On Mon, Aug 10, 2020 at 1:56 PM Juergen Schoenwaelder <
j.schoenwaelder@jacobs-university.de> wrote:

> There are generic preprocessors such as good old cpp or m4 that can do
> wonderful things if there is a need to split large (YANG module) files
> into smaller pieces. The question here is what the added benefit is to
> build sub-modules into YANG itself. The argument I have heard is that
> this allows separate compilation of the sub-modules but even then I am
> not sure how well this works in practice and whether it is worth to
> save some CPU or IO time on developer machines. Perhaps someone can
> post concrete numbers that show the savings that can be obtained...
>
>
It is not possible in YANG 1.1 to compile a single submodule.
YANG allows the use of identifiers from other submodules without any
include-stmts.
It is not possible to compile (or read) a single submodule without the main
module and
all the correct revisions of the other submodules.

In this way submodules make readability much worse than imported modules.




> /js
>

Andy


>
> On Mon, Aug 10, 2020 at 08:08:02PM +0000, Sterne, Jason (Nokia -
> CA/Ottawa) wrote:
> > Thanks Tom.
> >
> > Versioning in current YANG specs and in the new versioning work has
> independent versioning available for modules and for sub-modules. The
> module version will always bump when something changes in a submodule, but
> each submodule has its own revision. So it can help consumers quickly see
> which parts of a large schema have and haven't changed.
> >
> > I agree that certain ways of dividing up modules, using groupings, etc
> can help or hinder readability. But I think that is orthogonal to
> submodules. YANG authors can make good or bad (*) readability decisions in
> a schema with submodules or a schema without submodules.  If a schema is
> divided up at the top level of a tree into submodules, then that is just as
> readable IMO as a large data model being divided up the same way into
> individual modules.  i.e. you can have your bgp module, your interfaces
> module, etc OR you can have your bgp submodule, your interfaces submodule,
> etc.
> >
> > (*) good vs bad is often pretty subjective and there are sometimes
> tradeoffs amongst readability, consistency, maintainability, etc. But again
> that is all orthogonal to submodules vs modules IMO.
> >
> > Rgds,
> > Jason
> >
> > > -----Original Message-----
> > > From: tom petch <ietfc@btconnect.com>
> > > Sent: Monday, August 10, 2020 5:23 AM
> > > To: Sterne, Jason (Nokia - CA/Ottawa) <jason.sterne@nokia.com>om>; Mahesh
> > > Jethanandani <mjethanandani@gmail.com>om>; netmod@ietf.org
> > > Subject: Re: [netmod] submodules the hidden benefits
> > >
> > > From: netmod <netmod-bounces@ietf.org> on behalf of Sterne, Jason
> (Nokia -
> > > CA/Ottawa) <jason.sterne@nokia.com>
> > > Sent: 07 August 2020 22:40
> > >
> > > I agree submodules can cause confusion, but I also agree with Mahesh
> that
> > > they can be useful to partition things for people using the modules.
> Especially
> > > for huge models (e.g. router vendor models). You can jump right to a
> > > subsection of the data (a bit like a document with chapters rather
> than one
> > > huge chapter).
> > >
> > > It can also be useful for consumers of the models for versioning (when
> you
> > > want to avoid multiple namespaces). If a model is made up of 30
> sub-modules,
> > > it might be useful to know that the "bgp" part changed while the other
> parts of
> > > the model didn't.
> > >
> > > <tp>
> > >
> > > Jason,
> > >
> > > Jan commented earlier that versioning happens at the module/namespace
> level
> > > in which case it would seem to me that all submodules will by
> definition have
> > > the same version so you cannot tell which submodules have changed,,
> > >
> > > I think too that there is a fallacy in the belief that dividing up
> something large
> > > makes it easier to use, understand etc.  Divide up code by procedure,
> > > subroutine etc and if you can provide a parameter or two input, and
> one or two
> > > results output, and all the complexity of data structures, validation,
> algorithms
> > > etc and hidden out of sight, then you have simplified.   But DDL is
> not like that.
> > > With a grouping or submodule, you need to know the internals, of what
> objects
> > > there are, how they are structured, what semantics they have, pretty
> much
> > > everything inside; it is just harder to find, to reference, to access
> because it has
> > > been wrapped up in something that gets in the way and tucked out of
> sight in
> > > some part of the I-D,
> > > Rather simplification comes from having the right structure in the
> model, which
> > > some WG are good at,
> > >
> > > Tom Petch
> > >
> > > Jason
> > >
> > > From: netmod <netmod-bounces@ietf.org> On Behalf Of Mahesh
> Jethanandani
> > > Sent: Wednesday, August 5, 2020 6:43 PM
> > > To: netmod@ietf.org
> > > Subject: Re: [netmod] submodules the hidden benefits
> > >
> > > A contrarian view:
> > >
> > > I find the use of sub-modules helpful when I want to use separate
> files to
> > > maintain part of the module that is logically separate, while
> > > maintaining/restricting the use of them to a single namespace.
> > > The fact that tools have a problem with trying to compile a sub-module
> can be
> > > addressed in the tools themselves.
> > >
> > >
> > > On Aug 5, 2020, at 2:44 PM, Reshad Rahman (rrahman)
> > > <rrahman=40cisco.com@dmarc.ietf.org<mailto:rrahman=40cisco.com@dmarc.i
> > > etf.org>> wrote:
> > >
> > > Indeed
> > > https://github.com/netmod-wg/yang-next/issues/26
> > >
> > > ´╗┐On 2020-08-05, 5:22 PM, "netmod on behalf of Vladimir Vassilev"
> <netmod-
> > > bounces@ietf.org on behalf of vladimir@lightside-
> > > instruments.com<mailto:netmod-
> > > bounces@ietf.org%20on%20behalf%20of%20vladimir@lightside-
> > > instruments.com>> wrote:
> > >
> > >    On 05/08/2020 18.48, Juergen Schoenwaelder wrote:
> > >
> > >
> > > I personally meanwhile believe that sub-modules add complexity with
> > > little extra value but this view surely is not shared by others.
> > >
> > >    +1. IMO removing sub-modules from YANG 2.0 should be on the list of
> > >    proposed changes.
> > >
> > >    /Vladimir
> > >
> > >    _______________________________________________
> > >    netmod mailing list
> > >    netmod@ietf.org<mailto:netmod@ietf.org>
> > >    https://www.ietf.org/mailman/listinfo/netmod
> > >
> > > _______________________________________________
> > > netmod mailing list
> > > netmod@ietf.org<mailto:netmod@ietf.org>
> > > https://www.ietf.org/mailman/listinfo/netmod
> >
> > _______________________________________________
> > netmod mailing list
> > netmod@ietf.org
> > https://www.ietf.org/mailman/listinfo/netmod
>
> --
> Juergen Schoenwaelder           Jacobs University Bremen gGmbH
> Phone: +49 421 200 3587         Campus Ring 1 | 28759 Bremen | Germany
> Fax:   +49 421 200 3103         <https://www.jacobs-university.de/>
>
> _______________________________________________
> netmod mailing list
> netmod@ietf.org
> https://www.ietf.org/mailman/listinfo/netmod
>