diff --git a/src/app/pipelines/[namespace]/columns.tsx b/src/app/pipelines/[namespace]/columns.tsx index dd6056f77..a2ab7362a 100644 --- a/src/app/pipelines/[namespace]/columns.tsx +++ b/src/app/pipelines/[namespace]/columns.tsx @@ -6,11 +6,10 @@ import { InlineAvatar } from "@/components/InlineAvatar"; import { routes } from "@/router/routes"; import { CodeRepository } from "@/types/code-repository"; import { PipelineRun, PipelineRunBody } from "@/types/pipeline-runs"; -import { PipelineBody } from "@/types/pipelines"; import { Stack } from "@/types/stack"; import { User } from "@/types/user"; import { ColumnDef } from "@tanstack/react-table"; -import { Badge, Tag } from "@zenml-io/react-component-library"; +import { Tag } from "@zenml-io/react-component-library"; import { Link } from "react-router-dom"; export function getPipelineDetailColumns(): ColumnDef[] { @@ -48,19 +47,6 @@ export function getPipelineDetailColumns(): ColumnDef[] { ); } }, - { - id: "version", - header: "Version", - accessorFn: (row) => row.body?.pipeline?.body?.version, - cell: ({ getValue }) => { - const version = getValue(); - return ( - - {version} - - ); - } - }, { id: "stack", header: "Stack", diff --git a/src/app/pipelines/columns.tsx b/src/app/pipelines/columns.tsx index 2b77217a7..8e3562eab 100644 --- a/src/app/pipelines/columns.tsx +++ b/src/app/pipelines/columns.tsx @@ -1,15 +1,15 @@ -import RunIcon from "@/assets/icons/terminal.svg?react"; import PipelineIcon from "@/assets/icons/pipeline.svg?react"; +import RunIcon from "@/assets/icons/terminal.svg?react"; +import { CopyButton } from "@/components/CopyButton"; import { ExecutionStatusIcon, getExecutionStatusColor } from "@/components/ExecutionStatus"; +import { routes } from "@/router/routes"; import { ExecutionStatus } from "@/types/pipeline-runs"; -import { PipelineNamespace, PipelineNamespaceBody } from "@/types/pipelines"; +import { Pipeline } from "@/types/pipelines"; import { ColumnDef } from "@tanstack/react-table"; import { Tag, TagProps } from "@zenml-io/react-component-library"; import { Link } from "react-router-dom"; -import { routes } from "@/router/routes"; -import { CopyButton } from "@/components/CopyButton"; -export function getPipelineColumns(): ColumnDef[] { +export function getPipelineColumns(): ColumnDef[] { return [ { id: "name", @@ -17,8 +17,8 @@ export function getPipelineColumns(): ColumnDef[] { accessorFn: (row) => ({ name: row.name, status: row.body?.latest_run_status }), cell: ({ getValue }) => { const { name, status } = getValue<{ - name: PipelineNamespace["name"]; - status: PipelineNamespaceBody["latest_run_status"]; + name: string; + status: ExecutionStatus; }>(); return ( @@ -46,7 +46,7 @@ export function getPipelineColumns(): ColumnDef[] { cell: ({ getValue }) => { const { runId, status } = getValue<{ runId?: string; - status?: PipelineNamespaceBody["latest_run_status"]; + status?: ExecutionStatus; }>(); if (!runId || !status) return
No run
; diff --git a/src/app/pipelines/page.tsx b/src/app/pipelines/page.tsx index 437da391b..af96d0120 100644 --- a/src/app/pipelines/page.tsx +++ b/src/app/pipelines/page.tsx @@ -1,27 +1,23 @@ import Refresh from "@/assets/icons/refresh.svg?react"; import { PageHeader } from "@/components/PageHeader"; +import Pagination from "@/components/Pagination"; import { SearchField } from "@/components/SearchField"; -import { useAllPipelineNamespaces } from "@/data/pipelines/pipeline-namespaces-query"; +import { pipelineQueries } from "@/data/pipelines"; +import { useBreadcrumbsContext } from "@/layouts/AuthenticatedLayout/BreadcrumbsContext"; +import { useQuery } from "@tanstack/react-query"; import { Button, DataTable, Skeleton } from "@zenml-io/react-component-library"; +import { useEffect } from "react"; import { getPipelineColumns } from "./columns"; import { usePipelineOverviewSearchParams } from "./service"; -import Pagination from "@/components/Pagination"; -import { useBreadcrumbsContext } from "@/layouts/AuthenticatedLayout/BreadcrumbsContext"; -import { useEffect } from "react"; export default function PipelinesPage() { const { setCurrentBreadcrumbData } = useBreadcrumbsContext(); const queryParams = usePipelineOverviewSearchParams(); - const { data, refetch } = useAllPipelineNamespaces( - { - params: { - ...queryParams, - sort_by: "desc:updated" - } - }, - { throwOnError: true } - ); + const { data, refetch } = useQuery({ + ...pipelineQueries.pipelineList({ ...queryParams, sort_by: "desc:latest_run" }), + throwOnError: true + }); useEffect(() => { setCurrentBreadcrumbData({ segment: "pipelines", data: null }); diff --git a/src/app/pipelines/service.tsx b/src/app/pipelines/service.tsx index 9151b3d54..b58609ab3 100644 --- a/src/app/pipelines/service.tsx +++ b/src/app/pipelines/service.tsx @@ -1,4 +1,4 @@ -import { PipelineNamespacesParams } from "@/types/pipelines"; +import { PipelineListParams } from "@/types/pipelines"; import { useSearchParams } from "react-router-dom"; import { z } from "zod"; @@ -11,7 +11,7 @@ const filterParamsSchema = z.object({ operator: z.enum(["and", "or"]).optional() }); -export function usePipelineOverviewSearchParams(): PipelineNamespacesParams { +export function usePipelineOverviewSearchParams(): PipelineListParams { const [searchParams] = useSearchParams(); const { page, name, operator } = filterParamsSchema.parse({ diff --git a/src/app/runs/[id]/_Tabs/Overview/Details.tsx b/src/app/runs/[id]/_Tabs/Overview/Details.tsx index 3de1e5972..a34bce27d 100644 --- a/src/app/runs/[id]/_Tabs/Overview/Details.tsx +++ b/src/app/runs/[id]/_Tabs/Overview/Details.tsx @@ -87,9 +87,6 @@ export function Details() { > {data.body?.pipeline?.name} -
- {data.body?.pipeline?.body?.version} -
diff --git a/src/app/stacks/create/new-infrastructure/Steps/schemas.ts b/src/app/stacks/create/new-infrastructure/Steps/schemas.ts index 3c3cbb7f8..97af2a4cf 100644 --- a/src/app/stacks/create/new-infrastructure/Steps/schemas.ts +++ b/src/app/stacks/create/new-infrastructure/Steps/schemas.ts @@ -1,7 +1,7 @@ import { z } from "zod"; import { stackNameSchema } from "../../components/sharedSchema"; -export const providerSchema = z.enum(["aws", "gcp"]); +export const providerSchema = z.enum(["aws", "gcp", "azure"]); export const providerFormSchema = z.object({ provider: providerSchema diff --git a/src/components/artifacts/artifact-node-sheet/DetailCards.tsx b/src/components/artifacts/artifact-node-sheet/DetailCards.tsx index 94d2b9dd4..0bc444039 100644 --- a/src/components/artifacts/artifact-node-sheet/DetailCards.tsx +++ b/src/components/artifacts/artifact-node-sheet/DetailCards.tsx @@ -71,10 +71,6 @@ export function DetailsCard({ artifactVersionId }: Props) { > {pipelineRun.data.body?.pipeline?.name} - -
- {pipelineRun.data.body?.pipeline?.body?.version} -
} diff --git a/src/components/steps/step-sheet/DetailsTab.tsx b/src/components/steps/step-sheet/DetailsTab.tsx index e3aafbfff..0891c2770 100644 --- a/src/components/steps/step-sheet/DetailsTab.tsx +++ b/src/components/steps/step-sheet/DetailsTab.tsx @@ -181,9 +181,6 @@ export function StepDetailsTab({ stepId, runId }: Props) { > {pipelineRunData.body?.pipeline?.name} -
- {pipelineRunData.body?.pipeline?.body?.version} -
} diff --git a/src/data/api.ts b/src/data/api.ts index 0bb01fd04..f3af84ae5 100644 --- a/src/data/api.ts +++ b/src/data/api.ts @@ -7,7 +7,7 @@ export const apiPaths = { settings: "/settings", onboarding: "/onboarding_state", pipelines: { - namespaces: "/pipeline_namespaces" + all: "/pipelines" }, artifactVersions: { detail: (versionId: string) => `/artifact_versions/${versionId}`, diff --git a/src/data/pipelines/index.ts b/src/data/pipelines/index.ts new file mode 100644 index 000000000..f8421f7fb --- /dev/null +++ b/src/data/pipelines/index.ts @@ -0,0 +1,12 @@ +import { PipelineListParams } from "@/types/pipelines"; +import { queryOptions } from "@tanstack/react-query"; +import { fetchAllPipelines } from "./pipeline-list-query"; + +export const pipelineQueries = { + all: ["pipelines"], + pipelineList: (queryParams: PipelineListParams) => + queryOptions({ + queryKey: [...pipelineQueries.all, queryParams], + queryFn: async () => fetchAllPipelines({ params: queryParams }) + }) +}; diff --git a/src/data/pipelines/pipeline-list-query.ts b/src/data/pipelines/pipeline-list-query.ts new file mode 100644 index 000000000..85b3317e6 --- /dev/null +++ b/src/data/pipelines/pipeline-list-query.ts @@ -0,0 +1,31 @@ +import { FetchError } from "@/lib/fetch-error"; +import { notFound } from "@/lib/not-found-error"; +import { objectToSearchParams } from "@/lib/url"; +import { PipelineListParams } from "@/types/pipelines"; +import { apiPaths, createApiPath } from "../api"; +import { fetcher } from "../fetch"; + +export type PipelineOverview = { + params: PipelineListParams; +}; + +export async function fetchAllPipelines({ params }: PipelineOverview) { + const url = createApiPath(apiPaths.pipelines.all + "?" + objectToSearchParams(params)); + const res = await fetcher(url, { + method: "GET", + headers: { + "Content-Type": "application/json" + } + }); + + if (res.status === 404) notFound(); + + if (!res.ok) { + throw new FetchError({ + message: "Error while fetching pipelines", + status: res.status, + statusText: res.statusText + }); + } + return res.json(); +} diff --git a/src/data/pipelines/pipeline-namespaces-query.ts b/src/data/pipelines/pipeline-namespaces-query.ts deleted file mode 100644 index 0cbb05965..000000000 --- a/src/data/pipelines/pipeline-namespaces-query.ts +++ /dev/null @@ -1,47 +0,0 @@ -import { PipelineNameSpacesPage, PipelineNamespacesParams } from "@/types/pipelines"; -import { apiPaths, createApiPath } from "../api"; -import { UseQueryOptions, useQuery } from "@tanstack/react-query"; -import { FetchError } from "@/lib/fetch-error"; -import { objectToSearchParams } from "@/lib/url"; -import { notFound } from "@/lib/not-found-error"; -import { fetcher } from "../fetch"; - -export type PipelineOverview = { - params: PipelineNamespacesParams; -}; - -export function getPipelinesQueryKey({ params }: PipelineOverview) { - return ["pipeline_namespaces", params]; -} - -export async function fetchAllPipelines({ params }: PipelineOverview) { - const url = createApiPath(apiPaths.pipelines.namespaces + "?" + objectToSearchParams(params)); - const res = await fetcher(url, { - method: "GET", - headers: { - "Content-Type": "application/json" - } - }); - - if (res.status === 404) notFound(); - - if (!res.ok) { - throw new FetchError({ - message: "Error while fetching pipeline namespaces", - status: res.status, - statusText: res.statusText - }); - } - return res.json(); -} - -export function useAllPipelineNamespaces( - params: PipelineOverview, - options?: Omit, "queryKey" | "queryFn"> -) { - return useQuery({ - queryKey: getPipelinesQueryKey(params), - queryFn: () => fetchAllPipelines(params), - ...options - }); -} diff --git a/src/types/core.ts b/src/types/core.ts index ee42695b6..0f99a98c7 100644 --- a/src/types/core.ts +++ b/src/types/core.ts @@ -903,36 +903,6 @@ export type paths = { */ get: operations["list_pipeline_runs_api_v1_pipelines__pipeline_id__runs_get"]; }; - "/api/v1/pipelines/{pipeline_id}/pipeline-spec": { - /** - * Get Pipeline Spec - * @description Gets the spec of a specific pipeline using its unique id. - * - * Args: - * pipeline_id: ID of the pipeline to get. - * - * Returns: - * The spec of the pipeline. - */ - get: operations["get_pipeline_spec_api_v1_pipelines__pipeline_id__pipeline_spec_get"]; - }; - "/api/v1/pipeline_namespaces": { - /** - * List Pipeline Namespaces - * @description Gets a list of pipeline namespaces. - * - * Args: - * filter_model: Filter model used for pagination, sorting, - * filtering. - * hydrate: Flag deciding whether to hydrate the output model(s) - * by including metadata fields in the response. - * auth_context: Authentication context. - * - * Returns: - * List of pipeline namespace objects. - */ - get: operations["list_pipeline_namespaces_api_v1_pipeline_namespaces_get"]; - }; "/api/v1/pipeline_builds": { /** * List Builds @@ -1146,6 +1116,57 @@ export type paths = { */ get: operations["get_run_metadata_api_v1_run_metadata__run_metadata_id__get"]; }; + "/api/v1/run_templates": { + /** + * List Run Templates + * @description Get a page of run templates. + * + * Args: + * filter_model: Filter model used for pagination, sorting, + * filtering. + * hydrate: Flag deciding whether to hydrate the output model(s) + * by including metadata fields in the response. + * + * Returns: + * Page of run templates. + */ + get: operations["list_run_templates_api_v1_run_templates_get"]; + }; + "/api/v1/run_templates/{template_id}": { + /** + * Get Run Template + * @description Get a run template. + * + * Args: + * template_id: ID of the run template to get. + * hydrate: Flag deciding whether to hydrate the output model(s) + * by including metadata fields in the response. + * + * Returns: + * The run template. + */ + get: operations["get_run_template_api_v1_run_templates__template_id__get"]; + /** + * Update Run Template + * @description Update a run template. + * + * Args: + * template_id: ID of the run template to get. + * update: The updates to apply. + * + * Returns: + * The updated run template. + */ + put: operations["update_run_template_api_v1_run_templates__template_id__put"]; + /** + * Delete Run Template + * @description Delete a run template. + * + * Args: + * template_id: ID of the run template to delete. + */ + delete: operations["delete_run_template_api_v1_run_templates__template_id__delete"]; + }; "/api/v1/schedules": { /** * List Schedules @@ -2549,6 +2570,39 @@ export type paths = { */ post: operations["create_deployment_api_v1_workspaces__workspace_name_or_id__pipeline_deployments_post"]; }; + "/api/v1/workspaces/{workspace_name_or_id}/run_templates": { + /** + * List Workspace Run Templates + * @description Get a page of run templates. + * + * Args: + * workspace_name_or_id: Name or ID of the workspace. + * filter_model: Filter model used for pagination, sorting, + * filtering. + * hydrate: Flag deciding whether to hydrate the output model(s) + * by including metadata fields in the response. + * + * Returns: + * Page of run templates. + */ + get: operations["list_workspace_run_templates_api_v1_workspaces__workspace_name_or_id__run_templates_get"]; + /** + * Create Run Template + * @description Create a run template. + * + * Args: + * workspace_name_or_id: Name or ID of the workspace. + * run_template: Run template to create. + * + * Returns: + * The created run template. + * + * Raises: + * IllegalOperationError: If the workspace specified in the + * run template does not match the current workspace. + */ + post: operations["create_run_template_api_v1_workspaces__workspace_name_or_id__run_templates_post"]; + }; "/api/v1/workspaces/{workspace_name_or_id}/runs": { /** * List Runs @@ -5677,8 +5731,8 @@ export type components = { /** Items */ items: components["schemas"]["PipelineDeploymentResponse"][]; }; - /** Page[PipelineNamespaceResponse] */ - Page_PipelineNamespaceResponse_: { + /** Page[PipelineResponse] */ + Page_PipelineResponse_: { /** Index */ index: number; /** Max Size */ @@ -5688,10 +5742,10 @@ export type components = { /** Total */ total: number; /** Items */ - items: components["schemas"]["PipelineNamespaceResponse"][]; + items: components["schemas"]["PipelineResponse"][]; }; - /** Page[PipelineResponse] */ - Page_PipelineResponse_: { + /** Page[PipelineRunResponse] */ + Page_PipelineRunResponse_: { /** Index */ index: number; /** Max Size */ @@ -5701,10 +5755,10 @@ export type components = { /** Total */ total: number; /** Items */ - items: components["schemas"]["PipelineResponse"][]; + items: components["schemas"]["PipelineRunResponse"][]; }; - /** Page[PipelineRunResponse] */ - Page_PipelineRunResponse_: { + /** Page[RunMetadataResponse] */ + Page_RunMetadataResponse_: { /** Index */ index: number; /** Max Size */ @@ -5714,10 +5768,10 @@ export type components = { /** Total */ total: number; /** Items */ - items: components["schemas"]["PipelineRunResponse"][]; + items: components["schemas"]["RunMetadataResponse"][]; }; - /** Page[RunMetadataResponse] */ - Page_RunMetadataResponse_: { + /** Page[RunTemplateResponse] */ + Page_RunTemplateResponse_: { /** Index */ index: number; /** Max Size */ @@ -5727,7 +5781,7 @@ export type components = { /** Total */ total: number; /** Items */ - items: components["schemas"]["RunMetadataResponse"][]; + items: components["schemas"]["RunTemplateResponse"][]; }; /** Page[ScheduleResponse] */ Page_ScheduleResponse_: { @@ -5917,12 +5971,12 @@ export type components = { python_version?: string | null; /** The build checksum. */ checksum?: string | null; + /** The stack checksum. */ + stack_checksum?: string | null; /** The stack that was used for this build. */ stack?: string | null; /** The pipeline that was used for this build. */ pipeline?: string | null; - /** Template Deployment Id */ - template_deployment_id?: string | null; }; /** * PipelineBuildResponse @@ -5988,12 +6042,12 @@ export type components = { python_version?: string | null; /** The build checksum. */ checksum?: string | null; + /** The stack checksum. */ + stack_checksum?: string | null; /** Whether the build images are stored in a container registry or locally. */ is_local: boolean; /** Whether any image of the build contains user code. */ contains_code: boolean; - /** Template Deployment Id */ - template_deployment_id?: string | null; }; /** * PipelineBuildResponseResources @@ -6115,6 +6169,10 @@ export type components = { client_version?: string | null; /** The version of the ZenML installation on the server side. */ server_version?: string | null; + /** The pipeline version hash of the deployment. */ + pipeline_version_hash?: string | null; + /** The pipeline spec of the deployment. */ + pipeline_spec?: components["schemas"]["PipelineSpec-Input"] | null; /** * The stack associated with the deployment. * Format: uuid @@ -6128,6 +6186,11 @@ export type components = { schedule?: string | null; /** The code reference associated with the deployment. */ code_reference?: components["schemas"]["CodeReferenceRequest"] | null; + /** + * Template + * @description Template used for the deployment. + */ + template?: string | null; }; /** * PipelineDeploymentResponse @@ -6198,6 +6261,10 @@ export type components = { client_version: string | null; /** The version of the ZenML installation on the server side. */ server_version: string | null; + /** The pipeline version hash of the deployment. */ + pipeline_version_hash?: string | null; + /** The pipeline spec of the deployment. */ + pipeline_spec?: components["schemas"]["PipelineSpec-Output"] | null; /** The pipeline associated with the deployment. */ pipeline?: components["schemas"]["PipelineResponse"] | null; /** The stack associated with the deployment. */ @@ -6208,6 +6275,11 @@ export type components = { schedule?: components["schemas"]["ScheduleResponse"] | null; /** The code reference associated with the deployment. */ code_reference?: components["schemas"]["CodeReferenceResponse"] | null; + /** + * Template Id + * @description Template used for the pipeline run. + */ + template_id?: string | null; }; /** * PipelineDeploymentResponseResources @@ -6218,42 +6290,6 @@ export type components = { triggers: components["schemas"]["Page_TriggerResponse_"]; [key: string]: unknown; }; - /** - * PipelineNamespaceResponse - * @description Response model for pipeline namespaces. - */ - PipelineNamespaceResponse: { - /** The body of the resource. */ - body?: components["schemas"]["PipelineNamespaceResponseBody"] | null; - /** The metadata related to this resource. */ - metadata?: components["schemas"]["PipelineNamespaceResponseMetadata"] | null; - /** The resources related to this resource. */ - resources?: components["schemas"]["PipelineNamespaceResponseResources"] | null; - /** The name of the pipeline namespace. */ - name: string; - }; - /** - * PipelineNamespaceResponseBody - * @description Response body for pipeline namespaces. - */ - PipelineNamespaceResponseBody: { - /** The ID of the latest run of the pipeline namespace. */ - latest_run_id?: string | null; - /** The status of the latest run of the pipeline namespace. */ - latest_run_status?: components["schemas"]["ExecutionStatus"] | null; - }; - /** - * PipelineNamespaceResponseMetadata - * @description Response metadata for pipeline namespaces. - */ - PipelineNamespaceResponseMetadata: Record; - /** - * PipelineNamespaceResponseResources - * @description Class for all resource models associated with the pipeline namespace entity. - */ - PipelineNamespaceResponseResources: { - [key: string]: unknown; - }; /** * PipelineRequest * @description Request model for pipelines. @@ -6271,14 +6307,10 @@ export type components = { workspace: string; /** The name of the pipeline. */ name: string; - /** The version of the pipeline. */ - version: string; - /** The version hash of the pipeline. */ - version_hash: string; - /** The docstring of the pipeline. */ - docstring?: string | null; - /** The spec of the pipeline. */ - spec: components["schemas"]["PipelineSpec-Input"]; + /** The description of the pipeline. */ + description?: string | null; + /** Tags of the pipeline. */ + tags?: string[] | null; }; /** * PipelineResponse @@ -6321,10 +6353,10 @@ export type components = { updated: string; /** The user who created this resource. */ user?: components["schemas"]["UserResponse"] | null; - /** The status of the last 3 Pipeline Runs. */ - status?: components["schemas"]["ExecutionStatus"][] | null; - /** The version of the pipeline. */ - version: string; + /** The ID of the latest run of the pipeline. */ + latest_run_id?: string | null; + /** The status of the latest run of the pipeline. */ + latest_run_status?: components["schemas"]["ExecutionStatus"] | null; }; /** * PipelineResponseMetadata @@ -6333,18 +6365,14 @@ export type components = { PipelineResponseMetadata: { /** The workspace of this resource. */ workspace: components["schemas"]["WorkspaceResponse"]; - /** The version hash of the pipeline. */ - version_hash: string; - /** The spec of the pipeline. */ - spec: components["schemas"]["PipelineSpec-Output"]; - /** The docstring of the pipeline. */ - docstring?: string | null; }; /** * PipelineResponseResources * @description Class for all resource models associated with the pipeline entity. */ PipelineResponseResources: { + /** Tags associated with the pipeline. */ + tags: components["schemas"]["TagResponse"][]; [key: string]: unknown; }; /** @@ -6395,6 +6423,8 @@ export type components = { }; /** ID of the trigger execution that triggered this run. */ trigger_execution_id?: string | null; + /** Tags of the pipeline run. */ + tags?: string[] | null; }; /** * PipelineRunResponse @@ -6497,6 +6527,11 @@ export type components = { }; /** The orchestrator run ID. */ orchestrator_run_id?: string | null; + /** + * Template Id + * @description Template used for the pipeline run. + */ + template_id?: string | null; }; /** * PipelineRunResponseResources @@ -6504,6 +6539,8 @@ export type components = { */ PipelineRunResponseResources: { model_version?: components["schemas"]["ModelVersionResponse"] | null; + /** Tags associated with the pipeline run. */ + tags: components["schemas"]["TagResponse"][]; [key: string]: unknown; }; /** @@ -6514,6 +6551,10 @@ export type components = { status?: components["schemas"]["ExecutionStatus"] | null; /** End Time */ end_time?: string | null; + /** New tags to add to the pipeline run. */ + add_tags?: string[] | null; + /** Tags to remove from the pipeline run. */ + remove_tags?: string[] | null; }; /** * PipelineSpec @@ -6562,16 +6603,12 @@ export type components = { * @description Update model for pipelines. */ PipelineUpdate: { - /** The name of the pipeline. */ - name?: string | null; - /** The version of the pipeline. */ - version?: string | null; - /** The version hash of the pipeline. */ - version_hash?: string | null; - /** The docstring of the pipeline. */ - docstring?: string | null; - /** The spec of the pipeline. */ - spec?: components["schemas"]["PipelineSpec-Input"] | null; + /** The description of the pipeline. */ + description?: string | null; + /** New tags to add to the pipeline. */ + add_tags?: string[] | null; + /** Tags to remove from the pipeline. */ + remove_tags?: string[] | null; }; /** * PluginType @@ -6744,6 +6781,132 @@ export type components = { RunMetadataResponseResources: { [key: string]: unknown; }; + /** + * RunTemplateRequest + * @description Request model for run templates. + */ + RunTemplateRequest: { + /** + * The id of the user that created this resource. + * Format: uuid + */ + user: string; + /** + * The workspace to which this resource belongs. + * Format: uuid + */ + workspace: string; + /** The name of the run template. */ + name: string; + /** The description of the run template. */ + description?: string | null; + /** + * The deployment that should be the base of the created template. + * Format: uuid + */ + source_deployment_id: string; + /** Tags of the run template. */ + tags?: string[] | null; + }; + /** + * RunTemplateResponse + * @description Response model for run templates. + */ + RunTemplateResponse: { + /** The body of the resource. */ + body?: components["schemas"]["RunTemplateResponseBody"] | null; + /** The metadata related to this resource. */ + metadata?: components["schemas"]["RunTemplateResponseMetadata"] | null; + /** The resources related to this resource. */ + resources?: components["schemas"]["RunTemplateResponseResources"] | null; + /** + * The unique resource id. + * Format: uuid + */ + id: string; + /** + * Permission Denied + * @default false + */ + permission_denied?: boolean; + /** The name of the run template. */ + name: string; + }; + /** + * RunTemplateResponseBody + * @description Response body for run templates. + */ + RunTemplateResponseBody: { + /** + * The timestamp when this resource was created. + * Format: date-time + */ + created: string; + /** + * The timestamp when this resource was last updated. + * Format: date-time + */ + updated: string; + /** The user who created this resource. */ + user?: components["schemas"]["UserResponse"] | null; + /** If a run can be started from the template. */ + runnable: boolean; + /** The ID of the latest run of the run template. */ + latest_run_id?: string | null; + /** The status of the latest run of the run template. */ + latest_run_status?: components["schemas"]["ExecutionStatus"] | null; + }; + /** + * RunTemplateResponseMetadata + * @description Response metadata for run templates. + */ + RunTemplateResponseMetadata: { + /** The workspace of this resource. */ + workspace: components["schemas"]["WorkspaceResponse"]; + /** The description of the run template. */ + description?: string | null; + /** The spec of the pipeline. */ + pipeline_spec?: components["schemas"]["PipelineSpec-Output"] | null; + /** Run configuration template. */ + config_template?: { + [key: string]: unknown; + } | null; + /** Run configuration schema. */ + config_schema?: { + [key: string]: unknown; + } | null; + }; + /** + * RunTemplateResponseResources + * @description All resource models associated with the run template. + */ + RunTemplateResponseResources: { + /** The deployment that is the source of the template. */ + source_deployment?: components["schemas"]["PipelineDeploymentResponse"] | null; + /** The pipeline associated with the template. */ + pipeline?: components["schemas"]["PipelineResponse"] | null; + /** The pipeline build associated with the template. */ + build?: components["schemas"]["PipelineBuildResponse"] | null; + /** The code reference associated with the template. */ + code_reference?: components["schemas"]["CodeReferenceResponse"] | null; + /** Tags associated with the run template. */ + tags: components["schemas"]["TagResponse"][]; + [key: string]: unknown; + }; + /** + * RunTemplateUpdate + * @description Run template update model. + */ + RunTemplateUpdate: { + /** The name of the run template. */ + name?: string | null; + /** The description of the run template. */ + description?: string | null; + /** New tags to add to the run template. */ + add_tags?: string[] | null; + /** Tags to remove from the run template. */ + remove_tags?: string[] | null; + }; /** * Schedule * @description Class for defining a pipeline schedule. @@ -7973,13 +8136,20 @@ export type components = { locations: { [key: string]: unknown; }; + /** + * The locations where the Skypilot clusters can be deployed by default. + * @description The locations where the Skypilot clusters can be deployed by default, as a dictionary mapping location names to descriptions. + */ + skypilot_default_regions: { + [key: string]: unknown; + }; }; /** * StackDeploymentProvider * @description All possible stack deployment providers. * @enum {string} */ - StackDeploymentProvider: "aws" | "gcp"; + StackDeploymentProvider: "aws" | "gcp" | "azure"; /** * StackRequest * @description Request model for stacks. @@ -12313,10 +12483,8 @@ export type operations = { created?: string | null; updated?: string | null; scope_workspace?: string | null; + tag?: string | null; name?: string | null; - version?: string | null; - version_hash?: string | null; - docstring?: string | null; workspace_id?: string | null; user_id?: string | null; }; @@ -12534,6 +12702,7 @@ export type operations = { created?: string | null; updated?: string | null; scope_workspace?: string | null; + tag?: string | null; name?: string | null; orchestrator_run_id?: string | null; pipeline_name?: string | null; @@ -12544,6 +12713,7 @@ export type operations = { build_id?: string | null; deployment_id?: string | null; code_repository_id?: string | null; + template_id?: string | null; status?: string | null; start_time?: string | null; end_time?: string | null; @@ -12587,156 +12757,46 @@ export type operations = { }; }; /** - * Get Pipeline Spec - * @description Gets the spec of a specific pipeline using its unique id. + * List Builds + * @description Gets a list of builds. * * Args: - * pipeline_id: ID of the pipeline to get. + * build_filter_model: Filter model used for pagination, sorting, + * filtering. + * hydrate: Flag deciding whether to hydrate the output model(s) + * by including metadata fields in the response. * * Returns: - * The spec of the pipeline. + * List of build objects. */ - get_pipeline_spec_api_v1_pipelines__pipeline_id__pipeline_spec_get: { + list_builds_api_v1_pipeline_builds_get: { parameters: { - path: { - pipeline_id: string; + query?: { + hydrate?: boolean; + sort_by?: string; + logical_operator?: components["schemas"]["LogicalOperators"]; + page?: number; + size?: number; + id?: string | null; + created?: string | null; + updated?: string | null; + scope_workspace?: string | null; + workspace_id?: string | null; + user_id?: string | null; + pipeline_id?: string | null; + stack_id?: string | null; + is_local?: boolean | null; + contains_code?: boolean | null; + zenml_version?: string | null; + python_version?: string | null; + checksum?: string | null; }; }; responses: { /** @description Successful Response */ 200: { content: { - "application/json": components["schemas"]["PipelineSpec-Output"]; - }; - }; - /** @description Unauthorized */ - 401: { - content: { - "application/json": components["schemas"]["ErrorModel"]; - }; - }; - /** @description Forbidden */ - 403: { - content: { - "application/json": components["schemas"]["ErrorModel"]; - }; - }; - /** @description Not Found */ - 404: { - content: { - "application/json": components["schemas"]["ErrorModel"]; - }; - }; - /** @description Unprocessable Entity */ - 422: { - content: { - "application/json": components["schemas"]["ErrorModel"]; - }; - }; - }; - }; - /** - * List Pipeline Namespaces - * @description Gets a list of pipeline namespaces. - * - * Args: - * filter_model: Filter model used for pagination, sorting, - * filtering. - * hydrate: Flag deciding whether to hydrate the output model(s) - * by including metadata fields in the response. - * auth_context: Authentication context. - * - * Returns: - * List of pipeline namespace objects. - */ - list_pipeline_namespaces_api_v1_pipeline_namespaces_get: { - parameters: { - query?: { - hydrate?: boolean; - sort_by?: string; - logical_operator?: components["schemas"]["LogicalOperators"]; - page?: number; - size?: number; - id?: string | null; - created?: string | null; - updated?: string | null; - name?: string | null; - }; - }; - responses: { - /** @description Successful Response */ - 200: { - content: { - "application/json": components["schemas"]["Page_PipelineNamespaceResponse_"]; - }; - }; - /** @description Unauthorized */ - 401: { - content: { - "application/json": components["schemas"]["ErrorModel"]; - }; - }; - /** @description Forbidden */ - 403: { - content: { - "application/json": components["schemas"]["ErrorModel"]; - }; - }; - /** @description Not Found */ - 404: { - content: { - "application/json": components["schemas"]["ErrorModel"]; - }; - }; - /** @description Unprocessable Entity */ - 422: { - content: { - "application/json": components["schemas"]["ErrorModel"]; - }; - }; - }; - }; - /** - * List Builds - * @description Gets a list of builds. - * - * Args: - * build_filter_model: Filter model used for pagination, sorting, - * filtering. - * hydrate: Flag deciding whether to hydrate the output model(s) - * by including metadata fields in the response. - * - * Returns: - * List of build objects. - */ - list_builds_api_v1_pipeline_builds_get: { - parameters: { - query?: { - hydrate?: boolean; - sort_by?: string; - logical_operator?: components["schemas"]["LogicalOperators"]; - page?: number; - size?: number; - id?: string | null; - created?: string | null; - updated?: string | null; - scope_workspace?: string | null; - workspace_id?: string | null; - user_id?: string | null; - pipeline_id?: string | null; - stack_id?: string | null; - is_local?: boolean | null; - contains_code?: boolean | null; - zenml_version?: string | null; - python_version?: string | null; - checksum?: string | null; - }; - }; - responses: { - /** @description Successful Response */ - 200: { - content: { - "application/json": components["schemas"]["Page_PipelineBuildResponse_"]; + "application/json": components["schemas"]["Page_PipelineBuildResponse_"]; }; }; /** @description Unauthorized */ @@ -12896,6 +12956,7 @@ export type operations = { stack_id?: string | null; build_id?: string | null; schedule_id?: string | null; + template_id?: string | null; }; }; responses: { @@ -13055,6 +13116,7 @@ export type operations = { created?: string | null; updated?: string | null; scope_workspace?: string | null; + tag?: string | null; name?: string | null; orchestrator_run_id?: string | null; pipeline_id?: string | null; @@ -13066,6 +13128,7 @@ export type operations = { build_id?: string | null; deployment_id?: string | null; code_repository_id?: string | null; + template_id?: string | null; status?: string | null; start_time?: string | null; end_time?: string | null; @@ -13599,6 +13662,229 @@ export type operations = { }; }; }; + /** + * List Run Templates + * @description Get a page of run templates. + * + * Args: + * filter_model: Filter model used for pagination, sorting, + * filtering. + * hydrate: Flag deciding whether to hydrate the output model(s) + * by including metadata fields in the response. + * + * Returns: + * Page of run templates. + */ + list_run_templates_api_v1_run_templates_get: { + parameters: { + query?: { + hydrate?: boolean; + sort_by?: string; + logical_operator?: components["schemas"]["LogicalOperators"]; + page?: number; + size?: number; + id?: string | null; + created?: string | null; + updated?: string | null; + scope_workspace?: string | null; + tag?: string | null; + name?: string | null; + workspace_id?: string | null; + user_id?: string | null; + pipeline_id?: string | null; + build_id?: string | null; + stack_id?: string | null; + code_repository_id?: string | null; + }; + }; + responses: { + /** @description Successful Response */ + 200: { + content: { + "application/json": components["schemas"]["Page_RunTemplateResponse_"]; + }; + }; + /** @description Unauthorized */ + 401: { + content: { + "application/json": components["schemas"]["ErrorModel"]; + }; + }; + /** @description Forbidden */ + 403: { + content: { + "application/json": components["schemas"]["ErrorModel"]; + }; + }; + /** @description Not Found */ + 404: { + content: { + "application/json": components["schemas"]["ErrorModel"]; + }; + }; + /** @description Unprocessable Entity */ + 422: { + content: { + "application/json": components["schemas"]["ErrorModel"]; + }; + }; + }; + }; + /** + * Get Run Template + * @description Get a run template. + * + * Args: + * template_id: ID of the run template to get. + * hydrate: Flag deciding whether to hydrate the output model(s) + * by including metadata fields in the response. + * + * Returns: + * The run template. + */ + get_run_template_api_v1_run_templates__template_id__get: { + parameters: { + query?: { + hydrate?: boolean; + }; + path: { + template_id: string; + }; + }; + responses: { + /** @description Successful Response */ + 200: { + content: { + "application/json": components["schemas"]["RunTemplateResponse"]; + }; + }; + /** @description Unauthorized */ + 401: { + content: { + "application/json": components["schemas"]["ErrorModel"]; + }; + }; + /** @description Forbidden */ + 403: { + content: { + "application/json": components["schemas"]["ErrorModel"]; + }; + }; + /** @description Not Found */ + 404: { + content: { + "application/json": components["schemas"]["ErrorModel"]; + }; + }; + /** @description Unprocessable Entity */ + 422: { + content: { + "application/json": components["schemas"]["ErrorModel"]; + }; + }; + }; + }; + /** + * Update Run Template + * @description Update a run template. + * + * Args: + * template_id: ID of the run template to get. + * update: The updates to apply. + * + * Returns: + * The updated run template. + */ + update_run_template_api_v1_run_templates__template_id__put: { + parameters: { + path: { + template_id: string; + }; + }; + requestBody: { + content: { + "application/json": components["schemas"]["RunTemplateUpdate"]; + }; + }; + responses: { + /** @description Successful Response */ + 200: { + content: { + "application/json": components["schemas"]["RunTemplateResponse"]; + }; + }; + /** @description Unauthorized */ + 401: { + content: { + "application/json": components["schemas"]["ErrorModel"]; + }; + }; + /** @description Forbidden */ + 403: { + content: { + "application/json": components["schemas"]["ErrorModel"]; + }; + }; + /** @description Not Found */ + 404: { + content: { + "application/json": components["schemas"]["ErrorModel"]; + }; + }; + /** @description Unprocessable Entity */ + 422: { + content: { + "application/json": components["schemas"]["ErrorModel"]; + }; + }; + }; + }; + /** + * Delete Run Template + * @description Delete a run template. + * + * Args: + * template_id: ID of the run template to delete. + */ + delete_run_template_api_v1_run_templates__template_id__delete: { + parameters: { + path: { + template_id: string; + }; + }; + responses: { + /** @description Successful Response */ + 200: { + content: { + "application/json": unknown; + }; + }; + /** @description Unauthorized */ + 401: { + content: { + "application/json": components["schemas"]["ErrorModel"]; + }; + }; + /** @description Forbidden */ + 403: { + content: { + "application/json": components["schemas"]["ErrorModel"]; + }; + }; + /** @description Not Found */ + 404: { + content: { + "application/json": components["schemas"]["ErrorModel"]; + }; + }; + /** @description Unprocessable Entity */ + 422: { + content: { + "application/json": components["schemas"]["ErrorModel"]; + }; + }; + }; + }; /** * List Schedules * @description Gets a list of schedules. @@ -18385,10 +18671,8 @@ export type operations = { created?: string | null; updated?: string | null; scope_workspace?: string | null; + tag?: string | null; name?: string | null; - version?: string | null; - version_hash?: string | null; - docstring?: string | null; workspace_id?: string | null; user_id?: string | null; }; @@ -18633,6 +18917,7 @@ export type operations = { stack_id?: string | null; build_id?: string | null; schedule_id?: string | null; + template_id?: string | null; }; path: { workspace_name_or_id: string; @@ -18719,6 +19004,125 @@ export type operations = { }; }; }; + /** + * List Workspace Run Templates + * @description Get a page of run templates. + * + * Args: + * workspace_name_or_id: Name or ID of the workspace. + * filter_model: Filter model used for pagination, sorting, + * filtering. + * hydrate: Flag deciding whether to hydrate the output model(s) + * by including metadata fields in the response. + * + * Returns: + * Page of run templates. + */ + list_workspace_run_templates_api_v1_workspaces__workspace_name_or_id__run_templates_get: { + parameters: { + query?: { + hydrate?: boolean; + sort_by?: string; + logical_operator?: components["schemas"]["LogicalOperators"]; + page?: number; + size?: number; + id?: string | null; + created?: string | null; + updated?: string | null; + scope_workspace?: string | null; + tag?: string | null; + name?: string | null; + workspace_id?: string | null; + user_id?: string | null; + pipeline_id?: string | null; + build_id?: string | null; + stack_id?: string | null; + code_repository_id?: string | null; + }; + path: { + workspace_name_or_id: string; + }; + }; + responses: { + /** @description Successful Response */ + 200: { + content: { + "application/json": components["schemas"]["Page_RunTemplateResponse_"]; + }; + }; + /** @description Unauthorized */ + 401: { + content: { + "application/json": components["schemas"]["ErrorModel"]; + }; + }; + /** @description Not Found */ + 404: { + content: { + "application/json": components["schemas"]["ErrorModel"]; + }; + }; + /** @description Unprocessable Entity */ + 422: { + content: { + "application/json": components["schemas"]["ErrorModel"]; + }; + }; + }; + }; + /** + * Create Run Template + * @description Create a run template. + * + * Args: + * workspace_name_or_id: Name or ID of the workspace. + * run_template: Run template to create. + * + * Returns: + * The created run template. + * + * Raises: + * IllegalOperationError: If the workspace specified in the + * run template does not match the current workspace. + */ + create_run_template_api_v1_workspaces__workspace_name_or_id__run_templates_post: { + parameters: { + path: { + workspace_name_or_id: string; + }; + }; + requestBody: { + content: { + "application/json": components["schemas"]["RunTemplateRequest"]; + }; + }; + responses: { + /** @description Successful Response */ + 200: { + content: { + "application/json": components["schemas"]["RunTemplateResponse"]; + }; + }; + /** @description Unauthorized */ + 401: { + content: { + "application/json": components["schemas"]["ErrorModel"]; + }; + }; + /** @description Conflict */ + 409: { + content: { + "application/json": components["schemas"]["ErrorModel"]; + }; + }; + /** @description Unprocessable Entity */ + 422: { + content: { + "application/json": components["schemas"]["ErrorModel"]; + }; + }; + }; + }; /** * List Runs * @description Get pipeline runs according to query filters. @@ -18745,6 +19149,7 @@ export type operations = { created?: string | null; updated?: string | null; scope_workspace?: string | null; + tag?: string | null; name?: string | null; orchestrator_run_id?: string | null; pipeline_id?: string | null; @@ -18756,6 +19161,7 @@ export type operations = { build_id?: string | null; deployment_id?: string | null; code_repository_id?: string | null; + template_id?: string | null; status?: string | null; start_time?: string | null; end_time?: string | null; diff --git a/src/types/pipelines.ts b/src/types/pipelines.ts index 5c48480f8..c3fbf6176 100644 --- a/src/types/pipelines.ts +++ b/src/types/pipelines.ts @@ -1,11 +1,8 @@ import { components, operations } from "./core"; -export type PipelineNamespace = components["schemas"]["PipelineNamespaceResponse"]; -export type PipelineNamespaceBody = components["schemas"]["PipelineNamespaceResponseBody"]; -export type PipelineNameSpacesPage = components["schemas"]["Page_PipelineNamespaceResponse_"]; - +export type Pipeline = components["schemas"]["PipelineResponse"]; export type PipelineBody = components["schemas"]["PipelineResponseBody"]; -export type PipelineNamespacesParams = NonNullable< - operations["list_pipeline_namespaces_api_v1_pipeline_namespaces_get"]["parameters"]["query"] +export type PipelineListParams = NonNullable< + operations["list_pipelines_api_v1_pipelines_get"]["parameters"]["query"] >;