Skip to content
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
122 changes: 122 additions & 0 deletions .github/workflows/pr-labeler.yml
Original file line number Diff line number Diff line change
@@ -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
});
}
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The current description for BenchmarkJob is a bit generic. While not incorrect, it could be more descriptive of the component's function. A more specific description that highlights its role in automating benchmarking for inference services would provide more clarity for users at a glance and align better with the detailed documentation.

Suggested change
- **BenchmarkJob:** Measures model performance under different workloads
- **BenchmarkJob:** Automates performance benchmarking of inference services


OME's controller automatically:
1. Downloads and parses models to understand their characteristics
Expand Down
Loading