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

ref(*): update mixin #3

Merged
merged 4 commits into from
Apr 12, 2019
Merged

ref(*): update mixin #3

merged 4 commits into from
Apr 12, 2019

Conversation

vdice
Copy link
Member

@vdice vdice commented Apr 11, 2019

  • update with most recent porter <-> mixin data protocol
  • add new terraform options/args to actions

In general, this PR gets this mixin up to speed and in a working state, tested by the integration test added in getporter/porter#261

cmd/terraform/main.go Outdated Show resolved Hide resolved
pkg/terraform/install.go Show resolved Hide resolved

assert.Equal(t, "Install MySQL", step.Description)
assert.Equal(t, true, step.Init)
Copy link
Member

Choose a reason for hiding this comment

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

Is it safe to unconditionally init terraform every time? I don't know enough about it, so I'm just asking for my own curiosity.

Copy link
Member Author

@vdice vdice Apr 11, 2019

Choose a reason for hiding this comment

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

Good question. I think it's becoming apparent that we need to init every time, now that I'm reconciling terraform with how porter (or, generally, CNAB) bundles currently operate. If I'm not mistaken, each porter/CNAB action is a fresh container run using the invocation image, with fresh context, and therefore in tf-land, we do need to init each time.

For maintaining/re-using state, I've created #4 for use of remote backends. I'm not currently aware of a technique to re-use state in a CNAB context locally, yet. We need to research this.

Which is to say, I think at this point, we probably need to assume that every action needs to init first (and, thus, the utility of allowing user to specify whether or not to via the porter manifest is not really useful/applicable.)

Copy link
Member

Choose a reason for hiding this comment

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

Oh so init is a client side action?

Copy link
Collaborator

Choose a reason for hiding this comment

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

init downloads all terraform modules required to run

Copy link
Member

@carolynvs carolynvs Apr 11, 2019

Choose a reason for hiding this comment

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

Hmmm, what if we ran it as part of the docker build instead of at runtime? Is that an option? Once we start passing in the full porter manifest to the mixin, it will know where the working directory is. So we can't do it in this PR, but soon.

Copy link
Member Author

Choose a reason for hiding this comment

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

Oh, good idea! This might definitely be the best way to go, once porter/mixins support it. I'll file a ticket to revisit.

},
// TODO: test Init: true (requires main test helper refactor to support one action issuing multiple commands)
Copy link
Member

Choose a reason for hiding this comment

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

oh yeah we really need to do this, Jeremy has an issue open for it getporter/porter#231

cmd/terraform/status.go Show resolved Hide resolved
pkg/terraform/terraform.go Outdated Show resolved Hide resolved
Copy link
Collaborator

@jdolitsky jdolitsky left a comment

Choose a reason for hiding this comment

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

just awesome vaughn 👍 lgtm


assert.Equal(t, "Install MySQL", step.Description)
assert.Equal(t, true, step.Init)
Copy link
Collaborator

Choose a reason for hiding this comment

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

init downloads all terraform modules required to run

pkg/terraform/terraform.go Outdated Show resolved Hide resolved
@carolynvs
Copy link
Member

Merge at will! 🚢

* update with most recent porter <-> mixin data protocol
* add new terraform options/args to actions
Signed-off-by: Vaughn Dice <vadice@microsoft.com>
@vdice
Copy link
Member Author

vdice commented Apr 12, 2019

Thanks @carolynvs ! The only blocker now for this PR is getporter/porter#266 (or a similar solution), as the bulk of these unit tests rely on the support mentioned in that PR/ticket.

@vdice
Copy link
Member Author

vdice commented Apr 12, 2019

Ok, needed to run dep ensure to get the updated porter pkg/test changes (for unit tests to pass), but it also brought in a slew of other updates. Assuming this is acceptable, this should be good to go.

@vdice vdice merged commit 793c38b into getporter:master Apr 12, 2019
@vdice vdice deleted the ref/update-mixin branch April 12, 2019 19:33
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.

None yet

3 participants