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

try grabbing query files from artifacts directory #15750

Merged
merged 1 commit into from
Jan 27, 2025

Conversation

pb82
Copy link
Contributor

@pb82 pb82 commented Jan 16, 2025

SUMMARY

Store queries discovered during job execution.

ISSUE TYPE
  • New or Enhanced Feature
COMPONENT NAME
  • API
AWX VERSION
devel
ADDITIONAL INFORMATION

@AlanCoding
Copy link
Member

#15754 should be ready to create a hook for further testing in a TODO comment marked there.

Copy link
Member

@AlanCoding AlanCoding left a comment

Choose a reason for hiding this comment

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

I've become concerned with this approach, and will file a followup issue. The planned schema will have an unbounded list of modules, which I expect to get extremely long and repetitive.

We've gotten burned in the past by storing large JSON content inside of job templates and jobs, because this affects query performance and list view loading performance. I think this applies to this case.

The best place to put this would be into a new model, say an internal CollectionVersion model which is unique to the FQCN and version. This would then be addressable from the installed_collections field already on the model.

@pb82 pb82 changed the title DRAFT: try grabbing query files from artifacts directory try grabbing query files from artifacts directory Jan 22, 2025
@pb82
Copy link
Contributor Author

pb82 commented Jan 22, 2025

@AlanCoding I can see the installed_collections field on the unified jobs model, which is also a JSON field. Does this also include the collection version? I've added a collections/requirements.yml file to my project and ran a job, but the field always seems to be empty, even though the collection got installed. But probably an issue on my end.

The new table could look like this:

fqcn collection_version event_query
foo.bar 1.0.0 dict[module name]query

FQCN and collection_version would form the primary key. Does that look good to you? We would also need to parse the query file once we receive it. And we can skip updating the table if there is already a query for a given collection version.

@AlanCoding
Copy link
Member

I've added a collections/requirements.yml file to my project and ran a job, but the field always seems to be empty

Presumably because of ansible/ansible-runner#1273

My stance is that we should send back the collection data by the same mechanism as the event_query data.

But I think we should store them in different locations, because IMO the event_query data will likely be too much to put on the job record.

@pb82 pb82 changed the base branch from devel to indirect-host-counting January 24, 2025 10:26
@pb82 pb82 merged commit 4495c6c into indirect-host-counting Jan 27, 2025
10 of 20 checks passed
@pb82 pb82 deleted the AAP-37278 branch January 27, 2025 14:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants