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

Question: How to omit job events for Ansible operator? #19

Open
el-pako opened this issue Jun 1, 2023 · 5 comments
Open

Question: How to omit job events for Ansible operator? #19

el-pako opened this issue Jun 1, 2023 · 5 comments
Labels
good first issue Denotes an issue ready for a new contributor, according to the "help wanted" guidelines. help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. kind/feature Categorizes issue or PR as related to a new feature. lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale.

Comments

@el-pako
Copy link

el-pako commented Jun 1, 2023

Type of question

General operator-related help

Question

I am trying to find any way for Ansible operator to stop generating job events (*.json) in artifacts directory for each run, but keep writing stdout, stderr, etc.

Ansible runner executable provides flag --omit-event-data, but it seems Ansible operator code passes a fixed list of flags when calling the runner:
https://github.com/operator-framework/operator-sdk/blob/v1.28.x/internal/ansible/runner/runner.go#L98

The awx display plugin, reads environment variable RUNNER_OMIT_EVENTS, but setting this to true before calling ansible-operator did not have the desired effect.

Operator type:

/language ansible

Kubernetes cluster type:

Openshift

$ oc version
Client Version: 4.10.16
Server Version: 4.10.16
Kubernetes Version: v1.23.5+3afdacb

$ ansible-operator version
ansible-operator version: "v1.28.1", commit: "b05f6a56a176a98b7d92c4d4b36076967e0d77f7", kubernetes version: "v1.26.0", go version: "go1.18.10", GOOS: "linux", GOARCH: "amd64"

$ ansible-runner --version
2.1.0
@varshaprasad96 varshaprasad96 added the triage/support Indicates an issue that is a support question. label Jun 12, 2023
@everettraven
Copy link
Collaborator

Does any of the information in https://sdk.operatorframework.io/docs/building-operators/ansible/reference/advanced_options/#using-ansible-log-events help?

If not, I think it seems reasonable that if the ansible-runner doesn't provide an environment variable for omitting the event data that we add a check for an env var that we would append the --omit-event-data flag to it.

@el-pako
Copy link
Author

el-pako commented Jun 15, 2023

None of this influences the creation of job events. The only thing that helps is reducing the overall number of artifacts using maxRunnerArtifacts, but this would also affect the collection of other files like stdout, stderr, etc.

Having default maxRunnerArtifacts of 20, the job events alone add up to > 1GB in the filesystem of our Ansible operator based pods, which consumes memory. It would be really helpful to be able to set the env var as you suggested.

@everettraven everettraven added kind/feature Categorizes issue or PR as related to a new feature. and removed triage/support Indicates an issue that is a support question. labels Jun 28, 2023
@everettraven
Copy link
Collaborator

Adding the kind/feature label and removing the milestone so that this show up in our next issue triage meeting.

The feature to be added is the ability to specify that the --omit-job-events flag should be appended to the set of flags passed to the ansible runner around https://github.com/operator-framework/operator-sdk/blob/v1.28.x/internal/ansible/runner/runner.go#L98

I'm also going to unassign myself from this issue as I likely won't have the bandwidth to implement this myself. I'm happy to be a point of contact for these changes and review any PRs

@everettraven everettraven removed their assignment Jun 28, 2023
@everettraven everettraven added help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. good first issue Denotes an issue ready for a new contributor, according to the "help wanted" guidelines. labels Jul 3, 2023
@openshift-bot
Copy link

Issues go stale after 90d of inactivity.

Mark the issue as fresh by commenting /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.
Exclude this issue from closing by commenting /lifecycle frozen.

If this issue is safe to close now please do so with /close.

/lifecycle stale

@openshift-ci openshift-ci bot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Oct 2, 2023
@openshift-ci
Copy link

openshift-ci bot commented Oct 5, 2023

@el-pako: The label(s) language/ansible cannot be applied, because the repository doesn't have them.

In response to this:

Type of question

General operator-related help

Question

I am trying to find any way for Ansible operator to stop generating job events (*.json) in artifacts directory for each run, but keep writing stdout, stderr, etc.

Ansible runner executable provides flag --omit-event-data, but it seems Ansible operator code passes a fixed list of flags when calling the runner:
https://github.com/operator-framework/operator-sdk/blob/v1.28.x/internal/ansible/runner/runner.go#L98

The awx display plugin, reads environment variable RUNNER_OMIT_EVENTS, but setting this to true before calling ansible-operator did not have the desired effect.

Operator type:

/language ansible

Kubernetes cluster type:

Openshift

$ oc version
Client Version: 4.10.16
Server Version: 4.10.16
Kubernetes Version: v1.23.5+3afdacb

$ ansible-operator version
ansible-operator version: "v1.28.1", commit: "b05f6a56a176a98b7d92c4d4b36076967e0d77f7", kubernetes version: "v1.26.0", go version: "go1.18.10", GOOS: "linux", GOARCH: "amd64"

$ ansible-runner --version
2.1.0

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@everettraven everettraven transferred this issue from operator-framework/operator-sdk Oct 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Denotes an issue ready for a new contributor, according to the "help wanted" guidelines. help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. kind/feature Categorizes issue or PR as related to a new feature. lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale.
Projects
None yet
Development

No branches or pull requests

4 participants