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

Add support for ExecTask and ExecTaskStreaming APIs #32

Merged
merged 1 commit into from
Sep 7, 2022

Conversation

grembo
Copy link
Contributor

@grembo grembo commented Aug 8, 2022

The ExecTask API allows running commands within a running pot
as part of service checks, example:

service {
   check {
     type    = "script"
     command = "/bin/sh"
     args    = ["-c", "test -f /tmp/mycookie || exit 2"]
     interval = "10s"
     timeout = "5s"
   }
 }

The ExecTaskStreaming API allows running command within a pot
from the command line:

nomad alloc exec 94b77f14 touch /tmp/mycookie
nomad alloc -job myjob vi /etc/resolv.conf

This API also allows running commands and opening a shell using
the Nomad web UI.

@grembo
Copy link
Contributor Author

grembo commented Aug 8, 2022

@ebarriosjr @pizzamig Note: This is based on #31, I didn't figure out how to create proper stacked PRs. So once #31 landed, I'll rebase this one.

@grembo grembo changed the title Support exec Add support for ExecTask and ExecTaskStreaming APIs Aug 8, 2022
@grembo
Copy link
Contributor Author

grembo commented Aug 28, 2022

@pizzamig any chance to look into this one (and the signal one first)? They’re really helpful when dealing with nomad - especially being able to exec into a running pot using nomad’s web ui is a lot of fun.

The ExecTask API allows running commands within a running pot
as part of service checks, example:

    service {
       check {
         type    = "script"
         command = "/bin/sh"
         args    = ["-c", "test -f /tmp/mycookie || exit 2"]
         interval = "10s"
         timeout = "5s"
       }
     }

The ExecTaskStreaming API allows running command within a pot
from the command line:

    nomad alloc exec 94b77f14 touch /tmp/mycookie
    nomad alloc -job myjob vi /etc/resolv.conf

This API also allows running commands and opening a shell using
the Nomad web UI.
@grembo
Copy link
Contributor Author

grembo commented Sep 6, 2022

Rebased now. Screenshot in action:

nomad exec web ui

Copy link
Contributor

@pizzamig pizzamig left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is just awesome!

@grembo grembo merged commit 50b8d21 into bsdpot:master Sep 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants