mage-ai 0.9.44__py3-none-any.whl → 0.9.46__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/api/constants.py +2 -0
- mage_ai/api/operations/base.py +208 -12
- mage_ai/api/policies/BasePolicy.py +3 -3
- mage_ai/api/policies/ComputeClusterPolicy.py +96 -0
- mage_ai/api/policies/ComputeConnectionPolicy.py +74 -0
- mage_ai/api/policies/ComputeServicePolicy.py +50 -0
- mage_ai/api/policies/DownloadPolicy.py +29 -0
- mage_ai/api/policies/GitCustomBranchPolicy.py +1 -0
- mage_ai/api/policies/GlobalHookPolicy.py +126 -0
- mage_ai/api/policies/OauthPolicy.py +56 -7
- mage_ai/api/policies/ProjectPolicy.py +1 -0
- mage_ai/api/policies/RolePolicy.py +12 -1
- mage_ai/api/presenters/ComputeClusterPresenter.py +19 -0
- mage_ai/api/presenters/ComputeConnectionPresenter.py +26 -0
- mage_ai/api/presenters/ComputeServicePresenter.py +15 -0
- mage_ai/api/presenters/DownloadPresenter.py +13 -0
- mage_ai/api/presenters/GlobalHookPresenter.py +74 -0
- mage_ai/api/presenters/OauthPresenter.py +1 -0
- mage_ai/api/presenters/PipelinePresenter.py +1 -0
- mage_ai/api/presenters/ProjectPresenter.py +1 -0
- mage_ai/api/presenters/SparkApplicationPresenter.py +2 -0
- mage_ai/api/presenters/WorkspacePresenter.py +22 -22
- mage_ai/api/resources/AsyncBaseResource.py +39 -0
- mage_ai/api/resources/BackfillResource.py +1 -0
- mage_ai/api/resources/BlockResource.py +57 -0
- mage_ai/api/resources/ClusterResource.py +1 -1
- mage_ai/api/resources/ComputeClusterResource.py +109 -0
- mage_ai/api/resources/ComputeConnectionResource.py +103 -0
- mage_ai/api/resources/ComputeServiceResource.py +35 -0
- mage_ai/api/resources/DownloadResource.py +56 -0
- mage_ai/api/resources/ExecutionStateResource.py +1 -1
- mage_ai/api/resources/GitBranchResource.py +35 -29
- mage_ai/api/resources/GitCustomBranchResource.py +9 -0
- mage_ai/api/resources/GlobalHookResource.py +192 -0
- mage_ai/api/resources/KernelResource.py +10 -0
- mage_ai/api/resources/OauthResource.py +60 -98
- mage_ai/api/resources/PipelineResource.py +4 -4
- mage_ai/api/resources/PipelineScheduleResource.py +37 -16
- mage_ai/api/resources/ProjectResource.py +5 -3
- mage_ai/api/resources/SessionResource.py +24 -9
- mage_ai/api/resources/SparkApplicationResource.py +5 -5
- mage_ai/api/resources/SparkEnvironmentResource.py +1 -2
- mage_ai/api/resources/SparkExecutorResource.py +1 -2
- mage_ai/api/resources/SparkJobResource.py +3 -6
- mage_ai/api/resources/SparkSqlResource.py +6 -11
- mage_ai/api/resources/SparkStageAttemptResource.py +2 -3
- mage_ai/api/resources/SparkStageAttemptTaskResource.py +1 -2
- mage_ai/api/resources/SparkStageAttemptTaskSummaryResource.py +1 -2
- mage_ai/api/resources/SparkStageResource.py +3 -6
- mage_ai/api/resources/SparkThreadResource.py +1 -2
- mage_ai/api/resources/UserResource.py +32 -31
- mage_ai/api/resources/mixins/spark.py +25 -4
- mage_ai/authentication/oauth/constants.py +4 -0
- mage_ai/authentication/oauth2.py +1 -3
- mage_ai/authentication/permissions/constants.py +4 -0
- mage_ai/authentication/providers/__init__.py +0 -0
- mage_ai/authentication/providers/active_directory.py +136 -0
- mage_ai/authentication/providers/constants.py +17 -0
- mage_ai/authentication/providers/ghe.py +81 -0
- mage_ai/authentication/providers/google.py +86 -0
- mage_ai/authentication/providers/oauth.py +60 -0
- mage_ai/authentication/providers/okta.py +101 -0
- mage_ai/authentication/providers/sso.py +20 -0
- mage_ai/authentication/providers/utils.py +12 -0
- mage_ai/cluster_manager/aws/emr_cluster_manager.py +2 -1
- mage_ai/cluster_manager/workspace/base.py +7 -3
- mage_ai/data_integrations/destinations/constants.py +2 -0
- mage_ai/data_preparation/executors/block_executor.py +3 -0
- mage_ai/data_preparation/executors/pipeline_executor.py +9 -0
- mage_ai/data_preparation/git/__init__.py +3 -3
- mage_ai/data_preparation/git/api.py +69 -35
- mage_ai/data_preparation/models/block/__init__.py +95 -60
- mage_ai/data_preparation/models/block/data_integration/data.py +1 -1
- mage_ai/data_preparation/models/block/dbt/block_sql.py +95 -1
- mage_ai/data_preparation/models/block/dbt/utils.py +6 -0
- mage_ai/data_preparation/models/block/spark/mixins.py +82 -34
- mage_ai/data_preparation/models/download/__init__.py +8 -0
- mage_ai/data_preparation/models/global_hooks/__init__.py +0 -0
- mage_ai/data_preparation/models/global_hooks/constants.py +44 -0
- mage_ai/data_preparation/models/global_hooks/models.py +928 -0
- mage_ai/data_preparation/models/global_hooks/utils.py +21 -0
- mage_ai/data_preparation/models/pipeline.py +82 -6
- mage_ai/data_preparation/models/pipelines/models.py +16 -0
- mage_ai/data_preparation/models/project/__init__.py +6 -0
- mage_ai/data_preparation/models/project/constants.py +1 -0
- mage_ai/data_preparation/models/project/models.py +12 -0
- mage_ai/data_preparation/repo_manager.py +23 -1
- mage_ai/data_preparation/templates/callbacks/base.jinja +4 -0
- mage_ai/data_preparation/templates/data_exporters/streaming/kafka.yaml +1 -0
- mage_ai/data_preparation/templates/data_loaders/streaming/activemq.yaml +6 -0
- mage_ai/data_preparation/templates/data_loaders/streaming/kafka.yaml +1 -0
- mage_ai/data_preparation/templates/data_loaders/streaming/nats.yaml +20 -0
- mage_ai/data_preparation/templates/repo/io_config.yaml +2 -2
- mage_ai/io/duckdb.py +0 -1
- mage_ai/orchestration/concurrency.py +8 -1
- mage_ai/orchestration/db/models/schedules.py +23 -2
- mage_ai/orchestration/pipeline_scheduler.py +168 -105
- mage_ai/orchestration/queue/process_queue.py +9 -1
- mage_ai/orchestration/triggers/api.py +11 -3
- mage_ai/orchestration/triggers/constants.py +1 -0
- mage_ai/orchestration/triggers/utils.py +23 -0
- mage_ai/server/active_kernel.py +37 -4
- mage_ai/server/api/downloads.py +76 -1
- mage_ai/server/api/triggers.py +1 -0
- mage_ai/server/constants.py +1 -1
- mage_ai/server/frontend_dist/404.html +2 -2
- mage_ai/server/frontend_dist/_next/static/9jB4XPuz6BzxBcG9VNao5/_buildManifest.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/1749-9a6276b2918fdae1.js +1 -0
- mage_ai/server/{frontend_dist_base_path_template/_next/static/chunks/7519-8c29bbb92e03cc77.js → frontend_dist/_next/static/chunks/1845-5ce774d5ab81ed57.js} +1 -1
- mage_ai/server/frontend_dist/_next/static/chunks/1952-ac7722e8b1ab88fe.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/3419-f8d518d024e7b5c8.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/4267-fd4d8049e83178de.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/4366-93e09e5a4a7e182c.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/5457-949640f4037bf12f.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/5499-76cf8f023c6b0985.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/553-7f7919e14392ca67.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/5638-a65610405a70961c.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/5810-12eadc488265d55b.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/5820-28adeabb5cda2b96.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/595-0d174b1f9fbfce4f.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/600-705fe234320ec5de.js +1 -0
- mage_ai/server/{frontend_dist_base_path_template/_next/static/chunks/3122-f27de34d0b5426af.js → frontend_dist/_next/static/chunks/6285-e9b45335bfb9ccaf.js} +1 -1
- mage_ai/server/frontend_dist/_next/static/chunks/6333-bc1b433b428a9095.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/{5397-b5f2e477acc6bd6b.js → 6965-c613d1834c8ed92d.js} +1 -1
- mage_ai/server/frontend_dist/_next/static/chunks/{7022-18fde36eb46e1d65.js → 7022-070ec0144a4d029c.js} +1 -1
- mage_ai/server/frontend_dist/_next/static/chunks/722-a1584445357a276c.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/{7858-c83d25349d0e980f.js → 7858-d9df72e95e438284.js} +1 -1
- mage_ai/server/frontend_dist/_next/static/chunks/8264-0d582a6ca33c3dfa.js +1 -0
- mage_ai/server/{frontend_dist_base_path_template/_next/static/chunks/3684-cbda680fd8927d07.js → frontend_dist/_next/static/chunks/8432-f191e39f9b5893f2.js} +1 -1
- mage_ai/server/frontend_dist/_next/static/chunks/90-a7308bae028d7001.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/9264-1d4f0327d42fed91.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/9618-2c5045255ac5a6e7.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/{976-27c4eed1c9b20c44.js → 976-18c98af60b76f1a7.js} +1 -1
- mage_ai/server/frontend_dist/_next/static/chunks/framework-22b71764bf44ede4.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/_app-ebef928183f9a3bb.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/block-layout-a24cb24b6f08bbc9.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/compute-419775ca1293b354.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/files-0f2d4be6fdca86ca.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/global-data-products/{[...slug]-3f6fc312f67ff72e.js → [...slug]-cfd68e760ae00958.js} +1 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/{global-data-products-f4cd03036c3e8723.js → global-data-products-c3b79ef31007f95b.js} +1 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/global-hooks/[...slug]-77edfa32d000e88b.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/global-hooks-e561ae38cf5592e8.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/manage/files-449a022f2f0f2d94.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/manage/settings-60845f0b59142f32.js +1 -0
- mage_ai/server/{frontend_dist_base_path_template/_next/static/chunks/pages/manage/users/[user]-1d9b298fdceabbf1.js → frontend_dist/_next/static/chunks/pages/manage/users/[user]-9384c5f1efa2ac18.js} +1 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/manage/users/new-abd8571907664fdf.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/manage/{users-a7c970122a10afdc.js → users-28a930b148d99766.js} +1 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/manage-f83deb790548693b.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/oauth-8bb62c4f6a511c43.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/overview-f0c40645f385f23f.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/{pipeline-runs-c79819d6826e5416.js → pipeline-runs-b35d37bfba8fbccc.js} +1 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/backfills/[...slug]-10e9a2d19541caa2.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/backfills-c8d3a5289ab93f88.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/dashboard-571c0962333b92f0.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/edit-ff7e9108502f5716.js +1 -0
- mage_ai/server/{frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/logs-a52d2d3e0c2978f4.js → frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/logs-ef680455ae54ccbe.js} +1 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/monitors/block-runs-ddddcddd2f74b4f6.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/monitors/block-runtime-4a238307feddb522.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/monitors-e051057d9fe94f23.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/runs/{[run]-4977276c8f84b5f4.js → [run]-0691711636fa95c7.js} +1 -1
- mage_ai/server/{frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/runs-ce717786f31e8f04.js → frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/runs-2d20b2cd08907afd.js} +1 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/settings-2914e326a5f1ffe0.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/syncs-b75bf17498e87354.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/triggers/[...slug]-3a7500e6e53084d3.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/triggers-c0e551d265a8d467.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/{[pipeline]-35fe7762cb83a733.js → [pipeline]-02c843b9c8418bb5.js} +1 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines-e47db5c3eaf683af.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/settings/account/profile-55ac955dfa9a5a8d.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/settings/workspace/permissions/{[...slug]-d6a62284c7c99cb3.js → [...slug]-b78b1be5b9ed84b9.js} +1 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/settings/workspace/{permissions-b1389695f758c32b.js → permissions-37b78a436eeab258.js} +1 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/settings/workspace/preferences-29c92a9bc54ae5cd.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/settings/workspace/roles/{[...slug]-0bdb66265286ab22.js → [...slug]-db05a80d18c168e5.js} +1 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/settings/workspace/{roles-e04e18fc295ca76a.js → roles-f55c77e4f46c8d33.js} +1 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/settings/workspace/sync-data-2a1f8737561fdd94.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/settings/workspace/users/{[...slug]-0267358c91122109.js → [...slug]-e3bf6e5d8bb250c4.js} +1 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/settings/workspace/{users-50fed18bb9b8d142.js → users-20f0a050a42a015d.js} +1 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/{settings-56f83205752b1323.js → settings-0f0121db7f5ff93d.js} +1 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/sign-in-99e2748e3c1d57a3.js +1 -0
- mage_ai/server/{frontend_dist_base_path_template/_next/static/chunks/pages/templates/[...slug]-9370551ffa462144.js → frontend_dist/_next/static/chunks/pages/templates/[...slug]-f44ccd1499ffd23a.js} +1 -1
- mage_ai/server/{frontend_dist_base_path_template/_next/static/chunks/pages/templates-3cff90df13a1a755.js → frontend_dist/_next/static/chunks/pages/templates-1bfaa1c50e844813.js} +1 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/terminal-ed121e305169cf1c.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/test-9ae68758102cc843.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/{triggers-ffaab4c013e62ba1.js → triggers-572d82d6eb7a5d43.js} +1 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/version-control-2d26d80370a2e481.js +1 -0
- mage_ai/server/frontend_dist/block-layout.html +2 -2
- mage_ai/server/frontend_dist/compute.html +5 -5
- mage_ai/server/frontend_dist/files.html +5 -5
- mage_ai/server/frontend_dist/global-data-products/[...slug].html +5 -5
- mage_ai/server/frontend_dist/global-data-products.html +5 -5
- mage_ai/server/frontend_dist/global-hooks/[...slug].html +24 -0
- mage_ai/server/frontend_dist/global-hooks.html +24 -0
- mage_ai/server/frontend_dist/index.html +2 -2
- mage_ai/server/frontend_dist/manage/files.html +5 -5
- mage_ai/server/frontend_dist/manage/settings.html +5 -5
- mage_ai/server/frontend_dist/manage/users/[user].html +5 -5
- mage_ai/server/frontend_dist/manage/users/new.html +5 -5
- mage_ai/server/frontend_dist/manage/users.html +5 -5
- mage_ai/server/frontend_dist/manage.html +5 -5
- mage_ai/server/frontend_dist/oauth.html +4 -4
- mage_ai/server/frontend_dist/overview.html +5 -5
- mage_ai/server/frontend_dist/pipeline-runs.html +5 -5
- mage_ai/server/frontend_dist/pipelines/[pipeline]/backfills/[...slug].html +5 -5
- mage_ai/server/frontend_dist/pipelines/[pipeline]/backfills.html +5 -5
- mage_ai/server/frontend_dist/pipelines/[pipeline]/dashboard.html +5 -5
- mage_ai/server/frontend_dist/pipelines/[pipeline]/edit.html +2 -2
- mage_ai/server/frontend_dist/pipelines/[pipeline]/logs.html +5 -5
- mage_ai/server/frontend_dist/pipelines/[pipeline]/monitors/block-runs.html +5 -5
- mage_ai/server/frontend_dist/pipelines/[pipeline]/monitors/block-runtime.html +5 -5
- mage_ai/server/frontend_dist/pipelines/[pipeline]/monitors.html +5 -5
- mage_ai/server/frontend_dist/pipelines/[pipeline]/runs/[run].html +5 -5
- mage_ai/server/frontend_dist/pipelines/[pipeline]/runs.html +5 -5
- mage_ai/server/frontend_dist/pipelines/[pipeline]/settings.html +5 -5
- mage_ai/server/frontend_dist/pipelines/[pipeline]/syncs.html +5 -5
- mage_ai/server/frontend_dist/pipelines/[pipeline]/triggers/[...slug].html +5 -5
- mage_ai/server/frontend_dist/pipelines/[pipeline]/triggers.html +5 -5
- mage_ai/server/frontend_dist/pipelines/[pipeline].html +2 -2
- mage_ai/server/frontend_dist/pipelines.html +5 -5
- mage_ai/server/frontend_dist/settings/account/profile.html +5 -5
- mage_ai/server/frontend_dist/settings/workspace/permissions/[...slug].html +5 -5
- mage_ai/server/frontend_dist/settings/workspace/permissions.html +5 -5
- mage_ai/server/frontend_dist/settings/workspace/preferences.html +5 -5
- mage_ai/server/frontend_dist/settings/workspace/roles/[...slug].html +5 -5
- mage_ai/server/frontend_dist/settings/workspace/roles.html +5 -5
- mage_ai/server/frontend_dist/settings/workspace/sync-data.html +5 -5
- mage_ai/server/frontend_dist/settings/workspace/users/[...slug].html +5 -5
- mage_ai/server/frontend_dist/settings/workspace/users.html +5 -5
- mage_ai/server/frontend_dist/settings.html +2 -2
- mage_ai/server/frontend_dist/sign-in.html +17 -17
- mage_ai/server/frontend_dist/templates/[...slug].html +5 -5
- mage_ai/server/frontend_dist/templates.html +5 -5
- mage_ai/server/frontend_dist/terminal.html +5 -5
- mage_ai/server/frontend_dist/test.html +15 -15
- mage_ai/server/frontend_dist/triggers.html +5 -5
- mage_ai/server/frontend_dist/version-control.html +5 -5
- mage_ai/server/frontend_dist_base_path_template/404.html +2 -2
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/1749-9a6276b2918fdae1.js +1 -0
- mage_ai/server/{frontend_dist/_next/static/chunks/7519-8c29bbb92e03cc77.js → frontend_dist_base_path_template/_next/static/chunks/1845-5ce774d5ab81ed57.js} +1 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/1952-ac7722e8b1ab88fe.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/3419-f8d518d024e7b5c8.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/4267-fd4d8049e83178de.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/4366-93e09e5a4a7e182c.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/5457-949640f4037bf12f.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/5499-76cf8f023c6b0985.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/553-7f7919e14392ca67.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/5638-a65610405a70961c.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/5810-12eadc488265d55b.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/5820-28adeabb5cda2b96.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/595-0d174b1f9fbfce4f.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/600-705fe234320ec5de.js +1 -0
- mage_ai/server/{frontend_dist/_next/static/chunks/3122-f27de34d0b5426af.js → frontend_dist_base_path_template/_next/static/chunks/6285-e9b45335bfb9ccaf.js} +1 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/6333-bc1b433b428a9095.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/{5397-b5f2e477acc6bd6b.js → 6965-c613d1834c8ed92d.js} +1 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/{7022-18fde36eb46e1d65.js → 7022-070ec0144a4d029c.js} +1 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/722-a1584445357a276c.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/{7858-c83d25349d0e980f.js → 7858-d9df72e95e438284.js} +1 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/8264-0d582a6ca33c3dfa.js +1 -0
- mage_ai/server/{frontend_dist/_next/static/chunks/3684-cbda680fd8927d07.js → frontend_dist_base_path_template/_next/static/chunks/8432-f191e39f9b5893f2.js} +1 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/90-a7308bae028d7001.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/9264-1d4f0327d42fed91.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/9618-2c5045255ac5a6e7.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/{976-27c4eed1c9b20c44.js → 976-18c98af60b76f1a7.js} +1 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/framework-22b71764bf44ede4.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/_app-ebef928183f9a3bb.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/block-layout-a24cb24b6f08bbc9.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/compute-419775ca1293b354.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/files-0f2d4be6fdca86ca.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/global-data-products/{[...slug]-3f6fc312f67ff72e.js → [...slug]-cfd68e760ae00958.js} +1 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/{global-data-products-f4cd03036c3e8723.js → global-data-products-c3b79ef31007f95b.js} +1 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/global-hooks/[...slug]-77edfa32d000e88b.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/global-hooks-e561ae38cf5592e8.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/manage/files-449a022f2f0f2d94.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/manage/settings-60845f0b59142f32.js +1 -0
- mage_ai/server/{frontend_dist/_next/static/chunks/pages/manage/users/[user]-1d9b298fdceabbf1.js → frontend_dist_base_path_template/_next/static/chunks/pages/manage/users/[user]-9384c5f1efa2ac18.js} +1 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/manage/users/new-abd8571907664fdf.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/manage/{users-a7c970122a10afdc.js → users-28a930b148d99766.js} +1 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/manage-f83deb790548693b.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/oauth-8bb62c4f6a511c43.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/overview-f0c40645f385f23f.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/{pipeline-runs-c79819d6826e5416.js → pipeline-runs-b35d37bfba8fbccc.js} +1 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/backfills/[...slug]-10e9a2d19541caa2.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/backfills-c8d3a5289ab93f88.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/dashboard-571c0962333b92f0.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/edit-ff7e9108502f5716.js +1 -0
- mage_ai/server/{frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/logs-a52d2d3e0c2978f4.js → frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/logs-ef680455ae54ccbe.js} +1 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/monitors/block-runs-ddddcddd2f74b4f6.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/monitors/block-runtime-4a238307feddb522.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/monitors-e051057d9fe94f23.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/runs/{[run]-4977276c8f84b5f4.js → [run]-0691711636fa95c7.js} +1 -1
- mage_ai/server/{frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/runs-ce717786f31e8f04.js → frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/runs-2d20b2cd08907afd.js} +1 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/settings-2914e326a5f1ffe0.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/syncs-b75bf17498e87354.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/triggers/[...slug]-3a7500e6e53084d3.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/triggers-c0e551d265a8d467.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/{[pipeline]-35fe7762cb83a733.js → [pipeline]-02c843b9c8418bb5.js} +1 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines-e47db5c3eaf683af.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/settings/account/profile-55ac955dfa9a5a8d.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/settings/workspace/permissions/{[...slug]-d6a62284c7c99cb3.js → [...slug]-b78b1be5b9ed84b9.js} +1 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/settings/workspace/{permissions-b1389695f758c32b.js → permissions-37b78a436eeab258.js} +1 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/settings/workspace/preferences-29c92a9bc54ae5cd.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/settings/workspace/roles/{[...slug]-0bdb66265286ab22.js → [...slug]-db05a80d18c168e5.js} +1 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/settings/workspace/{roles-e04e18fc295ca76a.js → roles-f55c77e4f46c8d33.js} +1 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/settings/workspace/sync-data-2a1f8737561fdd94.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/settings/workspace/users/{[...slug]-0267358c91122109.js → [...slug]-e3bf6e5d8bb250c4.js} +1 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/settings/workspace/{users-50fed18bb9b8d142.js → users-20f0a050a42a015d.js} +1 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/{settings-56f83205752b1323.js → settings-0f0121db7f5ff93d.js} +1 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/sign-in-99e2748e3c1d57a3.js +1 -0
- mage_ai/server/{frontend_dist/_next/static/chunks/pages/templates/[...slug]-9370551ffa462144.js → frontend_dist_base_path_template/_next/static/chunks/pages/templates/[...slug]-f44ccd1499ffd23a.js} +1 -1
- mage_ai/server/{frontend_dist/_next/static/chunks/pages/templates-3cff90df13a1a755.js → frontend_dist_base_path_template/_next/static/chunks/pages/templates-1bfaa1c50e844813.js} +1 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/terminal-ed121e305169cf1c.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/test-9ae68758102cc843.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/{triggers-ffaab4c013e62ba1.js → triggers-572d82d6eb7a5d43.js} +1 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/version-control-2d26d80370a2e481.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/uPDjJYpJMst1q6psbRyte/_buildManifest.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/block-layout.html +2 -2
- mage_ai/server/frontend_dist_base_path_template/compute.html +2 -2
- mage_ai/server/frontend_dist_base_path_template/files.html +2 -2
- mage_ai/server/frontend_dist_base_path_template/global-data-products/[...slug].html +2 -2
- mage_ai/server/frontend_dist_base_path_template/global-data-products.html +2 -2
- mage_ai/server/frontend_dist_base_path_template/global-hooks/[...slug].html +24 -0
- mage_ai/server/frontend_dist_base_path_template/global-hooks.html +24 -0
- mage_ai/server/frontend_dist_base_path_template/index.html +2 -2
- mage_ai/server/frontend_dist_base_path_template/manage/files.html +2 -2
- mage_ai/server/frontend_dist_base_path_template/manage/settings.html +2 -2
- mage_ai/server/frontend_dist_base_path_template/manage/users/[user].html +2 -2
- mage_ai/server/frontend_dist_base_path_template/manage/users/new.html +2 -2
- mage_ai/server/frontend_dist_base_path_template/manage/users.html +2 -2
- mage_ai/server/frontend_dist_base_path_template/manage.html +2 -2
- mage_ai/server/frontend_dist_base_path_template/oauth.html +3 -3
- mage_ai/server/frontend_dist_base_path_template/overview.html +2 -2
- mage_ai/server/frontend_dist_base_path_template/pipeline-runs.html +2 -2
- mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/backfills/[...slug].html +2 -2
- mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/backfills.html +2 -2
- mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/dashboard.html +2 -2
- mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/edit.html +2 -2
- mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/logs.html +2 -2
- mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/monitors/block-runs.html +2 -2
- mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/monitors/block-runtime.html +2 -2
- mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/monitors.html +2 -2
- mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/runs/[run].html +2 -2
- mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/runs.html +2 -2
- mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/settings.html +2 -2
- mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/syncs.html +2 -2
- mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/triggers/[...slug].html +2 -2
- mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/triggers.html +2 -2
- mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline].html +2 -2
- mage_ai/server/frontend_dist_base_path_template/pipelines.html +2 -2
- mage_ai/server/frontend_dist_base_path_template/settings/account/profile.html +2 -2
- mage_ai/server/frontend_dist_base_path_template/settings/workspace/permissions/[...slug].html +2 -2
- mage_ai/server/frontend_dist_base_path_template/settings/workspace/permissions.html +2 -2
- mage_ai/server/frontend_dist_base_path_template/settings/workspace/preferences.html +2 -2
- mage_ai/server/frontend_dist_base_path_template/settings/workspace/roles/[...slug].html +2 -2
- mage_ai/server/frontend_dist_base_path_template/settings/workspace/roles.html +2 -2
- mage_ai/server/frontend_dist_base_path_template/settings/workspace/sync-data.html +2 -2
- mage_ai/server/frontend_dist_base_path_template/settings/workspace/users/[...slug].html +2 -2
- mage_ai/server/frontend_dist_base_path_template/settings/workspace/users.html +2 -2
- mage_ai/server/frontend_dist_base_path_template/settings.html +2 -2
- mage_ai/server/frontend_dist_base_path_template/sign-in.html +9 -9
- mage_ai/server/frontend_dist_base_path_template/templates/[...slug].html +2 -2
- mage_ai/server/frontend_dist_base_path_template/templates.html +2 -2
- mage_ai/server/frontend_dist_base_path_template/terminal.html +2 -2
- mage_ai/server/frontend_dist_base_path_template/test.html +14 -14
- mage_ai/server/frontend_dist_base_path_template/triggers.html +2 -2
- mage_ai/server/frontend_dist_base_path_template/version-control.html +2 -2
- mage_ai/server/server.py +43 -15
- mage_ai/server/utils/output_display.py +6 -0
- mage_ai/server/websocket_server.py +14 -0
- mage_ai/services/aws/ecs/config.py +11 -8
- mage_ai/services/aws/emr/config.py +1 -0
- mage_ai/services/aws/emr/constants.py +1 -0
- mage_ai/services/aws/emr/emr.py +20 -7
- mage_ai/services/compute/__init__.py +0 -0
- mage_ai/services/compute/aws/__init__.py +0 -0
- mage_ai/services/compute/aws/constants.py +21 -0
- mage_ai/services/compute/aws/models.py +459 -0
- mage_ai/services/compute/aws/steps.py +482 -0
- mage_ai/services/compute/constants.py +27 -0
- mage_ai/services/compute/models.py +212 -0
- mage_ai/services/k8s/job_manager.py +3 -0
- mage_ai/services/spark/api/aws_emr.py +38 -0
- mage_ai/services/spark/api/base.py +7 -4
- mage_ai/services/spark/api/constants.py +4 -0
- mage_ai/services/spark/api/local.py +25 -24
- mage_ai/services/spark/api/service.py +15 -5
- mage_ai/services/spark/constants.py +1 -1
- mage_ai/services/spark/models/applications.py +45 -3
- mage_ai/services/spark/models/base.py +3 -19
- mage_ai/services/spark/models/environments.py +16 -11
- mage_ai/services/spark/models/executors.py +2 -2
- mage_ai/services/spark/models/sqls.py +46 -15
- mage_ai/services/spark/models/stages.py +55 -32
- mage_ai/services/spark/models/threads.py +2 -2
- mage_ai/services/spark/utils.py +22 -6
- mage_ai/services/ssh/__init__.py +0 -0
- mage_ai/services/ssh/aws/__init__.py +0 -0
- mage_ai/services/ssh/aws/emr/__init__.py +0 -0
- mage_ai/services/ssh/aws/emr/constants.py +10 -0
- mage_ai/services/ssh/aws/emr/models.py +326 -0
- mage_ai/services/ssh/aws/emr/utils.py +151 -0
- mage_ai/settings/__init__.py +16 -1
- mage_ai/settings/secret_generation.py +7 -0
- mage_ai/settings/sso.py +20 -0
- mage_ai/shared/hash.py +17 -1
- mage_ai/shared/models.py +253 -0
- mage_ai/streaming/constants.py +2 -0
- mage_ai/streaming/sources/activemq.py +89 -0
- mage_ai/streaming/sources/nats_js.py +182 -0
- mage_ai/streaming/sources/source_factory.py +8 -0
- mage_ai/tests/ai/test_ai_functions.py +53 -8
- mage_ai/tests/api/endpoints/test_oauths.py +33 -0
- mage_ai/tests/api/endpoints/test_projects.py +1 -0
- mage_ai/tests/api/endpoints/test_workspaces.py +55 -0
- mage_ai/tests/api/operations/test_base.py +7 -5
- mage_ai/tests/api/operations/test_operations.py +0 -1
- mage_ai/tests/api/operations/test_operations_with_hooks.py +577 -0
- mage_ai/tests/api/operations/test_syncs.py +0 -1
- mage_ai/tests/api/operations/test_users.py +13 -2
- mage_ai/tests/data_preparation/executors/test_block_executor.py +1 -0
- mage_ai/tests/data_preparation/models/global_hooks/__init__.py +0 -0
- mage_ai/tests/data_preparation/models/global_hooks/test_global_hooks.py +575 -0
- mage_ai/tests/data_preparation/models/global_hooks/test_hook.py +760 -0
- mage_ai/tests/data_preparation/models/global_hooks/test_utils.py +33 -0
- mage_ai/tests/data_preparation/models/test_pipeline.py +5 -0
- mage_ai/tests/data_preparation/test_repo_manager.py +11 -0
- mage_ai/tests/data_preparation/test_templates.py +1 -0
- mage_ai/tests/factory.py +132 -10
- mage_ai/tests/orchestration/queue/test_process_queue.py +15 -2
- mage_ai/tests/orchestration/test_pipeline_scheduler.py +447 -79
- mage_ai/tests/services/aws/ecs/__init__.py +0 -0
- mage_ai/tests/services/aws/ecs/test_config.py +144 -0
- mage_ai/tests/services/k8s/test_job_manager.py +22 -1
- mage_ai/tests/shared/mixins.py +291 -0
- mage_ai/tests/shared/test_hash.py +17 -1
- mage_ai/tests/streaming/sources/test_activemq.py +32 -0
- mage_ai/tests/streaming/sources/test_nats_js.py +32 -0
- mage_ai/tests/streaming/sources/test_source_factory.py +26 -1
- {mage_ai-0.9.44.dist-info → mage_ai-0.9.46.dist-info}/METADATA +28 -66
- {mage_ai-0.9.44.dist-info → mage_ai-0.9.46.dist-info}/RECORD +443 -364
- mage_ai/authentication/oauth/active_directory.py +0 -17
- mage_ai/server/frontend_dist/_next/static/RPXiX8RpZ7oO-yeaEtV2c/_buildManifest.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/1125-91d3ce33140ef041.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/1749-607014ecf28268bf.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/1952-573c7fc7ad84da6e.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/3004-231cad9039ae5dcb.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/3419-0873e170ef7d6303.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/3932-0ceca9599d6e6d00.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/4267-335766a915ee2fa9.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/5457-8be2e0a3fe0ba64b.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/5499-bca977f466e259e1.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/553-edf533e634e85192.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/5810-37c6091b29a1fe53.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/600-0733eb84f0a0a9e0.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/6333-53b6ebbef95a3691.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/722-3fff38a9019369fe.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/8224-39a93ee1058b6069.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/8264-6ef8fdb195694807.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/9264-1b5c4b071ed544c3.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/framework-7c365855dab1bf41.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/_app-a4a660fa14cf05a9.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/block-layout-c465c14d48392b11.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/compute-b1f8d5a7a9a30f2d.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/files-93c094bad0f299fb.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/manage/files-891e5bd5935f7473.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/manage/settings-d2e4ee4e68d36807.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/manage/users/new-4a49126fcfe8ced0.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/manage-5f8c5d0bc6ad1113.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/oauth-09467512a85c96ed.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/overview-31bde04718d0d3a8.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/backfills/[...slug]-96718f95103d7844.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/backfills-a9266d353f288e8c.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/dashboard-b5c29c852262312e.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/edit-5d525454ff7aeb3f.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/monitors/block-runs-883f4ae9a4a264c0.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/monitors/block-runtime-c65be964e6398cb7.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/monitors-1f5b4a974bd39740.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/settings-074c32397d341de9.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/syncs-50f5d8706ed0bc73.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/triggers/[...slug]-e151c1552fcb67bd.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/triggers-cc36f0f8c73fee4b.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines-8336c4326f1e7d96.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/settings/account/profile-01dd679e4a21e0d9.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/settings/workspace/preferences-4d9051c073a9b2ff.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/settings/workspace/sync-data-88d41c33b8fcb300.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/sign-in-d859e07561eb9010.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/terminal-578d862f3e56e6e6.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/test-1c0588d685b909b9.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/version-control-e284cf1535d93798.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/1125-91d3ce33140ef041.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/1749-607014ecf28268bf.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/1952-573c7fc7ad84da6e.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/3004-231cad9039ae5dcb.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/3419-0873e170ef7d6303.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/3932-0ceca9599d6e6d00.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/4267-335766a915ee2fa9.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/5457-8be2e0a3fe0ba64b.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/5499-bca977f466e259e1.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/553-edf533e634e85192.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/5810-37c6091b29a1fe53.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/600-0733eb84f0a0a9e0.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/6333-53b6ebbef95a3691.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/722-3fff38a9019369fe.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/8224-39a93ee1058b6069.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/8264-6ef8fdb195694807.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/9264-1b5c4b071ed544c3.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/framework-7c365855dab1bf41.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/_app-a4a660fa14cf05a9.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/block-layout-c465c14d48392b11.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/compute-b1f8d5a7a9a30f2d.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/files-93c094bad0f299fb.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/manage/files-891e5bd5935f7473.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/manage/settings-d2e4ee4e68d36807.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/manage/users/new-4a49126fcfe8ced0.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/manage-5f8c5d0bc6ad1113.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/oauth-09467512a85c96ed.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/overview-31bde04718d0d3a8.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/backfills/[...slug]-96718f95103d7844.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/backfills-a9266d353f288e8c.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/dashboard-b5c29c852262312e.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/edit-5d525454ff7aeb3f.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/monitors/block-runs-883f4ae9a4a264c0.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/monitors/block-runtime-c65be964e6398cb7.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/monitors-1f5b4a974bd39740.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/settings-074c32397d341de9.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/syncs-50f5d8706ed0bc73.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/triggers/[...slug]-e151c1552fcb67bd.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/triggers-cc36f0f8c73fee4b.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines-8336c4326f1e7d96.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/settings/account/profile-01dd679e4a21e0d9.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/settings/workspace/preferences-4d9051c073a9b2ff.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/settings/workspace/sync-data-88d41c33b8fcb300.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/sign-in-d859e07561eb9010.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/terminal-578d862f3e56e6e6.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/test-1c0588d685b909b9.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/version-control-e284cf1535d93798.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/rNR5JgSxO3eA2BWGa_i7U/_buildManifest.js +0 -1
- /mage_ai/server/frontend_dist/_next/static/{RPXiX8RpZ7oO-yeaEtV2c → 9jB4XPuz6BzxBcG9VNao5}/_ssgManifest.js +0 -0
- /mage_ai/server/frontend_dist_base_path_template/_next/static/{rNR5JgSxO3eA2BWGa_i7U → uPDjJYpJMst1q6psbRyte}/_ssgManifest.js +0 -0
- {mage_ai-0.9.44.dist-info → mage_ai-0.9.46.dist-info}/LICENSE +0 -0
- {mage_ai-0.9.44.dist-info → mage_ai-0.9.46.dist-info}/WHEEL +0 -0
- {mage_ai-0.9.44.dist-info → mage_ai-0.9.46.dist-info}/entry_points.txt +0 -0
- {mage_ai-0.9.44.dist-info → mage_ai-0.9.46.dist-info}/top_level.txt +0 -0
|
@@ -0,0 +1,326 @@
|
|
|
1
|
+
import json
|
|
2
|
+
import os
|
|
3
|
+
import socket
|
|
4
|
+
from typing import Dict
|
|
5
|
+
|
|
6
|
+
from sshtunnel import SSHTunnelForwarder
|
|
7
|
+
|
|
8
|
+
from mage_ai.data_preparation.models.project import Project
|
|
9
|
+
from mage_ai.services.compute.aws.models import Cluster
|
|
10
|
+
from mage_ai.services.compute.constants import SSH_PORT
|
|
11
|
+
from mage_ai.services.compute.models import ComputeService
|
|
12
|
+
from mage_ai.services.spark.api.constants import SPARK_UI_HOST
|
|
13
|
+
from mage_ai.services.ssh.aws.emr.constants import SSH_DEFAULTS
|
|
14
|
+
from mage_ai.services.ssh.aws.emr.utils import file_path, should_tunnel
|
|
15
|
+
from mage_ai.shared.hash import merge_dict
|
|
16
|
+
from mage_ai.shared.utils import is_port_in_use
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
class SSHTunnel:
|
|
20
|
+
_instance = None
|
|
21
|
+
_tunnel = None
|
|
22
|
+
ec2_key_path = None
|
|
23
|
+
master_public_dns_name = None
|
|
24
|
+
spark_ui_host_local = None
|
|
25
|
+
spark_ui_host_remote = None
|
|
26
|
+
spark_ui_port_local = None
|
|
27
|
+
spark_ui_port_remote = None
|
|
28
|
+
ssh_username = None
|
|
29
|
+
|
|
30
|
+
def __new__(
|
|
31
|
+
cls,
|
|
32
|
+
ec2_key_path: str = None,
|
|
33
|
+
master_public_dns_name: str = None,
|
|
34
|
+
spark_ui_host_local: str = None,
|
|
35
|
+
spark_ui_host_remote: str = None,
|
|
36
|
+
spark_ui_port_local: int = None,
|
|
37
|
+
spark_ui_port_remote: int = None,
|
|
38
|
+
ssh_username: str = None,
|
|
39
|
+
):
|
|
40
|
+
if cls._instance is None:
|
|
41
|
+
if ec2_key_path and master_public_dns_name:
|
|
42
|
+
cls._instance = super(SSHTunnel, cls).__new__(cls)
|
|
43
|
+
|
|
44
|
+
"""
|
|
45
|
+
ssh \
|
|
46
|
+
-i ~/.ssh/mage-emr-2023.pem \
|
|
47
|
+
-L [local host]:[local port]:[remote host]:[remote port] \
|
|
48
|
+
hadoop@ec2-34-217-92-37.us-west-2.compute.amazonaws.com
|
|
49
|
+
"""
|
|
50
|
+
cls._instance.ec2_key_path = ec2_key_path
|
|
51
|
+
cls._instance.master_public_dns_name = master_public_dns_name
|
|
52
|
+
cls._instance.spark_ui_host_local = spark_ui_host_local
|
|
53
|
+
cls._instance.spark_ui_host_remote = spark_ui_host_remote
|
|
54
|
+
cls._instance.spark_ui_port_local = spark_ui_port_local
|
|
55
|
+
cls._instance.spark_ui_port_remote = spark_ui_port_remote
|
|
56
|
+
cls._instance.ssh_username = ssh_username or SSH_DEFAULTS['ssh_username']
|
|
57
|
+
|
|
58
|
+
cls._instance._tunnel = SSHTunnelForwarder(
|
|
59
|
+
cls._instance.master_public_dns_name,
|
|
60
|
+
local_bind_address=(
|
|
61
|
+
cls._instance.spark_ui_host_local or SSH_DEFAULTS['spark_ui_host_local'],
|
|
62
|
+
get_port(
|
|
63
|
+
cls._instance.spark_ui_port_local or
|
|
64
|
+
SSH_DEFAULTS['spark_ui_port_local']
|
|
65
|
+
),
|
|
66
|
+
),
|
|
67
|
+
remote_bind_address=(
|
|
68
|
+
cls._instance.spark_ui_host_remote or SSH_DEFAULTS['spark_ui_host_remote'],
|
|
69
|
+
cls._instance.spark_ui_port_remote or SSH_DEFAULTS['spark_ui_port_remote'],
|
|
70
|
+
),
|
|
71
|
+
ssh_pkey=cls._instance.ec2_key_path,
|
|
72
|
+
ssh_username=cls._instance.ssh_username,
|
|
73
|
+
)
|
|
74
|
+
|
|
75
|
+
return cls._instance
|
|
76
|
+
|
|
77
|
+
@property
|
|
78
|
+
def tunnel(self) -> SSHTunnelForwarder:
|
|
79
|
+
if self._instance:
|
|
80
|
+
return self._instance._tunnel
|
|
81
|
+
|
|
82
|
+
def connect(self) -> bool:
|
|
83
|
+
if not self.precheck_access():
|
|
84
|
+
return
|
|
85
|
+
|
|
86
|
+
if not self.is_active():
|
|
87
|
+
self.__start()
|
|
88
|
+
|
|
89
|
+
return self.is_active()
|
|
90
|
+
|
|
91
|
+
def reconnect(self) -> bool:
|
|
92
|
+
if not self.precheck_access():
|
|
93
|
+
return False
|
|
94
|
+
|
|
95
|
+
if self.is_active():
|
|
96
|
+
self.__restart()
|
|
97
|
+
else:
|
|
98
|
+
self.__start()
|
|
99
|
+
|
|
100
|
+
return self.is_active()
|
|
101
|
+
|
|
102
|
+
def stop(self) -> None:
|
|
103
|
+
if not self.precheck_access():
|
|
104
|
+
return
|
|
105
|
+
|
|
106
|
+
if self.tunnel:
|
|
107
|
+
try:
|
|
108
|
+
self.tunnel.stop()
|
|
109
|
+
except Exception as err:
|
|
110
|
+
print(f'[WARNING] AWS EMR SSHTunnel: {err}')
|
|
111
|
+
|
|
112
|
+
def close(self) -> None:
|
|
113
|
+
if not self.precheck_access():
|
|
114
|
+
return
|
|
115
|
+
|
|
116
|
+
if self.tunnel:
|
|
117
|
+
self.tunnel.stop()
|
|
118
|
+
self._instance = None
|
|
119
|
+
|
|
120
|
+
absolute_file_path = file_path()
|
|
121
|
+
if os.path.exists(absolute_file_path):
|
|
122
|
+
os.remove(absolute_file_path)
|
|
123
|
+
|
|
124
|
+
def connection_details(self) -> Dict:
|
|
125
|
+
is_active = self.is_active()
|
|
126
|
+
|
|
127
|
+
return dict(
|
|
128
|
+
address=self.tunnel.local_bind_address if is_active else None,
|
|
129
|
+
host=SPARK_UI_HOST if is_active else None,
|
|
130
|
+
port=self.tunnel.local_bind_port if is_active else None,
|
|
131
|
+
)
|
|
132
|
+
|
|
133
|
+
def to_dict(self) -> Dict:
|
|
134
|
+
return merge_dict(self.connection_details(), dict(
|
|
135
|
+
active=self.is_active(),
|
|
136
|
+
ec2_key_path=self.ec2_key_path,
|
|
137
|
+
master_public_dns_name=self.master_public_dns_name,
|
|
138
|
+
spark_ui_host_local=self.spark_ui_host_local,
|
|
139
|
+
spark_ui_host_remote=self.spark_ui_host_remote,
|
|
140
|
+
spark_ui_port_local=self.spark_ui_port_local,
|
|
141
|
+
spark_ui_port_remote=self.spark_ui_port_remote,
|
|
142
|
+
ssh_username=self.ssh_username,
|
|
143
|
+
))
|
|
144
|
+
|
|
145
|
+
def is_active(self, raise_error: bool = False) -> bool:
|
|
146
|
+
if not self.precheck_access():
|
|
147
|
+
return False
|
|
148
|
+
|
|
149
|
+
if not self.tunnel:
|
|
150
|
+
return False
|
|
151
|
+
|
|
152
|
+
if raise_error:
|
|
153
|
+
|
|
154
|
+
self.tunnel._check_is_started()
|
|
155
|
+
|
|
156
|
+
return self.tunnel.is_active
|
|
157
|
+
|
|
158
|
+
def precheck_access(self, raise_error: bool = False) -> bool:
|
|
159
|
+
if not self._instance:
|
|
160
|
+
return False
|
|
161
|
+
|
|
162
|
+
try:
|
|
163
|
+
test_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
|
|
164
|
+
test_socket.settimeout(5)
|
|
165
|
+
test_socket.connect((self._instance.master_public_dns_name, SSH_PORT))
|
|
166
|
+
|
|
167
|
+
return True
|
|
168
|
+
except Exception as err:
|
|
169
|
+
if raise_error:
|
|
170
|
+
raise err
|
|
171
|
+
print(f'[WARNING] AWS EMR SSHTunnel precheck access: {err}')
|
|
172
|
+
|
|
173
|
+
return False
|
|
174
|
+
|
|
175
|
+
def __restart(self) -> None:
|
|
176
|
+
if self.tunnel:
|
|
177
|
+
try:
|
|
178
|
+
self.tunnel.restart()
|
|
179
|
+
except Exception as err:
|
|
180
|
+
print(f'[WARNING] AWS EMR SSHTunnel restart: {err}')
|
|
181
|
+
|
|
182
|
+
def __start(self) -> None:
|
|
183
|
+
if self.tunnel:
|
|
184
|
+
try:
|
|
185
|
+
self.tunnel.start()
|
|
186
|
+
except Exception as err:
|
|
187
|
+
print(f'[WARNING] AWS EMR SSHTunnel start: {err}')
|
|
188
|
+
|
|
189
|
+
|
|
190
|
+
def create_tunnel(
|
|
191
|
+
clean_up_on_failure: bool = False,
|
|
192
|
+
cluster: Cluster = None,
|
|
193
|
+
compute_service: ComputeService = None,
|
|
194
|
+
connect: bool = False,
|
|
195
|
+
fresh: bool = False,
|
|
196
|
+
project: Project = None,
|
|
197
|
+
reconnect: bool = False,
|
|
198
|
+
spark_ui_host_local: str = None,
|
|
199
|
+
spark_ui_host_remote: str = None,
|
|
200
|
+
spark_ui_port_local: int = None,
|
|
201
|
+
spark_ui_port_remote: int = None,
|
|
202
|
+
ssh_username: str = None,
|
|
203
|
+
stop: bool = False,
|
|
204
|
+
) -> SSHTunnel:
|
|
205
|
+
cluster_from_cache = False
|
|
206
|
+
|
|
207
|
+
absolute_file_path = file_path()
|
|
208
|
+
if os.path.exists(absolute_file_path):
|
|
209
|
+
if fresh:
|
|
210
|
+
os.remove(absolute_file_path)
|
|
211
|
+
else:
|
|
212
|
+
with open(absolute_file_path, 'r') as f:
|
|
213
|
+
text = f.read()
|
|
214
|
+
if text:
|
|
215
|
+
commands = json.loads(text) or {}
|
|
216
|
+
|
|
217
|
+
cluster = cluster or commands.get('cluster')
|
|
218
|
+
if cluster and isinstance(cluster, dict):
|
|
219
|
+
cluster = Cluster.load(**cluster)
|
|
220
|
+
cluster_from_cache = True
|
|
221
|
+
|
|
222
|
+
connect = connect or commands.get('connect')
|
|
223
|
+
reconnect = reconnect or commands.get('reconnect')
|
|
224
|
+
spark_ui_host_local = spark_ui_host_local or commands.get(
|
|
225
|
+
'spark_ui_host_local',
|
|
226
|
+
)
|
|
227
|
+
spark_ui_host_remote = spark_ui_host_remote or commands.get(
|
|
228
|
+
'spark_ui_host_remote',
|
|
229
|
+
)
|
|
230
|
+
spark_ui_port_local = spark_ui_port_local or commands.get(
|
|
231
|
+
'spark_ui_port_local',
|
|
232
|
+
)
|
|
233
|
+
spark_ui_port_remote = spark_ui_port_remote or commands.get(
|
|
234
|
+
'spark_ui_port_remote',
|
|
235
|
+
)
|
|
236
|
+
ssh_username = ssh_username or commands.get('ssh_username')
|
|
237
|
+
stop = stop or commands.get('stop')
|
|
238
|
+
|
|
239
|
+
if not project:
|
|
240
|
+
project = Project()
|
|
241
|
+
|
|
242
|
+
if not should_tunnel(
|
|
243
|
+
ignore_active_kernel=True,
|
|
244
|
+
project=project,
|
|
245
|
+
):
|
|
246
|
+
return close_tunnel()
|
|
247
|
+
|
|
248
|
+
if not compute_service:
|
|
249
|
+
compute_service = ComputeService.build(project)
|
|
250
|
+
|
|
251
|
+
if not compute_service:
|
|
252
|
+
return close_tunnel()
|
|
253
|
+
|
|
254
|
+
if not cluster:
|
|
255
|
+
cluster = compute_service.active_cluster()
|
|
256
|
+
|
|
257
|
+
if not cluster:
|
|
258
|
+
return close_tunnel()
|
|
259
|
+
|
|
260
|
+
if cluster_from_cache:
|
|
261
|
+
try:
|
|
262
|
+
cluster_server = compute_service.get_cluster_details(cluster.id)
|
|
263
|
+
except Exception as err:
|
|
264
|
+
print(f'[WARNING] AWS EMR create tunnel: {err}')
|
|
265
|
+
return
|
|
266
|
+
|
|
267
|
+
if not cluster_server or cluster_server.invalid:
|
|
268
|
+
return
|
|
269
|
+
active = cluster.active
|
|
270
|
+
cluster = Cluster.load(**cluster_server.to_dict())
|
|
271
|
+
cluster.active = active
|
|
272
|
+
|
|
273
|
+
try:
|
|
274
|
+
tunnel = SSHTunnel(
|
|
275
|
+
project.emr_config.get('ec2_key_path'),
|
|
276
|
+
cluster.master_public_dns_name,
|
|
277
|
+
spark_ui_host_local=spark_ui_host_local,
|
|
278
|
+
spark_ui_host_remote=spark_ui_host_remote,
|
|
279
|
+
spark_ui_port_local=spark_ui_port_local,
|
|
280
|
+
spark_ui_port_remote=spark_ui_port_remote,
|
|
281
|
+
ssh_username=ssh_username,
|
|
282
|
+
)
|
|
283
|
+
|
|
284
|
+
if connect:
|
|
285
|
+
tunnel.connect()
|
|
286
|
+
|
|
287
|
+
if reconnect:
|
|
288
|
+
tunnel.reconnect()
|
|
289
|
+
|
|
290
|
+
if stop:
|
|
291
|
+
tunnel.stop()
|
|
292
|
+
except Exception as err:
|
|
293
|
+
if clean_up_on_failure:
|
|
294
|
+
if os.path.exists(absolute_file_path):
|
|
295
|
+
os.remove(absolute_file_path)
|
|
296
|
+
raise err
|
|
297
|
+
|
|
298
|
+
# This method is invoked when the server restarts.
|
|
299
|
+
# When the server restarts, there is no active cluster set.
|
|
300
|
+
# We need to set it again.
|
|
301
|
+
if compute_service and cluster:
|
|
302
|
+
compute_service.update_cluster(cluster.id, dict(active=cluster.active))
|
|
303
|
+
|
|
304
|
+
return tunnel
|
|
305
|
+
|
|
306
|
+
|
|
307
|
+
def close_tunnel() -> None:
|
|
308
|
+
tunnel = SSHTunnel()
|
|
309
|
+
if tunnel:
|
|
310
|
+
tunnel.close()
|
|
311
|
+
|
|
312
|
+
|
|
313
|
+
def get_port(port: int) -> int:
|
|
314
|
+
local_port = port
|
|
315
|
+
max_local_port = int(local_port) + 100
|
|
316
|
+
|
|
317
|
+
while is_port_in_use(local_port):
|
|
318
|
+
if local_port > max_local_port:
|
|
319
|
+
raise Exception(
|
|
320
|
+
f'Cannot find an open port from {port} to '
|
|
321
|
+
f'{max_local_port} for SSH tunnel. '
|
|
322
|
+
'Please clear running processes to free up available ports.',
|
|
323
|
+
)
|
|
324
|
+
local_port += 1
|
|
325
|
+
|
|
326
|
+
return local_port
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
import json
|
|
2
|
+
import os
|
|
3
|
+
from typing import Dict
|
|
4
|
+
|
|
5
|
+
import simplejson
|
|
6
|
+
|
|
7
|
+
from mage_ai.data_preparation.models.project import Project
|
|
8
|
+
from mage_ai.data_preparation.models.project.constants import FeatureUUID
|
|
9
|
+
from mage_ai.server.kernels import KernelName
|
|
10
|
+
from mage_ai.services.compute.models import ComputeService
|
|
11
|
+
from mage_ai.services.spark.constants import ComputeServiceUUID
|
|
12
|
+
from mage_ai.services.spark.utils import get_compute_service
|
|
13
|
+
from mage_ai.settings.repo import get_repo_path
|
|
14
|
+
from mage_ai.shared.parsers import encode_complex
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
def file_path() -> str:
|
|
18
|
+
return os.path.join(
|
|
19
|
+
get_repo_path(),
|
|
20
|
+
'.ssh_tunnel',
|
|
21
|
+
'aws_emr.json',
|
|
22
|
+
)
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
def should_tunnel(
|
|
26
|
+
ignore_active_kernel: bool = False,
|
|
27
|
+
kernel_name: KernelName = None,
|
|
28
|
+
project: Project = None,
|
|
29
|
+
raise_error: bool = False,
|
|
30
|
+
) -> bool:
|
|
31
|
+
error_message = None
|
|
32
|
+
if not project:
|
|
33
|
+
project = Project()
|
|
34
|
+
|
|
35
|
+
if not project.is_feature_enabled(FeatureUUID.COMPUTE_MANAGEMENT):
|
|
36
|
+
error_message = 'Compute management feature isn’t enabled. '\
|
|
37
|
+
'Turn the feature on in the project’s settings.'
|
|
38
|
+
|
|
39
|
+
if raise_error:
|
|
40
|
+
raise Exception(error_message)
|
|
41
|
+
else:
|
|
42
|
+
return False
|
|
43
|
+
|
|
44
|
+
if ComputeServiceUUID.AWS_EMR != get_compute_service(
|
|
45
|
+
project.repo_config,
|
|
46
|
+
ignore_active_kernel=ignore_active_kernel,
|
|
47
|
+
kernel_name=kernel_name,
|
|
48
|
+
):
|
|
49
|
+
error_message = 'SSH tunnel is only supported for the AWS EMR compute service.'
|
|
50
|
+
|
|
51
|
+
if raise_error:
|
|
52
|
+
raise Exception(error_message)
|
|
53
|
+
else:
|
|
54
|
+
return False
|
|
55
|
+
|
|
56
|
+
if not project.emr_config:
|
|
57
|
+
error_message = 'Project has incomplete configuration for AWS EMR.'
|
|
58
|
+
|
|
59
|
+
if raise_error:
|
|
60
|
+
raise Exception(error_message)
|
|
61
|
+
else:
|
|
62
|
+
return False
|
|
63
|
+
|
|
64
|
+
ec2_key_name = project.emr_config.get('ec2_key_name')
|
|
65
|
+
ec2_key_path = project.emr_config.get('ec2_key_path')
|
|
66
|
+
|
|
67
|
+
if not ec2_key_name or not ec2_key_path:
|
|
68
|
+
error_message = 'SSH tunnel requires an EC2 key name and EC2 key path ' \
|
|
69
|
+
'in the project’s settings.'
|
|
70
|
+
|
|
71
|
+
if raise_error:
|
|
72
|
+
raise Exception(error_message)
|
|
73
|
+
else:
|
|
74
|
+
return False
|
|
75
|
+
|
|
76
|
+
if not os.path.exists(ec2_key_path):
|
|
77
|
+
error_message = f'EC2 key pair {ec2_key_path} doesn’t exist.'
|
|
78
|
+
|
|
79
|
+
if raise_error:
|
|
80
|
+
raise Exception(error_message)
|
|
81
|
+
|
|
82
|
+
return False
|
|
83
|
+
|
|
84
|
+
return True
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
def tunnel(
|
|
88
|
+
ignore_active_kernel: bool = False,
|
|
89
|
+
kernel_name: KernelName = None,
|
|
90
|
+
reconnect: bool = False,
|
|
91
|
+
spark_ui_host_local: str = None,
|
|
92
|
+
spark_ui_host_remote: str = None,
|
|
93
|
+
spark_ui_port_local: str = None,
|
|
94
|
+
spark_ui_port_remote: str = None,
|
|
95
|
+
ssh_username: str = None,
|
|
96
|
+
stop: bool = False,
|
|
97
|
+
validate_conditions: bool = False,
|
|
98
|
+
) -> None:
|
|
99
|
+
project = Project()
|
|
100
|
+
|
|
101
|
+
if validate_conditions and not should_tunnel(
|
|
102
|
+
ignore_active_kernel=ignore_active_kernel,
|
|
103
|
+
kernel_name=kernel_name,
|
|
104
|
+
project=project,
|
|
105
|
+
):
|
|
106
|
+
return
|
|
107
|
+
|
|
108
|
+
data = dict(
|
|
109
|
+
connect=not reconnect,
|
|
110
|
+
reconnect=reconnect,
|
|
111
|
+
spark_ui_host_local=spark_ui_host_local,
|
|
112
|
+
spark_ui_host_remote=spark_ui_host_remote,
|
|
113
|
+
spark_ui_port_local=spark_ui_port_local,
|
|
114
|
+
spark_ui_port_remote=spark_ui_port_remote,
|
|
115
|
+
ssh_username=ssh_username,
|
|
116
|
+
stop=stop,
|
|
117
|
+
)
|
|
118
|
+
|
|
119
|
+
if project and \
|
|
120
|
+
project.emr_config and \
|
|
121
|
+
project.is_feature_enabled(FeatureUUID.COMPUTE_MANAGEMENT):
|
|
122
|
+
|
|
123
|
+
compute_service = ComputeService.build(project)
|
|
124
|
+
if compute_service and ComputeServiceUUID.AWS_EMR == compute_service.uuid:
|
|
125
|
+
cluster = compute_service.active_cluster()
|
|
126
|
+
if cluster:
|
|
127
|
+
data['cluster'] = cluster.to_dict()
|
|
128
|
+
|
|
129
|
+
absolute_file_path = file_path()
|
|
130
|
+
os.makedirs(os.path.dirname(absolute_file_path), exist_ok=True)
|
|
131
|
+
|
|
132
|
+
with open(absolute_file_path, 'w') as f:
|
|
133
|
+
f.write(simplejson.dumps(
|
|
134
|
+
data,
|
|
135
|
+
default=encode_complex,
|
|
136
|
+
ignore_nan=True,
|
|
137
|
+
))
|
|
138
|
+
|
|
139
|
+
|
|
140
|
+
def cluster_info_from_tunnel() -> Dict:
|
|
141
|
+
cluster = None
|
|
142
|
+
|
|
143
|
+
absolute_file_path = file_path()
|
|
144
|
+
if os.path.exists(absolute_file_path):
|
|
145
|
+
with open(absolute_file_path, 'r') as f:
|
|
146
|
+
text = f.read()
|
|
147
|
+
if text:
|
|
148
|
+
commands = json.loads(text) or {}
|
|
149
|
+
cluster = commands.get('cluster')
|
|
150
|
+
|
|
151
|
+
return cluster
|
mage_ai/settings/__init__.py
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import os
|
|
2
2
|
|
|
3
|
+
from .secret_generation import generate_jwt_secret
|
|
4
|
+
|
|
3
5
|
# If you add a new environment variable, make sure to check if it should be added to
|
|
4
6
|
# the `MAGE_SETTINGS_ENVIRONMENT_VARIABLES` list at the bottom of this file. Also, update
|
|
5
7
|
# the environment variable documentation at docs/development/variables/environment-variables.mdx
|
|
@@ -94,7 +96,10 @@ REQUESTS_BASE_PATH = os.getenv('MAGE_REQUESTS_BASE_PATH', BASE_PATH)
|
|
|
94
96
|
# Routes base path is used to configure the base path for the backend routes. Defaults
|
|
95
97
|
# to the MAGE_BASE_PATH environment variable.
|
|
96
98
|
ROUTES_BASE_PATH = os.getenv('MAGE_ROUTES_BASE_PATH', BASE_PATH)
|
|
97
|
-
|
|
99
|
+
# Used for OAUTH
|
|
100
|
+
JWT_SECRET = os.getenv('JWT_SECRET', 'materia')
|
|
101
|
+
# Used for generating download tokens
|
|
102
|
+
JWT_DOWNLOAD_SECRET = os.getenv('JWT_DOWNLOAD_SECRET', generate_jwt_secret())
|
|
98
103
|
# Sets the trigger interval of the scheduler to a numeric value, in seconds
|
|
99
104
|
# Determines how often the scheduler gets invoked
|
|
100
105
|
try:
|
|
@@ -125,7 +130,17 @@ MAGE_SETTINGS_ENVIRONMENT_VARIABLES = [
|
|
|
125
130
|
'SENTRY_TRACES_SAMPLE_RATE',
|
|
126
131
|
'MAGE_PUBLIC_HOST',
|
|
127
132
|
'ACTIVE_DIRECTORY_DIRECTORY_ID',
|
|
133
|
+
'ACTIVE_DIRECTORY_CLIENT_ID',
|
|
134
|
+
'ACTIVE_DIRECTORY_CLIENT_SECRET',
|
|
128
135
|
'SCHEDULER_TRIGGER_INTERVAL',
|
|
129
136
|
'REQUIRE_USER_PERMISSIONS',
|
|
130
137
|
'ENABLE_PROMETHEUS',
|
|
138
|
+
'OKTA_DOMAIN_URL',
|
|
139
|
+
'OKTA_CLIENT_ID',
|
|
140
|
+
'OKTA_CLIENT_SECRET',
|
|
141
|
+
'GOOGLE_CLIENT_ID',
|
|
142
|
+
'GOOGLE_CLIENT_SECRET',
|
|
143
|
+
'GHE_CLIENT_ID',
|
|
144
|
+
'GHE_CLIENT_SECRET',
|
|
145
|
+
'GHE_HOSTNAME',
|
|
131
146
|
]
|
mage_ai/settings/sso.py
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import os
|
|
2
|
+
|
|
3
|
+
# Environment variable settings used to set up authentication for single
|
|
4
|
+
# sign on.
|
|
5
|
+
|
|
6
|
+
# Okta settings
|
|
7
|
+
|
|
8
|
+
OKTA_DOMAIN_URL = os.getenv('OKTA_DOMAIN_URL')
|
|
9
|
+
OKTA_CLIENT_ID = os.getenv('OKTA_CLIENT_ID')
|
|
10
|
+
OKTA_CLIENT_SECRET = os.getenv('OKTA_CLIENT_SECRET')
|
|
11
|
+
|
|
12
|
+
# Google settings
|
|
13
|
+
|
|
14
|
+
GOOGLE_CLIENT_ID = os.getenv('GOOGLE_CLIENT_ID')
|
|
15
|
+
GOOGLE_CLIENT_SECRET = os.getenv('GOOGLE_CLIENT_SECRET')
|
|
16
|
+
|
|
17
|
+
# Active directory settings
|
|
18
|
+
|
|
19
|
+
ACTIVE_DIRECTORY_CLIENT_ID = os.getenv('ACTIVE_DIRECTORY_CLIENT_ID')
|
|
20
|
+
ACTIVE_DIRECTORY_CLIENT_SECRET = os.getenv('ACTIVE_DIRECTORY_CLIENT_SECRET')
|
mage_ai/shared/hash.py
CHANGED
|
@@ -106,7 +106,7 @@ def index_by(func, arr):
|
|
|
106
106
|
return obj
|
|
107
107
|
|
|
108
108
|
|
|
109
|
-
def merge_dict(a, b):
|
|
109
|
+
def merge_dict(a: Dict, b: Dict) -> Dict:
|
|
110
110
|
if a:
|
|
111
111
|
c = a.copy()
|
|
112
112
|
else:
|
|
@@ -130,3 +130,19 @@ def replace_dict_nan_value(d):
|
|
|
130
130
|
|
|
131
131
|
def get_safe_value(data: Dict, key: str, default_value):
|
|
132
132
|
return data.get(key, default_value) if data else default_value
|
|
133
|
+
|
|
134
|
+
|
|
135
|
+
def set_value(obj: Dict, keys: List[str], value) -> Dict:
|
|
136
|
+
if len(keys) >= 2:
|
|
137
|
+
for idx in range(len(keys)):
|
|
138
|
+
keys_init = keys[:idx]
|
|
139
|
+
if len(keys_init) >= 1:
|
|
140
|
+
set_value(obj, keys_init, dig(obj, keys_init) or {})
|
|
141
|
+
|
|
142
|
+
results = dict(__obj_to_set_value=obj, __value=value)
|
|
143
|
+
|
|
144
|
+
key = ''.join(f"['{key}']" for key in keys)
|
|
145
|
+
expression = f'__obj_to_set_value{key} = __value'
|
|
146
|
+
exec(expression, results)
|
|
147
|
+
|
|
148
|
+
return results['__obj_to_set_value']
|