Heroku Build not idempotent if buildpack specified
dhollinger opened this issue · 1 comments
dhollinger commented
Describe the bug
When a buildpack is specified, a Heroku::Build resource will continually rebuild the app in Heroku
To Reproduce
Steps to reproduce the behavior:
- Write a workflow like
steps:
heroku_app:
returns: appID
resource: Heroku::App
value:
locked: false
name: "lyra-test"
personal: true
region: "us"
stack: "heroku-16"
heroku_build:
resource: Heroku::Build
value:
appID: $appID
buildpacks:
- name: heroku/ruby
sourceBlob:
uRL: "https://github.com/voxpupuli/puppet_webhook/archive/v2.0.0.tar.gz" # Only an example, don't use this URL as it is not currently Heroku compatible
- Run command
lyra apply heroku --debug
twice - You'll notice that the debug log will log a resource mismatch with the buildpacks between the workflow and what exists in heroku itself.
Expected behavior
A build should be an idempotent resource, or better yet, action.
Logs
2019-06-24T00:44:58.490-0500 [DEBUG] lyra: configuring scope
2019-06-24T00:44:58.490-0500 [DEBUG] lyra: applying: stepID=heroku
2019-06-24T00:44:58.490-0500 [DEBUG] lyra: starting plugin: path=/home/dhollinger/goplugins/heroku args=[/home/dhollinger/goplugins/heroku]
2019-06-24T00:44:58.490-0500 [DEBUG] lyra: plugin started: path=/home/dhollinger/goplugins/heroku pid=18511
2019-06-24T00:44:58.490-0500 [DEBUG] lyra: waiting for RPC address: path=/home/dhollinger/goplugins/heroku
2019-06-24T00:44:58.499-0500 [DEBUG] lyra.heroku: Starting to serve: @module=heroku name=Heroku timestamp=2019-06-24T00:44:58.499-0500
2019-06-24T00:44:58.499-0500 [DEBUG] lyra.heroku: plugin address: @module=heroku address=/tmp/plugin431289015 network=unix timestamp=2019-06-24T00:44:58.499-0500
2019-06-24T00:44:58.499-0500 [DEBUG] lyra: using plugin: version=1
2019-06-24T00:44:58.500-0500 [DEBUG] lyra: loaded executable: plugin="TypedName('namespace' => 'service', 'name' => 'Heroku')"
2019-06-24T00:44:58.501-0500 [DEBUG] lyra: loading metadata: plugin=/home/dhollinger/goplugins/heroku
2019-06-24T00:44:58.507-0500 [DEBUG] lyra: loaded TypeSet: name=Heroku count=6
2019-06-24T00:44:58.507-0500 [DEBUG] lyra: loaded Definitions: count=2
2019-06-24T00:44:58.507-0500 [DEBUG] lyra: done loading metadata: plugin=/home/dhollinger/goplugins/heroku
2019-06-24T00:44:58.507-0500 [DEBUG] lyra: starting plugin: path=/home/dhollinger/goplugins/yaml args=[/home/dhollinger/goplugins/yaml]
2019-06-24T00:44:58.507-0500 [DEBUG] lyra: plugin started: path=/home/dhollinger/goplugins/yaml pid=18537
2019-06-24T00:44:58.507-0500 [DEBUG] lyra: waiting for RPC address: path=/home/dhollinger/goplugins/yaml
2019-06-24T00:44:58.516-0500 [DEBUG] lyra.yaml: Starting to serve: @module=Yaml name=Yaml timestamp=2019-06-24T00:44:58.516-0500
2019-06-24T00:44:58.516-0500 [DEBUG] lyra.yaml: plugin address: @module=Yaml address=/tmp/plugin295611168 network=unix timestamp=2019-06-24T00:44:58.516-0500
2019-06-24T00:44:58.516-0500 [DEBUG] lyra: using plugin: version=1
2019-06-24T00:44:58.517-0500 [DEBUG] lyra: loaded executable: plugin="TypedName('namespace' => 'service', 'name' => 'Yaml')"
2019-06-24T00:44:58.517-0500 [DEBUG] lyra: loading metadata: plugin=/home/dhollinger/goplugins/yaml
2019-06-24T00:44:58.519-0500 [DEBUG] lyra: loaded TypeSet: name=Yaml count=2
2019-06-24T00:44:58.519-0500 [DEBUG] lyra: loaded Definitions: count=1
2019-06-24T00:44:58.519-0500 [DEBUG] lyra: done loading metadata: plugin=/home/dhollinger/goplugins/yaml
2019-06-24T00:44:58.519-0500 [DEBUG] lyra: loading manifest: file=workflows/heroku.yaml
2019-06-24T00:44:58.519-0500 [DEBUG] lyra.yaml: Invoke: name=loadManifest @module=Yaml api=Yaml::ManifestLoader timestamp=2019-06-24T00:44:58.519-0500
2019-06-24T00:44:58.521-0500 [DEBUG] lyra.yaml: Invoke: @module=Yaml api=Workflows::HerokuYaml name=metadata timestamp=2019-06-24T00:44:58.521-0500
2019-06-24T00:44:58.523-0500 [DEBUG] lyra: loaded Definitions: count=1
2019-06-24T00:44:58.523-0500 [DEBUG] lyra: creating step: style=workflow
2019-06-24T00:44:58.523-0500 [DEBUG] lyra: creating step: style=resource
2019-06-24T00:44:58.523-0500 [DEBUG] lyra: creating step: style=resource
2019-06-24T00:44:58.523-0500 [DEBUG] lyra: starting plugin: path=/home/dhollinger/goplugins/identity args=[/home/dhollinger/goplugins/identity]
2019-06-24T00:44:58.524-0500 [DEBUG] lyra: plugin started: path=/home/dhollinger/goplugins/identity pid=18563
2019-06-24T00:44:58.524-0500 [DEBUG] lyra: waiting for RPC address: path=/home/dhollinger/goplugins/identity
2019-06-24T00:44:58.537-0500 [DEBUG] lyra.identity: Starting to serve: @module=Identity name=Identity timestamp=2019-06-24T00:44:58.537-0500
2019-06-24T00:44:58.537-0500 [DEBUG] lyra.identity: plugin address: address=/tmp/plugin106892438 network=unix @module=Identity timestamp=2019-06-24T00:44:58.537-0500
2019-06-24T00:44:58.537-0500 [DEBUG] lyra: using plugin: version=1
2019-06-24T00:44:58.538-0500 [DEBUG] lyra: loaded executable: plugin="TypedName('namespace' => 'service', 'name' => 'Identity')"
2019-06-24T00:44:58.538-0500 [DEBUG] lyra: loading metadata: plugin=/home/dhollinger/goplugins/identity
2019-06-24T00:44:58.540-0500 [DEBUG] lyra: loaded TypeSet: name=Identity count=1
2019-06-24T00:44:58.540-0500 [DEBUG] lyra: loaded Definitions: count=1
2019-06-24T00:44:58.540-0500 [DEBUG] lyra: done loading metadata: plugin=/home/dhollinger/goplugins/identity [363/997]
2019-06-24T00:44:58.541-0500 [DEBUG] lyra.identity: Invoke: @module=Identity api=Identity::Service name=bumpEra timestamp=2019-06-24T00:44:58.540-0500
2019-06-24T00:44:58.542-0500 [DEBUG] lyra.identity: Invoke: @module=Identity api=Identity::Service name=getExternal timestamp=2019-06-24T00:44:58.542-0500
2019-06-24T00:44:58.546-0500 [DEBUG] lyra: GetExternal: intId=lyra://puppet.com/heroku/heroku_app?hid=Heroku%3A%3AApp&rt=Heroku%3A%3AApp extId=herokuid:/a7240136-cff1-41a5-b6d3-3200757320e2?
personal=true
2019-06-24T00:44:58.547-0500 [DEBUG] lyra.yaml: Invoke: name=state @module=Yaml api=Workflows::HerokuYaml timestamp=2019-06-24T00:44:58.546-0500
2019-06-24T00:44:58.547-0500 [DEBUG] lyra: Read state: extId=herokuid:/a7240136-cff1-41a5-b6d3-3200757320e2?personal=true
2019-06-24T00:44:58.548-0500 [DEBUG] lyra.heroku: Invoke: @module=heroku api=Heroku::AppHandler name=read timestamp=2019-06-24T00:44:58.547-0500
2019-06-24T00:44:58.548-0500 [DEBUG] lyra.heroku: Reading App: @module=heroku externalID=herokuid:/a7240136-cff1-41a5-b6d3-3200757320e2?personal=true timestamp=2019-06-24T00:44:58.548-0500
2019-06-24T00:44:58.897-0500 [DEBUG] lyra.identity: Invoke: api=Identity::Service name=getExternal @module=Identity timestamp=2019-06-24T00:44:58.897-0500
2019-06-24T00:44:58.904-0500 [DEBUG] lyra: GetExternal: intId=lyra://puppet.com/heroku/heroku_build?hid=Heroku%3A%3ABuild&rt=Heroku%3A%3ABuild extId=herokuid:/a7240136-cff1-41a5-b6d3-3200757
320e2?build_id=c4fc5772-c7f9-4a26-a5cc-bd2ba4e891da&url=/home/dhollinger/Documents/k8s-picard-api-master.tar.gz
2019-06-24T00:44:58.904-0500 [DEBUG] lyra.yaml: Invoke: @module=Yaml api=Workflows::HerokuYaml name=state timestamp=2019-06-24T00:44:58.904-0500
2019-06-24T00:44:58.905-0500 [DEBUG] lyra: Read state: extId=herokuid:/a7240136-cff1-41a5-b6d3-3200757320e2?build_id=c4fc5772-c7f9-4a26-a5cc-bd2ba4e891da&url=/home/dhollinger/Documents/k8s-p
icard-api-master.tar.gz
2019-06-24T00:44:58.905-0500 [DEBUG] lyra.heroku: Invoke: name=read @module=heroku api=Heroku::BuildHandler timestamp=2019-06-24T00:44:58.905-0500
2019-06-24T00:44:58.905-0500 [DEBUG] lyra.heroku: Reading Heroku Build: externalID=herokuid:/a7240136-cff1-41a5-b6d3-3200757320e2?build_id=c4fc5772-c7f9-4a26-a5cc-bd2ba4e891da&url=/home/dhol
linger/Documents/k8s-picard-api-master.tar.gz @module=heroku timestamp=2019-06-24T00:44:58.905-0500
2019-06-24T00:44:59.073-0500 [DEBUG] lyra: mutable attribute mismatch: attribute="attribute Heroku::Build[buildpacks]" desired="[Heroku::BuildPack('name' => 'heroku/ruby')]" actual="[Heroku:
:BuildPack('name' => '', 'uRL' => 'https://buildpack-registry.s3.amazonaws.com/buildpacks/heroku/ruby.tgz')]"
2019-06-24T00:44:59.073-0500 [DEBUG] lyra: Update state: extId=herokuid:/a7240136-cff1-41a5-b6d3-3200757320e2?build_id=c4fc5772-c7f9-4a26-a5cc-bd2ba4e891da&url=/home/dhollinger/Documents/k8s
-picard-api-master.tar.gz
2019-06-24T00:44:59.076-0500 [DEBUG] lyra.heroku: Invoke: name=update @module=heroku api=Heroku::BuildHandler timestamp=2019-06-24T00:44:59.076-0500
2019-06-24T00:44:59.076-0500 [DEBUG] lyra.heroku: Updating Build: @module=heroku desiredState="map[AppID:a7240136-cff1-41a5-b6d3-3200757320e2 BuildID:<nil> Buildpacks:[map[Name:heroku/ruby U
RL:<nil>]] SourceBlob:map[Checksum:<nil> URL:/home/dhollinger/Documents/k8s-picard-api-master.tar.gz Version:<nil>]]" timestamp=2019-06-24T00:44:59.076-0500
2019-06-24T00:44:59.161-0500 [DEBUG] lyra.heroku: [DEBUG] Uploading source '%s' to %s %s: https://s3-external-1.amazonaws.com/heroku-sources-production/ff814c71-c69a-456e-abd2-b58c4534f23e?A
WSAccessKeyId=AKIAJ6LKZGKGPARPZE4A&Signature=%2FB3Jtsp4JZLXbEBvmKbSuyT%2B9Lc%3D&Expires=1561358699=<unknown> /home/dhollinger/Documents/k8s-picard-api-master.tar.gz=PUT @module=heroku timest
amp=2019-06-24T00:44:59.161-0500
2019-06-24T00:44:59.161-0500 [DEBUG] lyra.heroku: [DEBUG] Upload source request: %+v: @module=heroku timestamp=2019-06-24T00:44:59.161-0500
2019-06-24T00:44:59.570-0500 [DEBUG] lyra.heroku: [DEBUG] Source upload response: %s: @module=heroku timestamp=2019-06-24T00:44:59.570-0500
2019-06-24T00:45:00.061-0500 [DEBUG] lyra: apply done: result={}
▸ apply done: heroku
2019-06-24T00:45:00.061-0500 [DEBUG] lyra: garbage collecting: prefix=lyra://puppet.com/heroku/
2019-06-24T00:45:00.061-0500 [DEBUG] lyra: Identity Sweep: prefix=lyra://puppet.com/heroku/
2019-06-24T00:45:00.061-0500 [DEBUG] lyra.identity: Invoke: @module=Identity api=Identity::Service name=sweep timestamp=2019-06-24T00:45:00.061-0500
2019-06-24T00:45:00.063-0500 [DEBUG] lyra: Identity Collect garbage: prefix=lyra://puppet.com/heroku/
2019-06-24T00:45:00.064-0500 [DEBUG] lyra.identity: Invoke: api=Identity::Service name=garbage @module=Identity timestamp=2019-06-24T00:45:00.064-0500
2019-06-24T00:45:00.064-0500 [DEBUG] lyra: Identity Collect garbage: prefix=lyra://puppet.com/heroku/ count=0
2019-06-24T00:45:00.065-0500 [DEBUG] lyra.identity: Invoke: api=Identity::Service name=purgeReferences @module=Identity timestamp=2019-06-24T00:45:00.064-0500
2019-06-24T00:45:00.069-0500 [DEBUG] lyra.identity: Done serving: @module=Identity name=Identity timestamp=2019-06-24T00:45:00.068-0500
2019-06-24T00:45:00.069-0500 [DEBUG] lyra.heroku: Done serving: @module=heroku name=Heroku timestamp=2019-06-24T00:45:00.069-0500
2019-06-24T00:45:00.069-0500 [DEBUG] lyra.yaml: Done serving: @module=Yaml name=Yaml timestamp=2019-06-24T00:45:00.069-0500
2019-06-24T00:45:00.070-0500 [DEBUG] lyra: plugin process exited: path=/home/dhollinger/goplugins/identity pid=18563
2019-06-24T00:45:00.071-0500 [DEBUG] lyra: plugin exited
2019-06-24T00:45:00.071-0500 [DEBUG] lyra: plugin process exited: path=/home/dhollinger/goplugins/yaml pid=18537
2019-06-24T00:45:00.071-0500 [DEBUG] lyra: plugin exited
2019-06-24T00:45:00.072-0500 [DEBUG] lyra: plugin process exited: path=/home/dhollinger/goplugins/heroku pid=18511
2019-06-24T00:45:00.072-0500 [DEBUG] lyra: plugin exited
2019-06-24T00:45:00.072-0500 [DEBUG] lyra: all plugins cleaned up
Environment (please complete the following information):
- OS: Pop!_OS 19.04 (Ubuntu based)
- Version/Build number: 1d7eb19
- Cloud target: Heroku
dhollinger commented
I will probably work this issue myself, but wanted an issue up here for tracking purposes