Re: [netmod] Request to review the YANG compiler annotations draft.

Vinod Kumar <vinods.kumar@gmail.com> Mon, 04 July 2016 09:19 UTC

Return-Path: <vinods.kumar@gmail.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 F30AB12B051 for <netmod@ietfa.amsl.com>; Mon, 4 Jul 2016 02:19:30 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.699
X-Spam-Level:
X-Spam-Status: No, score=-2.699 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_LOW=-0.7, SPF_PASS=-0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.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 lyS3BD_ORfmO for <netmod@ietfa.amsl.com>; Mon, 4 Jul 2016 02:19:28 -0700 (PDT)
Received: from mail-yw0-x233.google.com (mail-yw0-x233.google.com [IPv6:2607:f8b0:4002:c05::233]) (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 D97A212B049 for <netmod@ietf.org>; Mon, 4 Jul 2016 02:19:27 -0700 (PDT)
Received: by mail-yw0-x233.google.com with SMTP id i12so35383460ywa.1 for <netmod@ietf.org>; Mon, 04 Jul 2016 02:19:27 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=JZJZCAZLsCPbZ6kHdU/AI9dtmEf7Zr2dIb29CcncvWM=; b=S/8CjuITZ5L6X/DpvZE8vls21DPDCRU4W0o8KTZy3YBwGUcDjBCqjqzCgN+jtgqo2N zvIg5doF/vexGXx6L1jRJlrB8Fe1pOjDO6UuI2Q2gKQCdXyDTophJXT8++Rys31OugJJ PD/uI9+u01TCPT42BCrq38qd2oWqNTYjOUqLKHkJ9raKE4Brl4VPqoEqdqGWGIVRsylH wKVuTPaUyVdF2sELDCf6h0vdCiRhmD40M9YEpWD6/1bxUExJSAJv4A6LEnmyKoVr948H DLESj9RCmkoxuSrk21Ma0sWgWG8sB9YMAXLpfm+pDnnUjVGVazZ4rB/p98O7Y9Ib6PjQ +9kw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=JZJZCAZLsCPbZ6kHdU/AI9dtmEf7Zr2dIb29CcncvWM=; b=eGQbvz9/s3tSwVbc7K7QzGn0s7orIjdh34P6pUIixMfB72qTKdtjdke70ljIN0a0et VquSkDNdBAhpYEnPr99syfu+4tdANRKs82eU2gM0Pj8EEhO9CCaI0JqJd559Wc0UvZXb HjdUKr5JZxXxGGZ1kRN2c3i0jcCwDdUoGEv+2M5SdTqv7HLYAsAhwsKNYGHYKpqmyLt3 XaFoiUSsb89lZnJS2WGbUFoq0NMvWpA5fchZwIGXiVinz7m+RTqW7fQ1CzP1njMsGo5R SJDotN52W0jsQy8X+3wxCroNsziQcsAkI8CqHdp0eJlznnubEMF0rct9ZIs0ngTk1A6O rmPA==
X-Gm-Message-State: ALyK8tKb61wHze7lJeiqsezeYNb0u4GO2tNOrpN6Z1qaEEGQWjyH/Qga5IBWEGH2QT/oViG6JlcVp1MTR8aFpw==
X-Received: by 10.129.43.84 with SMTP id r81mr7086446ywr.283.1467623967028; Mon, 04 Jul 2016 02:19:27 -0700 (PDT)
MIME-Version: 1.0
Received: by 10.37.111.198 with HTTP; Mon, 4 Jul 2016 02:19:26 -0700 (PDT)
In-Reply-To: <CABCOCHQxMVtVzj99QKD89LTWwpdAk72dArMuS5VHw2EpZ17Mqw@mail.gmail.com>
References: <25452548.1467414626550.JavaMail.wam@elwamui-little.atl.sa.earthlink.net> <CABCOCHQxMVtVzj99QKD89LTWwpdAk72dArMuS5VHw2EpZ17Mqw@mail.gmail.com>
From: Vinod Kumar <vinods.kumar@gmail.com>
Date: Mon, 04 Jul 2016 14:49:26 +0530
Message-ID: <CAJtQF=nrmRLqhtjhTvXNCB0f5GMDUD98GkGToJT+eFyka7uozg@mail.gmail.com>
To: Andy Bierman <andy@yumaworks.com>, Randy Presuhn <randy_presuhn@mindspring.com>, Martin Bjorklund <mbj@tail-f.com>
Content-Type: multipart/alternative; boundary="001a11413a523819a00536cbd5f9"
Archived-At: <https://mailarchive.ietf.org/arch/msg/netmod/IWoL9PjkpYzG-gom5KH3CeH9oA4>
Cc: netmod@ietf.org
Subject: Re: [netmod] Request to review the YANG compiler annotations draft.
X-BeenThere: netmod@ietf.org
X-Mailman-Version: 2.1.17
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, 04 Jul 2016 09:19:31 -0000

Dear All,

Thanks to all of you for your review and valuable suggestions/comments.

We would like to bring some more points to give you more information about
the background of requirement and purpose.

*Background*
We are handling YANG Utilities (YANG compiler) in ONOS which automates
application development using YANG. Here we see a gap wherein YANG doesn't
support data organization as required by application. Hence we see a
requirement for YANG to support different flavors of data organization.

*Need for Standard*
We wanted to address this gap, in a standardized way, so that it is NOT
compiler / tools specific. This enables applications to be portable across
platforms, for example, applications can be portable across controllers
(like ONOS / ODL) without any additional effort with respect to data
organization.

*Views on received suggestions/comments*
We accept the mechanism of decorating YANG modules/submodules with
annotations is NOT a correct approach, as pointed out, there are
maintenance issues.
As suggested, we can choose one of the alternative which defines the
annotations in separate module/sub-module. For Example: similar to augment,
we can use the compiler-annotation extension to have an argument, which
identifies the target node which is being annotated.

ca:compiler-annotation /candidate-servers/server{
  ca:app-data-structure{
    ca:data-structure="map";
    ca:key="name";
  }
  ca:app-derived{
    ca:extended-name="special-server";
  }
}


Kindly let us know your opinion/feedback on the same.


Thanks and Regards,

Vinod Kumar S.



On Sat, Jul 2, 2016 at 5:23 AM, Andy Bierman <andy@yumaworks.com> wrote:

>
>
> On Fri, Jul 1, 2016 at 4:10 PM, Randy Presuhn <
> randy_presuhn@mindspring.com> wrote:
>
>> Hi -
>>
>> Some lessons learned from annotating SMI files for code generation
>> are probably applicable here.
>>    (1) doing annotations "in-line", regardless of the grammatical
>>        tricks used to support those annotations, is problematic
>>        from a software configuration management perspective.
>>          (a) as new versions of the module definition appear,
>>              it becomes necessary to "re-apply" annotations.
>>              This is particularly a nuisance when different
>>              organizations are involved.
>>          (b) when the same module needs to be annotated in
>>              different ways for different purposes, as when used
>>              in multiple products built using different development
>>              environments.
>>
>>
>
> This is why commercial SDKs support separate annotations,
> deviations, and module/submodule files.  Ideally the module sources are
> common across all platforms, but annotations and deviations can be platform
> and revision specific.
>
> I understand the need for standard extensions like nacm:default-deny-all
> that are tied to a standard module, but not tool-specific annotations.
>
>
>    (2) As others have already mentioned, working within the
>>        language framework for annotation syntax is a big win
>>        *if* you're doing annotations in-line, but see (1).
>>
>>
> YANG allows either inline or separate module (sort of)
>
>
> Side issue...
>
> We use the deviation statement to patch in extensions same as other
> deviations.
> That's why I do not like all the text in 7.20.3 about deviating from the
> standard and
> 'server does not implement faithfully'.
>
> https://tools.ietf.org/html/draft-ietf-netmod-rfc6020bis-14#section-7.20.3
>
> The ABNF allows the following, so the RFC text is wrong:
>
>    deviation /if:interfaces/if:interface {
>        deviate add {
>             ncx:sil-delete-children-first;
>         }
>     }
>
> This does not alter the conformance requirements at all.
>
>
>
>> Randy
>>
>
>
> Andy
>
>
>>
>> -----Original Message-----
>>
>> From: Vinod Kumar
>>
>> Sent: Jul 1, 2016 6:21 AM
>>
>> To: Martin Bjorklund
>>
>> Cc: "vinods.kumar@huawei.com" , "Anil Kumar S N (VRP Network BL)" ,
>> Gaurav Agarwal , netmod@ietf.org
>>
>> Subject: Re: [netmod] Request to review the YANG compiler annotations
>> draft.
>>
>>
>>
>> Dear Martin,
>>     Thanks for your valuable comments.
>>     Initially we also wanted to define them as individual extensions and
>> use them in the YANG file as indicated by you.
>>     Below are some reasons, which compelled us to add them as a separate
>> annotations(metadata) in YANG file.
>>     - These extensions are not required while defining the schema, it is
>> only required while implementing a schema in a server or client. It is used
>> by applications to instruct the YANG utilities or compilers to automate the
>> application development related to data organization / processing.    -
>> These extension are of internal scope, and should be masked while server
>> advertises its schema resources.    - These extension values for a given
>> YANG file may not match in server and client.
>>     We felt that annotating is a good option, similar to other languages
>> where-in by looking at annotation itself utilities/compilers can perform
>> additional functionality as instructed.
>>     As you have pointed out, it is not a valid YANG 1.0, so we can modify
>> it as extensions to be compatible.
>>    We feel that annotation (compiler) support in YANG is an important
>> requirement which needs to be standardized for all compiler implementation,
>> hence we believe there is a need to incorporate annotations in YANG 2.0.
>> Looking forward for your opinion/feedback.
>> Thanks and Regards,Vinod Kumar S.
>> On Fri, Jul 1, 2016 at 2:10 PM, Martin Bjorklund <mbj@tail-f.com> wrote:
>> "vinods.kumar" <vinods.kumar@huawei.com> wrote:
>>
>> > Dear All,
>>
>> >
>>
>> >     We have written a draft, to add annotation in YANG definition which
>> can
>>
>> > be used by the YANG compilers.
>>
>> >
>>
>> > We are implementing these drafts as a reference implementation in the
>> IETF
>>
>> > 96 hackathon on ONOS YANG utilities.
>>
>> >
>>
>> > Request you to review the below drafts and provide your
>> comments/feedback.
>>
>> >
>>
>> > Draft(s):
>>
>> >
>> https://datatracker.ietf.org/doc/draft-agv-netmod-yang-compiler-metadata/
>>
>> >
>>
>> >
>>
>> >
>> https://datatracker.ietf.org/doc/draft-agv-netmod-yang-annotation-ds-and-der
>>
>> > ived/
>>
>>
>>
>> I have looked at these drafts.  I have two high-level comments.
>>
>>
>>
>>   1)  What you propose is not valid YANG.  This new syntax would
>>
>>       require a new version of the YANG language.
>>
>>
>>
>>   2)  What you propose is not necessary; it can be done (and is being
>>
>>       done in several existing implementations) with current YANG
>>
>>       syntax and semantics, with normal YANG extension statements.
>>
>>
>>
>>       For example, the draft proposes this:
>>
>>
>>
>>        list server {
>>
>>          ca:compiler-annotation{
>>
>>            @MappedCollection(collection-type='map', map-key='name')
>>
>>            @OverrideImpl('DefaultServer');
>>
>>          }
>>
>>          ...
>>
>>
>>
>>       It can be done today as:
>>
>>
>>
>>         list server {
>>
>>            xx:mapped-collection {
>>
>>              xx:collection-type map;
>>
>>              xx:map-key name;
>>
>>            }
>>
>>            xx:override-impl DefaultServer;
>>
>>            ...
>>
>>
>>
>>
>>
>> /martin
>>
>>
>>
>> _______________________________________________
>>
>> netmod mailing list
>>
>> netmod@ietf.org
>>
>> https://www.ietf.org/mailman/listinfo/netmod
>>
>> _______________________________________________
>> netmod mailing list
>> netmod@ietf.org
>> https://www.ietf.org/mailman/listinfo/netmod
>>
>
>
> _______________________________________________
> netmod mailing list
> netmod@ietf.org
> https://www.ietf.org/mailman/listinfo/netmod
>
>