mage-ai 0.9.69__py3-none-any.whl → 0.9.71__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of mage-ai might be problematic. Click here for more details.
- mage_ai/ai/utils/xgboost.py +222 -0
- mage_ai/api/errors.py +37 -25
- mage_ai/api/operations/base.py +13 -1
- mage_ai/api/parsers/PipelineScheduleParser.py +1 -1
- mage_ai/api/policies/BackfillPolicy.py +1 -0
- mage_ai/api/policies/BlockOutputPolicy.py +40 -17
- mage_ai/api/policies/GlobalDataProductPolicy.py +91 -41
- mage_ai/api/policies/KernelPolicy.py +55 -32
- mage_ai/api/policies/KernelProcessPolicy.py +56 -0
- mage_ai/api/policies/OutputPolicy.py +73 -41
- mage_ai/api/policies/PipelinePolicy.py +206 -137
- mage_ai/api/policies/WorkspacePolicy.py +1 -0
- mage_ai/api/presenters/BackfillPresenter.py +1 -0
- mage_ai/api/presenters/BlockLayoutItemPresenter.py +9 -7
- mage_ai/api/presenters/BlockPresenter.py +1 -1
- mage_ai/api/presenters/GlobalDataProductPresenter.py +6 -1
- mage_ai/api/presenters/KernelPresenter.py +5 -26
- mage_ai/api/presenters/KernelProcessPresenter.py +28 -0
- mage_ai/api/presenters/PipelinePresenter.py +18 -5
- mage_ai/api/presenters/StatusPresenter.py +2 -0
- mage_ai/api/presenters/SyncPresenter.py +25 -0
- mage_ai/api/resources/AutocompleteItemResource.py +1 -1
- mage_ai/api/resources/BlockLayoutItemResource.py +90 -44
- mage_ai/api/resources/BlockOutputResource.py +42 -9
- mage_ai/api/resources/BlockResource.py +4 -3
- mage_ai/api/resources/BlockRunResource.py +27 -22
- mage_ai/api/resources/ClusterResource.py +4 -1
- mage_ai/api/resources/CustomTemplateResource.py +34 -14
- mage_ai/api/resources/DataProviderResource.py +1 -1
- mage_ai/api/resources/ExecutionStateResource.py +3 -1
- mage_ai/api/resources/FileContentResource.py +8 -2
- mage_ai/api/resources/FileResource.py +10 -4
- mage_ai/api/resources/FileVersionResource.py +3 -1
- mage_ai/api/resources/GitBranchResource.py +101 -31
- mage_ai/api/resources/GitCustomBranchResource.py +29 -1
- mage_ai/api/resources/GlobalDataProductResource.py +44 -7
- mage_ai/api/resources/GlobalHookResource.py +4 -1
- mage_ai/api/resources/IntegrationDestinationResource.py +6 -2
- mage_ai/api/resources/IntegrationSourceResource.py +8 -4
- mage_ai/api/resources/IntegrationSourceStreamResource.py +6 -2
- mage_ai/api/resources/KernelProcessResource.py +44 -0
- mage_ai/api/resources/KernelResource.py +25 -3
- mage_ai/api/resources/OauthResource.py +1 -1
- mage_ai/api/resources/OutputResource.py +33 -11
- mage_ai/api/resources/PageBlockLayoutResource.py +34 -23
- mage_ai/api/resources/PipelineInteractionResource.py +31 -15
- mage_ai/api/resources/PipelineResource.py +258 -125
- mage_ai/api/resources/PipelineRunResource.py +52 -7
- mage_ai/api/resources/PipelineScheduleResource.py +11 -2
- mage_ai/api/resources/PipelineTriggerResource.py +6 -1
- mage_ai/api/resources/ProjectResource.py +18 -7
- mage_ai/api/resources/PullRequestResource.py +6 -4
- mage_ai/api/resources/SecretResource.py +1 -1
- mage_ai/api/resources/SeedResource.py +8 -1
- mage_ai/api/resources/StatusResource.py +21 -6
- mage_ai/api/resources/SyncResource.py +6 -8
- mage_ai/api/resources/VariableResource.py +46 -26
- mage_ai/api/resources/VersionControlProjectResource.py +9 -2
- mage_ai/api/resources/WidgetResource.py +1 -1
- mage_ai/api/resources/WorkspaceResource.py +6 -5
- mage_ai/api/views.py +47 -40
- mage_ai/authentication/permissions/seed.py +16 -2
- mage_ai/authentication/providers/oidc.py +21 -1
- mage_ai/autocomplete/utils.py +13 -9
- mage_ai/cache/base.py +1 -1
- mage_ai/cache/block.py +18 -12
- mage_ai/cache/block_action_object/__init__.py +33 -5
- mage_ai/cache/file.py +22 -19
- mage_ai/cache/pipeline.py +18 -12
- mage_ai/cli/main.py +1 -0
- mage_ai/cluster_manager/aws/emr_cluster_manager.py +9 -5
- mage_ai/cluster_manager/config.py +2 -2
- mage_ai/cluster_manager/kubernetes/workload_manager.py +52 -1
- mage_ai/cluster_manager/manage.py +1 -1
- mage_ai/cluster_manager/workspace/base.py +7 -1
- mage_ai/cluster_manager/workspace/kubernetes.py +22 -1
- mage_ai/command_center/applications/factory.py +10 -7
- mage_ai/command_center/applications/utils.py +2 -2
- mage_ai/command_center/files/factory.py +17 -15
- mage_ai/command_center/presenters/text.py +1 -1
- mage_ai/command_center/utils.py +25 -13
- mage_ai/data/__init__.py +0 -0
- mage_ai/data/constants.py +45 -0
- mage_ai/data/models/__init__.py +0 -0
- mage_ai/data/models/base.py +119 -0
- mage_ai/data/models/constants.py +1 -0
- mage_ai/data/models/generator.py +115 -0
- mage_ai/data/models/manager.py +168 -0
- mage_ai/data/models/pyarrow/__init__.py +0 -0
- mage_ai/data/models/pyarrow/record_batch.py +55 -0
- mage_ai/data/models/pyarrow/shared.py +21 -0
- mage_ai/data/models/pyarrow/table.py +8 -0
- mage_ai/data/models/reader.py +103 -0
- mage_ai/data/models/utils.py +59 -0
- mage_ai/data/models/writer.py +91 -0
- mage_ai/data/tabular/__init__.py +0 -0
- mage_ai/data/tabular/constants.py +23 -0
- mage_ai/data/tabular/mocks.py +19 -0
- mage_ai/data/tabular/models.py +126 -0
- mage_ai/data/tabular/reader.py +602 -0
- mage_ai/data/tabular/utils.py +102 -0
- mage_ai/data/tabular/writer.py +266 -0
- mage_ai/data/variables/__init__.py +0 -0
- mage_ai/data/variables/wrapper.py +54 -0
- mage_ai/data_cleaner/analysis/charts.py +61 -39
- mage_ai/data_cleaner/column_types/column_type_detector.py +53 -31
- mage_ai/data_cleaner/estimators/encoders.py +5 -2
- mage_ai/data_integrations/utils/scheduler.py +16 -11
- mage_ai/data_preparation/decorators.py +1 -0
- mage_ai/data_preparation/executors/block_executor.py +237 -155
- mage_ai/data_preparation/executors/k8s_block_executor.py +30 -7
- mage_ai/data_preparation/executors/k8s_pipeline_executor.py +30 -7
- mage_ai/data_preparation/executors/streaming_pipeline_executor.py +2 -2
- mage_ai/data_preparation/git/__init__.py +77 -29
- mage_ai/data_preparation/git/api.py +69 -8
- mage_ai/data_preparation/git/utils.py +64 -34
- mage_ai/data_preparation/logging/logger_manager.py +4 -3
- mage_ai/data_preparation/models/block/__init__.py +1562 -879
- mage_ai/data_preparation/models/block/data_integration/mixins.py +4 -3
- mage_ai/data_preparation/models/block/dynamic/__init__.py +17 -6
- mage_ai/data_preparation/models/block/dynamic/child.py +41 -102
- mage_ai/data_preparation/models/block/dynamic/constants.py +1 -0
- mage_ai/data_preparation/models/block/dynamic/counter.py +296 -0
- mage_ai/data_preparation/models/block/dynamic/data.py +16 -0
- mage_ai/data_preparation/models/block/dynamic/factory.py +163 -0
- mage_ai/data_preparation/models/block/dynamic/models.py +19 -0
- mage_ai/data_preparation/models/block/dynamic/shared.py +92 -0
- mage_ai/data_preparation/models/block/dynamic/utils.py +295 -167
- mage_ai/data_preparation/models/block/dynamic/variables.py +384 -144
- mage_ai/data_preparation/models/block/dynamic/wrappers.py +77 -0
- mage_ai/data_preparation/models/block/extension/utils.py +10 -1
- mage_ai/data_preparation/models/block/global_data_product/__init__.py +35 -3
- mage_ai/data_preparation/models/block/integration/__init__.py +6 -2
- mage_ai/data_preparation/models/block/outputs.py +722 -0
- mage_ai/data_preparation/models/block/platform/mixins.py +7 -8
- mage_ai/data_preparation/models/block/r/__init__.py +56 -38
- mage_ai/data_preparation/models/block/remote/__init__.py +0 -0
- mage_ai/data_preparation/models/block/remote/models.py +58 -0
- mage_ai/data_preparation/models/block/settings/__init__.py +0 -0
- mage_ai/data_preparation/models/block/settings/dynamic/__init__.py +0 -0
- mage_ai/data_preparation/models/block/settings/dynamic/constants.py +7 -0
- mage_ai/data_preparation/models/block/settings/dynamic/mixins.py +118 -0
- mage_ai/data_preparation/models/block/settings/dynamic/models.py +31 -0
- mage_ai/data_preparation/models/block/settings/global_data_products/__init__.py +0 -0
- mage_ai/data_preparation/models/block/settings/global_data_products/mixins.py +20 -0
- mage_ai/data_preparation/models/block/settings/global_data_products/models.py +46 -0
- mage_ai/data_preparation/models/block/settings/variables/__init__.py +0 -0
- mage_ai/data_preparation/models/block/settings/variables/mixins.py +74 -0
- mage_ai/data_preparation/models/block/settings/variables/models.py +49 -0
- mage_ai/data_preparation/models/block/spark/mixins.py +2 -1
- mage_ai/data_preparation/models/block/sql/__init__.py +30 -5
- mage_ai/data_preparation/models/block/sql/utils/shared.py +21 -3
- mage_ai/data_preparation/models/block/utils.py +164 -69
- mage_ai/data_preparation/models/constants.py +21 -14
- mage_ai/data_preparation/models/custom_templates/custom_block_template.py +18 -13
- mage_ai/data_preparation/models/custom_templates/custom_pipeline_template.py +33 -16
- mage_ai/data_preparation/models/custom_templates/utils.py +1 -1
- mage_ai/data_preparation/models/file.py +41 -28
- mage_ai/data_preparation/models/global_data_product/__init__.py +100 -58
- mage_ai/data_preparation/models/global_hooks/models.py +1 -0
- mage_ai/data_preparation/models/interfaces.py +29 -0
- mage_ai/data_preparation/models/pipeline.py +374 -185
- mage_ai/data_preparation/models/pipelines/integration_pipeline.py +1 -2
- mage_ai/data_preparation/models/pipelines/seed.py +1 -1
- mage_ai/data_preparation/models/project/__init__.py +66 -18
- mage_ai/data_preparation/models/project/constants.py +2 -0
- mage_ai/data_preparation/models/triggers/__init__.py +124 -26
- mage_ai/data_preparation/models/utils.py +467 -17
- mage_ai/data_preparation/models/variable.py +1028 -137
- mage_ai/data_preparation/models/variables/__init__.py +0 -0
- mage_ai/data_preparation/models/variables/cache.py +149 -0
- mage_ai/data_preparation/models/variables/constants.py +72 -0
- mage_ai/data_preparation/models/variables/summarizer.py +336 -0
- mage_ai/data_preparation/models/variables/utils.py +77 -0
- mage_ai/data_preparation/models/widget/__init__.py +63 -41
- mage_ai/data_preparation/models/widget/charts.py +40 -27
- mage_ai/data_preparation/models/widget/constants.py +2 -0
- mage_ai/data_preparation/models/widget/utils.py +3 -3
- mage_ai/data_preparation/preferences.py +3 -3
- mage_ai/data_preparation/repo_manager.py +55 -21
- mage_ai/data_preparation/storage/base_storage.py +2 -2
- mage_ai/data_preparation/storage/gcs_storage.py +7 -4
- mage_ai/data_preparation/storage/local_storage.py +18 -9
- mage_ai/data_preparation/storage/s3_storage.py +5 -2
- mage_ai/data_preparation/templates/data_exporters/streaming/oracledb.yaml +8 -0
- mage_ai/data_preparation/variable_manager.py +281 -76
- mage_ai/io/base.py +3 -2
- mage_ai/io/bigquery.py +1 -0
- mage_ai/io/redshift.py +7 -5
- mage_ai/kernels/__init__.py +0 -0
- mage_ai/kernels/models.py +188 -0
- mage_ai/kernels/utils.py +169 -0
- mage_ai/orchestration/concurrency.py +6 -2
- mage_ai/orchestration/db/__init__.py +1 -0
- mage_ai/orchestration/db/migrations/versions/0227396a216c_add_userproject_table.py +38 -0
- mage_ai/orchestration/db/migrations/versions/42a14d6143f1_update_token_column_type.py +54 -0
- mage_ai/orchestration/db/models/dynamic/__init__.py +0 -0
- mage_ai/orchestration/db/models/dynamic/controller.py +67 -0
- mage_ai/orchestration/db/models/oauth.py +12 -18
- mage_ai/orchestration/db/models/projects.py +10 -0
- mage_ai/orchestration/db/models/schedules.py +225 -187
- mage_ai/orchestration/db/models/schedules_project_platform.py +18 -12
- mage_ai/orchestration/db/models/utils.py +46 -5
- mage_ai/orchestration/metrics/pipeline_run.py +8 -9
- mage_ai/orchestration/notification/sender.py +38 -15
- mage_ai/orchestration/pipeline_scheduler_original.py +64 -33
- mage_ai/orchestration/pipeline_scheduler_project_platform.py +1 -1
- mage_ai/orchestration/run_status_checker.py +11 -4
- mage_ai/orchestration/triggers/api.py +41 -2
- mage_ai/orchestration/triggers/global_data_product.py +9 -4
- mage_ai/orchestration/triggers/utils.py +10 -1
- mage_ai/orchestration/utils/resources.py +3 -0
- mage_ai/presenters/charts/data_sources/base.py +4 -2
- mage_ai/presenters/charts/data_sources/block.py +15 -9
- mage_ai/presenters/charts/data_sources/chart_code.py +8 -5
- mage_ai/presenters/charts/data_sources/constants.py +1 -0
- mage_ai/presenters/charts/data_sources/system_metrics.py +22 -0
- mage_ai/presenters/interactions/models.py +11 -7
- mage_ai/presenters/pages/loaders/pipelines.py +5 -3
- mage_ai/presenters/pages/models/page_components/pipeline_schedules.py +3 -1
- mage_ai/presenters/utils.py +2 -0
- mage_ai/server/api/blocks.py +2 -1
- mage_ai/server/api/downloads.py +9 -2
- mage_ai/server/api/runs.py +151 -0
- mage_ai/server/api/triggers.py +3 -1
- mage_ai/server/constants.py +1 -1
- mage_ai/server/frontend_dist/404.html +8 -8
- mage_ai/server/frontend_dist/_next/static/UZLabyPgcxtZvp0O0EUUS/_buildManifest.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/1376-22de38b4ad008d8a.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/1557-25a7d985d5564fd3.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/1668-30b4619b9534519b.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/1799-c42db95a015689ee.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/2996-2108b53b9d371d8d.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/{3548-fa0792ddb88f4646.js → 3548-9d26185b3fb663b1.js} +1 -1
- mage_ai/server/frontend_dist/_next/static/chunks/{3763-61b542dafdbf5754.js → 3763-40780c6d1e4b261d.js} +1 -1
- mage_ai/server/frontend_dist/_next/static/chunks/3782-129dd2a2448a2e36.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/3958-bcdfa414ccfa1eb2.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/4168-97fd1578d1a38315.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/4982-fa5a238b139fbdd2.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/5699-176f445e1313f001.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/7162-7dd03f0f605de721.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/7779-68d2b72a90c5f925.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/7966-5446a8e43711e2f9.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/8023-6c2f172f48dcb99b.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/8095-c351b8a735d73e0c.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/9624-8b8e100079ab69e1.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/{main-77fe248a6fbd12d8.js → main-b99d4e30a88d9dc7.js} +1 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/_app-9fe2d9d07c94e968.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/{block-layout-14f952f66964022f.js → block-layout-7f4b735c67115df5.js} +1 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/global-data-products/[...slug]-e7d48e6b0c3068ac.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/global-data-products-b943f31f050fc3a4.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/manage-4bfc84ff07d7656f.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/{overview-597b74828bf105db.js → overview-9f1ac4ec003884f3.js} +1 -1
- mage_ai/server/{frontend_dist_base_path_template/_next/static/chunks/pages/pipeline-runs-3edc6270c5b0e962.js → frontend_dist/_next/static/chunks/pages/pipeline-runs-6d183f91a2ff6668.js} +1 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/backfills/[...slug]-7e737f6fc7e83e9b.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/backfills-38e1fbcfbfc1014e.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/dashboard-d94488e3f2eeef36.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/edit-cc641a7fa8473796.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/monitors/{block-runs-a5c0362763a21fa8.js → block-runs-284309877f3c5a5a.js} +1 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/monitors/block-runtime-26250e5335194ade.js +1 -0
- mage_ai/server/{frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/monitors-7acc7afc00df17c2.js → frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/monitors-5f4c8128b2413fd8.js} +1 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/runs/[run]-4ebfc8e400315dda.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/settings-e5e0150a256aadb3.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/triggers/[...slug]-eb11c5390c982b49.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/{triggers-1bdfda8edc9cf4a8.js → triggers-4612d15a65c35912.js} +1 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/settings/account/{profile-3f0df3decc856ee9.js → profile-3ae43c932537b254.js} +1 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/settings/platform/preferences-b603d7fe4b175256.js +1 -0
- mage_ai/server/{frontend_dist_base_path_template/_next/static/chunks/pages/settings/platform/settings-c2e9ef989c8bfa73.js → frontend_dist/_next/static/chunks/pages/settings/platform/settings-319ddbabc239e91b.js} +1 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/settings/workspace/permissions/{[...slug]-47b64ced27c24985.js → [...slug]-5c360f72e4498855.js} +1 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/settings/workspace/{permissions-e5a4d3d815cec25d.js → permissions-fb29fa6c2bd90bb0.js} +1 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/settings/workspace/preferences-3b76fa959ffa09d3.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/settings/workspace/roles/{[...slug]-379e1ee292504842.js → [...slug]-3b787b42f1093b1f.js} +1 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/settings/workspace/roles-0b83fbdd39e85f5b.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/settings/workspace/sync-data-a1e6950974d643a8.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/settings/workspace/users/{[...slug]-2af9afbe727d88aa.js → [...slug]-0aa019d87db8b0b8.js} +1 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/settings/workspace/{users-a4db8710f703c729.js → users-88c694d19207f2ec.js} +1 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/{triggers-9cba3211434a8966.js → triggers-a599c6ac89be8c8d.js} +1 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/version-control-31d0d50f7f30462b.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/{webpack-d079359c241db804.js → webpack-ac7fdc472bedf682.js} +1 -1
- mage_ai/server/frontend_dist/block-layout.html +3 -3
- mage_ai/server/frontend_dist/compute.html +6 -6
- mage_ai/server/frontend_dist/files.html +6 -6
- mage_ai/server/frontend_dist/global-data-products/[...slug].html +6 -6
- mage_ai/server/frontend_dist/global-data-products.html +6 -6
- mage_ai/server/frontend_dist/global-hooks/[...slug].html +6 -6
- mage_ai/server/frontend_dist/global-hooks.html +6 -6
- mage_ai/server/frontend_dist/index.html +3 -3
- mage_ai/server/frontend_dist/manage/files.html +6 -6
- mage_ai/server/frontend_dist/manage/settings.html +6 -6
- mage_ai/server/frontend_dist/manage/users/[user].html +6 -6
- mage_ai/server/frontend_dist/manage/users/new.html +6 -6
- mage_ai/server/frontend_dist/manage/users.html +6 -6
- mage_ai/server/frontend_dist/manage.html +6 -6
- mage_ai/server/frontend_dist/oauth.html +5 -5
- mage_ai/server/frontend_dist/overview.html +6 -6
- mage_ai/server/frontend_dist/pipeline-runs.html +6 -6
- mage_ai/server/frontend_dist/pipelines/[pipeline]/backfills/[...slug].html +6 -6
- mage_ai/server/frontend_dist/pipelines/[pipeline]/backfills.html +6 -6
- mage_ai/server/frontend_dist/pipelines/[pipeline]/dashboard.html +6 -6
- mage_ai/server/frontend_dist/pipelines/[pipeline]/edit.html +3 -3
- mage_ai/server/frontend_dist/pipelines/[pipeline]/logs.html +6 -6
- mage_ai/server/frontend_dist/pipelines/[pipeline]/monitors/block-runs.html +6 -6
- mage_ai/server/frontend_dist/pipelines/[pipeline]/monitors/block-runtime.html +6 -6
- mage_ai/server/frontend_dist/pipelines/[pipeline]/monitors.html +6 -6
- mage_ai/server/frontend_dist/pipelines/[pipeline]/runs/[run].html +6 -6
- mage_ai/server/frontend_dist/pipelines/[pipeline]/runs.html +6 -6
- mage_ai/server/frontend_dist/pipelines/[pipeline]/settings.html +6 -6
- mage_ai/server/frontend_dist/pipelines/[pipeline]/syncs.html +6 -6
- mage_ai/server/frontend_dist/pipelines/[pipeline]/triggers/[...slug].html +6 -6
- mage_ai/server/frontend_dist/pipelines/[pipeline]/triggers.html +6 -6
- mage_ai/server/frontend_dist/pipelines/[pipeline].html +3 -3
- mage_ai/server/frontend_dist/pipelines.html +6 -6
- mage_ai/server/frontend_dist/platform/global-hooks/[...slug].html +6 -6
- mage_ai/server/frontend_dist/platform/global-hooks.html +6 -6
- mage_ai/server/frontend_dist/settings/account/profile.html +6 -6
- mage_ai/server/frontend_dist/settings/platform/preferences.html +6 -6
- mage_ai/server/frontend_dist/settings/platform/settings.html +6 -6
- mage_ai/server/frontend_dist/settings/workspace/permissions/[...slug].html +6 -6
- mage_ai/server/frontend_dist/settings/workspace/permissions.html +6 -6
- mage_ai/server/frontend_dist/settings/workspace/preferences.html +6 -6
- mage_ai/server/frontend_dist/settings/workspace/roles/[...slug].html +6 -6
- mage_ai/server/frontend_dist/settings/workspace/roles.html +6 -6
- mage_ai/server/frontend_dist/settings/workspace/sync-data.html +6 -6
- mage_ai/server/frontend_dist/settings/workspace/users/[...slug].html +6 -6
- mage_ai/server/frontend_dist/settings/workspace/users.html +6 -6
- mage_ai/server/frontend_dist/settings.html +3 -3
- mage_ai/server/frontend_dist/sign-in.html +15 -15
- mage_ai/server/frontend_dist/templates/[...slug].html +6 -6
- mage_ai/server/frontend_dist/templates.html +6 -6
- mage_ai/server/frontend_dist/terminal.html +6 -6
- mage_ai/server/frontend_dist/test.html +3 -3
- mage_ai/server/frontend_dist/triggers.html +6 -6
- mage_ai/server/frontend_dist/version-control.html +6 -6
- mage_ai/server/frontend_dist_base_path_template/404.html +8 -8
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/1376-22de38b4ad008d8a.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/1557-25a7d985d5564fd3.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/1668-30b4619b9534519b.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/1799-c42db95a015689ee.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/2996-2108b53b9d371d8d.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/{3548-fa0792ddb88f4646.js → 3548-9d26185b3fb663b1.js} +1 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/{3763-61b542dafdbf5754.js → 3763-40780c6d1e4b261d.js} +1 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/3782-129dd2a2448a2e36.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/3958-bcdfa414ccfa1eb2.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/4168-97fd1578d1a38315.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/4982-fa5a238b139fbdd2.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/5699-176f445e1313f001.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/7162-7dd03f0f605de721.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/7779-68d2b72a90c5f925.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/7966-5446a8e43711e2f9.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/8023-6c2f172f48dcb99b.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/8095-c351b8a735d73e0c.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/9624-8b8e100079ab69e1.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/{main-70b78159c2bb3fe1.js → main-384298e9133cec76.js} +1 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/_app-13a578bce3b7f30c.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/{block-layout-14f952f66964022f.js → block-layout-7f4b735c67115df5.js} +1 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/global-data-products/[...slug]-e7d48e6b0c3068ac.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/global-data-products-b943f31f050fc3a4.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/manage-4bfc84ff07d7656f.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/{overview-597b74828bf105db.js → overview-9f1ac4ec003884f3.js} +1 -1
- mage_ai/server/{frontend_dist/_next/static/chunks/pages/pipeline-runs-3edc6270c5b0e962.js → frontend_dist_base_path_template/_next/static/chunks/pages/pipeline-runs-6d183f91a2ff6668.js} +1 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/backfills/[...slug]-7e737f6fc7e83e9b.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/backfills-38e1fbcfbfc1014e.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/dashboard-d94488e3f2eeef36.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/edit-cc641a7fa8473796.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/monitors/{block-runs-a5c0362763a21fa8.js → block-runs-284309877f3c5a5a.js} +1 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/monitors/block-runtime-26250e5335194ade.js +1 -0
- mage_ai/server/{frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/monitors-7acc7afc00df17c2.js → frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/monitors-5f4c8128b2413fd8.js} +1 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/runs/[run]-4ebfc8e400315dda.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/settings-e5e0150a256aadb3.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/triggers/[...slug]-eb11c5390c982b49.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/{triggers-1bdfda8edc9cf4a8.js → triggers-4612d15a65c35912.js} +1 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/settings/account/{profile-3f0df3decc856ee9.js → profile-3ae43c932537b254.js} +1 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/settings/platform/preferences-b603d7fe4b175256.js +1 -0
- mage_ai/server/{frontend_dist/_next/static/chunks/pages/settings/platform/settings-c2e9ef989c8bfa73.js → frontend_dist_base_path_template/_next/static/chunks/pages/settings/platform/settings-319ddbabc239e91b.js} +1 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/settings/workspace/permissions/{[...slug]-47b64ced27c24985.js → [...slug]-5c360f72e4498855.js} +1 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/settings/workspace/{permissions-e5a4d3d815cec25d.js → permissions-fb29fa6c2bd90bb0.js} +1 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/settings/workspace/preferences-3b76fa959ffa09d3.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/settings/workspace/roles/{[...slug]-379e1ee292504842.js → [...slug]-3b787b42f1093b1f.js} +1 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/settings/workspace/roles-0b83fbdd39e85f5b.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/settings/workspace/sync-data-a1e6950974d643a8.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/settings/workspace/users/{[...slug]-2af9afbe727d88aa.js → [...slug]-0aa019d87db8b0b8.js} +1 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/settings/workspace/{users-a4db8710f703c729.js → users-88c694d19207f2ec.js} +1 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/{triggers-9cba3211434a8966.js → triggers-a599c6ac89be8c8d.js} +1 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/version-control-31d0d50f7f30462b.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/{webpack-68c003fb6a175cd7.js → webpack-481689d9989710cd.js} +1 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/kcptwoOU-JJJg6Vwpkfmx/_buildManifest.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/block-layout.html +3 -3
- mage_ai/server/frontend_dist_base_path_template/compute.html +6 -6
- mage_ai/server/frontend_dist_base_path_template/files.html +6 -6
- mage_ai/server/frontend_dist_base_path_template/global-data-products/[...slug].html +6 -6
- mage_ai/server/frontend_dist_base_path_template/global-data-products.html +6 -6
- mage_ai/server/frontend_dist_base_path_template/global-hooks/[...slug].html +6 -6
- mage_ai/server/frontend_dist_base_path_template/global-hooks.html +6 -6
- mage_ai/server/frontend_dist_base_path_template/index.html +3 -3
- mage_ai/server/frontend_dist_base_path_template/manage/files.html +6 -6
- mage_ai/server/frontend_dist_base_path_template/manage/settings.html +6 -6
- mage_ai/server/frontend_dist_base_path_template/manage/users/[user].html +6 -6
- mage_ai/server/frontend_dist_base_path_template/manage/users/new.html +6 -6
- mage_ai/server/frontend_dist_base_path_template/manage/users.html +6 -6
- mage_ai/server/frontend_dist_base_path_template/manage.html +6 -6
- mage_ai/server/frontend_dist_base_path_template/oauth.html +5 -5
- mage_ai/server/frontend_dist_base_path_template/overview.html +6 -6
- mage_ai/server/frontend_dist_base_path_template/pipeline-runs.html +6 -6
- mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/backfills/[...slug].html +6 -6
- mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/backfills.html +6 -6
- mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/dashboard.html +6 -6
- mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/edit.html +3 -3
- mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/logs.html +6 -6
- mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/monitors/block-runs.html +6 -6
- mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/monitors/block-runtime.html +6 -6
- mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/monitors.html +6 -6
- mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/runs/[run].html +6 -6
- mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/runs.html +6 -6
- mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/settings.html +6 -6
- mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/syncs.html +6 -6
- mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/triggers/[...slug].html +6 -6
- mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/triggers.html +6 -6
- mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline].html +3 -3
- mage_ai/server/frontend_dist_base_path_template/pipelines.html +6 -6
- mage_ai/server/frontend_dist_base_path_template/platform/global-hooks/[...slug].html +6 -6
- mage_ai/server/frontend_dist_base_path_template/platform/global-hooks.html +6 -6
- mage_ai/server/frontend_dist_base_path_template/settings/account/profile.html +6 -6
- mage_ai/server/frontend_dist_base_path_template/settings/platform/preferences.html +6 -6
- mage_ai/server/frontend_dist_base_path_template/settings/platform/settings.html +6 -6
- mage_ai/server/frontend_dist_base_path_template/settings/workspace/permissions/[...slug].html +6 -6
- mage_ai/server/frontend_dist_base_path_template/settings/workspace/permissions.html +6 -6
- mage_ai/server/frontend_dist_base_path_template/settings/workspace/preferences.html +6 -6
- mage_ai/server/frontend_dist_base_path_template/settings/workspace/roles/[...slug].html +6 -6
- mage_ai/server/frontend_dist_base_path_template/settings/workspace/roles.html +6 -6
- mage_ai/server/frontend_dist_base_path_template/settings/workspace/sync-data.html +6 -6
- mage_ai/server/frontend_dist_base_path_template/settings/workspace/users/[...slug].html +6 -6
- mage_ai/server/frontend_dist_base_path_template/settings/workspace/users.html +6 -6
- mage_ai/server/frontend_dist_base_path_template/settings.html +3 -3
- mage_ai/server/frontend_dist_base_path_template/sign-in.html +15 -15
- mage_ai/server/frontend_dist_base_path_template/templates/[...slug].html +6 -6
- mage_ai/server/frontend_dist_base_path_template/templates.html +6 -6
- mage_ai/server/frontend_dist_base_path_template/terminal.html +6 -6
- mage_ai/server/frontend_dist_base_path_template/test.html +3 -3
- mage_ai/server/frontend_dist_base_path_template/triggers.html +6 -6
- mage_ai/server/frontend_dist_base_path_template/version-control.html +6 -6
- mage_ai/server/kernel_output_parser.py +4 -1
- mage_ai/server/scheduler_manager.py +12 -1
- mage_ai/server/server.py +69 -42
- mage_ai/server/utils/custom_output.py +284 -0
- mage_ai/server/utils/execute_custom_code.py +245 -0
- mage_ai/server/utils/output_display.py +123 -289
- mage_ai/server/websocket_server.py +116 -69
- mage_ai/services/aws/ecs/ecs.py +1 -0
- mage_ai/services/k8s/config.py +27 -4
- mage_ai/services/k8s/job_manager.py +6 -1
- mage_ai/services/k8s/utils.py +97 -0
- mage_ai/services/ssh/aws/emr/utils.py +8 -8
- mage_ai/settings/keys/auth.py +1 -0
- mage_ai/settings/platform/__init__.py +159 -38
- mage_ai/settings/platform/constants.py +5 -0
- mage_ai/settings/platform/utils.py +53 -10
- mage_ai/settings/repo.py +26 -12
- mage_ai/settings/server.py +128 -37
- mage_ai/shared/array.py +24 -1
- mage_ai/shared/complex.py +45 -0
- mage_ai/shared/config.py +2 -1
- mage_ai/shared/custom_logger.py +11 -0
- mage_ai/shared/dates.py +10 -6
- mage_ai/shared/files.py +63 -8
- mage_ai/shared/hash.py +33 -9
- mage_ai/shared/io.py +9 -5
- mage_ai/shared/models.py +82 -24
- mage_ai/shared/outputs.py +87 -0
- mage_ai/shared/parsers.py +144 -13
- mage_ai/shared/path_fixer.py +11 -7
- mage_ai/shared/singletons/__init__.py +0 -0
- mage_ai/shared/singletons/base.py +47 -0
- mage_ai/shared/singletons/memory.py +38 -0
- mage_ai/shared/strings.py +34 -1
- mage_ai/shared/yaml.py +24 -0
- mage_ai/streaming/sinks/oracledb.py +57 -0
- mage_ai/streaming/sinks/sink_factory.py +4 -0
- mage_ai/system/__init__.py +0 -0
- mage_ai/system/constants.py +14 -0
- mage_ai/system/memory/__init__.py +0 -0
- mage_ai/system/memory/constants.py +1 -0
- mage_ai/system/memory/manager.py +174 -0
- mage_ai/system/memory/presenters.py +158 -0
- mage_ai/system/memory/process.py +216 -0
- mage_ai/system/memory/samples.py +13 -0
- mage_ai/system/memory/utils.py +656 -0
- mage_ai/system/memory/wrappers.py +177 -0
- mage_ai/system/models.py +58 -0
- mage_ai/system/storage/__init__.py +0 -0
- mage_ai/system/storage/utils.py +29 -0
- mage_ai/tests/api/endpoints/mixins.py +2 -2
- mage_ai/tests/api/endpoints/test_blocks.py +2 -1
- mage_ai/tests/api/endpoints/test_custom_designs.py +4 -4
- mage_ai/tests/api/endpoints/test_pipeline_runs.py +2 -2
- mage_ai/tests/api/endpoints/test_projects.py +2 -1
- mage_ai/tests/api/operations/base/mixins.py +1 -1
- mage_ai/tests/api/operations/base/test_base.py +27 -27
- mage_ai/tests/api/operations/base/test_base_with_user_authentication.py +27 -27
- mage_ai/tests/api/operations/base/test_base_with_user_permissions.py +23 -23
- mage_ai/tests/api/operations/test_syncs.py +6 -4
- mage_ai/tests/api/resources/test_pipeline_resource.py +11 -4
- mage_ai/tests/authentication/oauth/test_utils.py +1 -1
- mage_ai/tests/authentication/providers/test_oidc.py +59 -0
- mage_ai/tests/base_test.py +2 -2
- mage_ai/tests/data/__init__.py +0 -0
- mage_ai/tests/data/models/__init__.py +0 -0
- mage_ai/tests/data_preparation/executors/test_block_executor.py +23 -16
- mage_ai/tests/data_preparation/git/test_git.py +4 -1
- mage_ai/tests/data_preparation/models/block/dynamic/test_combos.py +305 -0
- mage_ai/tests/data_preparation/models/block/dynamic/test_counter.py +212 -0
- mage_ai/tests/data_preparation/models/block/dynamic/test_factory.py +360 -0
- mage_ai/tests/data_preparation/models/block/dynamic/test_variables.py +332 -0
- mage_ai/tests/data_preparation/models/block/hook/test_hook_block.py +2 -2
- mage_ai/tests/data_preparation/models/block/platform/test_mixins.py +1 -1
- mage_ai/tests/data_preparation/models/block/sql/utils/test_shared.py +26 -1
- mage_ai/tests/data_preparation/models/block/test_global_data_product.py +5 -2
- mage_ai/tests/data_preparation/models/custom_templates/test_utils.py +5 -4
- mage_ai/tests/data_preparation/models/global_hooks/test_hook.py +3 -0
- mage_ai/tests/data_preparation/models/global_hooks/test_predicates.py +9 -3
- mage_ai/tests/data_preparation/models/test_block.py +115 -120
- mage_ai/tests/data_preparation/models/test_blocks_helper.py +114 -0
- mage_ai/tests/data_preparation/models/test_global_data_product.py +41 -24
- mage_ai/tests/data_preparation/models/test_pipeline.py +9 -6
- mage_ai/tests/data_preparation/models/test_project.py +4 -1
- mage_ai/tests/data_preparation/models/test_utils.py +80 -0
- mage_ai/tests/data_preparation/models/test_variable.py +242 -69
- mage_ai/tests/data_preparation/models/variables/__init__.py +0 -0
- mage_ai/tests/data_preparation/models/variables/test_summarizer.py +481 -0
- mage_ai/tests/data_preparation/storage/shared/__init__.py +0 -0
- mage_ai/tests/data_preparation/test_repo_manager.py +6 -7
- mage_ai/tests/data_preparation/test_variable_manager.py +57 -48
- mage_ai/tests/factory.py +64 -43
- mage_ai/tests/orchestration/db/models/test_schedules.py +3 -3
- mage_ai/tests/orchestration/db/models/test_schedules_dynamic_blocks.py +279 -0
- mage_ai/tests/orchestration/test_pipeline_scheduler.py +1 -0
- mage_ai/tests/orchestration/triggers/test_global_data_product.py +141 -138
- mage_ai/tests/orchestration/triggers/test_utils.py +3 -2
- mage_ai/tests/server/test_server.py +19 -0
- mage_ai/tests/services/k8s/test_job_manager.py +27 -6
- mage_ai/tests/streaming/sinks/test_oracledb.py +38 -0
- mage_ai/tests/test_shared.py +61 -0
- mage_ai/usage_statistics/logger.py +7 -2
- mage_ai/utils/code.py +33 -19
- mage_ai/version_control/branch/utils.py +2 -1
- mage_ai/version_control/models.py +3 -2
- {mage_ai-0.9.69.dist-info → mage_ai-0.9.71.dist-info}/METADATA +6 -3
- {mage_ai-0.9.69.dist-info → mage_ai-0.9.71.dist-info}/RECORD +555 -454
- mage_ai/data_preparation/models/global_data_product/constants.py +0 -6
- mage_ai/server/frontend_dist/_next/static/_krrrgup_C-dPOpX36S8I/_buildManifest.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/1557-df144fbd8b2208c3.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/2631-b9f9bea3f1cf906d.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/3782-ef4cd4f0b52072d0.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/4783-422429203610c318.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/5699-6d708c6b2153ea08.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/635-0d6b7c8804bcd2dc.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/7022-0d52dd8868621fb0.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/7361-8a23dd8360593e7a.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/7966-f07b2913f7326b50.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/8095-bdce03896ef9639a.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/8146-6bed4e7401e067e6.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/9265-d2a1aaec75ec69b8.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/9440-4069842b90d4b801.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/9624-59b2f803f9c88cd6.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/9832-67896490f6e8a014.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/_app-d9c89527266296f7.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/global-data-products/[...slug]-591abd392dc50ed4.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/global-data-products-78e8e88f2a757a18.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/manage-852d403c7bda21b3.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/backfills/[...slug]-ff4bd7a8ec3bab40.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/backfills-a8b61d8d239fd16f.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/dashboard-95ffcd3e2b27e567.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/edit-e1dd1ed71d26c10d.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/monitors/block-runtime-1ed9045b2f1dfd65.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/runs/[run]-1417ad1c821d720a.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/settings-59aca25a5b1d3998.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/triggers/[...slug]-f028ef3880ed856c.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/settings/platform/preferences-503049734a8b082f.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/settings/workspace/preferences-5b26eeda8aed8a7b.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/settings/workspace/roles-36fa165a48af586b.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/settings/workspace/sync-data-8b793b3b696a2cd3.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/version-control-5753fac7c1bfdc88.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/KLL5mirre9d7_ZeEpaw3s/_buildManifest.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/1557-df144fbd8b2208c3.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/2631-b9f9bea3f1cf906d.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/3782-ef4cd4f0b52072d0.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/4783-422429203610c318.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/5699-6d708c6b2153ea08.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/635-0d6b7c8804bcd2dc.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/7022-0d52dd8868621fb0.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/7361-8a23dd8360593e7a.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/7966-f07b2913f7326b50.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/8095-bdce03896ef9639a.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/8146-6bed4e7401e067e6.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/9265-d2a1aaec75ec69b8.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/9440-4069842b90d4b801.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/9624-59b2f803f9c88cd6.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/9832-67896490f6e8a014.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/_app-d9c89527266296f7.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/global-data-products/[...slug]-591abd392dc50ed4.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/global-data-products-78e8e88f2a757a18.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/manage-852d403c7bda21b3.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/backfills/[...slug]-ff4bd7a8ec3bab40.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/backfills-a8b61d8d239fd16f.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/dashboard-95ffcd3e2b27e567.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/edit-e1dd1ed71d26c10d.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/monitors/block-runtime-1ed9045b2f1dfd65.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/runs/[run]-1417ad1c821d720a.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/settings-59aca25a5b1d3998.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/triggers/[...slug]-f028ef3880ed856c.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/settings/platform/preferences-503049734a8b082f.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/settings/workspace/preferences-5b26eeda8aed8a7b.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/settings/workspace/roles-36fa165a48af586b.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/settings/workspace/sync-data-8b793b3b696a2cd3.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/version-control-5753fac7c1bfdc88.js +0 -1
- mage_ai/shared/memory.py +0 -90
- mage_ai/tests/data_preparation/models/block/dynamic/test_dynamic_helpers.py +0 -48
- /mage_ai/{tests/data_preparation/shared → ai/utils}/__init__.py +0 -0
- /mage_ai/server/frontend_dist/_next/static/{_krrrgup_C-dPOpX36S8I → UZLabyPgcxtZvp0O0EUUS}/_ssgManifest.js +0 -0
- /mage_ai/server/frontend_dist_base_path_template/_next/static/{KLL5mirre9d7_ZeEpaw3s → kcptwoOU-JJJg6Vwpkfmx}/_ssgManifest.js +0 -0
- /mage_ai/tests/data_preparation/{shared → storage/shared}/test_secrets.py +0 -0
- {mage_ai-0.9.69.dist-info → mage_ai-0.9.71.dist-info}/LICENSE +0 -0
- {mage_ai-0.9.69.dist-info → mage_ai-0.9.71.dist-info}/WHEEL +0 -0
- {mage_ai-0.9.69.dist-info → mage_ai-0.9.71.dist-info}/entry_points.txt +0 -0
- {mage_ai-0.9.69.dist-info → mage_ai-0.9.71.dist-info}/top_level.txt +0 -0
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
from dataclasses import dataclass
|
|
4
|
+
from inspect import isawaitable
|
|
5
|
+
from typing import Dict, List, Optional, Tuple
|
|
6
|
+
|
|
7
|
+
from mage_ai.kernels.utils import (
|
|
8
|
+
find_ipykernel_launchers_info,
|
|
9
|
+
is_kernel_process_active,
|
|
10
|
+
terminate_process,
|
|
11
|
+
)
|
|
12
|
+
from mage_ai.shared.models import BaseDataClass
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
@dataclass
|
|
16
|
+
class PCPUTimes(BaseDataClass):
|
|
17
|
+
user: Optional[float] = None
|
|
18
|
+
system: Optional[float] = None
|
|
19
|
+
children_user: Optional[float] = None
|
|
20
|
+
children_system: Optional[float] = None
|
|
21
|
+
iowait: Optional[float] = None
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
@dataclass
|
|
25
|
+
class PMemoryInfo(BaseDataClass):
|
|
26
|
+
rss: Optional[int] = None
|
|
27
|
+
vms: Optional[int] = None
|
|
28
|
+
shared: Optional[int] = None
|
|
29
|
+
text: Optional[int] = None
|
|
30
|
+
lib: Optional[int] = None
|
|
31
|
+
data: Optional[int] = None
|
|
32
|
+
dirty: Optional[int] = None
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
@dataclass
|
|
36
|
+
class POpenFile(BaseDataClass):
|
|
37
|
+
path: Optional[str] = None
|
|
38
|
+
fd: Optional[int] = None
|
|
39
|
+
position: Optional[int] = None
|
|
40
|
+
mode: Optional[str] = None
|
|
41
|
+
flags: Optional[int] = None
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
@dataclass
|
|
45
|
+
class Addr(BaseDataClass):
|
|
46
|
+
ip: Optional[str] = None
|
|
47
|
+
port: Optional[int] = None
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
@dataclass
|
|
51
|
+
class PConn(BaseDataClass):
|
|
52
|
+
fd: Optional[int] = None
|
|
53
|
+
family: Optional[str] = None
|
|
54
|
+
type: Optional[str] = None
|
|
55
|
+
laddr: Optional[Addr] = None
|
|
56
|
+
raddr: Optional[Addr] = None
|
|
57
|
+
status: Optional[str] = None
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
@dataclass
|
|
61
|
+
class KernelProcess(BaseDataClass):
|
|
62
|
+
active: Optional[bool] = None
|
|
63
|
+
cmdline: Optional[str] = None
|
|
64
|
+
connection_file: Optional[str] = None
|
|
65
|
+
connections: Optional[List[PConn]] = None
|
|
66
|
+
cpu: Optional[float] = None
|
|
67
|
+
cpu_times: Optional[PCPUTimes] = None
|
|
68
|
+
create_time: Optional[float] = None
|
|
69
|
+
exe: Optional[str] = None
|
|
70
|
+
memory: Optional[float] = None
|
|
71
|
+
memory_info: Optional[PMemoryInfo] = None
|
|
72
|
+
name: Optional[str] = None
|
|
73
|
+
num_threads: Optional[str] = None
|
|
74
|
+
open_files: Optional[List[POpenFile]] = None
|
|
75
|
+
pid: Optional[int] = None
|
|
76
|
+
ppid: Optional[int] = None
|
|
77
|
+
status: Optional[str] = None
|
|
78
|
+
username: Optional[str] = None
|
|
79
|
+
|
|
80
|
+
def __post_init__(self):
|
|
81
|
+
self.serialize_attribute_class('memory_info', PMemoryInfo)
|
|
82
|
+
self.serialize_attribute_classes('connections', PConn)
|
|
83
|
+
self.serialize_attribute_classes('cpu_times', PCPUTimes)
|
|
84
|
+
self.serialize_attribute_classes('open_files', POpenFile)
|
|
85
|
+
|
|
86
|
+
self.cpu = (
|
|
87
|
+
sum([
|
|
88
|
+
float(val) if val is not None else 0
|
|
89
|
+
for val in [self.cpu_times.user, self.cpu_times.system]
|
|
90
|
+
])
|
|
91
|
+
if self.cpu_times
|
|
92
|
+
else 0
|
|
93
|
+
)
|
|
94
|
+
self.memory = int(self.memory_info.rss) if self.memory_info and self.memory_info.rss else 0
|
|
95
|
+
|
|
96
|
+
@classmethod
|
|
97
|
+
def load_all(cls, check_active_status: bool = False) -> List['KernelProcess']:
|
|
98
|
+
return [
|
|
99
|
+
cls.load(**d)
|
|
100
|
+
for d in find_ipykernel_launchers_info(check_active_status=check_active_status)
|
|
101
|
+
]
|
|
102
|
+
|
|
103
|
+
@classmethod
|
|
104
|
+
def terminate_inactive(
|
|
105
|
+
cls,
|
|
106
|
+
process_dicts: Optional[List[Dict]] = None,
|
|
107
|
+
) -> Tuple[int, int]:
|
|
108
|
+
print('Terminating inactive kernels...')
|
|
109
|
+
memory_usage = []
|
|
110
|
+
|
|
111
|
+
if process_dicts:
|
|
112
|
+
arr = [cls.load(**d) for d in process_dicts]
|
|
113
|
+
else:
|
|
114
|
+
arr = cls.load_all(check_active_status=True)
|
|
115
|
+
if len(arr) >= 2:
|
|
116
|
+
for kernel_process in arr:
|
|
117
|
+
if not kernel_process.active:
|
|
118
|
+
print(f'Terminating process {kernel_process.pid}...')
|
|
119
|
+
if kernel_process.terminate():
|
|
120
|
+
memory_usage.append(kernel_process.memory)
|
|
121
|
+
|
|
122
|
+
if len(memory_usage) == 0:
|
|
123
|
+
print('No inactive kernels found.')
|
|
124
|
+
return 0, 0
|
|
125
|
+
|
|
126
|
+
print(
|
|
127
|
+
f'{sum(memory_usage)} bytes of memory freed '
|
|
128
|
+
f'from {len(memory_usage)} inactive kernel(s).'
|
|
129
|
+
)
|
|
130
|
+
return len(memory_usage), sum(memory_usage)
|
|
131
|
+
|
|
132
|
+
def check_active_status(self) -> bool:
|
|
133
|
+
if not self.pid or not self.connection_file:
|
|
134
|
+
return False
|
|
135
|
+
|
|
136
|
+
self.active = is_kernel_process_active(self.pid, self.connection_file) or False
|
|
137
|
+
return self.active
|
|
138
|
+
|
|
139
|
+
def terminate(self) -> bool:
|
|
140
|
+
return self.pid is not None and terminate_process(self.pid)
|
|
141
|
+
|
|
142
|
+
|
|
143
|
+
class KernelWrapper:
|
|
144
|
+
def __init__(self, kernel):
|
|
145
|
+
self.kernel = kernel
|
|
146
|
+
self.usage = None
|
|
147
|
+
self.active_kernels = None
|
|
148
|
+
self.inactive_kernels = None
|
|
149
|
+
|
|
150
|
+
async def prepare_usage(self):
|
|
151
|
+
try:
|
|
152
|
+
client = self.kernel.client()
|
|
153
|
+
session = self.kernel.session
|
|
154
|
+
control_channel = client.control_channel
|
|
155
|
+
usage_request = session.msg('usage_request', {})
|
|
156
|
+
|
|
157
|
+
control_channel.send(usage_request)
|
|
158
|
+
res = client.control_channel.get_msg(timeout=3)
|
|
159
|
+
if isawaitable(res):
|
|
160
|
+
# control_channel.get_msg may return a Future,
|
|
161
|
+
# depending on configured KernelManager class
|
|
162
|
+
res = await res
|
|
163
|
+
self.usage = res.get('content')
|
|
164
|
+
control_channel.stop()
|
|
165
|
+
except Exception:
|
|
166
|
+
pass
|
|
167
|
+
|
|
168
|
+
def is_ready(self) -> bool:
|
|
169
|
+
return self.usage is not None
|
|
170
|
+
|
|
171
|
+
def is_alive(self):
|
|
172
|
+
return self.kernel.is_alive()
|
|
173
|
+
|
|
174
|
+
@property
|
|
175
|
+
def kernel_id(self) -> str:
|
|
176
|
+
return self.kernel.kernel_id
|
|
177
|
+
|
|
178
|
+
@property
|
|
179
|
+
def kernel_name(self) -> str:
|
|
180
|
+
return self.kernel.kernel_name
|
|
181
|
+
|
|
182
|
+
def to_dict(self) -> Dict:
|
|
183
|
+
return {
|
|
184
|
+
'alive': self.is_alive(),
|
|
185
|
+
'id': self.kernel_id,
|
|
186
|
+
'name': self.kernel_name,
|
|
187
|
+
'usage': self.usage,
|
|
188
|
+
}
|
mage_ai/kernels/utils.py
ADDED
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
import asyncio
|
|
2
|
+
import datetime
|
|
3
|
+
import os
|
|
4
|
+
from queue import Empty
|
|
5
|
+
from typing import Any, Dict, List, Optional
|
|
6
|
+
|
|
7
|
+
import jupyter_client
|
|
8
|
+
import psutil
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
def list_open_files(pid):
|
|
12
|
+
"""
|
|
13
|
+
List open files by a process and their last modification time.
|
|
14
|
+
|
|
15
|
+
Parameters:
|
|
16
|
+
- pid (int): Process ID.
|
|
17
|
+
"""
|
|
18
|
+
proc = psutil.Process(pid)
|
|
19
|
+
for item in proc.open_files():
|
|
20
|
+
file_path = item.path
|
|
21
|
+
try:
|
|
22
|
+
mod_time = os.path.getmtime(file_path)
|
|
23
|
+
print(f'File: {file_path}, Last Mod Time: {datetime.datetime.fromtimestamp(mod_time)}')
|
|
24
|
+
except Exception as e:
|
|
25
|
+
print(f'Could not retrieve modification time for {file_path}: {str(e)}')
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
def is_cmdline_contains_ipykernel(cmdline, search_term='ipykernel_launcher'):
|
|
29
|
+
"""Check if the command line (if exists) contains the specified search term."""
|
|
30
|
+
if cmdline and search_term in ' '.join(cmdline):
|
|
31
|
+
return True
|
|
32
|
+
return False
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
async def find_ipykernel_launchers_info_async(timeout: int = 5) -> List[Dict]:
|
|
36
|
+
loop = asyncio.get_running_loop()
|
|
37
|
+
try:
|
|
38
|
+
# Run the synchronous function in a separate thread with a timeout
|
|
39
|
+
arr = await asyncio.wait_for(
|
|
40
|
+
loop.run_in_executor(None, lambda: find_ipykernel_launchers_info(True)), timeout
|
|
41
|
+
)
|
|
42
|
+
return arr
|
|
43
|
+
except asyncio.TimeoutError:
|
|
44
|
+
print(f'Operation timed out after {timeout} seconds')
|
|
45
|
+
return []
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
def find_ipykernel_launchers_info(check_active_status: bool = False) -> List[Dict]:
|
|
49
|
+
"""
|
|
50
|
+
ps aux | grep ipykernel_launcher
|
|
51
|
+
"""
|
|
52
|
+
arr = []
|
|
53
|
+
for proc in psutil.process_iter(['pid', 'ppid', 'name', 'cmdline', 'memory_info']):
|
|
54
|
+
try:
|
|
55
|
+
# Check if cmdline is available and contains 'ipykernel_launcher'
|
|
56
|
+
cmdline = proc.info['cmdline']
|
|
57
|
+
if cmdline and 'ipykernel_launcher' in ' '.join(proc.info['cmdline']):
|
|
58
|
+
pid = proc.info['pid']
|
|
59
|
+
process = dict(pid=pid)
|
|
60
|
+
process.update(
|
|
61
|
+
get_process_info(pid, check_active_status=check_active_status) or {}
|
|
62
|
+
)
|
|
63
|
+
arr.append(process)
|
|
64
|
+
except (psutil.NoSuchProcess, psutil.AccessDenied, psutil.ZombieProcess):
|
|
65
|
+
pass # Process has been terminated or access was denied
|
|
66
|
+
return arr
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
def get_process_info(pid: int, check_active_status: bool = False) -> Optional[Dict]:
|
|
70
|
+
"""
|
|
71
|
+
Retrieves information about a process given its PID.
|
|
72
|
+
|
|
73
|
+
Parameters:
|
|
74
|
+
- pid (int): Process ID.
|
|
75
|
+
|
|
76
|
+
Returns:
|
|
77
|
+
- dict: A dictionary containing process information, or None if the process does not exist.
|
|
78
|
+
"""
|
|
79
|
+
try:
|
|
80
|
+
"""
|
|
81
|
+
Most common to refer to the RSS (Resident Set Size) value
|
|
82
|
+
because it most accurately represents the amount of physical memory actually
|
|
83
|
+
occupied by the process
|
|
84
|
+
{
|
|
85
|
+
'memory_info': pmem(
|
|
86
|
+
rss=62554112,
|
|
87
|
+
vms=692289536,
|
|
88
|
+
shared=14155776,
|
|
89
|
+
text=4096,
|
|
90
|
+
lib=0,
|
|
91
|
+
data=130043904,
|
|
92
|
+
dirty=0,
|
|
93
|
+
),
|
|
94
|
+
}
|
|
95
|
+
"""
|
|
96
|
+
process = psutil.Process(int(pid))
|
|
97
|
+
cmdline = process.cmdline()
|
|
98
|
+
proc_info = {
|
|
99
|
+
'pid': process.pid,
|
|
100
|
+
'ppid': process.ppid(),
|
|
101
|
+
'name': process.name(),
|
|
102
|
+
'exe': process.exe(),
|
|
103
|
+
'cmdline': ' '.join(cmdline),
|
|
104
|
+
# If there are more than 1, kill the ones that are "sleeping"
|
|
105
|
+
# Kernels that are busy can still show status as "sleeping"
|
|
106
|
+
# ESTABLISHED
|
|
107
|
+
'status': process.status(),
|
|
108
|
+
'username': process.username(),
|
|
109
|
+
'create_time': process.create_time(),
|
|
110
|
+
'cpu_times': process.cpu_times(),
|
|
111
|
+
'memory_info': process.memory_info(),
|
|
112
|
+
'open_files': process.open_files(),
|
|
113
|
+
'connections': process.connections(),
|
|
114
|
+
'num_threads': process.num_threads(),
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
# Extract and add the connection file path
|
|
118
|
+
for arg in cmdline:
|
|
119
|
+
if arg and arg.endswith('.json'):
|
|
120
|
+
proc_info['connection_file'] = arg
|
|
121
|
+
break # Break after finding the first .json argument
|
|
122
|
+
|
|
123
|
+
if check_active_status:
|
|
124
|
+
proc_info['active'] = is_kernel_process_active(pid, proc_info.get('connection_file'))
|
|
125
|
+
return proc_info
|
|
126
|
+
except (psutil.NoSuchProcess, psutil.AccessDenied, psutil.ZombieProcess):
|
|
127
|
+
return None
|
|
128
|
+
|
|
129
|
+
|
|
130
|
+
def terminate_process(pid: int) -> bool:
|
|
131
|
+
"""
|
|
132
|
+
Attempt to terminate the process with the given PID.
|
|
133
|
+
"""
|
|
134
|
+
try:
|
|
135
|
+
process = psutil.Process(pid)
|
|
136
|
+
process.terminate() # Requests the process to terminate
|
|
137
|
+
process.wait(timeout=3) # Wait up to 3 seconds for the process to end
|
|
138
|
+
return True
|
|
139
|
+
except psutil.NoSuchProcess:
|
|
140
|
+
print(f'No process with PID {pid} exists.')
|
|
141
|
+
return False
|
|
142
|
+
except psutil.AccessDenied:
|
|
143
|
+
print(f'Permission denied to terminate process {pid}.')
|
|
144
|
+
return False
|
|
145
|
+
except psutil.TimeoutExpired:
|
|
146
|
+
print(f'Process {pid} did not terminate within the timeout period.')
|
|
147
|
+
# Optionally use process.kill() if you must forcibly stop the process
|
|
148
|
+
# return False
|
|
149
|
+
except Exception as e:
|
|
150
|
+
print(f'An unexpected error occurred: {e}')
|
|
151
|
+
return False
|
|
152
|
+
return False
|
|
153
|
+
|
|
154
|
+
|
|
155
|
+
def is_kernel_process_active(pid: int, connection_file: Any) -> bool:
|
|
156
|
+
if not connection_file:
|
|
157
|
+
return False
|
|
158
|
+
|
|
159
|
+
km = jupyter_client.BlockingKernelClient()
|
|
160
|
+
km.load_connection_file(connection_file)
|
|
161
|
+
|
|
162
|
+
km.execute('1 + 1', connection_file)
|
|
163
|
+
try:
|
|
164
|
+
km.get_shell_msg(timeout=1)
|
|
165
|
+
return False
|
|
166
|
+
except Empty:
|
|
167
|
+
return True
|
|
168
|
+
|
|
169
|
+
return False
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
from dataclasses import dataclass
|
|
2
2
|
|
|
3
|
+
from mage_ai.settings.server import (
|
|
4
|
+
CONCURRENCY_CONFIG_BLOCK_RUN_LIMIT,
|
|
5
|
+
CONCURRENCY_CONFIG_PIPELINE_RUN_LIMIT,
|
|
6
|
+
)
|
|
3
7
|
from mage_ai.shared.config import BaseConfig
|
|
4
8
|
|
|
5
9
|
|
|
@@ -10,7 +14,7 @@ class OnLimitReached:
|
|
|
10
14
|
|
|
11
15
|
@dataclass
|
|
12
16
|
class ConcurrencyConfig(BaseConfig):
|
|
13
|
-
block_run_limit: int =
|
|
14
|
-
pipeline_run_limit: int =
|
|
17
|
+
block_run_limit: int = CONCURRENCY_CONFIG_BLOCK_RUN_LIMIT
|
|
18
|
+
pipeline_run_limit: int = CONCURRENCY_CONFIG_PIPELINE_RUN_LIMIT
|
|
15
19
|
pipeline_run_limit_all_triggers: int = None
|
|
16
20
|
on_pipeline_run_limit_reached: OnLimitReached = OnLimitReached.WAIT
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"""Add UserProject table
|
|
2
|
+
|
|
3
|
+
Revision ID: 0227396a216c
|
|
4
|
+
Revises: 42a14d6143f1
|
|
5
|
+
Create Date: 2024-04-01 11:31:34.680396
|
|
6
|
+
|
|
7
|
+
"""
|
|
8
|
+
from alembic import op
|
|
9
|
+
import sqlalchemy as sa
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
# revision identifiers, used by Alembic.
|
|
13
|
+
revision = '0227396a216c'
|
|
14
|
+
down_revision = '42a14d6143f1'
|
|
15
|
+
branch_labels = None
|
|
16
|
+
depends_on = None
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
def upgrade() -> None:
|
|
20
|
+
# ### commands auto generated by Alembic - please adjust! ###
|
|
21
|
+
op.create_table('user_project',
|
|
22
|
+
sa.Column('id', sa.Integer(), autoincrement=True, nullable=False),
|
|
23
|
+
sa.Column('created_at', sa.DateTime(timezone=True), server_default=sa.text('(CURRENT_TIMESTAMP)'), nullable=True),
|
|
24
|
+
sa.Column('updated_at', sa.DateTime(timezone=True), server_default=sa.text('(CURRENT_TIMESTAMP)'), nullable=True),
|
|
25
|
+
sa.Column('user_id', sa.Integer(), nullable=True),
|
|
26
|
+
sa.Column('root_project_uuid', sa.String(length=255), nullable=True),
|
|
27
|
+
sa.Column('project_name', sa.String(length=255), nullable=True),
|
|
28
|
+
sa.Column('active', sa.Boolean(), nullable=True),
|
|
29
|
+
sa.ForeignKeyConstraint(['user_id'], ['user.id'], ),
|
|
30
|
+
sa.PrimaryKeyConstraint('id')
|
|
31
|
+
)
|
|
32
|
+
# ### end Alembic commands ###
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
def downgrade() -> None:
|
|
36
|
+
# ### commands auto generated by Alembic - please adjust! ###
|
|
37
|
+
op.drop_table('user_project')
|
|
38
|
+
# ### end Alembic commands ###
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
"""Update token column type
|
|
2
|
+
|
|
3
|
+
Revision ID: 42a14d6143f1
|
|
4
|
+
Revises: b9a2d6d0a2c7
|
|
5
|
+
Create Date: 2024-04-12 15:19:52.639580
|
|
6
|
+
|
|
7
|
+
"""
|
|
8
|
+
from alembic import op
|
|
9
|
+
import sqlalchemy as sa
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
# revision identifiers, used by Alembic.
|
|
13
|
+
revision = '42a14d6143f1'
|
|
14
|
+
down_revision = 'b9a2d6d0a2c7'
|
|
15
|
+
branch_labels = None
|
|
16
|
+
depends_on = None
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
def upgrade() -> None:
|
|
20
|
+
# ### commands auto generated by Alembic - please adjust! ###
|
|
21
|
+
with op.batch_alter_table('oauth2_access_token', schema=None) as batch_op:
|
|
22
|
+
batch_op.alter_column(
|
|
23
|
+
'token',
|
|
24
|
+
existing_type=sa.String(length=255),
|
|
25
|
+
type_=sa.Text(),
|
|
26
|
+
existing_nullable=True,
|
|
27
|
+
)
|
|
28
|
+
batch_op.alter_column(
|
|
29
|
+
'refresh_token',
|
|
30
|
+
existing_type=sa.String(length=255),
|
|
31
|
+
type_=sa.Text(),
|
|
32
|
+
existing_nullable=True,
|
|
33
|
+
)
|
|
34
|
+
|
|
35
|
+
# ### end Alembic commands ###
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
def downgrade() -> None:
|
|
39
|
+
# ### commands auto generated by Alembic - please adjust! ###
|
|
40
|
+
with op.batch_alter_table('oauth2_access_token', schema=None) as batch_op:
|
|
41
|
+
batch_op.alter_column(
|
|
42
|
+
'token',
|
|
43
|
+
existing_type=sa.Text(),
|
|
44
|
+
type_=sa.String(length=255),
|
|
45
|
+
existing_nullable=True,
|
|
46
|
+
)
|
|
47
|
+
batch_op.alter_column(
|
|
48
|
+
'refresh_token',
|
|
49
|
+
existing_type=sa.String(length=255),
|
|
50
|
+
type_=sa.Text(),
|
|
51
|
+
existing_nullable=True,
|
|
52
|
+
)
|
|
53
|
+
|
|
54
|
+
# ### end Alembic commands ###
|
|
File without changes
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
from mage_ai.data_preparation.models.block.dynamic.models import DynamicRun
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
def is_ready_to_process_data(pipeline, block_run, block_runs) -> bool:
|
|
5
|
+
"""
|
|
6
|
+
Runs are “ready” can begin running when all their upstream blocks meet 1 of these conditions:
|
|
7
|
+
1. Condition set 1
|
|
8
|
+
- dynamic block or dynamic child
|
|
9
|
+
- not reduce_output
|
|
10
|
+
- status is running or all their upstream blocks are completed
|
|
11
|
+
2. Condition set 2
|
|
12
|
+
- not (dynamic block or dynamic child) or reduce_output
|
|
13
|
+
- block.all_upstream_blocks_completed(completed_block_uuids)
|
|
14
|
+
"""
|
|
15
|
+
block = pipeline.get_block(block_run.block_uuid)
|
|
16
|
+
if not block:
|
|
17
|
+
raise Exception(f'Block {block_run.block_uuid} not found in pipeline {pipeline.uuid}')
|
|
18
|
+
|
|
19
|
+
if not block.upstream_blocks:
|
|
20
|
+
return True
|
|
21
|
+
|
|
22
|
+
mapping = {}
|
|
23
|
+
for br in block_runs:
|
|
24
|
+
block_inner = pipeline.get_block(br.block_uuid)
|
|
25
|
+
if block_inner.uuid not in mapping:
|
|
26
|
+
mapping[block_inner.uuid] = DynamicRun.load(block=block_inner)
|
|
27
|
+
|
|
28
|
+
run = mapping[block_inner.uuid]
|
|
29
|
+
run.add(br)
|
|
30
|
+
|
|
31
|
+
def __condition_1(upstream_block, block=block, mapping=mapping) -> bool:
|
|
32
|
+
run = mapping.get(upstream_block.uuid)
|
|
33
|
+
if run is None or run.block_run is None:
|
|
34
|
+
return False
|
|
35
|
+
|
|
36
|
+
return (
|
|
37
|
+
(
|
|
38
|
+
upstream_block.should_dynamically_generate_block(block)
|
|
39
|
+
or upstream_block.is_dynamic_child
|
|
40
|
+
)
|
|
41
|
+
and not upstream_block.should_reduce_output
|
|
42
|
+
and (
|
|
43
|
+
run.block_run.status
|
|
44
|
+
in [run.block_run.BlockRunStatus.COMPLETED, run.block_run.BlockRunStatus.RUNNING]
|
|
45
|
+
)
|
|
46
|
+
)
|
|
47
|
+
|
|
48
|
+
def __condition_2(upstream_block, block=block, mapping=mapping) -> bool:
|
|
49
|
+
run = mapping.get(upstream_block.uuid)
|
|
50
|
+
if run is None or run.block_run is None:
|
|
51
|
+
return False
|
|
52
|
+
|
|
53
|
+
return (
|
|
54
|
+
upstream_block.should_reduce_output
|
|
55
|
+
or not (
|
|
56
|
+
upstream_block.should_dynamically_generate_block(block)
|
|
57
|
+
or upstream_block.is_dynamic_child
|
|
58
|
+
)
|
|
59
|
+
) and (run.block_run.status in [run.block_run.BlockRunStatus.COMPLETED])
|
|
60
|
+
|
|
61
|
+
results = [
|
|
62
|
+
(upstream_block.uuid, __condition_1(upstream_block), __condition_2(upstream_block))
|
|
63
|
+
for upstream_block in block.upstream_blocks
|
|
64
|
+
]
|
|
65
|
+
ready = all([t[1] or t[2] for t in results])
|
|
66
|
+
|
|
67
|
+
return ready
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import enum
|
|
2
2
|
import re
|
|
3
3
|
from datetime import datetime
|
|
4
|
-
from typing import Callable,
|
|
4
|
+
from typing import Callable, List, Union
|
|
5
5
|
|
|
6
6
|
from sqlalchemy import (
|
|
7
7
|
JSON,
|
|
@@ -12,6 +12,7 @@ from sqlalchemy import (
|
|
|
12
12
|
ForeignKey,
|
|
13
13
|
Integer,
|
|
14
14
|
String,
|
|
15
|
+
Text,
|
|
15
16
|
and_,
|
|
16
17
|
asc,
|
|
17
18
|
func,
|
|
@@ -29,7 +30,6 @@ from mage_ai.orchestration.constants import Entity
|
|
|
29
30
|
from mage_ai.orchestration.db import db_connection, safe_db_query
|
|
30
31
|
from mage_ai.orchestration.db.errors import ValidationError
|
|
31
32
|
from mage_ai.orchestration.db.models.base import BaseModel
|
|
32
|
-
from mage_ai.settings.repo import get_repo_path
|
|
33
33
|
from mage_ai.shared.array import find
|
|
34
34
|
from mage_ai.shared.environments import is_test
|
|
35
35
|
from mage_ai.shared.hash import group_by, merge_dict
|
|
@@ -156,14 +156,8 @@ class User(BaseModel):
|
|
|
156
156
|
|
|
157
157
|
return False
|
|
158
158
|
|
|
159
|
-
|
|
160
|
-
def git_settings(self) -> Union[Dict, None]:
|
|
161
|
-
return self.get_git_settings()
|
|
162
|
-
|
|
163
|
-
def get_git_settings(self, repo_path: str = None):
|
|
159
|
+
def get_git_settings(self, repo_path: str):
|
|
164
160
|
preferences = self.preferences or dict()
|
|
165
|
-
if not repo_path:
|
|
166
|
-
repo_path = get_repo_path()
|
|
167
161
|
pref = preferences.get(repo_path)
|
|
168
162
|
if pref:
|
|
169
163
|
return (pref or {}).get('git_settings')
|
|
@@ -324,7 +318,7 @@ class Role(BaseModel):
|
|
|
324
318
|
@classmethod
|
|
325
319
|
@safe_db_query
|
|
326
320
|
def create_default_roles(
|
|
327
|
-
|
|
321
|
+
cls,
|
|
328
322
|
entity: Entity = None,
|
|
329
323
|
entity_id: str = None,
|
|
330
324
|
name_func: Callable[[str], str] = None,
|
|
@@ -342,18 +336,18 @@ class Role(BaseModel):
|
|
|
342
336
|
entity = Entity.GLOBAL
|
|
343
337
|
permissions = Permission.create_default_permissions(entity=entity, entity_id=entity_id)
|
|
344
338
|
mapping = {
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
339
|
+
cls.DefaultRole.OWNER: Permission.Access.OWNER,
|
|
340
|
+
cls.DefaultRole.ADMIN: Permission.Access.ADMIN,
|
|
341
|
+
cls.DefaultRole.EDITOR: Permission.Access.EDITOR,
|
|
342
|
+
cls.DefaultRole.VIEWER: Permission.Access.VIEWER,
|
|
349
343
|
}
|
|
350
344
|
for name, access in mapping.items():
|
|
351
345
|
role_name = name
|
|
352
346
|
if name_func is not None:
|
|
353
347
|
role_name = name_func(name)
|
|
354
|
-
role =
|
|
348
|
+
role = cls.query.filter(Role.name == role_name).first()
|
|
355
349
|
if not role:
|
|
356
|
-
|
|
350
|
+
cls.create(
|
|
357
351
|
name=role_name,
|
|
358
352
|
permissions=[
|
|
359
353
|
Permission.query.filter(
|
|
@@ -880,10 +874,10 @@ class Oauth2AccessToken(BaseModel):
|
|
|
880
874
|
expires = Column(DateTime(timezone=True))
|
|
881
875
|
oauth2_application = relationship(Oauth2Application, back_populates='oauth2_access_tokens')
|
|
882
876
|
oauth2_application_id = Column(Integer, ForeignKey('oauth2_application.id'))
|
|
883
|
-
token = Column(
|
|
877
|
+
token = Column(Text, index=True, unique=True)
|
|
884
878
|
user = relationship(User, back_populates='oauth2_access_tokens')
|
|
885
879
|
user_id = Column(Integer, ForeignKey('user.id'))
|
|
886
|
-
refresh_token = Column(
|
|
880
|
+
refresh_token = Column(Text)
|
|
887
881
|
|
|
888
882
|
def is_valid(self) -> bool:
|
|
889
883
|
return self.token and \
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
from sqlalchemy import Boolean, Column, ForeignKey, Integer, String
|
|
2
|
+
|
|
3
|
+
from mage_ai.orchestration.db.models.base import BaseModel
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
class UserProject(BaseModel):
|
|
7
|
+
user_id = Column(Integer, ForeignKey('user.id'))
|
|
8
|
+
root_project_uuid = Column(String(255), default=None)
|
|
9
|
+
project_name = Column(String(255), default=None)
|
|
10
|
+
active = Column(Boolean, default=False)
|