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

Skip unneeded steps #126

Merged
merged 2 commits into from
Mar 11, 2024
Merged

Skip unneeded steps #126

merged 2 commits into from
Mar 11, 2024

Conversation

torarnv
Copy link
Contributor

@torarnv torarnv commented Mar 10, 2024

Without a communicator we can't provision, and if we don't have
boot commands there's not any keys to send to the running VM, so
running it is not needed.

This allows configuring builders that only create the VM,
in preparation for later OS installation and provisioning:

source "tart-cli" "create-only" {
  cpu_count    = 4
  memory_gb    = 8
  disk_size_gb = 40
  from_ipsw    = var.ipsw_file
  vm_name      = "pre-install-vm"
  communicator = "none"
}
image

Also, there's no need to connect to VNC if we have no boot commands
to type.

image

Copy link
Contributor

@fkorotkov fkorotkov left a comment

Choose a reason for hiding this comment

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

Great optimization! One nit pick from me. Do you mind extracting b.config.CommunicatorConfig.Type != "none" into a variable like communicatorConfigured. I think it will cleaner to read the code. What do you think?

@torarnv
Copy link
Contributor Author

torarnv commented Mar 10, 2024

Thanks!

Do you mind extracting b.config.CommunicatorConfig.Type != "none" into a variable like communicatorConfigured. I think it will cleaner to read the code. What do you think?

Absolutely, will push :)

@torarnv torarnv force-pushed the skip-unneeded-steps branch from 56c2d98 to 18f954c Compare March 10, 2024 22:32
builder/tart/builder.go Outdated Show resolved Hide resolved
@torarnv
Copy link
Contributor Author

torarnv commented Mar 10, 2024

Pushed update :)

@torarnv
Copy link
Contributor Author

torarnv commented Mar 10, 2024

Doh, missed the second one :D

torarnv added 2 commits March 10, 2024 23:35
Without a communicator we can't provision, and if we don't have
boot commands there's not any keys to send to the running VM, so
running it is not needed.

This allows configuring builders that only create the VM,
in preparation for later OS installation and provisioning:

source "tart-cli" "create-only" {
  cpu_count    = 4
  memory_gb    = 8
  disk_size_gb = 40
  from_ipsw    = var.ipsw_file
  vm_name      = "pre-install-vm"
  communicator = "none"
}
There's no need to connect to VNC if we have no boot commands
to type.
@torarnv torarnv force-pushed the skip-unneeded-steps branch from 18f954c to 3733e71 Compare March 10, 2024 22:35
@torarnv
Copy link
Contributor Author

torarnv commented Mar 10, 2024

Like this?

@edigaryev edigaryev merged commit 1d969c0 into cirruslabs:main Mar 11, 2024
2 checks passed
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.

3 participants