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

[8.x] [Inference] create the @kbn/inference-common package (#193464) #199002

Merged
merged 1 commit into from
Nov 5, 2024

Conversation

pgayvallet
Copy link
Contributor

Backport

This will backport the following commits from main to 8.x:

Questions ?

Please refer to the Backport tool documentation

## Summary

At the moment, all inference API related types and utilities
(`chatComplete`, `output` and more) are living inside the `inference`
plugin's common folder.

This is somewhat problematic because it forces any consumers of those
types to explicitly depends on the `inference` plugin (via plugin dep or
ts ref), which could lead to any kind of cyclic dependency issues, in
addition to being overall a bad design pattern.

This also makes it more complicated that it should to try to split the
inference logic / task framework / task implementation into distinct
packages or plugins, due to some (concrete) utilities living in the
inference plugin's code.

It's also a bad experience for consumers, as it's quite difficult to
easily resolve imports they need (we're mixing internal and public
exports atm, plus not all types are exported from a single entry point,
making it very tedious to find the right path for each individual import
we need to consume the inference APIs)

This PR addresses most of those points, by introducing a new
`@kbn/inference-common` package and moving all the low level types and
utilities to it, while exposing all of them from the package's
entrypoint.

---------

Co-authored-by: kibanamachine <[email protected]>
Co-authored-by: Elastic Machine <[email protected]>
(cherry picked from commit 631ccb0)

# Conflicts:
#	.github/CODEOWNERS
@pgayvallet pgayvallet enabled auto-merge (squash) November 5, 2024 15:17
@botelastic botelastic bot added ci:project-deploy-observability Create an Observability project Team:Obs AI Assistant Observability AI Assistant labels Nov 5, 2024
@elasticmachine
Copy link
Contributor

Pinging @elastic/obs-ai-assistant (Team:Obs AI Assistant)

Copy link
Contributor

github-actions bot commented Nov 5, 2024

🤖 GitHub comments

Expand to view the GitHub comments

Just comment with:

  • /oblt-deploy : Deploy a Kibana instance using the Observability test environments.
  • run docs-build : Re-trigger the docs validation. (use unformatted text in the comment!)

@elasticmachine
Copy link
Contributor

elasticmachine commented Nov 5, 2024

⏳ Build in-progress, with failures

Failed CI Steps

Test Failures

  • [job] [logs] Investigations - Security Solution Cypress Tests #2 / Timeline scope Alerts checkbox alerts checkbox behaves as expected alerts checkbox behaves as expected
  • [job] [logs] Investigations - Security Solution Cypress Tests #2 / Timeline scope Alerts checkbox alerts checkbox behaves as expected alerts checkbox behaves as expected
  • [job] [logs] Investigations - Security Solution Cypress Tests #2 / Timeline scope Alerts checkbox alerts checkbox behaves as expected alerts checkbox behaves as expected
  • [job] [logs] Investigations - Security Solution Cypress Tests #2 / Timeline scope Alerts checkbox alerts checkbox behaves as expected alerts checkbox behaves as expected

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
inference 15 22 +7

Public APIs missing comments

Total count of every public API that lacks a comment. Target amount is 0. Run node scripts/build_api_docs --plugin [yourplugin] --stats comments for more detailed information.

id before after diff
@kbn/inference-common - 39 +39
inference 44 28 -16
total +23

Public APIs missing exports

Total count of every type that is part of your API that should be exported but is not. This will cause broken links in the API documentation system. Target amount is 0. Run node scripts/build_api_docs --plugin [yourplugin] --stats exports for more detailed information.

id before after diff
inference 15 4 -11

Page load bundle

Size of the bundles that are downloaded on every page load. Target size is below 100kb

id before after diff
inference 5.8KB 5.7KB -128.0B
Unknown metric groups

API count

id before after diff
@kbn/inference-common - 99 +99
inference 49 33 -16
total +83

History

@jbudz jbudz disabled auto-merge November 5, 2024 23:00
@jbudz
Copy link
Member

jbudz commented Nov 5, 2024

The test failure is unrelated, it was also failing on 8.x. Merging

@jbudz jbudz merged commit 0c5f916 into elastic:8.x Nov 5, 2024
40 of 43 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport ci:project-deploy-observability Create an Observability project Team:Obs AI Assistant Observability AI Assistant
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants