All of lore.kernel.org
 help / color / mirror / Atom feed
* Re: [SPDK] About dump/load (or export/edit/import) JSON file by SPDK
@ 2018-02-09 19:48 Wodkowski, PawelX
  0 siblings, 0 replies; 14+ messages in thread
From: Wodkowski, PawelX @ 2018-02-09 19:48 UTC (permalink / raw)
  To: spdk

[-- Attachment #1: Type: text/plain, Size: 5657 bytes --]

Hi Shuhei,

I saw trello board you created. This is a great start to describe what we can do in SPDK RPC topic for next release.

About the “Doing” list and “SPDK Monitor like QEMU QMP” card (https://trello.com/c/CPq9jcyG/14-spdk-monitor-like-qemu-qmp):
I noticed your comment there about many things to do. I feel a bit lost there. Which part of that card you are currently working on? Can we split this card to smaller tasks that each of us can handle? Or, if you are handling this as a whole, I will take one of the TO DO item.

As an offtopic: can you attend to our next community meeting? It would be great to discuss this.

Pawel

From: SPDK [mailto:spdk-bounces(a)lists.01.org] On Behalf Of ???? / MATSUMOTO,SHUUHEI
Sent: Monday, February 5, 2018 10:05 AM
To: spdk(a)lists.01.org
Subject: Re: [SPDK] About dump/load (or export/edit/import) JSON file by SPDK


Hi Jim, Pawel, Daniel, Ben, and All



Thank you so much for your really really helpful feedback.

My motivation was first and I will develop my ability to go forward together with you.



First I created the board "JSON Configuration File" and tried to include your feedback.

https://trello.com/b/lMJIrv91/json-configuration-file
Trello<https://trello.com/b/lMJIrv91/json-configuration-file>
trello.com
Organize anything, together. Trello is a collaboration tool that organizes your projects into boards. In one glance, know what's being worked on, who's working on what, and where something is in a process.

If you find anything not covered yet or not described correctly, please update it.

In particular I'm happy for your any feedback about how to preserve ordering of requests.
https://trello.com/c/Vy02q59e/3-preserve-ordering-of-the-list-of-json-rpc-requests-in-json-config-file
Trello<https://trello.com/c/Vy02q59e/3-preserve-ordering-of-the-list-of-json-rpc-requests-in-json-config-file>
trello.com
Organize anything, together. Trello is a collaboration tool that organizes your projects into boards. In one glance, know what's being worked on, who's working on what, and where something is in a process.



Besides, I'll have a presentation in the upcoming SPDK china summit. If you are OK, I would like to include JSON config file even just a little bit because we may be able to get any feedback helpful to go forward.

Thank you,
Shuhei


________________________________
差出人: SPDK <spdk-bounces(a)lists.01.org<mailto:spdk-bounces(a)lists.01.org>> が Walker, Benjamin <benjamin.walker(a)intel.com<mailto:benjamin.walker(a)intel.com>> の代理で送信
送信日時: 2018年2月3日 2:48
宛先: spdk(a)lists.01.org<mailto:spdk(a)lists.01.org>
件名: [!]Re: [SPDK] About dump/load (or export/edit/import) JSON file by SPDK

On Fri, 2018-02-02 at 10:24 -0700, Daniel Verkamp wrote:
> I agree that we definitely want to be able to have comments in the
> configuration file.
>
> We already have support for (non-standard) JavaScript-style // and /* */
> comments in our JSON parser; it just needs to be enabled with the
> SPDK_JSON_PARSE_FLAG_ALLOW_COMMENTS flag.
>
> However, if we make the config file parser an external Python tool, we would
> probably need something like JSON-minify to remove the comments first (or a
> JSON parser that has non-standard comment support).

I think the top level object should be a JSON list which contains the already-
defined RPC calls. The 'id' and 'jsonrpc' fields can be omitted and
automatically inserted by the config file parser. JavaScript-style comments
should be allowed, which can be removed using JSON-minify. I'm glad this is the
consensus that's emerging - it should make this really easy to use.

> I like the idea of having an external tool (possibly written in Python) that
> loads the JSON config file and sends RPC requests one at a time through the
> existing JSON-RPC interface; that keeps the SPDK library code modifications to
> a minimum.

I agree with this one. Let's just write a simple Python script that loads the
config file (json.loads), then iterates through the list of RPC commands and
sends them one by one using the regular interface.


On Fri, 2018-02-02 at 01:22 +0000, 松本周平 / MATSUMOTO,SHUUHEI wrote:
> We should keep the current config file implementation for compatibility?
> Or is it OK to replace the whole to the new one once everything is prepared?

We need to have some level of backward compatibility, at least for a full
release cycle, in my opinion. I see two options:

1) Leave the current config file parsing in our code. Add the ability to dump
JSON-RPC config files in response to SIGUSR (which is planned anyway). If the
user passes a config file on the command line, print out a big deprecation
warning, but otherwise continue. This gives users the ability to load up their
old configuration file, then dump the new JSON-RPC format. After a release
cycle, we can delete support for parsing the old config file. At that point, if
someone needs to use an old config file they can always go back to the release
that supported both formats and use it as a converter.

2) Write a Python script that converts the old config format into the new JSON
format. This allows us to delete the current config parsing code immediately and
provide the conversion utility with every release going forward. My only concern
with this approach is it may not be trivial to do the conversion, but I could be
wrong.
_______________________________________________
SPDK mailing list
SPDK(a)lists.01.org<mailto:SPDK(a)lists.01.org>
https://lists.01.org/mailman/listinfo/spdk

[-- Attachment #2: attachment.html --]
[-- Type: text/html, Size: 19990 bytes --]

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [SPDK] About dump/load (or export/edit/import) JSON file by SPDK
@ 2018-02-13  7:00 
  0 siblings, 0 replies; 14+ messages in thread
From:  @ 2018-02-13  7:00 UTC (permalink / raw)
  To: spdk

[-- Attachment #1: Type: text/plain, Size: 7613 bytes --]

Hi Pawel and All,


I split the large one into smaller pieces and added into the Dong list of Trello.

https://trello.com/b/lMJIrv91/json-configuration-file

Trello<https://trello.com/b/lMJIrv91/json-configuration-file>
trello.com
Organize anything, together. Trello is a collaboration tool that organizes your projects into boards. In one glance, know what's being worked on, who's working on what, and where something is in a process.

I have not picked up any particular one yet.
I would appreciate for your any feedback and hope if we can talk in the next meeting.

Thank you,

Shuhei


________________________________
差出人: 松本周平 / MATSUMOTO,SHUUHEI
送信日時: 2018年2月13日 11:15
宛先: Storage Performance Development Kit
件名: RE: [SPDK] About dump/load (or export/edit/import) JSON file by SPDK


Hi Pawel,


Thank you so much for your cooperation.


As you said, my card does not cover a lot of basic and important things to do, I never think I can handle this as a whole, I know the idea of JSON config have been already shared among the community, and it will be great if we can go together.


Honestly I'm still investigating and learning about this card and I have not started anything except for a couple of patches already submitted to the Gerrit.


I'll try to do split this card to smaller tasks and I'm happy if I can talk with you in the community meeting.


When the next meeting will be held?  I would like to join it. WeWe and Paul are asking it too.


Thank you,

Shuhei

________________________________
差出人: SPDK <spdk-bounces(a)lists.01.org> が Wodkowski, PawelX <pawelx.wodkowski(a)intel.com> の代理で送信
送信日時: 2018年2月10日 4:48
宛先: Storage Performance Development Kit
件名: [!]Re: [SPDK] About dump/load (or export/edit/import) JSON file by SPDK


Hi Shuhei,



I saw trello board you created. This is a great start to describe what we can do in SPDK RPC topic for next release.



About the “Doing” list and “SPDK Monitor like QEMU QMP” card (https://trello.com/c/CPq9jcyG/14-spdk-monitor-like-qemu-qmp):

I noticed your comment there about many things to do. I feel a bit lost there. Which part of that card you are currently working on? Can we split this card to smaller tasks that each of us can handle? Or, if you are handling this as a whole, I will take one of the TO DO item.



As an offtopic: can you attend to our next community meeting? It would be great to discuss this.



Pawel



From: SPDK [mailto:spdk-bounces(a)lists.01.org] On Behalf Of ???? / MATSUMOTO,SHUUHEI
Sent: Monday, February 5, 2018 10:05 AM
To: spdk(a)lists.01.org
Subject: Re: [SPDK] About dump/load (or export/edit/import) JSON file by SPDK



Hi Jim, Pawel, Daniel, Ben, and All



Thank you so much for your really really helpful feedback.

My motivation was first and I will develop my ability to go forward together with you.



First I created the board "JSON Configuration File" and tried to include your feedback.

https://trello.com/b/lMJIrv91/json-configuration-file

Trello<https://trello.com/b/lMJIrv91/json-configuration-file>

trello.com

Organize anything, together. Trello is a collaboration tool that organizes your projects into boards. In one glance, know what's being worked on, who's working on what, and where something is in a process.


If you find anything not covered yet or not described correctly, please update it.



In particular I'm happy for your any feedback about how to preserve ordering of requests.

https://trello.com/c/Vy02q59e/3-preserve-ordering-of-the-list-of-json-rpc-requests-in-json-config-file

Trello<https://trello.com/c/Vy02q59e/3-preserve-ordering-of-the-list-of-json-rpc-requests-in-json-config-file>

trello.com

Organize anything, together. Trello is a collaboration tool that organizes your projects into boards. In one glance, know what's being worked on, who's working on what, and where something is in a process.






Besides, I'll have a presentation in the upcoming SPDK china summit. If you are OK, I would like to include JSON config file even just a little bit because we may be able to get any feedback helpful to go forward.



Thank you,

Shuhei





________________________________

差出人: SPDK <spdk-bounces(a)lists.01.org<mailto:spdk-bounces(a)lists.01.org>> が Walker, Benjamin <benjamin.walker(a)intel.com<mailto:benjamin.walker(a)intel.com>> の代理で送信
送信日時: 2018年2月3日 2:48
宛先: spdk(a)lists.01.org<mailto:spdk(a)lists.01.org>
件名: [!]Re: [SPDK] About dump/load (or export/edit/import) JSON file by SPDK



On Fri, 2018-02-02 at 10:24 -0700, Daniel Verkamp wrote:
> I agree that we definitely want to be able to have comments in the
> configuration file.
>
> We already have support for (non-standard) JavaScript-style // and /* */
> comments in our JSON parser; it just needs to be enabled with the
> SPDK_JSON_PARSE_FLAG_ALLOW_COMMENTS flag.
>
> However, if we make the config file parser an external Python tool, we would
> probably need something like JSON-minify to remove the comments first (or a
> JSON parser that has non-standard comment support).

I think the top level object should be a JSON list which contains the already-
defined RPC calls. The 'id' and 'jsonrpc' fields can be omitted and
automatically inserted by the config file parser. JavaScript-style comments
should be allowed, which can be removed using JSON-minify. I'm glad this is the
consensus that's emerging - it should make this really easy to use.

> I like the idea of having an external tool (possibly written in Python) that
> loads the JSON config file and sends RPC requests one at a time through the
> existing JSON-RPC interface; that keeps the SPDK library code modifications to
> a minimum.

I agree with this one. Let's just write a simple Python script that loads the
config file (json.loads), then iterates through the list of RPC commands and
sends them one by one using the regular interface.


On Fri, 2018-02-02 at 01:22 +0000, 松本周平 / MATSUMOTO,SHUUHEI wrote:
> We should keep the current config file implementation for compatibility?
> Or is it OK to replace the whole to the new one once everything is prepared?

We need to have some level of backward compatibility, at least for a full
release cycle, in my opinion. I see two options:

1) Leave the current config file parsing in our code. Add the ability to dump
JSON-RPC config files in response to SIGUSR (which is planned anyway). If the
user passes a config file on the command line, print out a big deprecation
warning, but otherwise continue. This gives users the ability to load up their
old configuration file, then dump the new JSON-RPC format. After a release
cycle, we can delete support for parsing the old config file. At that point, if
someone needs to use an old config file they can always go back to the release
that supported both formats and use it as a converter.

2) Write a Python script that converts the old config format into the new JSON
format. This allows us to delete the current config parsing code immediately and
provide the conversion utility with every release going forward. My only concern
with this approach is it may not be trivial to do the conversion, but I could be
wrong.
_______________________________________________
SPDK mailing list
SPDK(a)lists.01.org<mailto:SPDK(a)lists.01.org>
https://lists.01.org/mailman/listinfo/spdk

[-- Attachment #2: attachment.html --]
[-- Type: text/html, Size: 25224 bytes --]

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [SPDK] About dump/load (or export/edit/import) JSON file by SPDK
@ 2018-02-13  2:15 
  0 siblings, 0 replies; 14+ messages in thread
From:  @ 2018-02-13  2:15 UTC (permalink / raw)
  To: spdk

[-- Attachment #1: Type: text/plain, Size: 6757 bytes --]

Hi Pawel,


Thank you so much for your cooperation.


As you said, my card does not cover a lot of basic and important things to do, I never think I can handle this as a whole, I know the idea of JSON config have been already shared among the community, and it will be great if we can go together.


Honestly I'm still investigating and learning about this card and I have not started anything except for a couple of patches already submitted to the Gerrit.


I'll try to do split this card to smaller tasks and I'm happy if I can talk with you in the community meeting.


When the next meeting will be held?  I would like to join it. WeWe and Paul are asking it too.


Thank you,

Shuhei

________________________________
差出人: SPDK <spdk-bounces(a)lists.01.org> が Wodkowski, PawelX <pawelx.wodkowski(a)intel.com> の代理で送信
送信日時: 2018年2月10日 4:48
宛先: Storage Performance Development Kit
件名: [!]Re: [SPDK] About dump/load (or export/edit/import) JSON file by SPDK


Hi Shuhei,



I saw trello board you created. This is a great start to describe what we can do in SPDK RPC topic for next release.



About the “Doing” list and “SPDK Monitor like QEMU QMP” card (https://trello.com/c/CPq9jcyG/14-spdk-monitor-like-qemu-qmp):

I noticed your comment there about many things to do. I feel a bit lost there. Which part of that card you are currently working on? Can we split this card to smaller tasks that each of us can handle? Or, if you are handling this as a whole, I will take one of the TO DO item.



As an offtopic: can you attend to our next community meeting? It would be great to discuss this.



Pawel



From: SPDK [mailto:spdk-bounces(a)lists.01.org] On Behalf Of ???? / MATSUMOTO,SHUUHEI
Sent: Monday, February 5, 2018 10:05 AM
To: spdk(a)lists.01.org
Subject: Re: [SPDK] About dump/load (or export/edit/import) JSON file by SPDK



Hi Jim, Pawel, Daniel, Ben, and All



Thank you so much for your really really helpful feedback.

My motivation was first and I will develop my ability to go forward together with you.



First I created the board "JSON Configuration File" and tried to include your feedback.

https://trello.com/b/lMJIrv91/json-configuration-file

Trello<https://trello.com/b/lMJIrv91/json-configuration-file>

trello.com

Organize anything, together. Trello is a collaboration tool that organizes your projects into boards. In one glance, know what's being worked on, who's working on what, and where something is in a process.


If you find anything not covered yet or not described correctly, please update it.



In particular I'm happy for your any feedback about how to preserve ordering of requests.

https://trello.com/c/Vy02q59e/3-preserve-ordering-of-the-list-of-json-rpc-requests-in-json-config-file

Trello<https://trello.com/c/Vy02q59e/3-preserve-ordering-of-the-list-of-json-rpc-requests-in-json-config-file>

trello.com

Organize anything, together. Trello is a collaboration tool that organizes your projects into boards. In one glance, know what's being worked on, who's working on what, and where something is in a process.






Besides, I'll have a presentation in the upcoming SPDK china summit. If you are OK, I would like to include JSON config file even just a little bit because we may be able to get any feedback helpful to go forward.



Thank you,

Shuhei





________________________________

差出人: SPDK <spdk-bounces(a)lists.01.org<mailto:spdk-bounces(a)lists.01.org>> が Walker, Benjamin <benjamin.walker(a)intel.com<mailto:benjamin.walker(a)intel.com>> の代理で送信
送信日時: 2018年2月3日 2:48
宛先: spdk(a)lists.01.org<mailto:spdk(a)lists.01.org>
件名: [!]Re: [SPDK] About dump/load (or export/edit/import) JSON file by SPDK



On Fri, 2018-02-02 at 10:24 -0700, Daniel Verkamp wrote:
> I agree that we definitely want to be able to have comments in the
> configuration file.
>
> We already have support for (non-standard) JavaScript-style // and /* */
> comments in our JSON parser; it just needs to be enabled with the
> SPDK_JSON_PARSE_FLAG_ALLOW_COMMENTS flag.
>
> However, if we make the config file parser an external Python tool, we would
> probably need something like JSON-minify to remove the comments first (or a
> JSON parser that has non-standard comment support).

I think the top level object should be a JSON list which contains the already-
defined RPC calls. The 'id' and 'jsonrpc' fields can be omitted and
automatically inserted by the config file parser. JavaScript-style comments
should be allowed, which can be removed using JSON-minify. I'm glad this is the
consensus that's emerging - it should make this really easy to use.

> I like the idea of having an external tool (possibly written in Python) that
> loads the JSON config file and sends RPC requests one at a time through the
> existing JSON-RPC interface; that keeps the SPDK library code modifications to
> a minimum.

I agree with this one. Let's just write a simple Python script that loads the
config file (json.loads), then iterates through the list of RPC commands and
sends them one by one using the regular interface.


On Fri, 2018-02-02 at 01:22 +0000, 松本周平 / MATSUMOTO,SHUUHEI wrote:
> We should keep the current config file implementation for compatibility?
> Or is it OK to replace the whole to the new one once everything is prepared?

We need to have some level of backward compatibility, at least for a full
release cycle, in my opinion. I see two options:

1) Leave the current config file parsing in our code. Add the ability to dump
JSON-RPC config files in response to SIGUSR (which is planned anyway). If the
user passes a config file on the command line, print out a big deprecation
warning, but otherwise continue. This gives users the ability to load up their
old configuration file, then dump the new JSON-RPC format. After a release
cycle, we can delete support for parsing the old config file. At that point, if
someone needs to use an old config file they can always go back to the release
that supported both formats and use it as a converter.

2) Write a Python script that converts the old config format into the new JSON
format. This allows us to delete the current config parsing code immediately and
provide the conversion utility with every release going forward. My only concern
with this approach is it may not be trivial to do the conversion, but I could be
wrong.
_______________________________________________
SPDK mailing list
SPDK(a)lists.01.org<mailto:SPDK(a)lists.01.org>
https://lists.01.org/mailman/listinfo/spdk

[-- Attachment #2: attachment.html --]
[-- Type: text/html, Size: 19559 bytes --]

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [SPDK] About dump/load (or export/edit/import) JSON file by SPDK
@ 2018-02-05  9:04 
  0 siblings, 0 replies; 14+ messages in thread
From:  @ 2018-02-05  9:04 UTC (permalink / raw)
  To: spdk

[-- Attachment #1: Type: text/plain, Size: 4637 bytes --]

Hi Jim, Pawel, Daniel, Ben, and All


Thank you so much for your really really helpful feedback.

My motivation was first and I will develop my ability to go forward together with you.


First I created the board "JSON Configuration File" and tried to include your feedback.

https://trello.com/b/lMJIrv91/json-configuration-file

Trello<https://trello.com/b/lMJIrv91/json-configuration-file>
trello.com
Organize anything, together. Trello is a collaboration tool that organizes your projects into boards. In one glance, know what's being worked on, who's working on what, and where something is in a process.

If you find anything not covered yet or not described correctly, please update it.

In particular I'm happy for your any feedback about how to preserve ordering of requests.
https://trello.com/c/Vy02q59e/3-preserve-ordering-of-the-list-of-json-rpc-requests-in-json-config-file
Trello<https://trello.com/c/Vy02q59e/3-preserve-ordering-of-the-list-of-json-rpc-requests-in-json-config-file>
trello.com
Organize anything, together. Trello is a collaboration tool that organizes your projects into boards. In one glance, know what's being worked on, who's working on what, and where something is in a process.



Besides, I'll have a presentation in the upcoming SPDK china summit. If you are OK, I would like to include JSON config file even just a little bit because we may be able to get any feedback helpful to go forward.

Thank you,
Shuhei



________________________________
差出人: SPDK <spdk-bounces(a)lists.01.org> が Walker, Benjamin <benjamin.walker(a)intel.com> の代理で送信
送信日時: 2018年2月3日 2:48
宛先: spdk(a)lists.01.org
件名: [!]Re: [SPDK] About dump/load (or export/edit/import) JSON file by SPDK

On Fri, 2018-02-02 at 10:24 -0700, Daniel Verkamp wrote:
> I agree that we definitely want to be able to have comments in the
> configuration file.
>
> We already have support for (non-standard) JavaScript-style // and /* */
> comments in our JSON parser; it just needs to be enabled with the
> SPDK_JSON_PARSE_FLAG_ALLOW_COMMENTS flag.
>
> However, if we make the config file parser an external Python tool, we would
> probably need something like JSON-minify to remove the comments first (or a
> JSON parser that has non-standard comment support).

I think the top level object should be a JSON list which contains the already-
defined RPC calls. The 'id' and 'jsonrpc' fields can be omitted and
automatically inserted by the config file parser. JavaScript-style comments
should be allowed, which can be removed using JSON-minify. I'm glad this is the
consensus that's emerging - it should make this really easy to use.

> I like the idea of having an external tool (possibly written in Python) that
> loads the JSON config file and sends RPC requests one at a time through the
> existing JSON-RPC interface; that keeps the SPDK library code modifications to
> a minimum.

I agree with this one. Let's just write a simple Python script that loads the
config file (json.loads), then iterates through the list of RPC commands and
sends them one by one using the regular interface.


On Fri, 2018-02-02 at 01:22 +0000, 松本周平 / MATSUMOTO,SHUUHEI wrote:
> We should keep the current config file implementation for compatibility?
> Or is it OK to replace the whole to the new one once everything is prepared?

We need to have some level of backward compatibility, at least for a full
release cycle, in my opinion. I see two options:

1) Leave the current config file parsing in our code. Add the ability to dump
JSON-RPC config files in response to SIGUSR (which is planned anyway). If the
user passes a config file on the command line, print out a big deprecation
warning, but otherwise continue. This gives users the ability to load up their
old configuration file, then dump the new JSON-RPC format. After a release
cycle, we can delete support for parsing the old config file. At that point, if
someone needs to use an old config file they can always go back to the release
that supported both formats and use it as a converter.

2) Write a Python script that converts the old config format into the new JSON
format. This allows us to delete the current config parsing code immediately and
provide the conversion utility with every release going forward. My only concern
with this approach is it may not be trivial to do the conversion, but I could be
wrong.
_______________________________________________
SPDK mailing list
SPDK(a)lists.01.org
https://lists.01.org/mailman/listinfo/spdk

[-- Attachment #2: attachment.html --]
[-- Type: text/html, Size: 13870 bytes --]

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [SPDK] About dump/load (or export/edit/import) JSON file by SPDK
@ 2018-02-02 17:48 Walker, Benjamin
  0 siblings, 0 replies; 14+ messages in thread
From: Walker, Benjamin @ 2018-02-02 17:48 UTC (permalink / raw)
  To: spdk

[-- Attachment #1: Type: text/plain, Size: 2719 bytes --]

On Fri, 2018-02-02 at 10:24 -0700, Daniel Verkamp wrote:
> I agree that we definitely want to be able to have comments in the
> configuration file.
> 
> We already have support for (non-standard) JavaScript-style // and /* */
> comments in our JSON parser; it just needs to be enabled with the
> SPDK_JSON_PARSE_FLAG_ALLOW_COMMENTS flag.
> 
> However, if we make the config file parser an external Python tool, we would
> probably need something like JSON-minify to remove the comments first (or a
> JSON parser that has non-standard comment support).

I think the top level object should be a JSON list which contains the already-
defined RPC calls. The 'id' and 'jsonrpc' fields can be omitted and
automatically inserted by the config file parser. JavaScript-style comments
should be allowed, which can be removed using JSON-minify. I'm glad this is the
consensus that's emerging - it should make this really easy to use.

> I like the idea of having an external tool (possibly written in Python) that
> loads the JSON config file and sends RPC requests one at a time through the
> existing JSON-RPC interface; that keeps the SPDK library code modifications to
> a minimum.

I agree with this one. Let's just write a simple Python script that loads the
config file (json.loads), then iterates through the list of RPC commands and
sends them one by one using the regular interface.


On Fri, 2018-02-02 at 01:22 +0000, 松本周平 / MATSUMOTO,SHUUHEI wrote:
> We should keep the current config file implementation for compatibility?
> Or is it OK to replace the whole to the new one once everything is prepared?

We need to have some level of backward compatibility, at least for a full
release cycle, in my opinion. I see two options:

1) Leave the current config file parsing in our code. Add the ability to dump
JSON-RPC config files in response to SIGUSR (which is planned anyway). If the
user passes a config file on the command line, print out a big deprecation
warning, but otherwise continue. This gives users the ability to load up their
old configuration file, then dump the new JSON-RPC format. After a release
cycle, we can delete support for parsing the old config file. At that point, if
someone needs to use an old config file they can always go back to the release
that supported both formats and use it as a converter.

2) Write a Python script that converts the old config format into the new JSON
format. This allows us to delete the current config parsing code immediately and
provide the conversion utility with every release going forward. My only concern
with this approach is it may not be trivial to do the conversion, but I could be
wrong.

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [SPDK] About dump/load (or export/edit/import) JSON file by SPDK
@ 2018-02-02 17:24 Daniel Verkamp
  0 siblings, 0 replies; 14+ messages in thread
From: Daniel Verkamp @ 2018-02-02 17:24 UTC (permalink / raw)
  To: spdk

[-- Attachment #1: Type: text/plain, Size: 3962 bytes --]

On 02/02/2018 09:25 AM, Harris, James R wrote:
> *From: *SPDK <spdk-bounces(a)lists.01.org> on behalf of "Wodkowski, PawelX" <pawelx.wodkowski(a)intel.com>
> *Reply-To: *Storage Performance Development Kit <spdk(a)lists.01.org>
> *Date: *Friday, February 2, 2018 at 7:19 AM
> *To: *Storage Performance Development Kit <spdk(a)lists.01.org>
> *Subject: *Re: [SPDK] About dump/load (or export/edit/import) JSON file by SPDK
> 
> About your questions:
>> - the top layer of a JSON configuration file is a JSON object
> 
> I vote for this
> 
> I agree – making the JSON configuration file a JSON object seems like a good idea.
> 
> I would like to consider allowing comments + something like JSON-minify though.  https://github.com/getify/JSON.minify/tree/python
> 
> I’d love Daniel’s input on this – 50/50 chance he’ll either like the minify idea, or will flame me for suggesting it.

I agree that we definitely want to be able to have comments in the configuration file.

We already have support for (non-standard) JavaScript-style // and /* */ comments in our JSON parser; it just needs to be enabled with the SPDK_JSON_PARSE_FLAG_ALLOW_COMMENTS flag.

However, if we make the config file parser an external Python tool, we would probably need something like JSON-minify to remove the comments first (or a JSON parser that has non-standard comment support).

>> - the object has the following key-value pairs:
> 
>>  - key = "apptype", value = "name of application type",
> 
> I don’t see any value in adding this. If we decide to merge all apps into one capable of serving iSCSI, vhost,
> NVMeF what to do with this type of field. It will be dead anyway.
> 
> I agree with Pawel here.  I could see cases for testing where we may even describe the configuration using multiple JSON-RPC files.  For example, one configuration file to construct a bunch of block devices that are common across a bunch of different tests.  Then each test could provide a second configuration file that only provides specifics for the upper layer target (iSCSI, NVMe-oF, vhost, etc.)
> 
>>  - key = "jsonrpc", value = "2.0",
>>  - key = "sequence", value = an array of request objects which is made of ID, method, and params
>>  - Currently ID of JSON-RPC request is always 1.
>>  - Change it to the sequence number of each JSON-RPC request to call JSON-RPC requests in order.
> 
> User app might want to read many config files as well want to save config of each subsystem to different file.
> 
> I would vote against embedding “jsonrpc”, “id” etc in any JSON config file. Only data needed to fully restore
> application configuration should be needed in JSON config file.

Agreed, the jsonrpc and id fields shouldn't be necessary in the config file dump format.  "id" is only really useful for interactive RPC use where multiple requests are submitted at once; the "id" can be used to match up responses to requests, but in the config file case, we can submit the requests one at a time.

>> Do you think any general metadata should be included in the file or just sequence of requests is enough?
> 
> For other “metadata” reported by RPC calls there could be some additional call like “get_info”.
> 
> I think a sequence of requests is enough – plus ability to add comments in the JSON.
> 
> I think a new RPC that accepts a batch of other JSON-RPC objects would be challenging from an error handling perspective.  For example, what happens if the 4^th RPC out of a batch of 20 fails?  Sure – we could try to define a protocol for this but I think having the client just send one RPC at a time is sufficient for now.

I like the idea of having an external tool (possibly written in Python) that loads the JSON config file and sends RPC requests one at a time through the existing JSON-RPC interface; that keeps the SPDK library code modifications to a minimum.

Thanks,
-- Daniel

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [SPDK] About dump/load (or export/edit/import) JSON file by SPDK
@ 2018-02-02 16:25 Harris, James R
  0 siblings, 0 replies; 14+ messages in thread
From: Harris, James R @ 2018-02-02 16:25 UTC (permalink / raw)
  To: spdk

[-- Attachment #1: Type: text/plain, Size: 12873 bytes --]



From: SPDK <spdk-bounces(a)lists.01.org> on behalf of "Wodkowski, PawelX" <pawelx.wodkowski(a)intel.com>
Reply-To: Storage Performance Development Kit <spdk(a)lists.01.org>
Date: Friday, February 2, 2018 at 7:19 AM
To: Storage Performance Development Kit <spdk(a)lists.01.org>
Subject: Re: [SPDK] About dump/load (or export/edit/import) JSON file by SPDK

Hi Shuhei,

<trim>

About your questions:


> - the top layer of a JSON configuration file is a JSON object

I vote for this



I agree – making the JSON configuration file a JSON object seems like a good idea.



I would like to consider allowing comments + something like JSON-minify though.  https://github.com/getify/JSON.minify/tree/python



I’d love Daniel’s input on this – 50/50 chance he’ll either like the minify idea, or will flame me for suggesting it.



> - the object has the following key-value pairs:

>  - key = "apptype", value = "name of application type",

I don’t see any value in adding this. If we decide to merge all apps into one capable of serving iSCSI, vhost,

NVMeF what to do with this type of field. It will be dead anyway.



I agree with Pawel here.  I could see cases for testing where we may even describe the configuration using multiple JSON-RPC files.  For example, one configuration file to construct a bunch of block devices that are common across a bunch of different tests.  Then each test could provide a second configuration file that only provides specifics for the upper layer target (iSCSI, NVMe-oF, vhost, etc.)



>  - key = "jsonrpc", value = "2.0",

>  - key = "sequence", value = an array of request objects which is made of ID, method, and params

>  - Currently ID of JSON-RPC request is always 1.

>  - Change it to the sequence number of each JSON-RPC request to call JSON-RPC requests in order.

User app might want to read many config files as well want to save config of each subsystem to different file.

I would vote against embedding “jsonrpc”, “id” etc in any JSON config file. Only data needed to fully restore

application configuration should be needed in JSON config file.

> Do you think any general metadata should be included in the file or just sequence of requests is enough?
For other “metadata” reported by RPC calls there could be some additional call like “get_info”.

I think a sequence of requests is enough – plus ability to add comments in the JSON.

I think a new RPC that accepts a batch of other JSON-RPC objects would be challenging from an error handling perspective.  For example, what happens if the 4th RPC out of a batch of 20 fails?  Sure – we could try to define a protocol for this but I think having the client just send one RPC at a time is sufficient for now.

I don’t hide that I’m under impression of the QEMU QMP and QAPI. They did excellent work in similar area,
maybe we could base our JSON(-RPC) API on their ideas in some way. What do you think?

And last topic: are we ready to describe those changes on trello?

Yes – I think starting to get some details in Trello would be excellent.

Regarding Shuhei’s question on maintaining old INI config file capability – yes, we will need to keep both for some period of time.  We will need to officially deprecate the INI config file format first, but cannot do that until JSON-RPC configuration is fully functional.  If JSON-RPC is fully functional for the 18.04 release, we could deprecate it for 18.04 and remove it in 18.07 possibly or more likely 18.10.

Paweł

From: SPDK [mailto:spdk-bounces(a)lists.01.org] On Behalf Of ???? / MATSUMOTO,SHUUHEI
Sent: Friday, February 2, 2018 10:04 AM
To: Storage Performance Development Kit <spdk(a)lists.01.org>
Subject: Re: [SPDK] About dump/load (or export/edit/import) JSON file by SPDK


Hi Jim, Daniel and All,



I found another questions and would like to put them on the discussion in this week.



The batch request format may be better as the format of JSON config file.


[
    { "jsonrpc": "2.0", "id": 1, "method": "add_portal_group", "params": { ... } },
    { "jsonrpc": "2.0", "id": 2, "method": "add_portal_group", "params": { ... } }
]

Do you think any general metadata should be included in the file or just sequence of requests is enough?

Additionally do you think which is reasonable? I think the former is enough for now.
- batch requests is managed by the python RPC client and the python RPC client send one of each.
- SPDK support batch requests and the python RPC client send batch requests, SPDK RPC handler processes one of each.

Any of your feedback is valuable.

Thank you,
Shuhei

________________________________
差出人: SPDK <spdk-bounces(a)lists.01.org<mailto:spdk-bounces(a)lists.01.org>> が 松本周平 / MATSUMOTO,SHUUHEI <shuhei.matsumoto.xt(a)hitachi.com<mailto:shuhei.matsumoto.xt(a)hitachi.com>> の代理で送信
送信日時: 2018年2月2日 10:22
宛先: Storage Performance Development Kit
件名: [!]Re: [SPDK] About dump/load (or export/edit/import) JSON file by SPDK


Hi Jim and All,



Sorry I forgot to bring an item onto the discussion.



We should keep the current config file implementation for compatibility?

Or is it OK to replace the whole to the new one once everything is prepared?



Thank you,

Shuhei

________________________________
差出人: 松本周平 / MATSUMOTO,SHUUHEI
送信日時: 2018年2月2日 10:12:23
宛先: Storage Performance Development Kit
件名: RE: [SPDK] About dump/load (or export/edit/import) JSON file by SPDK


Hi Jim and All,



Thank you for valuable feedback to go forward.

Based on your feedback, I'm happy if we can share the idea of the format of the SPDK JSON configuration file.



One key question is whether the configuration file should be a set of JSON objects which are just SPDK JSON-RPC requests, or if they are set of some new type of SPDK JSON objects.



My thought is that a JSON configuration file could just be a sequence of JSON-RPC requests.  Each SPDK subsystem/module would need to know how to generate a sequence of JSON-RPC requests to rebuild its current state.  This would be similar to the get_running_config() routines that many of the subsystems and modules have today which generate an INI config file when a process receives a USR1 signal.

Make sense to me. How do you think the following:



- the top layer of a JSON configuration file is a JSON object

- the object has the following key-value pairs:

  - key = "apptype", value = "name of application type",

  - key = "jsonrpc", value = "2.0",

  - key = "sequence", value = an array of request objects which is made of ID, method, and params

  - Currently ID of JSON-RPC request is always 1.

  - Change it to the sequence number of each JSON-RPC request to call JSON-RPC requests in order.


{
    "apptype": "iscsi-tgt",
    "jsonrpc": "2.0",
    "sequence" : [
        {
            "id": 1,
            "method": "add_portal_group",
            "params": {
                "tag": 2,
                "portals": [
                    {
                        "host": "192.168.2,21",
                        "port": "3260"
                    }
                ]
            }
        },
        {
            "id": 2,
            "method": "add_portal_group",
            "params": {
                "tag": 2,
                "portals": [
                    {
                        "host": "192.168.2,22",
                        "port": "3260"
                    }
                ]
            }
        },
    ]
}


I think this should be straightforward.  spdk_app_start() and spdk_subsystem_init() currently use the following order:

1)      Initialize subsystems

2)      Initialize RPC

3)      Start reactors



It basically needs to change to:

1)      Initialize RPC

2)      Start reactors

3)      Initialize subsystems

Thank you, very clear for me now.





However I think only python implementation is not enough and  importing/exporting JSON file by SPDK C library will be valuable at least

- for unit tests

- for iSCSI CHAP shared secret file. (Sending secrets written in plain text by RPC is not comfortable for me.)

Yes – I agree, we will want a small C library that could read the JSON-RPC objects and execute them internally.
OK, I got it.

Thank you,
Shuhei



________________________________
差出人: SPDK <spdk-bounces(a)lists.01.org<mailto:spdk-bounces(a)lists.01.org>> が Harris, James R <james.r.harris(a)intel.com<mailto:james.r.harris(a)intel.com>> の代理で送信
送信日時: 2018年2月2日 6:00
宛先: Storage Performance Development Kit
件名: [!]Re: [SPDK] About dump/load (or export/edit/import) JSON file by SPDK


Hi Shuhei,



Thank you for starting this discussion – I have some comments inline below.



-Jim





From: SPDK <spdk-bounces(a)lists.01.org<mailto:spdk-bounces(a)lists.01.org>> on behalf of 松本周平 / MATSUMOTO,SHUUHEI <shuhei.matsumoto.xt(a)hitachi.com<mailto:shuhei.matsumoto.xt(a)hitachi.com>>
Reply-To: Storage Performance Development Kit <spdk(a)lists.01.org<mailto:spdk(a)lists.01.org>>
Date: Wednesday, January 31, 2018 at 6:13 PM
To: "spdk(a)lists.01.org<mailto:spdk(a)lists.01.org>" <spdk(a)lists.01.org<mailto:spdk(a)lists.01.org>>
Subject: [SPDK] About dump/load (or export/edit/import) JSON file by SPDK



Hi All,



As you know, current variant of INI configuration file is dated and SPDK have great JSON-RPC stack.



I think as KVM utilize effectively XML configuration file well, utilizing JSON configuration file will be valuable for SPDK.

By doing this SPDK will be able to have persistent configuration by itself.



As long as I investigate, now SPDK support
(1) create and dump JSON object to fixed size JSON-RPC buffer
(2) load JSON object from JSON-RPC and then parse/convert it to a spdk_json_vals table to decode it



Adding the following may be helpful:

(3) create and dump JSON object to resizable string buffer and then to file/fd
(4) load JSON object from file/fd and then parse/convert it to a spdk_json_vals table to decode it



About (3), having pretty print function in which indent/newlines/whitespace can be tuned will be desirable.



One key question is whether the configuration file should be a set of JSON objects which are just SPDK JSON-RPC requests, or if they are set of some new type of SPDK JSON objects.



My thought is that a JSON configuration file could just be a sequence of JSON-RPC requests.  Each SPDK subsystem/module would need to know how to generate a sequence of JSON-RPC requests to rebuild its current state.  This would be similar to the get_running_config() routines that many of the subsystems and modules have today which generate an INI config file when a process receives a USR1 signal.



Furthermore,
I would like to add the following in Python JSON-RPC code,
(5) for reply, dump response to JSON file
(6) for send, load JSON file to Python object, and convert (dump) to JSON object request, and then send to SPDK.

((3) and (5)) or ((4) and (6)) may be duplicated each other, respectively,
and the following approach make sense as I talked with Jim shortly.

- SPDK start only JSON-RPC first
- and then SPDK python handles all configuration files



I think this should be straightforward.  spdk_app_start() and spdk_subsystem_init() currently use the following order:

1)      Initialize subsystems

2)      Initialize RPC

3)      Start reactors



It basically needs to change to:

1)      Initialize RPC

2)      Start reactors

3)      Initialize subsystems



Where step #3 (initialize subsystems) is triggered by a new RPC.



However I think only python implementation is not enough and  importing/exporting JSON file by SPDK C library will be valuable at least

- for unit tests

- for iSCSI CHAP shared secret file. (Sending secrets written in plain text by RPC is not comfortable for me.)



Yes – I agree, we will want a small C library that could read the JSON-RPC objects and execute them internally.

I can't say I have mastered JSON but as long as I read and learn JSON and SPDK's JSON implementation,
we will be able to do the above without difficulty.



The first major use case may be to replace SPDK subsystem's config dump function from the variant of INI format to JSON format.



I would like to post patch one by one or series of patches if prepared but discussion in Trello first may be better because each will have own idea in this area.



I'm happy for your any feedback.



Best Regards,

Shuhei



