Skip to content

Commit

Permalink
Sustainable Kibana Architecture: Move modules owned by `@elastic/appe…
Browse files Browse the repository at this point in the history
…x-ai-infra` (#202410)

## Summary

This PR aims at relocating some of the Kibana modules (plugins and
packages) into a new folder structure, according to the _Sustainable
Kibana Architecture_ initiative.

> [!IMPORTANT]
> * We kindly ask you to:
> * Manually fix the errors in the error section below (if there are
any).
> * Search for the `packages[\/\\]` and `plugins[\/\\]` patterns in the
source code (Babel and Eslint config files), and update them
appropriately.
> * Manually review
`.buildkite/scripts/pipelines/pull_request/pipeline.ts` to ensure that
any CI pipeline customizations continue to be correctly applied after
the changed path names
> * Review all of the updated files, specially the `.ts` and `.js` files
listed in the sections below, as some of them contain relative paths
that have been updated.
> * Think of potential impact of the move, including tooling and
configuration files that can be pointing to the relocated modules. E.g.:
>     * customised eslint rules
>     * docs pointing to source code

> [!NOTE]
> This PR has been auto-generated.
> Do not attempt to push any changes unless you know what you are doing.
> Please use
[#sustainable_kibana_architecture](https://elastic.slack.com/archives/C07TCKTA22E)
Slack channel for feedback.




#### 3 plugin(s) are going to be relocated:

| Id | Target folder |
| -- | ------------- |
| `@kbn/inference-plugin` | `x-pack/platform/plugins/shared/inference` |
| `@kbn/llm-tasks-plugin` |
`x-pack/platform/plugins/shared/ai_infra/llm_tasks` |
| `@kbn/product-doc-base-plugin` |
`x-pack/platform/plugins/shared/ai_infra/product_doc_base` |


#### 2 package(s) are going to be relocated:

  | Id | Target folder |
  | -- | ------------- |
| `@kbn/inference-common` |
`x-pack/platform/packages/shared/ai-infra/inference-common` |
| `@kbn/product-doc-common` |
`x-pack/platform/packages/shared/ai-infra/product-doc-common` |


<details>
<summary>Updated references</summary>

```
./docs/developer/plugin-list.asciidoc
./package.json
./packages/kbn-repo-packages/package-map.json
./packages/kbn-ts-projects/config-paths.json
./tsconfig.base.json
./x-pack/.i18nrc.json
./x-pack/platform/packages/shared/ai-infra/inference-common/jest.config.js
./x-pack/platform/packages/shared/ai-infra/product-doc-common/jest.config.js
./x-pack/platform/plugins/shared/ai_infra/llm_tasks/jest.config.js
./x-pack/platform/plugins/shared/ai_infra/product_doc_base/jest.config.js
./x-pack/platform/plugins/shared/inference/jest.config.js
./x-pack/platform/plugins/shared/inference/scripts/evaluation/README.md
./yarn.lock
```
</details>
<details>
<summary>Updated relative paths</summary>

```
x-pack/platform/packages/shared/ai-infra/inference-common/jest.config.js:10
x-pack/platform/packages/shared/ai-infra/inference-common/tsconfig.json:2
x-pack/platform/packages/shared/ai-infra/product-doc-common/jest.config.js:10
x-pack/platform/packages/shared/ai-infra/product-doc-common/tsconfig.json:2
x-pack/platform/plugins/shared/ai_infra/llm_tasks/jest.config.js:10
x-pack/platform/plugins/shared/ai_infra/llm_tasks/tsconfig.json:2
x-pack/platform/plugins/shared/ai_infra/llm_tasks/tsconfig.json:7
x-pack/platform/plugins/shared/ai_infra/product_doc_base/jest.config.js:10
x-pack/platform/plugins/shared/ai_infra/product_doc_base/tsconfig.json:2
x-pack/platform/plugins/shared/ai_infra/product_doc_base/tsconfig.json:7
x-pack/platform/plugins/shared/inference/jest.config.js:10
x-pack/platform/plugins/shared/inference/scripts/util/read_kibana_config.ts:16
x-pack/platform/plugins/shared/inference/tsconfig.json:2
x-pack/platform/plugins/shared/inference/tsconfig.json:7
```
</details>
<details>
<summary>Script errors</summary>

```

```
</details>

---------

Co-authored-by: pgayvallet <[email protected]>
  • Loading branch information
gsoldevila and pgayvallet authored Dec 10, 2024
1 parent 2e733f2 commit a0f5a7f
Show file tree
Hide file tree
Showing 409 changed files with 59 additions and 59 deletions.
6 changes: 3 additions & 3 deletions .buildkite/scripts/pipelines/pull_request/pipeline.ts
Original file line number Diff line number Diff line change
Expand Up @@ -154,9 +154,9 @@ const getPipeline = (filename: string, removeSteps = true) => {

if (
(await doAnyChangesMatch([
/^x-pack\/packages\/ai-infra/,
/^x-pack\/plugins\/ai_infra/,
/^x-pack\/plugins\/inference/,
/^x-pack\/platform\/packages\/shared\/ai-infra/,
/^x-pack\/platform\/plugins\/shared\/ai_infra/,
/^x-pack\/platform\/plugins\/shared\/inference/,
/^x-pack\/plugins\/stack_connectors\/server\/connector_types\/bedrock/,
/^x-pack\/plugins\/stack_connectors\/server\/connector_types\/gemini/,
/^x-pack\/plugins\/stack_connectors\/server\/connector_types\/openai/,
Expand Down
10 changes: 5 additions & 5 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -776,9 +776,7 @@ x-pack/examples/third_party_maps_source_example @elastic/kibana-presentation
x-pack/examples/third_party_vis_lens_example @elastic/kibana-visualizations
x-pack/examples/triggers_actions_ui_example @elastic/response-ops
x-pack/examples/ui_actions_enhanced_examples @elastic/appex-sharedux
x-pack/packages/ai-infra/inference-common @elastic/appex-ai-infra
x-pack/packages/ai-infra/product-doc-artifact-builder @elastic/appex-ai-infra
x-pack/packages/ai-infra/product-doc-common @elastic/appex-ai-infra
x-pack/packages/index-lifecycle-management/index_lifecycle_management_common_shared @elastic/kibana-management
x-pack/packages/index-management/index_management_shared_types @elastic/kibana-management
x-pack/packages/kbn-ai-assistant @elastic/search-kibana
Expand Down Expand Up @@ -856,6 +854,8 @@ x-pack/platform/packages/private/ml/time_buckets @elastic/ml-ui
x-pack/platform/packages/private/ml/ui_actions @elastic/ml-ui
x-pack/platform/packages/private/ml/url_state @elastic/ml-ui
x-pack/platform/packages/private/ml/validators @elastic/ml-ui
x-pack/platform/packages/shared/ai-infra/inference-common @elastic/appex-ai-infra
x-pack/platform/packages/shared/ai-infra/product-doc-common @elastic/appex-ai-infra
x-pack/platform/packages/shared/kbn-entities-schema @elastic/obs-entities
x-pack/platform/packages/shared/ml/aiops_common @elastic/ml-ui
x-pack/platform/packages/shared/ml/aiops_log_pattern_analysis @elastic/ml-ui
Expand All @@ -869,12 +869,13 @@ x-pack/platform/packages/shared/ml/runtime_field_utils @elastic/ml-ui
x-pack/platform/packages/shared/ml/trained_models_utils @elastic/ml-ui
x-pack/platform/plugins/private/data_visualizer @elastic/ml-ui
x-pack/platform/plugins/private/transform @elastic/ml-ui
x-pack/platform/plugins/shared/ai_infra/llm_tasks @elastic/appex-ai-infra
x-pack/platform/plugins/shared/ai_infra/product_doc_base @elastic/appex-ai-infra
x-pack/platform/plugins/shared/aiops @elastic/ml-ui
x-pack/platform/plugins/shared/entity_manager @elastic/obs-entities
x-pack/platform/plugins/shared/inference @elastic/appex-ai-infra
x-pack/platform/plugins/shared/ml @elastic/ml-ui
x-pack/plugins/actions @elastic/response-ops
x-pack/plugins/ai_infra/llm_tasks @elastic/appex-ai-infra
x-pack/plugins/ai_infra/product_doc_base @elastic/appex-ai-infra
x-pack/plugins/alerting @elastic/response-ops
x-pack/plugins/asset_inventory @elastic/kibana-cloud-security-posture
x-pack/plugins/banners @elastic/appex-sharedux
Expand Down Expand Up @@ -912,7 +913,6 @@ x-pack/plugins/graph @elastic/kibana-visualizations
x-pack/plugins/grokdebugger @elastic/kibana-management
x-pack/plugins/index_lifecycle_management @elastic/kibana-management
x-pack/plugins/index_management @elastic/kibana-management
x-pack/plugins/inference @elastic/appex-ai-infra
x-pack/plugins/ingest_pipelines @elastic/kibana-management
x-pack/plugins/integration_assistant @elastic/security-scalability
x-pack/plugins/kubernetes_security @elastic/kibana-cloud-security-posture
Expand Down
6 changes: 3 additions & 3 deletions docs/developer/plugin-list.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -643,7 +643,7 @@ Index Management by running this series of requests in Console:
|This service is exposed from the Index Management setup contract and can be used to add content to the indices list and the index details page.
|{kib-repo}blob/{branch}/x-pack/plugins/inference/README.md[inference]
|{kib-repo}blob/{branch}/x-pack/platform/plugins/shared/inference/README.md[inference]
|The inference plugin is a central place to handle all interactions with the Elasticsearch Inference API and
external LLM APIs. Its goals are:
Expand Down Expand Up @@ -698,7 +698,7 @@ the infrastructure monitoring use-case within Kibana.
using the CURL scripts in the scripts folder.
|{kib-repo}blob/{branch}/x-pack/plugins/ai_infra/llm_tasks/README.md[llmTasks]
|{kib-repo}blob/{branch}/x-pack/platform/plugins/shared/ai_infra/llm_tasks/README.md[llmTasks]
|This plugin contains various LLM tasks.
Expand Down Expand Up @@ -779,7 +779,7 @@ Elastic.
|This plugin helps users learn how to use the Painless scripting language.
|{kib-repo}blob/{branch}/x-pack/plugins/ai_infra/product_doc_base/README.md[productDocBase]
|{kib-repo}blob/{branch}/x-pack/platform/plugins/shared/ai_infra/product_doc_base/README.md[productDocBase]
|This plugin contains the product documentation base service.
Expand Down
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -577,8 +577,8 @@
"@kbn/index-management-plugin": "link:x-pack/plugins/index_management",
"@kbn/index-management-shared-types": "link:x-pack/packages/index-management/index_management_shared_types",
"@kbn/index-patterns-test-plugin": "link:test/plugin_functional/plugins/index_patterns",
"@kbn/inference-common": "link:x-pack/packages/ai-infra/inference-common",
"@kbn/inference-plugin": "link:x-pack/plugins/inference",
"@kbn/inference-common": "link:x-pack/platform/packages/shared/ai-infra/inference-common",
"@kbn/inference-plugin": "link:x-pack/platform/plugins/shared/inference",
"@kbn/inference_integration_flyout": "link:x-pack/platform/packages/private/ml/inference_integration_flyout",
"@kbn/infra-forge": "link:x-pack/packages/kbn-infra-forge",
"@kbn/infra-plugin": "link:x-pack/plugins/observability_solution/infra",
Expand Down Expand Up @@ -620,7 +620,7 @@
"@kbn/licensing-plugin": "link:x-pack/plugins/licensing",
"@kbn/links-plugin": "link:src/plugins/links",
"@kbn/lists-plugin": "link:x-pack/plugins/lists",
"@kbn/llm-tasks-plugin": "link:x-pack/plugins/ai_infra/llm_tasks",
"@kbn/llm-tasks-plugin": "link:x-pack/platform/plugins/shared/ai_infra/llm_tasks",
"@kbn/locator-examples-plugin": "link:examples/locator_examples",
"@kbn/locator-explorer-plugin": "link:examples/locator_explorer",
"@kbn/logging": "link:packages/kbn-logging",
Expand Down Expand Up @@ -724,8 +724,8 @@
"@kbn/presentation-panel-plugin": "link:src/plugins/presentation_panel",
"@kbn/presentation-publishing": "link:packages/presentation/presentation_publishing",
"@kbn/presentation-util-plugin": "link:src/plugins/presentation_util",
"@kbn/product-doc-base-plugin": "link:x-pack/plugins/ai_infra/product_doc_base",
"@kbn/product-doc-common": "link:x-pack/packages/ai-infra/product-doc-common",
"@kbn/product-doc-base-plugin": "link:x-pack/platform/plugins/shared/ai_infra/product_doc_base",
"@kbn/product-doc-common": "link:x-pack/platform/packages/shared/ai-infra/product-doc-common",
"@kbn/profiling-data-access-plugin": "link:x-pack/plugins/observability_solution/profiling_data_access",
"@kbn/profiling-plugin": "link:x-pack/plugins/observability_solution/profiling",
"@kbn/profiling-utils": "link:packages/kbn-profiling-utils",
Expand Down
20 changes: 10 additions & 10 deletions tsconfig.base.json
Original file line number Diff line number Diff line change
Expand Up @@ -1062,10 +1062,10 @@
"@kbn/index-patterns-test-plugin/*": ["test/plugin_functional/plugins/index_patterns/*"],
"@kbn/inference_integration_flyout": ["x-pack/platform/packages/private/ml/inference_integration_flyout"],
"@kbn/inference_integration_flyout/*": ["x-pack/platform/packages/private/ml/inference_integration_flyout/*"],
"@kbn/inference-common": ["x-pack/packages/ai-infra/inference-common"],
"@kbn/inference-common/*": ["x-pack/packages/ai-infra/inference-common/*"],
"@kbn/inference-plugin": ["x-pack/plugins/inference"],
"@kbn/inference-plugin/*": ["x-pack/plugins/inference/*"],
"@kbn/inference-common": ["x-pack/platform/packages/shared/ai-infra/inference-common"],
"@kbn/inference-common/*": ["x-pack/platform/packages/shared/ai-infra/inference-common/*"],
"@kbn/inference-plugin": ["x-pack/platform/plugins/shared/inference"],
"@kbn/inference-plugin/*": ["x-pack/platform/plugins/shared/inference/*"],
"@kbn/infra-forge": ["x-pack/packages/kbn-infra-forge"],
"@kbn/infra-forge/*": ["x-pack/packages/kbn-infra-forge/*"],
"@kbn/infra-plugin": ["x-pack/plugins/observability_solution/infra"],
Expand Down Expand Up @@ -1160,8 +1160,8 @@
"@kbn/lint-ts-projects-cli/*": ["packages/kbn-lint-ts-projects-cli/*"],
"@kbn/lists-plugin": ["x-pack/plugins/lists"],
"@kbn/lists-plugin/*": ["x-pack/plugins/lists/*"],
"@kbn/llm-tasks-plugin": ["x-pack/plugins/ai_infra/llm_tasks"],
"@kbn/llm-tasks-plugin/*": ["x-pack/plugins/ai_infra/llm_tasks/*"],
"@kbn/llm-tasks-plugin": ["x-pack/platform/plugins/shared/ai_infra/llm_tasks"],
"@kbn/llm-tasks-plugin/*": ["x-pack/platform/plugins/shared/ai_infra/llm_tasks/*"],
"@kbn/locator-examples-plugin": ["examples/locator_examples"],
"@kbn/locator-examples-plugin/*": ["examples/locator_examples/*"],
"@kbn/locator-explorer-plugin": ["examples/locator_explorer"],
Expand Down Expand Up @@ -1404,10 +1404,10 @@
"@kbn/presentation-util-plugin/*": ["src/plugins/presentation_util/*"],
"@kbn/product-doc-artifact-builder": ["x-pack/packages/ai-infra/product-doc-artifact-builder"],
"@kbn/product-doc-artifact-builder/*": ["x-pack/packages/ai-infra/product-doc-artifact-builder/*"],
"@kbn/product-doc-base-plugin": ["x-pack/plugins/ai_infra/product_doc_base"],
"@kbn/product-doc-base-plugin/*": ["x-pack/plugins/ai_infra/product_doc_base/*"],
"@kbn/product-doc-common": ["x-pack/packages/ai-infra/product-doc-common"],
"@kbn/product-doc-common/*": ["x-pack/packages/ai-infra/product-doc-common/*"],
"@kbn/product-doc-base-plugin": ["x-pack/platform/plugins/shared/ai_infra/product_doc_base"],
"@kbn/product-doc-base-plugin/*": ["x-pack/platform/plugins/shared/ai_infra/product_doc_base/*"],
"@kbn/product-doc-common": ["x-pack/platform/packages/shared/ai-infra/product-doc-common"],
"@kbn/product-doc-common/*": ["x-pack/platform/packages/shared/ai-infra/product-doc-common/*"],
"@kbn/profiling-data-access-plugin": ["x-pack/plugins/observability_solution/profiling_data_access"],
"@kbn/profiling-data-access-plugin/*": ["x-pack/plugins/observability_solution/profiling_data_access/*"],
"@kbn/profiling-plugin": ["x-pack/plugins/observability_solution/profiling"],
Expand Down
2 changes: 1 addition & 1 deletion x-pack/.i18nrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
"xpack.fleet": "plugins/fleet",
"xpack.ingestPipelines": "plugins/ingest_pipelines",
"xpack.integrationAssistant": "plugins/integration_assistant",
"xpack.inference": "plugins/inference",
"xpack.inference": "platform/plugins/shared/inference",
"xpack.inventory": "plugins/observability_solution/inventory",
"xpack.investigate": "plugins/observability_solution/investigate",
"xpack.investigateApp": "plugins/observability_solution/investigate_app",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@

module.exports = {
preset: '@kbn/test',
rootDir: '../../../..',
roots: ['<rootDir>/x-pack/packages/ai-infra/inference-common'],
rootDir: '../../../../../..',
roots: ['<rootDir>/x-pack/platform/packages/shared/ai-infra/inference-common'],
};
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"extends": "../../../../tsconfig.base.json",
"extends": "../../../../../../tsconfig.base.json",
"compilerOptions": {
"outDir": "target/types",
"types": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@

module.exports = {
preset: '@kbn/test/jest_node',
rootDir: '../../../..',
roots: ['<rootDir>/x-pack/packages/ai-infra/product-doc-common'],
rootDir: '../../../../../..',
roots: ['<rootDir>/x-pack/platform/packages/shared/ai-infra/product-doc-common'],
};
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"extends": "../../../../tsconfig.base.json",
"extends": "../../../../../../tsconfig.base.json",
"compilerOptions": {
"outDir": "target/types",
"types": [
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@

module.exports = {
preset: '@kbn/test',
rootDir: '../../../..',
roots: ['<rootDir>/x-pack/plugins/ai_infra/llm_tasks/server'],
rootDir: '../../../../../..',
roots: ['<rootDir>/x-pack/platform/plugins/shared/ai_infra/llm_tasks/server'],
setupFiles: [],
collectCoverage: true,
collectCoverageFrom: [
'<rootDir>/x-pack/plugins/ai_infra/llm_tasks/{public,server,common}/**/*.{js,ts,tsx}',
'<rootDir>/x-pack/platform/plugins/shared/ai_infra/llm_tasks/{public,server,common}/**/*.{js,ts,tsx}',
],

coverageReporters: ['html'],
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"extends": "../../../../tsconfig.base.json",
"extends": "../../../../../../tsconfig.base.json",
"compilerOptions": {
"outDir": "target/types"
},
"include": [
"../../../../typings/**/*",
"../../../../../../typings/**/*",
"common/**/*",
"public/**/*",
"typings/**/*",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,16 @@

module.exports = {
preset: '@kbn/test',
rootDir: '../../..',
rootDir: '../../../../../..',
roots: [
'<rootDir>/x-pack/plugins/inference/public',
'<rootDir>/x-pack/plugins/inference/server',
'<rootDir>/x-pack/plugins/inference/common',
'<rootDir>/x-pack/platform/plugins/shared/ai_infra/product_doc_base/public',
'<rootDir>/x-pack/platform/plugins/shared/ai_infra/product_doc_base/server',
'<rootDir>/x-pack/platform/plugins/shared/ai_infra/product_doc_base/common',
],
setupFiles: [],
collectCoverage: true,
collectCoverageFrom: [
'<rootDir>/x-pack/plugins/inference/{public,server,common}/**/*.{js,ts,tsx}',
'<rootDir>/x-pack/platform/plugins/shared/ai_infra/product_doc_base/{public,server,common}/**/*.{js,ts,tsx}',
],

coverageReporters: ['html'],
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"extends": "../../../../tsconfig.base.json",
"extends": "../../../../../../tsconfig.base.json",
"compilerOptions": {
"outDir": "target/types"
},
"include": [
"../../../../typings/**/*",
"../../../../../../typings/**/*",
"common/**/*",
"public/**/*",
"typings/**/*",
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,16 @@

module.exports = {
preset: '@kbn/test',
rootDir: '../../../..',
rootDir: '../../../../..',
roots: [
'<rootDir>/x-pack/plugins/ai_infra/product_doc_base/public',
'<rootDir>/x-pack/plugins/ai_infra/product_doc_base/server',
'<rootDir>/x-pack/plugins/ai_infra/product_doc_base/common',
'<rootDir>/x-pack/platform/plugins/shared/inference/public',
'<rootDir>/x-pack/platform/plugins/shared/inference/server',
'<rootDir>/x-pack/platform/plugins/shared/inference/common',
],
setupFiles: [],
collectCoverage: true,
collectCoverageFrom: [
'<rootDir>/x-pack/plugins/ai_infra/product_doc_base/{public,server,common}/**/*.{js,ts,tsx}',
'<rootDir>/x-pack/platform/plugins/shared/inference/{public,server,common}/**/*.{js,ts,tsx}',
],

coverageReporters: ['html'],
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ This tool is developed for the teams working on anything related to inference. I

Run the tool using:

`$ node x-pack/plugins/inference/scripts/evaluation/index.js`
`$ node x-pack/platform/plugins/shared/inference/scripts/evaluation/index.js`

This will evaluate all existing scenarios, and write the evaluation results to the terminal.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import { identity, pickBy } from 'lodash';
export type KibanaConfig = ReturnType<typeof readKibanaConfig>;

export const readKibanaConfig = () => {
const kibanaConfigDir = path.join(__filename, '../../../../../../config');
const kibanaConfigDir = path.join(__filename, '../../../../../../../../config');
const kibanaDevConfig = path.join(kibanaConfigDir, 'kibana.dev.yml');
const kibanaConfig = path.join(kibanaConfigDir, 'kibana.yml');

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading

0 comments on commit a0f5a7f

Please sign in to comment.