Hey folks,
I'm using packer with OpenStack to create base images from puppet manifests. An unexpected use case grew somewhat organically. We started using packer to build merge requests to verify the puppet manifests actually applied. This has worked really well for us. Unfortunately, it takes 4 minutes out of an 11 minute build to just save the image back to OpenStack. It doesn't look like there's an option to skip the creating image step. I took a look at the code base and it doesn't look too complicated to add this option. I don't mind doing this myself, but I first wanted to get some feedback on the issue.
First, since this isn't technically something that packer is designed to do, would you be receptive to adding an option to skipe the image save? Second, if so, should this be a global option, or one specifically for the openstack provider?
Thanks!
Ben
After writing this up, I discovered #1740 which seems to be similar to what I'm trying to accomplish. I'm not trying to stir up an old argument, but it was closed because the value add wasn't clear. Hopefully this ticket makes the value add clear?
Relates to #4681 and #4899
Maybe related to #2679 which looks merged?
I'm not familiar with this code base, but is the image saving a post processor? This is where the save step seems to occur: https://github.com/hashicorp/packer/blob/c8fab8c7a37cb3f3d1dd1b758b9eddec50ae38ce/builder/openstack/builder.go#L142
+1 to this. like @bheiskell-datto mentioned, it's already been discussed a few years ago, but it would be very helpful to apply CI to the packer template itself. And I'm thinking for builders in general, not just Openstack.
Primarily I think it would be useful for PR-triggered jobs, to test that a template is "buildable" before merging, as well as during development when you want to test provisioners without having to worry about cleaning up images or CTRL-C the build to avoid it.
I'm not wild about this because I thing being used as a CI provider is outside of Packer's scope. That said, I would merge a PR that added an option to skip saving the image. If someone wants to implement this, I won't stand in your way.
I'd be pretty excited if #4681 were reopened, or otherwise revived, and merged! 馃槂
@lorengordon To restate why we didn't merge that one, and why I don't love this one -- this feature, no matter which builder we use it with, alters the builder artifact which breaks post-processor assumptions, which could break Packer builds.
But if people keep asking for it, then maybe it's worth figuring out how to safely break those assumptions. I'm not going to be rebasing or cleaning up #4681, but at this point, if someone else wants to then I'll revisit it.
@SwampDragons what do you think of skipping post-processors if the -no-artifact (or whatever the flag is) is present?
@cbrit That's one option. Making some kind of "null" artifact that gets produced in these cases may be a more flexible one.
Would love this option implemented!
Any news on this issue?
The maintainers are not planning to prioritize work on it, but PRs are welcome. I'll merge a new PR that implements this work.
Most helpful comment
Would love this option implemented!