[-- Attachment #2: attachment.html --]
[-- Type: text/html, Size: 50541 bytes --]

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [SPDK] About dump/load (or export/edit/import) JSON file by SPDK
@ 2018-02-02 14:19 Wodkowski, PawelX
  0 siblings, 0 replies; 14+ messages in thread
From: Wodkowski, PawelX @ 2018-02-02 14:19 UTC (permalink / raw)
  To: spdk

[-- Attachment #1: Type: text/plain, Size: 11877 bytes --]

Hi Shuhei,

Those incoming changes in RPC are great. I would like aid you with this work. I just want to give some thoughts I got:

Can we describe schema for each command first? All JSON API would be more readable and consistent.
Why? This enable other languages for interacting with SPDK (other than C and python) more easily.
Python, ruby, java etc would benefit from such schema. Also I am aware of some other tasks that
might benefit from such schema: SPDK target-cli and py-spdk client<https://trello.com/c/Bn3DIG7F/87-add-py-spdk-client-for-spdk>.


Example schema for add_portal_group:
#
# Description of structure.
#
{
‘struct’ : ‘iScsiPortal’,
‘data’ : {
‘host’ : ‘str’,
‘port’ : ‘int’
‘cpumask’ : ‘spdk_cpuset’
}
}

#
# Description & example of command.
#
{
'method': ‘add_portal_group’,
'params': { 'tag': 'int', ‘portals’ : [ ‘iScsiPortal’ ]  },
'result': 'bool'
}

This could be used to write/generate JSON load/save handlers which will be used by JSON-RPC server and Config load/save to file.

About your questions:


> - the top layer of a JSON configuration file is a JSON object

I vote for this



> - the object has the following key-value pairs:

>  - key = "apptype", value = "name of application type",

I don’t see any value in adding this. If we decide to merge all apps into one capable of serving iSCSI, vhost,

NVMeF what to do with this type of field. It will be dead anyway.



>  - key = "jsonrpc", value = "2.0",

>  - key = "sequence", value = an array of request objects which is made of ID, method, and params

>  - Currently ID of JSON-RPC request is always 1.

>  - Change it to the sequence number of each JSON-RPC request to call JSON-RPC requests in order.

User app might want to read many config files as well want to save config of each subsystem to different file.

I would vote against embedding “jsonrpc”, “id” etc in any JSON config file. Only data needed to fully restore

application configuration should be needed in JSON config file.

> Do you think any general metadata should be included in the file or just sequence of requests is enough?
For other “metadata” reported by RPC calls there could be some additional call like “get_info”.

I don’t hide that I’m under impression of the QEMU QMP and QAPI. They did excellent work in similar area,
maybe we could base our JSON(-RPC) API on their ideas in some way. What do you think?

And last topic: are we ready to describe those changes on trello?

Paweł

From: SPDK [mailto:spdk-bounces(a)lists.01.org] On Behalf Of ???? / MATSUMOTO,SHUUHEI
Sent: Friday, February 2, 2018 10:04 AM
To: Storage Performance Development Kit <spdk(a)lists.01.org>
Subject: Re: [SPDK] About dump/load (or export/edit/import) JSON file by SPDK


Hi Jim, Daniel and All,



I found another questions and would like to put them on the discussion in this week.



The batch request format may be better as the format of JSON config file.


[
    { "jsonrpc": "2.0", "id": 1, "method": "add_portal_group", "params": { ... } },
    { "jsonrpc": "2.0", "id": 2, "method": "add_portal_group", "params": { ... } }
]

Do you think any general metadata should be included in the file or just sequence of requests is enough?

Additionally do you think which is reasonable? I think the former is enough for now.
- batch requests is managed by the python RPC client and the python RPC client send one of each.
- SPDK support batch requests and the python RPC client send batch requests, SPDK RPC handler processes one of each.

Any of your feedback is valuable.

Thank you,
Shuhei

________________________________
差出人: SPDK <spdk-bounces(a)lists.01.org<mailto:spdk-bounces(a)lists.01.org>> が 松本周平 / MATSUMOTO,SHUUHEI <shuhei.matsumoto.xt(a)hitachi.com<mailto:shuhei.matsumoto.xt(a)hitachi.com>> の代理で送信
送信日時: 2018年2月2日 10:22
宛先: Storage Performance Development Kit
件名: [!]Re: [SPDK] About dump/load (or export/edit/import) JSON file by SPDK


Hi Jim and All,



Sorry I forgot to bring an item onto the discussion.



We should keep the current config file implementation for compatibility?

Or is it OK to replace the whole to the new one once everything is prepared?



Thank you,

Shuhei

________________________________
差出人: 松本周平 / MATSUMOTO,SHUUHEI
送信日時: 2018年2月2日 10:12:23
宛先: Storage Performance Development Kit
件名: RE: [SPDK] About dump/load (or export/edit/import) JSON file by SPDK


Hi Jim and All,



Thank you for valuable feedback to go forward.

Based on your feedback, I'm happy if we can share the idea of the format of the SPDK JSON configuration file.



One key question is whether the configuration file should be a set of JSON objects which are just SPDK JSON-RPC requests, or if they are set of some new type of SPDK JSON objects.



My thought is that a JSON configuration file could just be a sequence of JSON-RPC requests.  Each SPDK subsystem/module would need to know how to generate a sequence of JSON-RPC requests to rebuild its current state.  This would be similar to the get_running_config() routines that many of the subsystems and modules have today which generate an INI config file when a process receives a USR1 signal.

Make sense to me. How do you think the following:



- the top layer of a JSON configuration file is a JSON object

- the object has the following key-value pairs:

  - key = "apptype", value = "name of application type",

  - key = "jsonrpc", value = "2.0",

  - key = "sequence", value = an array of request objects which is made of ID, method, and params

  - Currently ID of JSON-RPC request is always 1.

  - Change it to the sequence number of each JSON-RPC request to call JSON-RPC requests in order.


{
    "apptype": "iscsi-tgt",
    "jsonrpc": "2.0",
    "sequence" : [
        {
            "id": 1,
            "method": "add_portal_group",
            "params": {
                "tag": 2,
                "portals": [
                    {
                        "host": "192.168.2,21",
                        "port": "3260"
                    }
                ]
            }
        },
        {
            "id": 2,
            "method": "add_portal_group",
            "params": {
                "tag": 2,
                "portals": [
                    {
                        "host": "192.168.2,22",
                        "port": "3260"
                    }
                ]
            }
        },
    ]
}


I think this should be straightforward.  spdk_app_start() and spdk_subsystem_init() currently use the following order:

1)      Initialize subsystems

2)      Initialize RPC

3)      Start reactors



It basically needs to change to:

1)      Initialize RPC

2)      Start reactors

3)      Initialize subsystems

Thank you, very clear for me now.





However I think only python implementation is not enough and  importing/exporting JSON file by SPDK C library will be valuable at least

- for unit tests

- for iSCSI CHAP shared secret file. (Sending secrets written in plain text by RPC is not comfortable for me.)

Yes - I agree, we will want a small C library that could read the JSON-RPC objects and execute them internally.
OK, I got it.

Thank you,
Shuhei



________________________________
差出人: SPDK <spdk-bounces(a)lists.01.org<mailto:spdk-bounces(a)lists.01.org>> が Harris, James R <james.r.harris(a)intel.com<mailto:james.r.harris(a)intel.com>> の代理で送信
送信日時: 2018年2月2日 6:00
宛先: Storage Performance Development Kit
件名: [!]Re: [SPDK] About dump/load (or export/edit/import) JSON file by SPDK


Hi Shuhei,



Thank you for starting this discussion - I have some comments inline below.



-Jim





From: SPDK <spdk-bounces(a)lists.01.org<mailto:spdk-bounces(a)lists.01.org>> on behalf of 松本周平 / MATSUMOTO,SHUUHEI <shuhei.matsumoto.xt(a)hitachi.com<mailto:shuhei.matsumoto.xt(a)hitachi.com>>
Reply-To: Storage Performance Development Kit <spdk(a)lists.01.org<mailto:spdk(a)lists.01.org>>
Date: Wednesday, January 31, 2018 at 6:13 PM
To: "spdk(a)lists.01.org<mailto:spdk(a)lists.01.org>" <spdk(a)lists.01.org<mailto:spdk(a)lists.01.org>>
Subject: [SPDK] About dump/load (or export/edit/import) JSON file by SPDK



Hi All,



As you know, current variant of INI configuration file is dated and SPDK have great JSON-RPC stack.



I think as KVM utilize effectively XML configuration file well, utilizing JSON configuration file will be valuable for SPDK.

By doing this SPDK will be able to have persistent configuration by itself.



As long as I investigate, now SPDK support
(1) create and dump JSON object to fixed size JSON-RPC buffer
(2) load JSON object from JSON-RPC and then parse/convert it to a spdk_json_vals table to decode it



Adding the following may be helpful:

(3) create and dump JSON object to resizable string buffer and then to file/fd
(4) load JSON object from file/fd and then parse/convert it to a spdk_json_vals table to decode it



About (3), having pretty print function in which indent/newlines/whitespace can be tuned will be desirable.



One key question is whether the configuration file should be a set of JSON objects which are just SPDK JSON-RPC requests, or if they are set of some new type of SPDK JSON objects.



My thought is that a JSON configuration file could just be a sequence of JSON-RPC requests.  Each SPDK subsystem/module would need to know how to generate a sequence of JSON-RPC requests to rebuild its current state.  This would be similar to the get_running_config() routines that many of the subsystems and modules have today which generate an INI config file when a process receives a USR1 signal.



Furthermore,
I would like to add the following in Python JSON-RPC code,
(5) for reply, dump response to JSON file
(6) for send, load JSON file to Python object, and convert (dump) to JSON object request, and then send to SPDK.

((3) and (5)) or ((4) and (6)) may be duplicated each other, respectively,
and the following approach make sense as I talked with Jim shortly.

- SPDK start only JSON-RPC first
- and then SPDK python handles all configuration files



I think this should be straightforward.  spdk_app_start() and spdk_subsystem_init() currently use the following order:

1)      Initialize subsystems

2)      Initialize RPC

3)      Start reactors



It basically needs to change to:

1)      Initialize RPC

2)      Start reactors

3)      Initialize subsystems



Where step #3 (initialize subsystems) is triggered by a new RPC.



However I think only python implementation is not enough and  importing/exporting JSON file by SPDK C library will be valuable at least

- for unit tests

- for iSCSI CHAP shared secret file. (Sending secrets written in plain text by RPC is not comfortable for me.)



Yes - I agree, we will want a small C library that could read the JSON-RPC objects and execute them internally.

I can't say I have mastered JSON but as long as I read and learn JSON and SPDK's JSON implementation,
we will be able to do the above without difficulty.



The first major use case may be to replace SPDK subsystem's config dump function from the variant of INI format to JSON format.



I would like to post patch one by one or series of patches if prepared but discussion in Trello first may be better because each will have own idea in this area.



I'm happy for your any feedback.



Best Regards,

Shuhei



[-- Attachment #2: attachment.html --]
[-- Type: text/html, Size: 68670 bytes --]

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [SPDK] About dump/load (or export/edit/import) JSON file by SPDK
@ 2018-02-02  9:04 
  0 siblings, 0 replies; 14+ messages in thread
From:  @ 2018-02-02  9:04 UTC (permalink / raw)
  To: spdk

[-- Attachment #1: Type: text/plain, Size: 8673 bytes --]

Hi Jim, Daniel and All,


I found another questions and would like to put them on the discussion in this week.


The batch request format may be better as the format of JSON config file.


[
    { "jsonrpc": "2.0", "id": 1, "method": "add_portal_group", "params": { ... } },
    { "jsonrpc": "2.0", "id": 2, "method": "add_portal_group", "params": { ... } }
]

Do you think any general metadata should be included in the file or just sequence of requests is enough?

Additionally do you think which is reasonable? I think the former is enough for now.
- batch requests is managed by the python RPC client and the python RPC client send one of each.
- SPDK support batch requests and the python RPC client send batch requests, SPDK RPC handler processes one of each.

Any of your feedback is valuable.

Thank you,
Shuhei

________________________________
差出人: SPDK <spdk-bounces(a)lists.01.org> が 松本周平 / MATSUMOTO,SHUUHEI <shuhei.matsumoto.xt(a)hitachi.com> の代理で送信
送信日�: 2018年2月2日 10:22
宛先: Storage Performance Development Kit
件名: [!]Re: [SPDK] About dump/load (or export/edit/import) JSON file by SPDK


Hi Jim and All,


Sorry I forgot to bring an item onto the discussion.


We should keep the current config file implementation for compatibility?

Or is it OK to replace the whole to the new one once everything is prepared?


Thank you,

Shuhei

________________________________
差出人: 松本周平 / MATSUMOTO,SHUUHEI
送信日�: 2018年2月2日 10:12:23
宛先: Storage Performance Development Kit
件名: RE: [SPDK] About dump/load (or export/edit/import) JSON file by SPDK


Hi Jim and All,


Thank you for valuable feedback to go forward.

Based on your feedback, I'm happy if we can share the idea of the format of the SPDK JSON configuration file.


One key question is whether the configuration file should be a set of JSON objects which are just SPDK JSON-RPC requests, or if they are set of some new type of SPDK JSON objects.



My thought is that a JSON configuration file could just be a sequence of JSON-RPC requests.  Each SPDK subsystem/module would need to know how to generate a sequence of JSON-RPC requests to rebuild its current state.  This would be similar to the get_running_config() routines that many of the subsystems and modules have today which generate an INI config file when a process receives a USR1 signal.

Make sense to me. How do you think the following:


- the top layer of a JSON configuration file is a JSON object

- the object has the following key-value pairs:

  - key = "apptype", value = "name of application type",

  - key = "jsonrpc", value = "2.0",

  - key = "sequence", value = an array of request objects which is made of ID, method, and params

  - Currently ID of JSON-RPC request is always 1.

  - Change it to the sequence number of each JSON-RPC request to call JSON-RPC requests in order.


{
    "apptype": "iscsi-tgt",
    "jsonrpc": "2.0",
    "sequence" : [
        {
            "id": 1,
            "method": "add_portal_group",
            "params": {
                "tag": 2,
                "portals": [
                    {
                        "host": "192.168.2,21",
                        "port": "3260"
                    }
                ]
            }
        },
        {
            "id": 2,
            "method": "add_portal_group",
            "params": {
                "tag": 2,
                "portals": [
                    {
                        "host": "192.168.2,22",
                        "port": "3260"
                    }
                ]
            }
        },
    ]
}


I think this should be straightforward.  spdk_app_start() and spdk_subsystem_init() currently use the following order:

1)      Initialize subsystems

2)      Initialize RPC

3)      Start reactors



It basically needs to change to:

1)      Initialize RPC

2)      Start reactors

3)      Initialize subsystems

Thank you, very clear for me now.



However I think only python implementation is not enough and  importing/exporting JSON file by SPDK C library will be valuable at least

- for unit tests

- for iSCSI CHAP shared secret file. (Sending secrets written in plain text by RPC is not comfortable for me.)

Yes � I agree, we will want a small C library that could read the JSON-RPC objects and execute them internally.

OK, I got it.

Thank you,
Shuhei


________________________________
差出人: SPDK <spdk-bounces(a)lists.01.org> が Harris, James R <james.r.harris(a)intel.com> の代理で送信
送信日�: 2018年2月2日 6:00
宛先: Storage Performance Development Kit
件名: [!]Re: [SPDK] About dump/load (or export/edit/import) JSON file by SPDK


Hi Shuhei,



Thank you for starting this discussion � I have some comments inline below.



-Jim





From: SPDK <spdk-bounces(a)lists.01.org> on behalf of 松本周平 / MATSUMOTO,SHUUHEI <shuhei.matsumoto.xt(a)hitachi.com>
Reply-To: Storage Performance Development Kit <spdk(a)lists.01.org>
Date: Wednesday, January 31, 2018 at 6:13 PM
To: "spdk(a)lists.01.org" <spdk(a)lists.01.org>
Subject: [SPDK] About dump/load (or export/edit/import) JSON file by SPDK



Hi All,



As you know, current variant of INI configuration file is dated and SPDK have great JSON-RPC stack.



I think as KVM utilize effectively XML configuration file well, utilizing JSON configuration file will be valuable for SPDK.

By doing this SPDK will be able to have persistent configuration by itself.



As long as I investigate, now SPDK support
(1) create and dump JSON object to fixed size JSON-RPC buffer
(2) load JSON object from JSON-RPC and then parse/convert it to a spdk_json_vals table to decode it



Adding the following may be helpful:

(3) create and dump JSON object to resizable string buffer and then to file/fd
(4) load JSON object from file/fd and then parse/convert it to a spdk_json_vals table to decode it



About (3), having pretty print function in which indent/newlines/whitespace can be tuned will be desirable.



One key question is whether the configuration file should be a set of JSON objects which are just SPDK JSON-RPC requests, or if they are set of some new type of SPDK JSON objects.



My thought is that a JSON configuration file could just be a sequence of JSON-RPC requests.  Each SPDK subsystem/module would need to know how to generate a sequence of JSON-RPC requests to rebuild its current state.  This would be similar to the get_running_config() routines that many of the subsystems and modules have today which generate an INI config file when a process receives a USR1 signal.



Furthermore,
I would like to add the following in Python JSON-RPC code,
(5) for reply, dump response to JSON file
(6) for send, load JSON file to Python object, and convert (dump) to JSON object request, and then send to SPDK.

((3) and (5)) or ((4) and (6)) may be duplicated each other, respectively,
and the following approach make sense as I talked with Jim shortly.

- SPDK start only JSON-RPC first
- and then SPDK python handles all configuration files



I think this should be straightforward.  spdk_app_start() and spdk_subsystem_init() currently use the following order:

1)      Initialize subsystems

2)      Initialize RPC

3)      Start reactors



It basically needs to change to:

1)      Initialize RPC

2)      Start reactors

3)      Initialize subsystems



Where step #3 (initialize subsystems) is triggered by a new RPC.



However I think only python implementation is not enough and  importing/exporting JSON file by SPDK C library will be valuable at least

- for unit tests

- for iSCSI CHAP shared secret file. (Sending secrets written in plain text by RPC is not comfortable for me.)



Yes � I agree, we will want a small C library that could read the JSON-RPC objects and execute them internally.

I can't say I have mastered JSON but as long as I read and learn JSON and SPDK's JSON implementation,
we will be able to do the above without difficulty.



The first major use case may be to replace SPDK subsystem's config dump function from the variant of INI format to JSON format.



I would like to post patch one by one or series of patches if prepared but discussion in Trello first may be better because each will have own idea in this area.



I'm happy for your any feedback.



Best Regards,

Shuhei



[-- Attachment #2: attachment.html --]
[-- Type: text/html, Size: 26653 bytes --]

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [SPDK] About dump/load (or export/edit/import) JSON file by SPDK
@ 2018-02-02  1:22 
  0 siblings, 0 replies; 14+ messages in thread
From:  @ 2018-02-02  1:22 UTC (permalink / raw)
  To: spdk

[-- Attachment #1: Type: text/plain, Size: 7485 bytes --]

Hi Jim and All,


Sorry I forgot to bring an item onto the discussion.


We should keep the current config file implementation for compatibility?

Or is it OK to replace the whole to the new one once everything is prepared?


Thank you,

Shuhei

________________________________
差出人: 松本周平 / MATSUMOTO,SHUUHEI
送信日�: 2018年2月2日 10:12:23
宛先: Storage Performance Development Kit
件名: RE: [SPDK] About dump/load (or export/edit/import) JSON file by SPDK


Hi Jim and All,


Thank you for valuable feedback to go forward.

Based on your feedback, I'm happy if we can share the idea of the format of the SPDK JSON configuration file.


One key question is whether the configuration file should be a set of JSON objects which are just SPDK JSON-RPC requests, or if they are set of some new type of SPDK JSON objects.



My thought is that a JSON configuration file could just be a sequence of JSON-RPC requests.  Each SPDK subsystem/module would need to know how to generate a sequence of JSON-RPC requests to rebuild its current state.  This would be similar to the get_running_config() routines that many of the subsystems and modules have today which generate an INI config file when a process receives a USR1 signal.

Make sense to me. How do you think the following:


- the top layer of a JSON configuration file is a JSON object

- the object has the following key-value pairs:

  - key = "apptype", value = "name of application type",

  - key = "jsonrpc", value = "2.0",

  - key = "sequence", value = an array of request objects which is made of ID, method, and params

  - Currently ID of JSON-RPC request is always 1.

  - Change it to the sequence number of each JSON-RPC request to call JSON-RPC requests in order.


{
    "apptype": "iscsi-tgt",
    "jsonrpc": "2.0",
    "sequence" : [
        {
            "id": 1,
            "method": "add_portal_group",
            "params": {
                "tag": 2,
                "portals": [
                    {
                        "host": "192.168.2,21",
                        "port": "3260"
                    }
                ]
            }
        },
        {
            "id": 2,
            "method": "add_portal_group",
            "params": {
                "tag": 2,
                "portals": [
                    {
                        "host": "192.168.2,22",
                        "port": "3260"
                    }
                ]
            }
        },
    ]
}


I think this should be straightforward.  spdk_app_start() and spdk_subsystem_init() currently use the following order:

1)      Initialize subsystems

2)      Initialize RPC

