Skip to content
This repository has been archived by the owner on Dec 21, 2021. It is now read-only.

Add ability to run "one shot" commands #117

Closed
soenkeliebau opened this issue Mar 22, 2021 · 2 comments · Fixed by #205
Closed

Add ability to run "one shot" commands #117

soenkeliebau opened this issue Mar 22, 2021 · 2 comments · Fixed by #205
Assignees
Labels
priority/high type/enhancement New feature or request

Comments

@soenkeliebau
Copy link
Member

soenkeliebau commented Mar 22, 2021

The idea here is to support running preparatory or maintenance tasks that need to execute as a command that finishes after a while.
Ideally this should also be done via systemd as some of these commands can run for quite a while (days sometimes) and we do not want them aborted, when the agent crashes or is restarted.

This could be done via the following settings:

Type=oneshot
RemainAfterExit=true

An example can be seen here.

I am unsure if RemainAfterExit is necessary, but this might be required to check the exit code of the command afterwards.

@siegfriedweber
Copy link
Member

Kubernetes jobs behave as follows:

  • The job controller creates a pod with the label job-name=<name of the job>.
  • If the pod terminates successfully then its status contains phase: Succeeded and status/containerStatuses/state/terminated contains exitCode: 0 and reason: Completed.
  • If the pod terminates unsuccessfully then its status contains phase: Failed and status/containerStatuses/state/terminated contains exitCode: <exit code> and reason: Error.
  • The job does not delete the pod so that the result can be inspected.

(The job controller actually does a lot more but that is not relevant here.)

This behavior should be replicated in the agent.

@lfrancke
Copy link
Member

We have this ticket stackabletech/documentation#28 which talks about designing this feature.
That has been superseded by this one.
Is this a thing/change that needs to be documented? I believe so, right? We should document the Agent behavior.
I'll close the other issue in favor of this one.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
priority/high type/enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants