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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Nomad dependencies #7

Merged
merged 4 commits into from
Sep 19, 2017
Merged

Update Nomad dependencies #7

merged 4 commits into from
Sep 19, 2017

Conversation

blalor
Copy link
Contributor

@blalor blalor commented Aug 9, 2017

This updates the vendored Nomad dependencies to v0.6.0, with a couple of other transitive dependencies as specified in Nomad's vendor.json.

I struggled mightily with govendor and resorted to brute-forcing the fetch of the previously-existing vendored sources under github.com/hashicorp/nomad (plus the others). This does not feel like the correct approach. 馃 However, the end result works. I believe this project's vendor.json needs to be adjusted to ease future maintenance.

Fixes #4.

@dadgar
Copy link

dadgar commented Aug 21, 2017

@radeksimko Gave it a look and from Nomad perspective looks 馃憤

@cstruct
Copy link

cstruct commented Aug 29, 2017

Ping @radeksimko. What's necessary for this to land? It would make my day if this landed soon.

Copy link
Member

@radeksimko radeksimko left a comment

Choose a reason for hiding this comment

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

This is looking good. Besides that one inline question I wonder if it's worth removing github.com/hashicorp/nomad/ from ignore in vendor/vendor.json?

As far as I remember @mitchellh made some local modifications to nomad a while back to avoid depending on cgo which is where the ignore entry comes from.

Am I assuming correctly this is no longer necessary and we can use nomad w/out modifications?

if err != nil {
return fmt.Errorf("error parsing jobspec: %s", err)
}

// Initialize and validate
jobspecStruct.Canonicalize()
if err := jobspecStruct.Validate(); err != nil {
Copy link
Member

Choose a reason for hiding this comment

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

I understand the validation is now part of Parse, right? So it's just implicit, rather than explicit? 馃

Copy link

Choose a reason for hiding this comment

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

@radeksimko It is not validated as part of Parse(). The job is validated during Register. If it is invalid and error will be returned. If you want early validation, you would have to call validate before register: https://github.com/hashicorp/nomad/blob/master/api/jobs.go#L42

Copy link
Member

Choose a reason for hiding this comment

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

Understood. So the user practically won't see any difference, because it's validated in CRUD - in either case during apply. If we wanted to do early validation we'd do it in ValidateFunc (which runs during plan).

Still a little bit confusing to see this being removed as part of an upgrade, but it doesn't do any harm, I guess.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It was removed because jobspec.Parse returns *api.Job which does not have a Validate function. That was the simple solution. Based on the conversation I don't believe there's much value in performing additional validation, but I'm happy to if that's what you'd like.

@sirocode
Copy link

sirocode commented Sep 4, 2017

Why you consider this issue as "enhancement"? It's a bug.

@cstruct
Copy link

cstruct commented Sep 4, 2017

@sirocode I think this was marked as an enhancement when the only reported issue about this was missing support for the leader property. It could be argued adding support for a new property where everything else works is an enhancement and not a bug.

@sirocode
Copy link

sirocode commented Sep 6, 2017

@cstruct I understand, I just can not wait to finally see this issue fixed!

@blalor
Copy link
Contributor Author

blalor commented Sep 7, 2017

I'm on vacation right now, but I'll try to address the issues raised on Monday. Sorry for the delay!

@cstruct
Copy link

cstruct commented Sep 7, 2017

@sirocode If you can't wait you can build it from source and bundle it with terraform-bundle, that's what I've done.

@apparentlymart
Copy link
Member

hashicorp/nomad#1982 was opened to track the issue that we weren't able to use the upstream Nomad due to the need for all of the drivers to be present.

Since that issue remains open, I assume that limitation still applies and so we need to retain the local patches in Terraform to work around the problem. 馃槥

@dadgar
Copy link

dadgar commented Sep 11, 2017

@apparentlymart Sorry about that, I just closed the issue. That has been resolved since Nomad v0.5.5

@radeksimko
Copy link
Member

@dadgar Thanks for the clarification.

@blalor My only question remains - can we remove github.com/hashicorp/nomad/ from ignore then?

I'm happy to do it for you, if you don't have time to spend on this anymore - just let me know.

@justinpersaud
Copy link

any rough eta on when this might be merged? hoping to leverage the latest nomad features through terraform

@chandy
Copy link

chandy commented Sep 18, 2017

hi @blalor is there any chance you could make the update @radeksimko is proposing or just give him the goahead to do it? We would like very much to use this feature. Thanks for your work on it so far!

github.com/hashicorp/raft and github.com/ugorji/go/codec picked up from
github.com/hashicorp/nomad after compilation failed.

    govendor fetch github.com/hashicorp/nomad/nomad/structs@=v0.6.0
    govendor fetch github.com/hashicorp/nomad/jobspec@=v0.6.0
    govendor fetch github.com/hashicorp/nomad/helper@=v0.6.0
    govendor fetch github.com/hashicorp/nomad/api@=v0.6.0
    govendor fetch github.com/hashicorp/raft@e45173826775c4b782961c7b5758ba484b91464b
    govendor fetch github.com/ugorji/go/codec@c88ee250d0221a57af388746f5cf03768c21d6e2
Vendored deps are for Nomad 0.6.0.  Tests pass, so that's neat.
This is a side-effect of the dependency updates.

Fixes #4.
@radeksimko
Copy link
Member

Thanks for making those changes. 馃憤

@radeksimko radeksimko merged commit cf162ca into hashicorp:master Sep 19, 2017
@blalor blalor deleted the update-nomad-deps branch September 19, 2017 22:39
@chandy
Copy link

chandy commented Sep 20, 2017

Thank you @blalor !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

8 participants