3)      Start reactors



It basically needs to change to:

1)      Initialize RPC

2)      Start reactors

3)      Initialize subsystems

Thank you, very clear for me now.



However I think only python implementation is not enough and  importing/exporting JSON file by SPDK C library will be valuable at least

- for unit tests

- for iSCSI CHAP shared secret file. (Sending secrets written in plain text by RPC is not comfortable for me.)

Yes � I agree, we will want a small C library that could read the JSON-RPC objects and execute them internally.

OK, I got it.

Thank you,
Shuhei


________________________________
差出人: SPDK <spdk-bounces(a)lists.01.org> が Harris, James R <james.r.harris(a)intel.com> の代理で送信
送信日�: 2018年2月2日 6:00
宛先: Storage Performance Development Kit
件名: [!]Re: [SPDK] About dump/load (or export/edit/import) JSON file by SPDK


Hi Shuhei,



Thank you for starting this discussion � I have some comments inline below.



-Jim





From: SPDK <spdk-bounces(a)lists.01.org> on behalf of 松本周平 / MATSUMOTO,SHUUHEI <shuhei.matsumoto.xt(a)hitachi.com>
Reply-To: Storage Performance Development Kit <spdk(a)lists.01.org>
Date: Wednesday, January 31, 2018 at 6:13 PM
To: "spdk(a)lists.01.org" <spdk(a)lists.01.org>
Subject: [SPDK] About dump/load (or export/edit/import) JSON file by SPDK



Hi All,



As you know, current variant of INI configuration file is dated and SPDK have great JSON-RPC stack.



I think as KVM utilize effectively XML configuration file well, utilizing JSON configuration file will be valuable for SPDK.

By doing this SPDK will be able to have persistent configuration by itself.



As long as I investigate, now SPDK support
(1) create and dump JSON object to fixed size JSON-RPC buffer
(2) load JSON object from JSON-RPC and then parse/convert it to a spdk_json_vals table to decode it



Adding the following may be helpful:

(3) create and dump JSON object to resizable string buffer and then to file/fd
(4) load JSON object from file/fd and then parse/convert it to a spdk_json_vals table to decode it



About (3), having pretty print function in which indent/newlines/whitespace can be tuned will be desirable.



One key question is whether the configuration file should be a set of JSON objects which are just SPDK JSON-RPC requests, or if they are set of some new type of SPDK JSON objects.



My thought is that a JSON configuration file could just be a sequence of JSON-RPC requests.  Each SPDK subsystem/module would need to know how to generate a sequence of JSON-RPC requests to rebuild its current state.  This would be similar to the get_running_config() routines that many of the subsystems and modules have today which generate an INI config file when a process receives a USR1 signal.



Furthermore,
I would like to add the following in Python JSON-RPC code,
(5) for reply, dump response to JSON file
(6) for send, load JSON file to Python object, and convert (dump) to JSON object request, and then send to SPDK.

((3) and (5)) or ((4) and (6)) may be duplicated each other, respectively,
and the following approach make sense as I talked with Jim shortly.

- SPDK start only JSON-RPC first
- and then SPDK python handles all configuration files



I think this should be straightforward.  spdk_app_start() and spdk_subsystem_init() currently use the following order:

1)      Initialize subsystems

2)      Initialize RPC

3)      Start reactors



It basically needs to change to:

1)      Initialize RPC

2)      Start reactors

3)      Initialize subsystems



Where step #3 (initialize subsystems) is triggered by a new RPC.



However I think only python implementation is not enough and  importing/exporting JSON file by SPDK C library will be valuable at least

- for unit tests

- for iSCSI CHAP shared secret file. (Sending secrets written in plain text by RPC is not comfortable for me.)



Yes � I agree, we will want a small C library that could read the JSON-RPC objects and execute them internally.

I can't say I have mastered JSON but as long as I read and learn JSON and SPDK's JSON implementation,
we will be able to do the above without difficulty.



The first major use case may be to replace SPDK subsystem's config dump function from the variant of INI format to JSON format.



I would like to post patch one by one or series of patches if prepared but discussion in Trello first may be better because each will have own idea in this area.



I'm happy for your any feedback.



Best Regards,

Shuhei



[-- Attachment #2: attachment.html --]
[-- Type: text/html, Size: 21442 bytes --]

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [SPDK] About dump/load (or export/edit/import) JSON file by SPDK
@ 2018-02-02  1:12 
  0 siblings, 0 replies; 14+ messages in thread
From:  @ 2018-02-02  1:12 UTC (permalink / raw)
  To: spdk

[-- Attachment #1: Type: text/plain, Size: 6976 bytes --]

Hi Jim and All,


Thank you for valuable feedback to go forward.

Based on your feedback, I'm happy if we can share the idea of the format of the SPDK JSON configuration file.


One key question is whether the configuration file should be a set of JSON objects which are just SPDK JSON-RPC requests, or if they are set of some new type of SPDK JSON objects.



My thought is that a JSON configuration file could just be a sequence of JSON-RPC requests.  Each SPDK subsystem/module would need to know how to generate a sequence of JSON-RPC requests to rebuild its current state.  This would be similar to the get_running_config() routines that many of the subsystems and modules have today which generate an INI config file when a process receives a USR1 signal.

Make sense to me. How do you think the following:


- the top layer of a JSON configuration file is a JSON object

- the object has the following key-value pairs:

  - key = "apptype", value = "name of application type",

  - key = "jsonrpc", value = "2.0",

  - key = "sequence", value = an array of request objects which is made of ID, method, and params

  - Currently ID of JSON-RPC request is always 1.

  - Change it to the sequence number of each JSON-RPC request to call JSON-RPC requests in order.


{
    "apptype": "iscsi-tgt",
    "jsonrpc": "2.0",
    "sequence" : [
        {
            "id": 1,
            "method": "add_portal_group",
            "params": {
                "tag": 2,
                "portals": [
                    {
                        "host": "192.168.2,21",
                        "port": "3260"
                    }
                ]
            }
        },
        {
            "id": 2,
            "method": "add_portal_group",
            "params": {
                "tag": 2,
                "portals": [
                    {
                        "host": "192.168.2,22",
                        "port": "3260"
                    }
                ]
            }
        },
    ]
}


I think this should be straightforward.  spdk_app_start() and spdk_subsystem_init() currently use the following order:

1)      Initialize subsystems

2)      Initialize RPC

3)      Start reactors



It basically needs to change to:

1)      Initialize RPC

2)      Start reactors

3)      Initialize subsystems

Thank you, very clear for me now.



However I think only python implementation is not enough and  importing/exporting JSON file by SPDK C library will be valuable at least

- for unit tests

- for iSCSI CHAP shared secret file. (Sending secrets written in plain text by RPC is not comfortable for me.)

Yes � I agree, we will want a small C library that could read the JSON-RPC objects and execute them internally.

OK, I got it.

Thank you,
Shuhei


________________________________
差出人: SPDK <spdk-bounces(a)lists.01.org> が Harris, James R <james.r.harris(a)intel.com> の代理で送信
送信日�: 2018年2月2日 6:00
宛先: Storage Performance Development Kit
件名: [!]Re: [SPDK] About dump/load (or export/edit/import) JSON file by SPDK


Hi Shuhei,



Thank you for starting this discussion � I have some comments inline below.



-Jim





From: SPDK <spdk-bounces(a)lists.01.org> on behalf of 松本周平 / MATSUMOTO,SHUUHEI <shuhei.matsumoto.xt(a)hitachi.com>
Reply-To: Storage Performance Development Kit <spdk(a)lists.01.org>
Date: Wednesday, January 31, 2018 at 6:13 PM
To: "spdk(a)lists.01.org" <spdk(a)lists.01.org>
Subject: [SPDK] About dump/load (or export/edit/import) JSON file by SPDK



Hi All,



As you know, current variant of INI configuration file is dated and SPDK have great JSON-RPC stack.



I think as KVM utilize effectively XML configuration file well, utilizing JSON configuration file will be valuable for SPDK.

By doing this SPDK will be able to have persistent configuration by itself.



As long as I investigate, now SPDK support
(1) create and dump JSON object to fixed size JSON-RPC buffer
(2) load JSON object from JSON-RPC and then parse/convert it to a spdk_json_vals table to decode it



Adding the following may be helpful:

(3) create and dump JSON object to resizable string buffer and then to file/fd
(4) load JSON object from file/fd and then parse/convert it to a spdk_json_vals table to decode it



About (3), having pretty print function in which indent/newlines/whitespace can be tuned will be desirable.



One key question is whether the configuration file should be a set of JSON objects which are just SPDK JSON-RPC requests, or if they are set of some new type of SPDK JSON objects.



My thought is that a JSON configuration file could just be a sequence of JSON-RPC requests.  Each SPDK subsystem/module would need to know how to generate a sequence of JSON-RPC requests to rebuild its current state.  This would be similar to the get_running_config() routines that many of the subsystems and modules have today which generate an INI config file when a process receives a USR1 signal.



Furthermore,
I would like to add the following in Python JSON-RPC code,
(5) for reply, dump response to JSON file
(6) for send, load JSON file to Python object, and convert (dump) to JSON object request, and then send to SPDK.

((3) and (5)) or ((4) and (6)) may be duplicated each other, respectively,
and the following approach make sense as I talked with Jim shortly.

- SPDK start only JSON-RPC first
- and then SPDK python handles all configuration files



I think this should be straightforward.  spdk_app_start() and spdk_subsystem_init() currently use the following order:

1)      Initialize subsystems

2)      Initialize RPC

3)      Start reactors



It basically needs to change to:

1)      Initialize RPC

2)      Start reactors

3)      Initialize subsystems



Where step #3 (initialize subsystems) is triggered by a new RPC.



However I think only python implementation is not enough and  importing/exporting JSON file by SPDK C library will be valuable at least

- for unit tests

- for iSCSI CHAP shared secret file. (Sending secrets written in plain text by RPC is not comfortable for me.)



Yes � I agree, we will want a small C library that could read the JSON-RPC objects and execute them internally.

I can't say I have mastered JSON but as long as I read and learn JSON and SPDK's JSON implementation,
we will be able to do the above without difficulty.



The first major use case may be to replace SPDK subsystem's config dump function from the variant of INI format to JSON format.



I would like to post patch one by one or series of patches if prepared but discussion in Trello first may be better because each will have own idea in this area.



I'm happy for your any feedback.



Best Regards,

Shuhei



[-- Attachment #2: attachment.html --]
[-- Type: text/html, Size: 20150 bytes --]

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [SPDK] About dump/load (or export/edit/import) JSON file by SPDK
@ 2018-02-01 21:00 Harris, James R
  0 siblings, 0 replies; 14+ messages in thread
From: Harris, James R @ 2018-02-01 21:00 UTC (permalink / raw)
  To: spdk

[-- Attachment #1: Type: text/plain, Size: 3768 bytes --]

Hi Shuhei,

Thank you for starting this discussion – I have some comments inline below.

-Jim


From: SPDK <spdk-bounces(a)lists.01.org> on behalf of 松本周平 / MATSUMOTO,SHUUHEI <shuhei.matsumoto.xt(a)hitachi.com>
Reply-To: Storage Performance Development Kit <spdk(a)lists.01.org>
Date: Wednesday, January 31, 2018 at 6:13 PM
To: "spdk(a)lists.01.org" <spdk(a)lists.01.org>
Subject: [SPDK] About dump/load (or export/edit/import) JSON file by SPDK


Hi All,



As you know, current variant of INI configuration file is dated and SPDK have great JSON-RPC stack.



I think as KVM utilize effectively XML configuration file well, utilizing JSON configuration file will be valuable for SPDK.

By doing this SPDK will be able to have persistent configuration by itself.



As long as I investigate, now SPDK support
(1) create and dump JSON object to fixed size JSON-RPC buffer
(2) load JSON object from JSON-RPC and then parse/convert it to a spdk_json_vals table to decode it



Adding the following may be helpful:

(3) create and dump JSON object to resizable string buffer and then to file/fd
(4) load JSON object from file/fd and then parse/convert it to a spdk_json_vals table to decode it



About (3), having pretty print function in which indent/newlines/whitespace can be tuned will be desirable.



One key question is whether the configuration file should be a set of JSON objects which are just SPDK JSON-RPC requests, or if they are set of some new type of SPDK JSON objects.



My thought is that a JSON configuration file could just be a sequence of JSON-RPC requests.  Each SPDK subsystem/module would need to know how to generate a sequence of JSON-RPC requests to rebuild its current state.  This would be similar to the get_running_config() routines that many of the subsystems and modules have today which generate an INI config file when a process receives a USR1 signal.



Furthermore,
I would like to add the following in Python JSON-RPC code,
(5) for reply, dump response to JSON file
(6) for send, load JSON file to Python object, and convert (dump) to JSON object request, and then send to SPDK.

((3) and (5)) or ((4) and (6)) may be duplicated each other, respectively,
and the following approach make sense as I talked with Jim shortly.

- SPDK start only JSON-RPC first
- and then SPDK python handles all configuration files



I think this should be straightforward.  spdk_app_start() and spdk_subsystem_init() currently use the following order:

1)      Initialize subsystems

2)      Initialize RPC

3)      Start reactors



It basically needs to change to:

1)      Initialize RPC

2)      Start reactors

3)      Initialize subsystems



Where step #3 (initialize subsystems) is triggered by a new RPC.



However I think only python implementation is not enough and  importing/exporting JSON file by SPDK C library will be valuable at least

- for unit tests

- for iSCSI CHAP shared secret file. (Sending secrets written in plain text by RPC is not comfortable for me.)



Yes – I agree, we will want a small C library that could read the JSON-RPC objects and execute them internally.

I can't say I have mastered JSON but as long as I read and learn JSON and SPDK's JSON implementation,
we will be able to do the above without difficulty.



The first major use case may be to replace SPDK subsystem's config dump function from the variant of INI format to JSON format.



I would like to post patch one by one or series of patches if prepared but discussion in Trello first may be better because each will have own idea in this area.



I'm happy for your any feedback.



Best Regards,

Shuhei


[-- Attachment #2: attachment.html --]
[-- Type: text/html, Size: 15848 bytes --]

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [SPDK] About dump/load (or export/edit/import) JSON file by SPDK
@ 2018-02-01  9:05 
  0 siblings, 0 replies; 14+ messages in thread
From:  @ 2018-02-01  9:05 UTC (permalink / raw)
  To: spdk

[-- Attachment #1: Type: text/plain, Size: 3211 bytes --]

Hi All,


At first I pushed the following improvement to Gerrit.

>I would like to add the following in Python JSON-RPC code,
>(5) for reply, dump response to JSON file
>(6) for send, load JSON file to Python object, and convert (dump) to JSON object request, and then send to SPDK.


https://review.gerrithub.io/#/c/397949/
Gerrit Code Review<https://review.gerrithub.io/#/c/397949/>
review.gerrithub.io
Keep in touch. Copyright © 2017 | GerritForge Ltd. info(a)gerritforge.com www.gerritforge.com


JSON may not be the best format of configuration file, for example it doesn't allow comments.
However JSON config file is easy to read and I think it will be better than current INI format.
I wish these efforts will be of any help for development of py-spdk client or other management tool too.

Thank you,
Shuhei



________________________________
差出人: 松本周平 / MATSUMOTO,SHUUHEI
送信日時: 2018年2月1日 10:13
宛先: spdk(a)lists.01.org
件名: About dump/load (or export/edit/import) JSON file by SPDK


Hi All,


As you know, current variant of INI configuration file is dated and SPDK have great JSON-RPC stack.


I think as KVM utilize effectively XML configuration file well, utilizing JSON configuration file will be valuable for SPDK.

By doing this SPDK will be able to have persistent configuration by itself.


As long as I investigate, now SPDK support
(1) create and dump JSON object to fixed size JSON-RPC buffer
(2) load JSON object from JSON-RPC and then parse/convert it to a spdk_json_vals table to decode it


Adding the following may be helpful:

(3) create and dump JSON object to resizable string buffer and then to file/fd
(4) load JSON object from file/fd and then parse/convert it to a spdk_json_vals table to decode it


About (3), having pretty print function in which indent/newlines/whitespace can be tuned will be desirable.


Furthermore,
I would like to add the following in Python JSON-RPC code,
(5) for reply, dump response to JSON file
(6) for send, load JSON file to Python object, and convert (dump) to JSON object request, and then send to SPDK.

((3) and (5)) or ((4) and (6)) may be duplicated each other, respectively,
and the following approach make sense as I talked with Jim shortly.

- SPDK start only JSON-RPC first
- and then SPDK python handles all configuration filess


However I think only python implementation is not enough and  importing/exporting JSON file by SPDK C library will be valuable at least

- for unit tests

- for iSCSI CHAP shared secret file. (Sending secrets written in plain text by RPC is not comfortable for me.)

I can't say I have mastered JSON but as long as I read and learn JSON and SPDK's JSON implementation,
we will be able to do the above without difficulty.


The first major use case may be to replace SPDK subsystem's config dump function from the variant of INI format to JSON format.


I would like to post patch one by one or series of patches if prepared but discussion in Trello first may be better because each will have own idea in this area.


I'm happy for your any feedback.


Best Regards,

Shuhei


[-- Attachment #2: attachment.html --]
[-- Type: text/html, Size: 8205 bytes --]

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [SPDK] About dump/load (or export/edit/import) JSON file by SPDK
@ 2018-02-01  1:13 
  0 siblings, 0 replies; 14+ messages in thread
From:  @ 2018-02-01  1:13 UTC (permalink / raw)
  To: spdk

[-- Attachment #1: Type: text/plain, Size: 2149 bytes --]

Hi All,


As you know, current variant of INI configuration file is dated and SPDK have great JSON-RPC stack.


I think as KVM utilize effectively XML configuration file well, utilizing JSON configuration file will be valuable for SPDK.

By doing this SPDK will be able to have persistent configuration by itself.


As long as I investigate, now SPDK support
(1) create and dump JSON object to fixed size JSON-RPC buffer
(2) load JSON object from JSON-RPC and then parse/convert it to a spdk_json_vals table to decode it


Adding the following may be helpful:

(3) create and dump JSON object to resizable string buffer and then to file/fd
(4) load JSON object from file/fd and then parse/convert it to a spdk_json_vals table to decode it


About (3), having pretty print function in which indent/newlines/whitespace can be tuned will be desirable.


Furthermore,
I would like to add the following in Python JSON-RPC code,
(5) for reply, dump response to JSON file
(6) for send, load JSON file to Python object, and convert (dump) to JSON object request, and then send to SPDK.

((3) and (5)) or ((4) and (6)) may be duplicated each other, respectively,
and the following approach make sense as I talked with Jim shortly.

- SPDK start only JSON-RPC first
- and then SPDK python handles all configuration filess


However I think only python implementation is not enough and  importing/exporting JSON file by SPDK C library will be valuable at least

- for unit tests

- for iSCSI CHAP shared secret file. (Sending secrets written in plain text by RPC is not comfortable for me.)

I can't say I have mastered JSON but as long as I read and learn JSON and SPDK's JSON implementation,
we will be able to do the above without difficulty.


The first major use case may be to replace SPDK subsystem's config dump function from the variant of INI format to JSON format.


I would like to post patch one by one or series of patches if prepared but discussion in Trello first may be better because each will have own idea in this area.


I'm happy for your any feedback.


Best Regards,

Shuhei


[-- Attachment #2: attachment.html --]
[-- Type: text/html, Size: 3086 bytes --]

^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2018-02-13  7:00 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-02-09 19:48 [SPDK] About dump/load (or export/edit/import) JSON file by SPDK Wodkowski, PawelX
  -- strict thread matches above, loose matches on Subject: below --
2018-02-13  7:00 
2018-02-13  2:15 
2018-02-05  9:04 
2018-02-02 17:48 Walker, Benjamin
2018-02-02 17:24 Daniel Verkamp
2018-02-02 16:25 Harris, James R
2018-02-02 14:19 Wodkowski, PawelX
2018-02-02  9:04 
2018-02-02  1:22 
2018-02-02  1:12 
2018-02-01 21:00 Harris, James R
2018-02-01  9:05 
2018-02-01  1:13 

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.