Can't get nomad to load a docker image from a tar file

886 views
Skip to first unread message

Kevin Pauba

unread,
May 19, 2016, 5:11:34 PM5/19/16
to Nomad
I have a task where I would like to pull a Hazelcast docker image (built with packer) from Amazon S3 and run start it up:

             task "hazelcast" {
# Use Docker to run the task.
driver = "docker"

# Configure Docker driver with the image
config {
load = ["hazelcast.tar"]
image = "hazelcast/hazelcast:latest"
command = "/opt/hazelcast/server.sh"
port_map {
hazelcast = 5701
}
}

env {
JAVA_OPTS="-Xms1G -Xmx1G -Dhazelcast.initial.wait.seconds=100"
}

# We must specify the resources required for
# this task to ensure it runs on a machine with
# enough capacity.
resources {
cpu = 500 # 500 Mhz
memory = 2048 # 2GB
network {
mbits =2 
port "hazelcast" {}
}

}

      artifact {
      }

I have imported the tarball into my local docker and everything looks fine (the image is loaded, has the tag "hazelcast/hazelcast:latest" and I can "docker exec -it .... /bin/bash" to access it as expected).

When I run the job containing this task, I get this alloc-status:

ID            = f2e4b0d1
Eval ID       = a4ea234c
Name          = hazelcast.server[1]
Node ID       = f12ffa15
Job ID        = hazelcast
Client Status = failed

==> Task Resources
Task: "hazelcast"
CPU  Memory MB  Disk MB  IOPS  Addresses
500  2048       300      0     hazelcast: 10.139.3.244:29213

==> Task "hazelcast" is "dead"
Recent Events:
Time                   Type                   Description
19/05/16 20:37:37 UTC  Restarts Exceeded      <none>
19/05/16 20:37:37 UTC  Driver Failure         Failed to pull `hazelcast/hazelcast:latest`: Error: image hazelcast/hazelcast:latest not found
19/05/16 20:37:28 UTC  Downloading Artifacts  Client is downloading artifacts
19/05/16 20:37:28 UTC  Received               Task received by client


I tried using the Docker Image ID for the "image" configuration item but it still didn't work.

Any ideas?

Diptanu Choudhury

unread,
May 20, 2016, 3:37:00 PM5/20/16
to Kevin Pauba, Nomad
Hi Kevin,

I just tried loading your image in a job. I think there is some problem with the image itself, at the end of the load I am getting the message "invalid argument", and hence the image is not getting loaded properly.

--
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/nomad-tool/3730d10c-a4b0-4fe2-9e2c-78e278c83fe5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Thanks,
Diptanu Choudhury

Diptanu Choudhury

unread,
May 20, 2016, 3:39:05 PM5/20/16
to Kevin Pauba, Nomad
The "Failed to Pull" message you are seeing is the docker driver retrying loading the image and not actually "Pulling" the image from a registry.

Kevin Pauba

unread,
May 20, 2016, 4:02:42 PM5/20/16
to Nomad
Thanks for the reply, Diptanu (forgive me if that's not your given name).

I find that the image is loaded but it doesn't have a repository name or tag so the "image" value I provided can't be found in the list of available images (and there's no private repository by that name either).  If I can find some way to have the correct information in the tarball, I can probably get it to work.

I'm going to check to see if I can get packer to add the repository name and tag when it exports the image into the tarball (which I thought I was already doing).

There was a PR for this feature -- Issue #349 -- but they closed it thinking the private repositories (with authorized access) are the way to go.  Maybe so but I'm looking to demonstrate some stuff and don't want to take the time to set up all of the surrounding infrastructure ... yet.

l8r

Kevin Pauba

unread,
Jun 14, 2016, 4:41:13 PM6/14/16
to Nomad
Just as a follow up ...

I found that if I use "docker commit ..." and then "docker save ....", the resulting tarball loads up just fine.  :)
Reply all
Reply to author
Forward
0 new messages