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

[ML] Renaming ML API service #191742

Merged
merged 8 commits into from
Sep 4, 2024

Conversation

jgowdyelastic
Copy link
Member

@jgowdyelastic jgowdyelastic commented Aug 29, 2024

Addresses the comment from the description of this PR:
We have a bit of a mix of naming: ml, mlApiServices, useMlApiContext() for the same thing

Renames:
useMlApiContext -> useMlApi
ml -> mlApi
mlApiServices -> mlApi
MlApiServices -> MlApi

E.g. we can now use
const mlApi = useMlApi();

Rather than:
const ml = useMlApiContext();
or
const mlServices = useMlApiContext();
or

  const {
    services: {
      mlServices: { mlApiServices },
    },
  } = useMlKibana();

@jgowdyelastic
Copy link
Member Author

/ci

@jgowdyelastic jgowdyelastic self-assigned this Aug 30, 2024
@jgowdyelastic jgowdyelastic added chore non-issue Indicates to automation that a pull request should not appear in the release notes :ml release_note:skip Skip the PR/issue when compiling release notes v8.16.0 labels Aug 30, 2024
@jgowdyelastic jgowdyelastic marked this pull request as ready for review August 30, 2024 08:36
@jgowdyelastic jgowdyelastic requested a review from a team as a code owner August 30, 2024 08:36
@elasticmachine
Copy link
Contributor

Pinging @elastic/ml-ui (:ml)

Copy link
Contributor

@walterra walterra left a comment

Choose a reason for hiding this comment

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

LGTM, great to have that consistency now! Just added a comment with a question on some special initialization.

@@ -25,7 +25,7 @@ export function useMlNodeAvailableCheck() {

export function useMlNodeCheck() {
const { http } = useKibana().services;
const ml = useMemo(() => mlApiServicesProvider(new HttpService(http!)), [http]);
const mlApi = useMemo(() => mlApiProvider(new HttpService(http!)), [http]);
Copy link
Contributor

Choose a reason for hiding this comment

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

Is there a reason for this specific code or could this be const mlApi = useMlApi()?

Copy link
Member Author

@jgowdyelastic jgowdyelastic Aug 30, 2024

Choose a reason for hiding this comment

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

Yes, this is intentional, this component is shared out from the ML plugin and used in other plugins to warn about ML node availability.
We don't wrap it in a our various contexts and only require that the consuming plugin has http in their kibana context.

@@ -74,12 +74,12 @@ const defaultCloudInfo: CloudInfo = {

export function useCloudCheck() {
const { http } = useKibana().services;
const ml = useMemo(() => mlApiServicesProvider(new HttpService(http!)), [http]);
const mlApi = useMemo(() => mlApiProvider(new HttpService(http!)), [http]);
Copy link
Contributor

Choose a reason for hiding this comment

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

Is there a reason for this specific code or could this be const mlApi = useMlApi()?

Copy link
Contributor

@peteharverson peteharverson left a comment

Choose a reason for hiding this comment

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

LGTM (also gave each page a quick visual test)

@kibana-ci
Copy link
Collaborator

💛 Build succeeded, but was flaky

Failed CI Steps

Metrics [docs]

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
ml 4.6MB 4.6MB -1.7KB

Page load bundle

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

id before after diff
ml 78.8KB 78.7KB -96.0B

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

cc @jgowdyelastic

@jgowdyelastic jgowdyelastic merged commit 8c67fec into elastic:main Sep 4, 2024
22 checks passed
@kibanamachine kibanamachine added the backport:skip This commit does not require backporting label Sep 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:skip This commit does not require backporting chore :ml non-issue Indicates to automation that a pull request should not appear in the release notes release_note:skip Skip the PR/issue when compiling release notes v8.16.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants