Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check in SDL schema for GraphQL #11977

Merged
merged 4 commits into from
May 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 0 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,3 @@ a.md

# Ignore a gunicorn config file
gunicorn.conf.py

# GraphQL generated schema
mlflow/server/graphql/do_not_modify_autogenerated_schema.gql
4 changes: 1 addition & 3 deletions dev/proto_to_graphql/autogeneration_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,7 @@ def get_git_root():
SCHEMA_EXTENSION_MODULE = "mlflow.server.graphql.graphql_schema_extensions"
SCHEMA_EXTENSION = get_git_root() + "mlflow/server/graphql/graphql_schema_extensions.py"
AUTOGENERATED_SCHEMA = get_git_root() + "mlflow/server/graphql/autogenerated_graphql_schema.py"
AUTOGENERATED_SDL_SCHEMA = (
get_git_root() + "mlflow/server/graphql/do_not_modify_autogenerated_schema.gql"
)
AUTOGENERATED_SDL_SCHEMA = get_git_root() + "mlflow/server/js/src/graphql/autogenerated_schema.gql"
DUMMY_FIELD = (
"dummy = graphene.Boolean(description="
"'Dummy field required because GraphQL does not support empty types.')"
Expand Down
3 changes: 2 additions & 1 deletion mlflow/server/js/.prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,5 @@ __generated__

*.md
*.css
*.html
*.html
*.gql
179 changes: 179 additions & 0 deletions mlflow/server/js/src/graphql/autogenerated_schema.gql
Original file line number Diff line number Diff line change
@@ -0,0 +1,179 @@
# GENERATED FILE. PLEASE DON'T MODIFY.
# Run python3 ./dev/proto_to_graphql/code_generator.py to regenerate.

type Query {
mlflowGetExperiment(input: MlflowGetExperimentInput): MlflowGetExperimentResponse
mlflowGetRun(input: MlflowGetRunInput): MlflowGetRunResponse
mlflowSearchModelVersions(input: MlflowSearchModelVersionsInput): MlflowSearchModelVersionsResponse

"""Simple echoing field"""
test(inputString: String): Test
}

type MlflowGetExperimentResponse {
experiment: MlflowExperiment
}

type MlflowExperiment {
experimentId: String
name: String
artifactLocation: String
lifecycleStage: String
lastUpdateTime: LongString
creationTime: LongString
tags: [MlflowExperimentTag!]
}

"""
LongString Scalar type to prevent truncation to max integer in JavaScript.
"""
scalar LongString

type MlflowExperimentTag {
key: String
value: String
}

input MlflowGetExperimentInput {
experimentId: String
}

type MlflowGetRunResponse {
run: MlflowRunExtension
}

type MlflowRunExtension {
info: MlflowRunInfo
data: MlflowRunData
inputs: MlflowRunInputs
experiment: MlflowExperiment
modelVersions: [MlflowModelVersion!]
}

type MlflowRunInfo {
runId: String
runUuid: String
runName: String
experimentId: String
userId: String
status: MlflowRunStatus
startTime: LongString
endTime: LongString
artifactUri: String
lifecycleStage: String
}

enum MlflowRunStatus {
RUNNING
SCHEDULED
FINISHED
FAILED
KILLED
}

type MlflowRunData {
metrics: [MlflowMetric!]
params: [MlflowParam!]
tags: [MlflowRunTag!]
}

type MlflowMetric {
key: String
value: Float
timestamp: LongString
step: LongString
}

type MlflowParam {
key: String
value: String
}

type MlflowRunTag {
key: String
value: String
}

type MlflowRunInputs {
datasetInputs: [MlflowDatasetInput!]
}

type MlflowDatasetInput {
tags: [MlflowInputTag!]
dataset: MlflowDataset
}

type MlflowInputTag {
key: String
value: String
}

type MlflowDataset {
name: String
digest: String
sourceType: String
source: String
schema: String
profile: String
}

type MlflowModelVersion {
name: String
version: String
creationTimestamp: LongString
lastUpdatedTimestamp: LongString
userId: String
currentStage: String
description: String
source: String
runId: String
status: MlflowModelVersionStatus
statusMessage: String
tags: [MlflowModelVersionTag!]
runLink: String
aliases: [String]
}

enum MlflowModelVersionStatus {
PENDING_REGISTRATION
FAILED_REGISTRATION
READY
}

type MlflowModelVersionTag {
key: String
value: String
}

input MlflowGetRunInput {
runId: String
runUuid: String
}

type MlflowSearchModelVersionsResponse {
modelVersions: [MlflowModelVersion!]
nextPageToken: String
}

input MlflowSearchModelVersionsInput {
filter: String
maxResults: LongString
orderBy: [String]
pageToken: String
}

type Test {
"""Echoes the input string"""
output: String
}

type Mutation {
"""Simple echoing field"""
testMutation(inputString: String): TestMutation
}

type TestMutation {
"""Echoes the input string"""
output: String
}

2 changes: 1 addition & 1 deletion mlflow/server/js/src/graphql/graphql-codegen.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { CodegenConfig } from '@graphql-codegen/cli';

const config: CodegenConfig = {
schema: [`../graphql/do_not_modify_autogenerated_schema.gql`],
schema: [`./src/graphql/autogenerated_schema.gql`],
documents: ['src/**/!(*.test).js*', 'src/**/!(*.test).ts*'],
config: {
avoidOptionals: {
Expand Down