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

Fix parameterized job child meta/payload UI #11954

Closed

Conversation

alistairking
Copy link

Disclaimer: I don't know anything about UI things.
This seems to work for me, but I'm sure there are better ways to make this fix.

Test Job
job "example" {
  datacenters = ["dc1"]
  type = "batch"

  parameterized {
    payload = "required"
    meta_optional = ["something"]
  }

  group "web" {

    network {
      mode = "bridge"
      port "www" {
        to = 8001
      }
    }

    task "http" {

      driver = "docker"

      config {
        image   = "busybox:1"
        command = "httpd"
        args    = ["-v", "-f", "-p", "8001", "-h", "/local"]
        ports   = ["www"]
      }

      dispatch_payload {
        file = "/local/text.index.html"
      }

      resources {
        cpu    = 128
        memory = 128
      }

    }
  }
}

Metadata
Previously the metadata UI bit for parameterized children was completely broken. Even jobs that did have metadata would appear to have none.
It seems that the <jobPage.ui.Meta /> component already handles non-existent metadata, so I simply dropped the (broken) checking for no metadata.

Before:
Screen Shot 2022-01-27 at 10 29 05 AM

After
Screen Shot 2022-01-27 at 10 28 32 AM

Payload
I think something has broken recently with https://github.com/hashicorp/nomad/blob/main/ui/app/components/job-page/parameterized-child.js such that those payload and payloadJSON attributes aren't working, but I couldn't figure out how to fix it which is why I copied the payloadJSON method into the job model -- if someone smarter than me could help me fix this properly that would be great.

Previously the metadata UI bit for parameterized children was completely
broken. Also splits the payload component out into a separate template.
@lgfa29
Copy link
Contributor

lgfa29 commented Feb 5, 2022

Thanks for the PR @alistairking!

The meta change makes sense to me, but I'm not sure why the payload is broken. I think it may have happened during #11780 so I will ask @ChaiWithJai to take a look.

@lgfa29 lgfa29 requested a review from ChaiWithJai February 5, 2022 01:27
@alistairking
Copy link
Author

@lgfa29 @ChaiWithJai any updates on this one?
I'd love to be able to see metadata on my parameterized jobs :)

@lgfa29 lgfa29 added this to the 1.3.0 milestone Mar 10, 2022
@lgfa29
Copy link
Contributor

lgfa29 commented Mar 10, 2022

@alistairking no updates yet, but we have it set for the next release 🙂

@hashicorp-cla
Copy link

hashicorp-cla commented Mar 12, 2022

CLA assistant check
All committers have signed the CLA.

@philrenaud
Copy link
Contributor

Hi @alistairking, thanks for this PR. The fix in #13473 should bring the Meta and Payload sections back to parameterized child jobs, and is being backported to Nomad 1.3.x releases. I'll close out this PR as such, and thanks so much for helping us identify the issue!

@philrenaud philrenaud closed this Jun 24, 2022
@alistairking alistairking deleted the a6r-ui-param-child-meta branch June 26, 2022 14:44
@alistairking
Copy link
Author

thanks!

@lgfa29 lgfa29 removed this from the 1.3.x milestone Aug 24, 2022
@github-actions
Copy link

I'm going to lock this pull request because it has been closed for 120 days ⏳. This helps our maintainers find and focus on the active contributions.
If you have found a problem that seems related to this change, 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 Dec 22, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

6 participants