digesting/converting docker-compose into nomad

1,557 views
Skip to first unread message

Justin DynamicD

unread,
Nov 4, 2017, 4:53:25 PM11/4/17
to Nomad
Does anyone have a simple cli tool that can take a docker-compose file and spit out a nomad job?  I figured this would be rather trivial/common but turns out it's simply not.  

Scenario:  we have a internal tool that spits out docker-compose files for various micro-services, which then gets copied to a target node and run.  I'd like to effectively "step into" the process by using a tool to convert those docker-compose files into nomd job files and send them to the nomad server instead (and let a real scheduler do it's magic).  While there are obviously some additional values that would need to be added (like datacenter), I was hoping to find a simple tool I could call in bash and just "shim" into place (after the compose files are spit out I run "convert2nomad docker-compose.yaml nomad.hcl" and bam: I now have a hcl I can curl to the nomad servers.

I've googled around and saw some simple bash functions but they didn't work well with arrays, and to be quite honest I couldn't find an easy way in bash to even get a variable from a yaml file.  Anyone know of a tool that works (found some ruby code as well but it flat out errored)?

Alex Dadgar

unread,
Nov 6, 2017, 6:43:42 PM11/6/17
to Justin DynamicD, Nomad
Hey Justin,

As for as a I know such a tool does not exist! If you go down the road of creating one be sure to share with the community!

--
This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list.
 
GitHub Issues: https://github.com/hashicorp/nomad/issues
IRC: #nomad-tool on Freenode
---
You received this message because you are subscribed to the Google Groups "Nomad" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nomad-tool+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/nomad-tool/60bac0fb-a013-4c46-a4a7-dfb3f42f5d13%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Thanks,
Alex

Justin DynamicD

unread,
Nov 10, 2017, 12:31:48 AM11/10/17
to Nomad
Well, unfortunately for the community (though good for me) it turns out our internal tool that spits out Docker-Compose does so by passing variables through a go template, so all I had to do is provide a nomad template and I seem to be good to go.

Lucky me!


On Monday, November 6, 2017 at 3:43:42 PM UTC-8, Alex Dadgar wrote:
Hey Justin,

As for as a I know such a tool does not exist! If you go down the road of creating one be sure to share with the community!
On Sat, Nov 4, 2017 at 1:53 PM, Justin DynamicD <justin....@gmail.com> wrote:
Does anyone have a simple cli tool that can take a docker-compose file and spit out a nomad job?  I figured this would be rather trivial/common but turns out it's simply not.  

Scenario:  we have a internal tool that spits out docker-compose files for various micro-services, which then gets copied to a target node and run.  I'd like to effectively "step into" the process by using a tool to convert those docker-compose files into nomd job files and send them to the nomad server instead (and let a real scheduler do it's magic).  While there are obviously some additional values that would need to be added (like datacenter), I was hoping to find a simple tool I could call in bash and just "shim" into place (after the compose files are spit out I run "convert2nomad docker-compose.yaml nomad.hcl" and bam: I now have a hcl I can curl to the nomad servers.

I've googled around and saw some simple bash functions but they didn't work well with arrays, and to be quite honest I couldn't find an easy way in bash to even get a variable from a yaml file.  Anyone know of a tool that works (found some ruby code as well but it flat out errored)?

--
This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list.
 
GitHub Issues: https://github.com/hashicorp/nomad/issues
IRC: #nomad-tool on Freenode
---
You received this message because you are subscribed to the Google Groups "Nomad" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nomad-tool+...@googlegroups.com.



--
Thanks,
Alex
Reply all
Reply to author
Forward
0 new messages