From 4528c5f55a6ea599b21d9d9e155afbfb196ca589 Mon Sep 17 00:00:00 2001 From: Simo Lin Date: Mon, 30 Jun 2025 08:21:27 -0700 Subject: [PATCH 1/2] [doc] add missing benchmark in readme --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index f4e04b54..4880e078 100644 --- a/README.md +++ b/README.md @@ -100,6 +100,7 @@ OME uses a component-based architecture built on Kubernetes custom resources: - **BaseModel/ClusterBaseModel:** Define model sources and metadata - **ServingRuntime/ClusterServingRuntime:** Define how models are served - **InferenceService:** Connects models to runtimes for deployment +- **BenchmarkJob:** Measures model performance under different workloads OME's controller automatically: 1. Downloads and parses models to understand their characteristics From 444668613c50dbc603325b983902ea113853458e Mon Sep 17 00:00:00 2001 From: Simo Lin Date: Mon, 30 Jun 2025 08:32:10 -0700 Subject: [PATCH 2/2] [misc] add pr labeler --- .github/workflows/pr-labeler.yml | 122 +++++++++++++++++++++++++++++++ 1 file changed, 122 insertions(+) create mode 100644 .github/workflows/pr-labeler.yml diff --git a/.github/workflows/pr-labeler.yml b/.github/workflows/pr-labeler.yml new file mode 100644 index 00000000..60a3d4af --- /dev/null +++ b/.github/workflows/pr-labeler.yml @@ -0,0 +1,122 @@ +name: PR Labeler + +on: + pull_request: + types: [opened, edited] + issue_comment: + types: [created] + +permissions: + pull-requests: write + issues: write + +jobs: + label-pr: + if: | + (github.event_name == 'pull_request' && + (github.event.action == 'opened' || github.event.action == 'edited')) || + (github.event_name == 'issue_comment' && + github.event.issue.pull_request && + github.event.comment.user.login != 'github-actions[bot]') + runs-on: ubuntu-latest + steps: + - name: Parse /kind commands + uses: actions/github-script@v7 + with: + script: | + const kindMap = { + 'bug': 'bug', + 'cleanup': 'cleanup', + 'documentation': 'documentation', + 'feature': 'feature', + 'design': 'design' + }; + + let body = ''; + let prNumber = 0; + + if (context.eventName === 'pull_request') { + body = context.payload.pull_request.body || ''; + prNumber = context.payload.pull_request.number; + } else if (context.eventName === 'issue_comment') { + body = context.payload.comment.body || ''; + prNumber = context.payload.issue.number; + } + + // Find all /kind commands in the body + const kindRegex = /\/kind\s+(\w+)/g; + const matches = [...body.matchAll(kindRegex)]; + + if (matches.length === 0) { + console.log('No /kind commands found'); + return; + } + + // Get current labels + const { data: currentLabels } = await github.rest.issues.listLabelsOnIssue({ + owner: context.repo.owner, + repo: context.repo.repo, + issue_number: prNumber + }); + + const currentLabelNames = currentLabels.map(label => label.name); + const labelsToAdd = []; + const labelsToRemove = []; + + // Remove all existing kind labels + for (const label of currentLabelNames) { + if (Object.values(kindMap).includes(label)) { + labelsToRemove.push(label); + } + } + + // Add new kind labels + for (const match of matches) { + const kindType = match[1].toLowerCase(); + if (kindMap[kindType]) { + labelsToAdd.push(kindMap[kindType]); + } + } + + // Remove old kind labels + for (const label of labelsToRemove) { + if (!labelsToAdd.includes(label)) { + try { + await github.rest.issues.removeLabel({ + owner: context.repo.owner, + repo: context.repo.repo, + issue_number: prNumber, + name: label + }); + console.log(`Removed label: ${label}`); + } catch (error) { + console.log(`Failed to remove label ${label}: ${error.message}`); + } + } + } + + // Add new labels + if (labelsToAdd.length > 0) { + try { + await github.rest.issues.addLabels({ + owner: context.repo.owner, + repo: context.repo.repo, + issue_number: prNumber, + labels: labelsToAdd + }); + console.log(`Added labels: ${labelsToAdd.join(', ')}`); + } catch (error) { + console.log(`Failed to add labels: ${error.message}`); + } + } + + // Post a comment if this was triggered by a comment + if (context.eventName === 'issue_comment' && labelsToAdd.length > 0) { + const comment = `✅ Applied labels: ${labelsToAdd.map(l => `\`${l}\``).join(', ')}`; + await github.rest.issues.createComment({ + owner: context.repo.owner, + repo: context.repo.repo, + issue_number: prNumber, + body: comment + }); + } \ No newline at end of file