Skip to content
This repository has been archived by the owner on Dec 7, 2023. It is now read-only.

Make runtime and network-plugin VM create flags #669

Merged
merged 7 commits into from
Sep 9, 2020

Conversation

darkowlzz
Copy link
Contributor

@darkowlzz darkowlzz commented Aug 23, 2020

This is a follow-up change to #651, which adds the runtime and
network-plugin info in the VM status.

  • Remove the global flags runtime and network-plugin to be in VM create
    command.
  • Update all the VM commands (run, stop, rm) to read the runtime and
    network-plugin info from VM status.
  • Add runtime flag to image import.
  • Update docs.
  • Handle rm for stopped VMs - stopped VMs don't contain runtime info. Avoid runtime operations for them.
  • Fix patchStopped() status patch data in ignite-spawn as per the recent status changes.
  • Update e2e tests.
  • Handle VM start after stop - since stopped VMs don't contain runtime info, add runtime and network flags
    to VM start command.
  • Add e2e tests for VM lifecycle, including VM provider switching.

@darkowlzz darkowlzz added area/UX Let's make Ignite's UX great! do-not-merge/wip The PR is still work in progress labels Aug 23, 2020
@darkowlzz darkowlzz requested a review from twelho as a code owner August 23, 2020 13:21
--log-level loglevel Specify the loglevel for the program (default info)
--network-plugin plugin Network plugin to use. Available options are: [cni docker-bridge] (default cni)
-q, --quiet The quiet mode allows for machine-parsable output by printing only IDs
--runtime runtime Container runtime to use. Available options are: [docker containerd] (default containerd)
Copy link
Contributor

Choose a reason for hiding this comment

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

image import should probably have a runtime flag.

does not need to read any vm object.

flag is simply present to override ignite global config.

--log-level loglevel Specify the loglevel for the program (default info)
--network-plugin plugin Network plugin to use. Available options are: [cni docker-bridge] (default cni)
-q, --quiet The quiet mode allows for machine-parsable output by printing only IDs
--runtime runtime Container runtime to use. Available options are: [docker containerd] (default containerd)
Copy link
Contributor

Choose a reason for hiding this comment

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

same as image import

@stealthybox
Copy link
Contributor

commands like logs, exec, etc. will be modified to read from the VM object just like stop and start have already been.

Remove the global flags runtime and network-plugin to be VM create
command flags.
Update all the VM commands to read the runtime and network-plugin info
from VM status. Make attach and logs command aware of VM providers.

Add runtime flag to image and kernel import
Stopped VMs don't have the runtime and network info. Skip runtime
operations when removing stopped VMs. To avoid losing VM info, during
VM remove, perform CleanupVM() before deleting the VM manifest.

Also, fixes patchStopped() function in ignite-spawn to patch correct
VM status format.
@darkowlzz darkowlzz removed the do-not-merge/wip The PR is still work in progress label Sep 6, 2020
At VM stop, the runtime and network info are removed from the VM object.
Attempting to start a VM fails due to unknown runtime and network.
This adds runtime and network-plugin flag to VM start command to
explicitly set the providers if needed. This also causes the VM to use
the default providers when no providers are defined in the VM object.

Update VM start docs.
- Start VM, check network, stop VM, start VM with the same providers and
check network.
- Start VM, check network, stop vm, start VM with different providers
and check network access.
@stealthybox
Copy link
Contributor

Future generations will tell fond tales of the great and courageous traveler, @darkowlzz, and his inspiring, tenacious hunger for well-tested code.

🚢 lets merge this thang

Bug related to a non-default profider VM being created, then separately started with defaulted flag values will be fixed for and tested in a follow-up by passing flagSet to the Start() call to inspect for Changed().

@stealthybox stealthybox merged commit 6037e0f into weaveworks:master Sep 9, 2020
@darkowlzz darkowlzz deleted the non-global-providers branch September 12, 2020 21:02
@stealthybox stealthybox added the kind/enhancement Categorizes issue or PR as related to improving an existing feature. label Nov 5, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area/UX Let's make Ignite's UX great! kind/enhancement Categorizes issue or PR as related to improving an existing feature.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants