-
Notifications
You must be signed in to change notification settings - Fork 2k
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
[ui] example job with actions #19153
Conversation
Ember Test Audit comparison
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm a bit on the fence about the last action. While cool, the awk script is quite complex and I think a bit distracting for the purpose of the job.
If you want to curl something Nomad related you could add some ASCII art to https://github.com/hashicorp/nomad/tree/main/website/public/data
457545a
to
2f446a9
Compare
Note: used roughly this example job for the tutorial proposed at https://github.com/hashicorp/tutorials/pull/1814 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor nit-picks but LGTM!
ui/app/utils/default_jobs/actions.js
Outdated
image = "redis:3.2" | ||
ports = ["db"] | ||
command = "/bin/sh" | ||
args = ["-c", "redis-server --port \${NOMAD_PORT_db} & /local/db_log.sh"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Like above, we can probably use port mapping to keep this a bit cleaner and avoid the extra args, but if you want to use dynamic ports something like this would be a bit easier to understand?
job "example" {
group "cache" {
network {
port "db" {}
}
task "redis" {
driver = "docker"
config {
image = "redis:7"
ports = ["db"]
args = ["/etc/redis/redis.conf"]
volumes = ["local/conf:/etc/redis"]
}
template {
data = <<EOF
port {{env "NOMAD_PORT_db"}}
EOF
destination = "local/conf/redis.conf"
}
}
}
}
Then the redis-cli -p \${NOMAD_PORT_db} DBSIZE
command in db_log.sh
could be another action?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I realize it's not practical or desired for a real-world redis server on Nomad, but it seemed cool to illustrate db size output live when you make edits via action.
In the (pending) actions tutorial (PR), I hoped this would be something easily demonstrable to a user.
05090ca
to
d84df43
Compare
An example job in the UI templates to show off actions and how they work.