diff --git a/.github/workflows/validate-mdx.yml b/.github/workflows/validate-mdx.yml index 673ecea0dc..a2c39957dc 100644 --- a/.github/workflows/validate-mdx.yml +++ b/.github/workflows/validate-mdx.yml @@ -9,6 +9,8 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v6 + with: + fetch-depth: 0 - uses: actions/setup-node@v6 with: node-version: '20' diff --git a/scripts/mdx-validation/validate-mdx-mintlify.sh b/scripts/mdx-validation/validate-mdx-mintlify.sh index ebaef91ba9..3da0ca629f 100755 --- a/scripts/mdx-validation/validate-mdx-mintlify.sh +++ b/scripts/mdx-validation/validate-mdx-mintlify.sh @@ -18,13 +18,47 @@ cleanup() { # Trap to ensure cleanup trap cleanup EXIT INT TERM +# Check if there are any MDX files in the changeset +if [ -n "$GITHUB_BASE_REF" ]; then + # In a PR context, check changed files + echo "Checking for changed MDX files in PR..." + + # Get the list of changed files + CHANGED_MDX=$(git diff --name-only "origin/$GITHUB_BASE_REF"...HEAD -- '*.mdx' 2>/dev/null | grep -E '\.mdx$' || true) + + if [ -z "$CHANGED_MDX" ]; then + echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" + echo "NO MDX FILES CHANGED" + echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" + echo "No MDX files found in this PR. Skipping validation." + echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" + exit 0 + fi + + echo "Found changed MDX files:" + echo "$CHANGED_MDX" | sed 's/^/ /' + echo "" +fi + echo "Starting Mintlify validation..." echo "" echo "Running: mint dev --no-open (will run for ${PARSE_TIME}s to parse all files)" echo "" # Run mint dev with tee to force output writing, timeout after PARSE_TIME seconds -timeout --preserve-status ${PARSE_TIME}s mint dev --no-open 2>&1 | tee "$LOGFILE" > /dev/null || true +# Use timeout if available (Linux), otherwise use gtimeout (macOS with coreutils), or perl as fallback +if command -v timeout > /dev/null 2>&1; then + timeout --preserve-status ${PARSE_TIME}s mint dev --no-open 2>&1 | tee "$LOGFILE" > /dev/null || true +elif command -v gtimeout > /dev/null 2>&1; then + gtimeout --preserve-status ${PARSE_TIME}s mint dev --no-open 2>&1 | tee "$LOGFILE" > /dev/null || true +else + # Fallback: run mint dev in background and kill after PARSE_TIME + mint dev --no-open 2>&1 | tee "$LOGFILE" > /dev/null & + PID=$! + sleep ${PARSE_TIME} + kill "$PID" 2>/dev/null || true + wait "$PID" 2>/dev/null || true +fi echo "" echo "✓ Mintlify finished parsing" @@ -47,11 +81,28 @@ if grep -q "parsing error" "$LOGFILE"; then echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" echo "" exit 1 -else - echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" - echo "✅ MINTLIFY VALIDATION PASSED" - echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" - echo "No parsing errors detected by Mintlify" - exit 0 fi +echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" +echo "✅ MINTLIFY PARSING VALIDATION PASSED" +echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" +echo "No parsing errors detected by Mintlify" +echo "" + +# Run broken links check +echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" +echo "CHECKING FOR BROKEN LINKS" +echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" +echo "Running: mint broken-links" +echo "" + +# Run mint broken-links - it will exit with non-zero if broken links are found +mint broken-links + +echo "" +echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" +echo "✅ ALL VALIDATION CHECKS PASSED" +echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" +echo "- No parsing errors" +echo "- No broken links" +exit 0 diff --git a/training/api-reference.mdx b/training/api-reference.mdx index 046e63d671..2a2fafb93d 100644 --- a/training/api-reference.mdx +++ b/training/api-reference.mdx @@ -33,6 +33,29 @@ https://api.training.wandb.ai/v1 ### models +- **[POST /v1/preview/models](https://docs.wandb.ai/training/api-reference/models/create-model-v1-preview-models)** - Create Model +- **[DELETE /v1/preview/models/{model_id}](https://docs.wandb.ai/training/api-reference/models/delete-model-v1-preview-models--model-id-)** - Delete Model +- **[DELETE /v1/preview/models/{model_id}/checkpoints](https://docs.wandb.ai/training/api-reference/models/delete-model-checkpoints-v1-preview-models--model-id--checkpoints)** - Delete Model Checkpoints +- **[GET /v1/preview/models/{model_id}/checkpoints](https://docs.wandb.ai/training/api-reference/models/list-model-checkpoints-v1-preview-models--model-id--checkpoints)** - List Model Checkpoints +- **[POST /v1/preview/models/{model_id}/log](https://docs.wandb.ai/training/api-reference/models/log-v1-preview-models--model-id--log)** - Log + +### training-jobs + +- **[POST /v1/preview/training-jobs](https://docs.wandb.ai/training/api-reference/training-jobs/create-training-job-v1-preview-training-jobs)** - Create Training Job +- **[GET /v1/preview/training-jobs/{training_job_id}](https://docs.wandb.ai/training/api-reference/training-jobs/get-training-job-v1-preview-training-jobs--training-job-id-)** - Get Training Job +- **[GET /v1/preview/training-jobs/{training_job_id}/events](https://docs.wandb.ai/training/api-reference/training-jobs/get-training-job-events-v1-preview-training-jobs--training-job-id--events)** - Get Training Job Events + +### Uncategorized + +- **[GET /v1/health](https://docs.wandb.ai/training/api-reference/uncategorized/health-check-v1-health)** - Health Check +- **[GET /v1/system-check](https://docs.wandb.ai/training/api-reference/uncategorized/system-check-v1-system-check)** - System Check +### chat-completions + +- **[POST /v1/chat/completions](https://docs.wandb.ai/training/api-reference/chat-completions/create-chat-completion-v1-chat-completions)** - Create Chat Completion +- **[POST /v1/chat/completions/](https://docs.wandb.ai/training/api-reference/chat-completions/create-chat-completion-v1-chat-completions-)** - Create Chat Completion + +### models + - **[POST /v1/preview/models](https://docs.wandb.ai/training/api-reference/models/create-model-v1-preview-models)** - Create Model - **[DELETE /v1/preview/models/{model_id}/checkpoints](https://docs.wandb.ai/training/api-reference/models/delete-model-checkpoints-v1-preview-models--model-id--checkpoints)** - Delete Model Checkpoints - **[GET /v1/preview/models/{model_id}/checkpoints](https://docs.wandb.ai/training/api-reference/models/list-model-checkpoints-v1-preview-models--model-id--checkpoints)** - List Model Checkpoints diff --git a/training/api-reference/openapi.json b/training/api-reference/openapi.json index 73a07e7963..c3c7dcc644 100644 --- a/training/api-reference/openapi.json +++ b/training/api-reference/openapi.json @@ -290,6 +290,54 @@ } } }, + "/v1/preview/models/{model_id}": { + "delete": { + "tags": [ + "models" + ], + "summary": "Delete Model", + "description": "Delete a model, all its checkpoints, artifacts, and the associated W&B run.", + "operationId": "delete_model_v1_preview_models__model_id__delete", + "security": [ + { + "HTTPBearer": [] + } + ], + "parameters": [ + { + "name": "model_id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Model Id" + } + } + ], + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DeleteModelResponse" + } + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + } + }, "/v1/preview/models/{model_id}/log": { "post": { "tags": [ @@ -2676,6 +2724,31 @@ "title": "DeleteCheckpointsResponse", "description": "Schema for delete checkpoints response." }, + "DeleteModelResponse": { + "properties": { + "model_id": { + "type": "string", + "format": "uuid", + "title": "Model Id" + }, + "deleted_checkpoints": { + "type": "integer", + "title": "Deleted Checkpoints" + }, + "deleted_run": { + "type": "boolean", + "title": "Deleted Run" + } + }, + "type": "object", + "required": [ + "model_id", + "deleted_checkpoints", + "deleted_run" + ], + "title": "DeleteModelResponse", + "description": "Schema for delete model response." + }, "ExperimentalTrainingConfig": { "properties": { "learning_rate": {