Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[minigraph] new workflow for golden path #2396

Merged
merged 3 commits into from
Oct 5, 2022

Conversation

wen587
Copy link
Contributor

@wen587 wen587 commented Sep 23, 2022

What I did

Change the behavior that load_minigraph will consume golden config by default.
New behavior:
config load_minigraph: No longer consume golden config.
config load_minigraph --golden_config: Consume default golden config. /etc/sonic/golden_config_db.json
config load_minigraph --golden_config FilePath: Consume golden config with FilePath

How I did it

Make golden_config click.Option() and add an argument for golden config path.

How to verify it

UT test.

Previous command output (if the output of a command-line utility has changed)

sudo config load_minigraph -h
Usage: config load_minigraph [OPTIONS]

Reconfigure based on minigraph.

Options:
-y, --yes
-n, --no_service_restart Do not restart docker services
-t, --traffic_shift_away Keep device in maintenance with TSA
-p, --golden_config_path TEXT specify Golden Config path
-?, -h, --help Show this message and exit.

New command output (if the output of a command-line utility has changed)

admin@vlab-01:~$ sudo config load_minigraph --golden_config_path -h
Usage: config load_minigraph [OPTIONS]

Reconfigure based on minigraph.

Options:
-y, --yes
-n, --no_service_restart Do not restart docker services
-t, --traffic_shift_away Keep device in maintenance with TSA
-o, --override_config Enable config override. Proceed with default path.
-p, --golden_config_path TEXT Provide golden config path to override. Use with --override_config
-h, -?, --help Show this message and exit.

@wen587 wen587 marked this pull request as ready for review September 23, 2022 09:45
@qiluo-msft qiluo-msft merged commit 81e2aec into sonic-net:master Oct 5, 2022
yxieca pushed a commit that referenced this pull request Oct 5, 2022
#### What I did
Change the behavior that load_minigraph will consume golden config by default.
New behavior:
`config load_minigraph`: No longer consume golden config.
`config load_minigraph --golden_config`: Consume default golden config. /etc/sonic/golden_config_db.json
`config load_minigraph --golden_config FilePath`: Consume golden config with FilePath
#### How I did it
Make golden_config click.Option() and add an argument for golden config path.
#### How to verify it
UT test.
#### Previous command output (if the output of a command-line utility has changed)
sudo config load_minigraph -h
Usage: config load_minigraph [OPTIONS]

Reconfigure based on minigraph.

Options:
-y, --yes
-n, --no_service_restart Do not restart docker services
-t, --traffic_shift_away Keep device in maintenance with TSA
-p, --golden_config_path TEXT specify Golden Config path
-?, -h, --help Show this message and exit.
#### New command output (if the output of a command-line utility has changed)
admin@vlab-01:~$ sudo config load_minigraph --golden_config_path -h
Usage: config load_minigraph [OPTIONS]

  Reconfigure based on minigraph.

Options:
  -y, --yes
  -n, --no_service_restart       Do not restart docker services
  -t, --traffic_shift_away       Keep device in maintenance with TSA
  -o, --override_config          Enable config override. Proceed with default path.
  -p, --golden_config_path TEXT  Provide golden config path to override. Use with --override_config
  -h, -?, --help                 Show this message and exit.
EdenGri pushed a commit to EdenGri/sonic-utilities that referenced this pull request Oct 12, 2022
#### What I did
Change the behavior that load_minigraph will consume golden config by default.
New behavior:
`config load_minigraph`: No longer consume golden config.
`config load_minigraph --golden_config`: Consume default golden config. /etc/sonic/golden_config_db.json
`config load_minigraph --golden_config FilePath`: Consume golden config with FilePath
#### How I did it
Make golden_config click.Option() and add an argument for golden config path.
#### How to verify it
UT test.
#### Previous command output (if the output of a command-line utility has changed)
sudo config load_minigraph -h
Usage: config load_minigraph [OPTIONS]

Reconfigure based on minigraph.

Options:
-y, --yes
-n, --no_service_restart Do not restart docker services
-t, --traffic_shift_away Keep device in maintenance with TSA
-p, --golden_config_path TEXT specify Golden Config path
-?, -h, --help Show this message and exit.
#### New command output (if the output of a command-line utility has changed)
admin@vlab-01:~$ sudo config load_minigraph --golden_config_path -h
Usage: config load_minigraph [OPTIONS]

  Reconfigure based on minigraph.

Options:
  -y, --yes
  -n, --no_service_restart       Do not restart docker services
  -t, --traffic_shift_away       Keep device in maintenance with TSA
  -o, --override_config          Enable config override. Proceed with default path.
  -p, --golden_config_path TEXT  Provide golden config path to override. Use with --override_config
  -h, -?, --help                 Show this message and exit.
mdanish-kh pushed a commit to hamnarauf/sonic-utilities that referenced this pull request Oct 22, 2022
#### What I did
Change the behavior that load_minigraph will consume golden config by default.
New behavior:
`config load_minigraph`: No longer consume golden config.
`config load_minigraph --golden_config`: Consume default golden config. /etc/sonic/golden_config_db.json
`config load_minigraph --golden_config FilePath`: Consume golden config with FilePath
#### How I did it
Make golden_config click.Option() and add an argument for golden config path.
#### How to verify it
UT test.
#### Previous command output (if the output of a command-line utility has changed)
sudo config load_minigraph -h
Usage: config load_minigraph [OPTIONS]

Reconfigure based on minigraph.

Options:
-y, --yes
-n, --no_service_restart Do not restart docker services
-t, --traffic_shift_away Keep device in maintenance with TSA
-p, --golden_config_path TEXT specify Golden Config path
-?, -h, --help Show this message and exit.
#### New command output (if the output of a command-line utility has changed)
admin@vlab-01:~$ sudo config load_minigraph --golden_config_path -h
Usage: config load_minigraph [OPTIONS]

  Reconfigure based on minigraph.

Options:
  -y, --yes
  -n, --no_service_restart       Do not restart docker services
  -t, --traffic_shift_away       Keep device in maintenance with TSA
  -o, --override_config          Enable config override. Proceed with default path.
  -p, --golden_config_path TEXT  Provide golden config path to override. Use with --override_config
  -h, -?, --help                 Show this message and exit.
preetham-singh pushed a commit to preetham-singh/sonic-utilities that referenced this pull request Nov 21, 2022
#### What I did
Change the behavior that load_minigraph will consume golden config by default.
New behavior:
`config load_minigraph`: No longer consume golden config.
`config load_minigraph --golden_config`: Consume default golden config. /etc/sonic/golden_config_db.json
`config load_minigraph --golden_config FilePath`: Consume golden config with FilePath
#### How I did it
Make golden_config click.Option() and add an argument for golden config path.
#### How to verify it
UT test.
#### Previous command output (if the output of a command-line utility has changed)
sudo config load_minigraph -h
Usage: config load_minigraph [OPTIONS]

Reconfigure based on minigraph.

Options:
-y, --yes
-n, --no_service_restart Do not restart docker services
-t, --traffic_shift_away Keep device in maintenance with TSA
-p, --golden_config_path TEXT specify Golden Config path
-?, -h, --help Show this message and exit.
#### New command output (if the output of a command-line utility has changed)
admin@vlab-01:~$ sudo config load_minigraph --golden_config_path -h
Usage: config load_minigraph [OPTIONS]

  Reconfigure based on minigraph.

Options:
  -y, --yes
  -n, --no_service_restart       Do not restart docker services
  -t, --traffic_shift_away       Keep device in maintenance with TSA
  -o, --override_config          Enable config override. Proceed with default path.
  -p, --golden_config_path TEXT  Provide golden config path to override. Use with --override_config
  -h, -?, --help                 Show this message and exit.
if golden_config_path:
if override_config:
if golden_config_path is None:
golden_config_path = DEFAULT_GOLDEN_CONFIG_DB_FILE
if not os.path.isfile(golden_config_path):
click.secho("Cannot find '{}'!".format(golden_config_path),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cannot

This is critical failure. We need to check the condition before any real actions taken, like stop service.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants