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

[Service] Enable/disable container auto-restart based on configuration. #4073

Merged
merged 35 commits into from
Feb 7, 2020
Merged

[Service] Enable/disable container auto-restart based on configuration. #4073

merged 35 commits into from
Feb 7, 2020

Conversation

yozhao101
Copy link
Contributor

  • What I did
    Currently we already have the auto-restart features for each docker container. That means if a critical
    process exited abnormally or crashed, this event will be captured and then the corresponding
    container will be restarted. Right now, we want to add a knob/switch for this feature in all containers such that the developer can dynamically turn on/off it during testing new docker images.

  • How I did it
    We will create a table in the database container. In this table, we store the current state of
    auto-restart feature for all containers. Initially, the state of this feature will be enabled.
    The event listener will dynamically read the state from database container and then decide whether
    restart the container based on it once receive the event showing a critical process exited.
    The user can use the existing interface (TBD) to modify this state from enabled to disabled or
    vice versa.

  • How to verify it
    I manually created a table in the database container called CONTAINER_FEATURE. In this table, each
    container will have its corresponding state row such as the initial state of auto-restart for dhcp_relay is in the 'enabled' status.

of auto-restart feature from database and then decide whether to
enable/disable this feature.

Signed-off-by: Yong Zhao <yozhao@microsoft.com>
…ame to event listener.

Signed-off-by: Yong Zhao <yozhao@microsoft.com>
name to event listener.

Signed-off-by: Yong Zhao <yozhao@microsoft.com>
event listener.

Signed-off-by: Yong Zhao <yozhao@microsoft.com>
event listener.

Signed-off-by: Yong Zhao <yozhao@microsoft.com>
event listener.

Signed-off-by: Yong Zhao <yozhao@microsoft.com>
event listener.

Signed-off-by: Yong Zhao <yozhao@microsoft.com>
event listener.

Signed-off-by: Yong Zhao <yozhao@microsoft.com>
name to event listener.

Signed-off-by: Yong Zhao <yozhao@microsoft.com>
event listener.

Signed-off-by: Yong Zhao <yozhao@microsoft.com>
…er bgp and event listener will monitor

these critical processes and if one of them exited, the event listener
will restart this container based on the configuration flag set in database.

Signed-off-by: Yong Zhao <yozhao@microsoft.com>
Signed-off-by: Yong Zhao <yozhao@microsoft.com>
Signed-off-by: Yong Zhao <yozhao@microsoft.com>
container name to event listener.

Signed-off-by: Yong Zhao <yozhao@microsoft.com>
name to event listener.

Signed-off-by: Yong Zhao <yozhao@microsoft.com>
name to event listener.

Signed-off-by: Yong Zhao <yozhao@microsoft.com>
name to event listener.

Signed-off-by: Yong Zhao <yozhao@microsoft.com>
name to event listener.

Signed-off-by: Yong Zhao <yozhao@microsoft.com>
container name to event listener.

Signed-off-by: Yong Zhao <yozhao@microsoft.com>
container name as parameter to event listener.

Signed-off-by: Yong Zhao <yozhao@microsoft.com>
name as parameter to event listener.

Signed-off-by: Yong Zhao <yozhao@microsoft.com>
container name as parameter to event listener.

Signed-off-by: Yong Zhao <yozhao@microsoft.com>
Signed-off-by: Yong Zhao <yozhao@microsoft.com>
Copy link
Contributor

@jleveque jleveque left a comment

Choose a reason for hiding this comment

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

Please remove the BGP container changes from this PR, and submit them as a separate PR, with the new flag being passed to the event listener script.

Signed-off-by: Yong Zhao <yozhao@microsoft.com>
Signed-off-by: Yong Zhao <yozhao@microsoft.com>
Signed-off-by: Yong Zhao <yozhao@microsoft.com>
Signed-off-by: Yong Zhao <yozhao@microsoft.com>
Signed-off-by: Yong Zhao <yozhao@microsoft.com>
Signed-off-by: Yong Zhao <yozhao@microsoft.com>
…le is

not found in config db and container name is not found in the table.

Signed-off-by: Yong Zhao <yozhao@microsoft.com>
jleveque
jleveque previously approved these changes Jan 30, 2020
@yozhao101
Copy link
Contributor Author

Retest vsimage please.

@jleveque
Copy link
Contributor

Retest vsimage please

4 similar comments
@jleveque
Copy link
Contributor

Retest vsimage please

@jleveque
Copy link
Contributor

jleveque commented Feb 1, 2020

Retest vsimage please

@jleveque
Copy link
Contributor

jleveque commented Feb 2, 2020

Retest vsimage please

@jleveque
Copy link
Contributor

jleveque commented Feb 3, 2020

Retest vsimage please

file.

Signed-off-by: Yong Zhao <yozhao@microsoft.com>
@yozhao101
Copy link
Contributor Author

Retest vsimage please.

@jleveque
Copy link
Contributor

jleveque commented Feb 4, 2020

Retest vsimage please

@jleveque
Copy link
Contributor

jleveque commented Feb 4, 2020

Retest vs please

@jleveque
Copy link
Contributor

jleveque commented Feb 4, 2020

Retest vsimage please

1 similar comment
@jleveque
Copy link
Contributor

jleveque commented Feb 7, 2020

Retest vsimage please

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