Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
61b6a6a
add job scheduler
ajleong623 Aug 12, 2025
ade1192
add job scheduler plugin
ajleong623 Aug 12, 2025
50319e4
fixed pairwise error
ajleong623 Aug 13, 2025
b554ea6
added actions for scheduling and deleting jobs, validations, and new …
ajleong623 Aug 19, 2025
8309d93
added initial draft of technical design
ajleong623 Aug 20, 2025
4b5340a
made changes based on small suggestions
ajleong623 Aug 21, 2025
7f6352d
Apply suggestions from code review
ajleong623 Aug 21, 2025
b73746a
made changes based on small suggestions
ajleong623 Aug 21, 2025
fd62b14
Revert "Apply suggestions from code review"
ajleong623 Aug 21, 2025
d3d053a
reapply changes from suggestion
ajleong623 Aug 21, 2025
d338bf4
add new persistent index and modified request url
ajleong623 Aug 27, 2025
bb3426d
still need to add integration tests
ajleong623 Aug 31, 2025
03725fa
finished all integration tests
ajleong623 Sep 1, 2025
efdc0c6
update gradle build file
ajleong623 Sep 1, 2025
95581cb
update design document
ajleong623 Sep 1, 2025
a547b68
update build file
ajleong623 Sep 1, 2025
fde4c04
update build.gradle
ajleong623 Sep 2, 2025
8a1efcb
yamlRestTest dependencies installed
ajleong623 Sep 2, 2025
827acdd
Merge branch 'opensearch-project:main' into job-scheduler
ajleong623 Sep 2, 2025
51de07a
add changelog line
ajleong623 Sep 2, 2025
5d12f02
worked on some suggestions
ajleong623 Sep 4, 2025
7aa0b44
add futures and timeout
ajleong623 Sep 4, 2025
be09cd9
update as described in comment
ajleong623 Sep 5, 2025
c8740c6
refactored experiment runner and updated scheduledRunId
ajleong623 Sep 6, 2025
a8b5bf7
marked new apis as experimental, updated documentation, and added mor…
ajleong623 Sep 7, 2025
52955a2
fix forbidden apis
ajleong623 Sep 8, 2025
56c1911
fix failing tests
ajleong623 Sep 8, 2025
df91219
scheduled experiment concurrency with timeout and cleanup is now ready
ajleong623 Sep 9, 2025
66b5489
added tests for concurrency, timeout mechanism, and also async timeou…
ajleong623 Sep 16, 2025
ed511ac
add more comments and documentations
ajleong623 Sep 17, 2025
031b97b
cleaned up deleted job scheduled
ajleong623 Sep 19, 2025
f19c375
added scheduled parameter to experiment and cleanup scheduled experim…
ajleong623 Sep 20, 2025
9941bd7
help fix forbidden apis
ajleong623 Sep 20, 2025
7aa1c32
retry tests
ajleong623 Sep 23, 2025
e2cc6c1
Merge branch 'opensearch-project:main' into job-scheduler
ajleong623 Sep 23, 2025
1a404f0
Couple of text tweaks...
epugh Sep 23, 2025
fc9ab7f
increase timeout to one hour for production
ajleong623 Sep 23, 2025
7ef0e60
Merge branch 'job-scheduler' of https://github.com/ajleong623/search-…
ajleong623 Sep 23, 2025
eaabfd1
fix timeout test
ajleong623 Sep 23, 2025
3e514e4
update action names
ajleong623 Sep 24, 2025
24852eb
reenable neural search
ajleong623 Sep 24, 2025
dbf5f73
update scheduled run id value
ajleong623 Oct 7, 2025
bfc13cc
reenable ml plugin
ajleong623 Oct 7, 2025
1a27b3d
cleanup unused constants
ajleong623 Oct 7, 2025
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
6 changes: 3 additions & 3 deletions .github/workflows/delete_backport_branch.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
name: Delete merged branch of the backport PRs
on:
on:
pull_request:
types:
- closed

jobs:
delete-branch:
runs-on: ubuntu-latest
Expand All @@ -19,4 +19,4 @@ jobs:
owner: context.repo.owner,
repo: context.repo.repo,
ref: `heads/${context.payload.pull_request.head.ref}`,
})
})
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
### Breaking Changes

### Features
* Added APIs and components to implement running scheduled experiments ([#220](https://github.com/opensearch-project/search-relevance/pull/220))

### Enhancements

Expand Down
33 changes: 33 additions & 0 deletions DEVELOPER_GUIDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -294,3 +294,36 @@ The template is particularly valuable for:
- Changes affecting security or backward compatibility

Refer to the [design documentation guide](docs/README.md) for detailed instructions, examples, and best practices on using the template effectively.

## Explanation on Scheduled Experiment Indices

When running a scheduled experiment, the data is stored a little bit differently compared to running an individual experiment. The information of the job that runs the experiment is stored in a separate index called, `.search-relevance-scheduled-experiment-jobs`. The information stored is the schedule (in the cron job format) and whether the job is actually running or not.

The diagram below shows how the scheduled experiment API interacts with the `.search-relevance-scheduled-experiment-jobs` index.

```mermaid
sequenceDiagram
PostScheduledExperimentTransportAction->>+.search-relevance-scheduled-experiment-jobs: puts schedule and experiment_id and other metadata into index
.search-relevance-scheduled-experiment-jobs->>+IndexOperationListener:The index operation listener activates the scheduler in the job scheduler plugin which submits the experiment to the job runner
```

The results of these runs are also stored in its own index called `.search-relevance-scheduled-experiment-history`. This helps track the status of the experiment, the results, and the id of the experiment that the scheduled run is based on.

The diagram below shows the code flow behind how the data is stored into this index.

```mermaid
sequenceDiagram
SearchRelevanceJobRunner->>+ThreadPoolExecutor: Submits a scheduled experiment to be run into the threadpool executor
ThreadPoolExecutor->>+ScheduledExperimentRunnerManager:Runs the tasks which will invoke ScheduledExperimentRunnerManager to run the experiment
ScheduledExperimentRunnerManager->>+.search-relevance-scheduled-experiment-history: Submits result of that scheduled experiment
```

The evaluation results index `search-relevance-evaluation-result` will also be updated for viewing the scheduled experiment results in Search Relevance Dashboards. One nuance is that there will be an additional marker to indicate that the evaluation result was based on a scheduled experiment.

Below is a diagram to show how evaluation results are submitted.

```mermaid
sequenceDiagram
PutExperimentTransportAction/ScheduledExperimentRunnerManager->>+Hybrid/Pointwise ExperimentProcessor: Starts running a pointwise or hybrid search experiment
Hybrid/Pointwise ExperimentProcessor->>+search-relevance-evaluation-result: Submits evaluation_result
```
9 changes: 9 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,7 @@ opensearchplugin {
classname "${packagePath}.${pathToPlugin}.${pluginClassName}"
licenseFile rootProject.file('LICENSE.txt')
noticeFile rootProject.file('NOTICE.txt')
extendedPlugins = ['opensearch-job-scheduler']
}

dependencyLicenses.enabled = false
Expand All @@ -194,6 +195,7 @@ dependencies {
implementation "org.opensearch:opensearch:${opensearch_version}"
api "org.opensearch:opensearch:${opensearch_version}"
api group: 'org.opensearch', name:'opensearch-ml-client', version: "${opensearch_build}"
compileOnly "org.opensearch:opensearch-job-scheduler-spi:${opensearch_build}"
implementation group: 'com.google.guava', name: 'guava', version:'33.4.8-jre'
compileOnly group: 'commons-lang', name: 'commons-lang', version: '2.6'
implementation group: 'org.apache.commons', name: 'commons-lang3', version: '3.18.0'
Expand Down Expand Up @@ -229,6 +231,7 @@ dependencies {
zipArchive group: 'org.opensearch.plugin', name:'neural-search', version: "${opensearch_build}"
zipArchive group: 'org.opensearch.plugin', name:'opensearch-ubi', version: "${opensearch_build}"
opensearchPlugin "org.opensearch.plugin:opensearch-security:${opensearch_build}@zip"
opensearchPlugin "org.opensearch.plugin:opensearch-job-scheduler:${opensearch_build}@zip"

configurations.all {
resolutionStrategy {
Expand Down Expand Up @@ -293,6 +296,7 @@ ext.resolvePluginFile = { pluginId ->
}
}
def securityPluginFile = resolvePluginFile("opensearch-security")
def jobSchedulerFile = resolvePluginFile("opensearch-job-scheduler")

// === Setup security test ===
// This flag indicates the existence of security plugin
Expand Down Expand Up @@ -372,6 +376,11 @@ testClusters.integTest {
}
}

// Set up integration test clusters, installs all zipArchive dependencies
testClusters.yamlRestTest {
plugin(provider(jobSchedulerFile))
}

// Re-write WaitForHttpResource with updated code to support security plugin use case
class WaitForClusterYellow {

Expand Down
Loading