Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

[Feature] - Builds fail when publishing to HCP Packer #189

Closed
tomasbasham opened this issue Jun 5, 2022 · 5 comments
Closed

[Feature] - Builds fail when publishing to HCP Packer #189

tomasbasham opened this issue Jun 5, 2022 · 5 comments
Labels
enhancement New feature or request

Comments

@tomasbasham
Copy link

tomasbasham commented Jun 5, 2022

Describe the bug

When building an image and publishing build metadata to HCP Packer the post-processing stage fails and this in turn cleans up all the work done by the Vultr Packer plugin. Effectively the image build succeeds - I know this to be true as I am able to view all the assets in the Vultr dashboard, but when the post-processing stage kicks in the process fails with the following message:

Build 'vultr.almalinux' errored after 22 minutes 21 seconds: 1 error(s) occurred:

* Post-processor failed: [TRACE] failed to update Packer registry with image artifacts for "vultr.almalinux": setting a build to DONE with no published images is not currently supported.

This error only appears to happen with 3rd party plugins - plugins that were not created by HashiCorp - I suspect this because I am receiving the same error for another 3rd party Packer plugin for a different cloud provider, whilst all the HashiCorp providers run to completion.

To Reproduce

packer {
  required_plugins {
    digitalocean = {
      version = ">= 1.0.4"
      source  = "github.com/hashicorp/digitalocean"
    }
    vultr = {
      version = ">= v2.4.4"
      source  = "github.com/vultr/vultr"
    }
}

build {
  hcp_packer_registry {
    bucket_name = "test-almalinux"
    description = "some description"

    bucket_labels = {
      "owner" = "platform-team"
    }

    build_labels = {
      "build-time"   = timestamp()
      "build-source" = basename(path.cwd)
    }
  }

  sources = [
    "source.digitalocean.almalinux",
    "source.vultr.almalinux",
  ]

  provisioner "shell" {
    inline = [
      "echo hello",
    ]
  }
}

source "vultr" "almalinux" {
  api_key              = "${var.api_key}"
  os_id                = "413"
  plan_id              = "vhf-1c-1gb"
  region_id            = "${var.upcloud_zone}"
  snapshot_description = "testing"
  state_timeout        = "10m"
  ssh_username         = "root"
}

Expected behavior

Metadata published to the HCP Packer application when builds succeed.

Desktop (please complete the following information where applicable:

  • OS: Ubunut
  • Packer Version 1.8.0
  • Vultr Version 2.4.4

This may possibly be a feature request rather than a bug.

@tomasbasham tomasbasham added the bug Something isn't working label Jun 5, 2022
@tomasbasham tomasbasham changed the title [BUG] - Enter a descriptive title [BUG] - Builds fail when publishing to HCP Packer Jun 5, 2022
@optik-aper
Copy link
Member

I am able to reproduce and will look into this. Thanks for reporting it.

@optik-aper
Copy link
Member

It looks like we'll have to modify the plugin to match the required schema for the HCP registry. Documentation here.

@optik-aper optik-aper added enhancement New feature or request and removed bug Something isn't working labels Jun 6, 2022
@optik-aper optik-aper changed the title [BUG] - Builds fail when publishing to HCP Packer [Feature] - Builds fail when publishing to HCP Packer Jun 6, 2022
@optik-aper
Copy link
Member

@tomasbasham We merged support for this into master if you want to give it a try. It'll be in the next release if you'd rather wait for a binary.

@optik-aper
Copy link
Member

@tomasbasham Release v2.4.5 adds support for the HCP registry if you want to check it out.

@tomasbasham
Copy link
Author

Magic, thank you. I'll check that out.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants