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

Introdocing tag model and tag added in executions #1085

Merged
merged 16 commits into from
Jan 24, 2025

Conversation

muhammad-ali-e
Copy link
Contributor

@muhammad-ali-e muhammad-ali-e commented Jan 22, 2025

What

  • Introducing Tag Model.
  • Added many-to-many connection on tag to Execution model to enhance functionality.
  • Updated the APIDeployment POST endpoint to accept tags as a parameter.
  • Implemented usage calculation with filtering capabilities based on execution ID, tag, etc.
  • Limited the number of tags per request to one, ensuring compatibility with the LLM Whisperer integration.

Why

  • Enable users to provide a tags parameter, particularly for seamless integration with LLM Whisperer.
  • Facilitate precise usage tracking by incorporating filters such as execution ID and tags.

How

  • Created a new Tag model.
  • Established a many-to-many relationship between the Execution model and the Tag model.

Can this PR break any existing features. If yes, please list possible items. If no, please explain why. (PS: Admins do not merge the PR without this section filled)

  • This PR is unlikely to break any existing functionality

Database Migrations

  • Introduced a new Tag model.
  • Added a many-to-many field in the Execution model to associate it with tags.

Env Config

Relevant Docs

Related Issues or PRs

Dependencies Versions

Notes on Testing

Screenshots

Checklist

I have read and understood the Contribution Guidelines.

@muhammad-ali-e muhammad-ali-e marked this pull request as ready for review January 23, 2025 04:19
backend/tags/helper.py Outdated Show resolved Hide resolved
backend/tags/serializers.py Outdated Show resolved Hide resolved
backend/tags/urls.py Show resolved Hide resolved
backend/tags/views.py Outdated Show resolved Hide resolved
backend/tags/views.py Show resolved Hide resolved
backend/usage_v2/dto.py Show resolved Hide resolved
backend/usage_v2/models.py Show resolved Hide resolved
backend/usage_v2/utils.py Show resolved Hide resolved
Co-authored-by: Chandrasekharan M <[email protected]>
Signed-off-by: ali <[email protected]>
Copy link
Contributor

filepath function $$\textcolor{#23d18b}{\tt{passed}}$$ SUBTOTAL
$$\textcolor{#23d18b}{\tt{runner/src/unstract/runner/clients/test\_docker.py}}$$ $$\textcolor{#23d18b}{\tt{test\_logs}}$$ $$\textcolor{#23d18b}{\tt{1}}$$ $$\textcolor{#23d18b}{\tt{1}}$$
$$\textcolor{#23d18b}{\tt{runner/src/unstract/runner/clients/test\_docker.py}}$$ $$\textcolor{#23d18b}{\tt{test\_cleanup}}$$ $$\textcolor{#23d18b}{\tt{1}}$$ $$\textcolor{#23d18b}{\tt{1}}$$
$$\textcolor{#23d18b}{\tt{runner/src/unstract/runner/clients/test\_docker.py}}$$ $$\textcolor{#23d18b}{\tt{test\_cleanup\_skip}}$$ $$\textcolor{#23d18b}{\tt{1}}$$ $$\textcolor{#23d18b}{\tt{1}}$$
$$\textcolor{#23d18b}{\tt{runner/src/unstract/runner/clients/test\_docker.py}}$$ $$\textcolor{#23d18b}{\tt{test\_client\_init}}$$ $$\textcolor{#23d18b}{\tt{1}}$$ $$\textcolor{#23d18b}{\tt{1}}$$
$$\textcolor{#23d18b}{\tt{runner/src/unstract/runner/clients/test\_docker.py}}$$ $$\textcolor{#23d18b}{\tt{test\_get\_image\_exists}}$$ $$\textcolor{#23d18b}{\tt{1}}$$ $$\textcolor{#23d18b}{\tt{1}}$$
$$\textcolor{#23d18b}{\tt{runner/src/unstract/runner/clients/test\_docker.py}}$$ $$\textcolor{#23d18b}{\tt{test\_get\_image}}$$ $$\textcolor{#23d18b}{\tt{1}}$$ $$\textcolor{#23d18b}{\tt{1}}$$
$$\textcolor{#23d18b}{\tt{runner/src/unstract/runner/clients/test\_docker.py}}$$ $$\textcolor{#23d18b}{\tt{test\_get\_container\_run\_config}}$$ $$\textcolor{#23d18b}{\tt{1}}$$ $$\textcolor{#23d18b}{\tt{1}}$$
$$\textcolor{#23d18b}{\tt{runner/src/unstract/runner/clients/test\_docker.py}}$$ $$\textcolor{#23d18b}{\tt{test\_get\_container\_run\_config\_without\_mount}}$$ $$\textcolor{#23d18b}{\tt{1}}$$ $$\textcolor{#23d18b}{\tt{1}}$$
$$\textcolor{#23d18b}{\tt{runner/src/unstract/runner/clients/test\_docker.py}}$$ $$\textcolor{#23d18b}{\tt{test\_run\_container}}$$ $$\textcolor{#23d18b}{\tt{1}}$$ $$\textcolor{#23d18b}{\tt{1}}$$
$$\textcolor{#23d18b}{\tt{TOTAL}}$$ $$\textcolor{#23d18b}{\tt{9}}$$ $$\textcolor{#23d18b}{\tt{9}}$$

@muhammad-ali-e muhammad-ali-e merged commit 265972c into main Jan 24, 2025
4 checks passed
@muhammad-ali-e muhammad-ali-e deleted the UN-1991-add-tags-in-modules branch January 24, 2025 04:11
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.

3 participants