-
Notifications
You must be signed in to change notification settings - Fork 5
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
Add rust implementation of container Python script #38
base: master
Are you sure you want to change the base?
Conversation
This handles most use cases for local containers. For Kubernetes containers, there's very limited handling in the start function, and pretty much nothing else. Signed-off-by: Saikrishna Arcot <[email protected]>
Signed-off-by: Saikrishna Arcot <[email protected]>
Signed-off-by: Saikrishna Arcot <[email protected]>
Signed-off-by: Saikrishna Arcot <[email protected]>
Signed-off-by: Saikrishna Arcot <[email protected]>
Signed-off-by: Saikrishna Arcot <[email protected]>
Signed-off-by: Saikrishna Arcot <[email protected]>
Signed-off-by: Saikrishna Arcot <[email protected]>
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
Signed-off-by: Saikrishna Arcot <[email protected]>
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
Hi Sai, looks like it is hitting CI errors. Do you mind to help take a look? |
Signed-off-by: Saikrishna Arcot <[email protected]>
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
Signed-off-by: Saikrishna Arcot <[email protected]>
Signed-off-by: Saikrishna Arcot <[email protected]>
Signed-off-by: Saikrishna Arcot <[email protected]>
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
Signed-off-by: Saikrishna Arcot <[email protected]>
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
Signed-off-by: Saikrishna Arcot <[email protected]>
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
Signed-off-by: Saikrishna Arcot <[email protected]>
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
[dependencies] | ||
bollard = { version = "0.17.1", features = ["chrono"] } | ||
chrono = "0.4.38" | ||
enumset = "1.1.5" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will be better to move these dependencies to workspace root.
bollard = { version = "0.17.1", features = ["chrono"] } | ||
chrono = "0.4.38" | ||
enumset = "1.1.5" | ||
futures-util = "0.3.30" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
0.3 will be good enough. The last minor version can be ignored, since we have the lock file and will help with upgrade.
|
||
// DB field names | ||
//const FEATURE_TABLE: &str = "FEATURE"; | ||
const SET_OWNER: &str = "set_owner"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe better to add a prefix to specify these are db fields.
crates/container/src/main.rs
Outdated
|
||
fn set_label(db_connections: &DbConnections, _feature: &str, _create: bool) { | ||
if db_connections.remote_ctr_enabled { | ||
todo!(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this part missing?
crates/container/src/main.rs
Outdated
} | ||
|
||
let rt = tokio::runtime::Builder::new_current_thread() | ||
.enable_all() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like we can use async_main to simplify the code. Is this delayed block_on intentional?
Signed-off-by: Saikrishna Arcot <[email protected]>
Signed-off-by: Saikrishna Arcot <[email protected]>
Signed-off-by: Saikrishna Arcot <[email protected]>
Signed-off-by: Saikrishna Arcot <[email protected]>
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
Add a rust implementation of the
container
script in the SONiC image. This script is primarily responsible for starting, waiting on, and stopping containers.In the case of local containers, this script is basically a wrapper around
docker start
,docker wait
, anddocker stop
. In the case of Kubernetes containers, there's some additional logic/checks on whether the container should be started or not; this is not fully implemented.Basic testing has been done with local containers (the most common use case).