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

nomad init creates job that doesn't match anything in the docs (very bad UX) #8746

Closed
apollo13 opened this issue Aug 26, 2020 · 6 comments · Fixed by #8743
Closed

nomad init creates job that doesn't match anything in the docs (very bad UX) #8746

apollo13 opened this issue Aug 26, 2020 · 6 comments · Fixed by #8743

Comments

@apollo13
Copy link
Contributor

Nomad version

Nomad v0.12.3 (2db8abd)

Issue

./nomad init -short generates a job file that does not match stanzas from the documentation

Reproduction steps

$ ./nomad init -short 
Example job file written to example.nomad
$ cat example.nomad 
job "example" {
  datacenters = ["dc1"]

  group "cache" {
    task "redis" {
      driver = "docker"

      config {
        image = "redis:3.2"

        port_map {
          db = 6379
        }
      }

      resources {
        cpu    = 500
        memory = 256

        network {
          mbits = 10
          port "db" {}
        }
      }
    }
  }
}

Now job -> group -> task -> resources (https://www.nomadproject.io/docs/job-specification/resources) does not mention network at all and job -> group -> network (https://www.nomadproject.io/docs/job-specification/network) doesn't mention that it is allowed in resources either. I understand that task level networking is deprecated with the move to groups and consul connect, but either the example should use documented syntax.

@tgross
Copy link
Member

tgross commented Aug 26, 2020

Hi @apollo13! It looks like we hadn't managed to update that yet. We've marked this as a bug to fix but if you're up to it, we'd welcome a PR to the asset files where that job is defined!

@tgross tgross added theme/cli and removed theme/docs Documentation issues and enhancements labels Aug 26, 2020
@apollo13
Copy link
Contributor Author

@tgross I tried that somewhat in #8747 -- I am honestly confused about how it should look like nowadays :)

@nickethier
Copy link
Member

Hey @apollo13 I have some fixes for this slated to go in #8743

Would you mind taking a look and letting me know if theres still any confusion I could further clear up?

@apollo13
Copy link
Contributor Author

apollo13 commented Sep 1, 2020

@nickethier Fails with:

    2020-09-01T09:23:27.828+0200 [ERROR] client.alloc_runner.task_runner: running driver failed: alloc_id=756f5cf5-8aa8-58c2-169b-0cb22066332a task=redis error="Failed to create container configuration for image "redis:3.2" ("sha256:87856cc39862cec77541d68382e4867d7ccb29a85a17221446c857ddaebca916"): Trying to map ports but no network interface is available"

@nickethier nickethier linked a pull request Sep 15, 2020 that will close this issue
@nickethier
Copy link
Member

fixed in #8911

@github-actions
Copy link

github-actions bot commented Nov 1, 2022

I'm going to lock this issue because it has been closed for 120 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 1, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants