Skip to content

[cfggen] Extend Template Argument to Support Batch Mode (#4941)#5200

Merged
tahmed-dev merged 1 commit intosonic-net:201911-t0from
tahmed-dev:taahme/cherry-pick-cfggen-batch-mode
Oct 9, 2020
Merged

[cfggen] Extend Template Argument to Support Batch Mode (#4941)#5200
tahmed-dev merged 1 commit intosonic-net:201911-t0from
tahmed-dev:taahme/cherry-pick-cfggen-batch-mode

Conversation

@tahmed-dev
Copy link
Contributor

Calls to cfggen take considerable time. With batch mode, we will have the ability
to reduce number of calls from services.

Example of the batch mode command:
sonic-cfggen -t template-1.j2 -t template-2.j2,config-db -t template-3.j2,config-db -t template-4.j2,file1 -t template-5.j2,file2 --write-to-db.

template-1.j2 will be rendered to stdout since it is missing the dest part. stdout is default
config-db is a special keyword that will inject the rendered template into internal data structure. The internal data structure gets written to redis-db with --write-to-db switch. In the case the user would like to write to a file named config-db, it could be given as /config-db or ./config-db

signed-off-by: Tamer Ahmed [email protected]

@tahmed-dev tahmed-dev requested review from abdosi and rlhui August 17, 2020 17:07
@tahmed-dev
Copy link
Contributor Author

retest broadcom please

@lguohan
Copy link
Collaborator

lguohan commented Sep 24, 2020

is this for 201911 only? resolving the cherry-pick issue?

@tahmed-dev
Copy link
Contributor Author

is this for 201911 only? resolving the cherry-pick issue?

Yes, it is to resolve 201911 cherry-pick issues. The change was not cherry-pick-able as there was quite a churn in the sonic-cfggen.

@tahmed-dev tahmed-dev changed the base branch from 201911 to 201911-t0 October 7, 2020 22:16
Calls to cfggen take considerable time. With batch mode, we will have the ability
to reduce number of calls from services.

Example of the batch mode command:
sonic-cfggen -t template-1.j2 -t template-2.j2,config-db -t template-3.j2,config-db -t template-4.j2,file1 -t template-5.j2,file2 --write-to-db.

template-1.j2 will be rendered to stdout since it is missing the dest part. stdout is default
config-db is a special keyword that will inject the rendered template into internal data structure. The internal data structure gets written to redis-db with --write-to-db switch. In the case the user would like to write to a file named config-db, it could be given as /config-db or ./config-db

signed-off-by: Tamer Ahmed <[email protected]>
@tahmed-dev tahmed-dev force-pushed the taahme/cherry-pick-cfggen-batch-mode branch from 3f0ae7d to effe435 Compare October 8, 2020 16:48
@tahmed-dev tahmed-dev merged commit 12ab1c5 into sonic-net:201911-t0 Oct 9, 2020
lguohan pushed a commit that referenced this pull request Oct 30, 2020
Calls to cfggen take considerable time. With batch mode, we will have the ability
to reduce number of calls from services.

Example of the batch mode command:
sonic-cfggen -t template-1.j2 -t template-2.j2,config-db -t template-3.j2,config-db -t template-4.j2,file1 -t template-5.j2,file2 --write-to-db.

template-1.j2 will be rendered to stdout since it is missing the dest part. stdout is default
config-db is a special keyword that will inject the rendered template into internal data structure. The internal data structure gets written to redis-db with --write-to-db switch. In the case the user would like to write to a file named config-db, it could be given as /config-db or ./config-db

signed-off-by: Tamer Ahmed <[email protected]>
abdosi pushed a commit that referenced this pull request Dec 4, 2020
Calls to cfggen take considerable time. With batch mode, we will have the ability
to reduce number of calls from services.

Example of the batch mode command:
sonic-cfggen -t template-1.j2 -t template-2.j2,config-db -t template-3.j2,config-db -t template-4.j2,file1 -t template-5.j2,file2 --write-to-db.

template-1.j2 will be rendered to stdout since it is missing the dest part. stdout is default
config-db is a special keyword that will inject the rendered template into internal data structure. The internal data structure gets written to redis-db with --write-to-db switch. In the case the user would like to write to a file named config-db, it could be given as /config-db or ./config-db

signed-off-by: Tamer Ahmed <[email protected]>
abdosi pushed a commit that referenced this pull request Dec 22, 2020
Calls to cfggen take considerable time. With batch mode, we will have the ability
to reduce number of calls from services.

Example of the batch mode command:
sonic-cfggen -t template-1.j2 -t template-2.j2,config-db -t template-3.j2,config-db -t template-4.j2,file1 -t template-5.j2,file2 --write-to-db.

template-1.j2 will be rendered to stdout since it is missing the dest part. stdout is default
config-db is a special keyword that will inject the rendered template into internal data structure. The internal data structure gets written to redis-db with --write-to-db switch. In the case the user would like to write to a file named config-db, it could be given as /config-db or ./config-db

signed-off-by: Tamer Ahmed <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants