-
Notifications
You must be signed in to change notification settings - Fork 19
Implement ORB AWS EC2 Worker Adapter #525
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’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
magniloquency
wants to merge
88
commits into
finos:main
Choose a base branch
from
magniloquency:orb
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+1,071
−8
Open
Changes from 2 commits
Commits
Show all changes
88 commits
Select commit
Hold shift + click to select a range
4506147
Implement ORB Worker Adapter
magniloquency 783c10c
Add submit_tasks example to documentation and CI skip list
magniloquency 9133f52
Merge branch 'main' into orb
magniloquency a1ff776
move orb/ and ami/ to driver/
magniloquency a46af96
remove superfluous checks in orb config
magniloquency e8ae3fc
move import
magniloquency 2312d66
add a check for self._orb before returning machines
magniloquency 89d964b
adjust security group rules
magniloquency 248f2f7
move method
magniloquency 0333ee7
rename no random worker ids to deterministic worker ids
magniloquency ce17847
add comment
magniloquency 2796ead
run submit tasks in ci
magniloquency 389a7b6
fix help text
magniloquency 9eae58d
make _filter_data a static method
magniloquency d333899
refactor orb worker adapter polling to use constants
magniloquency 562ec6a
flake8
magniloquency 7a61c0e
don't touch skip examples file
magniloquency 594342d
Merge branch 'main' of https://github.com/finos/opengris-scaler into orb
magniloquency 350e840
bump minor version
magniloquency 8ad0a61
Merge branch 'main' into orb
magniloquency a2d3856
docs: add worker adapter tutorials and update ORB integration details
magniloquency 0329716
Merge branch 'orb' of https://github.com/magniloquency/scaler into orb
magniloquency c50fddb
refactor: move orb and ami drivers to src/scaler/drivers
magniloquency 90f608a
Delete test.toml
magniloquency 711e9e9
Merge branch 'main' into orb
magniloquency f789743
Refactor ORB worker adapter to use ZMQ-based protocol
magniloquency 287cd7c
fix type error
magniloquency 1235fae
fix type error
magniloquency 8fda46c
Output ORB templates in snake_case
magniloquency 5c5a76e
Simplify ORB driver config files
magniloquency 2130431
Document default no-scaling policy and vanilla scaler example in work…
magniloquency 2b54a3a
Merge branch 'main' into orb
sharpener6 4956370
Merge branch 'main' into orb
sharpener6 31de2fd
import documentation changes from #574
magniloquency 8d893fe
Merge branch 'main' into orb
magniloquency 759f21a
Merge main into orb, adopting worker_manager naming convention
magniloquency 2928bef
Refactor ORB worker adapter to worker_manager_adapter naming and impr…
magniloquency d31f8ad
Refactor ORB config handling and simplify worker manager
magniloquency 830d35f
Rename run_worker_adapter_orb to run_worker_manager_orb
magniloquency da6338c
Fix ORB template missing instance_types and broken region injection
magniloquency 940f0d0
Use subnet_ids list field instead of subnet_id in ORB template
magniloquency ef54411
Add name field to ORBMachine to fix TypeError on deserialization
magniloquency e90f85c
Filter unknown keys when deserializing ORBMachine from dict
magniloquency 15f3c42
Fix duplicate commands sent to adapter while previous command is in-f…
magniloquency 1e931e1
Merge origin/main into orb, resolving conflicts
magniloquency 31af0c7
upgrade to orb 1.2
magniloquency 2e591d8
Migrate ORB worker manager from CLI subprocess to Python SDK
magniloquency 1d50e13
Remove unused ORBMachine and ORBRequest types
magniloquency 9948bf6
Fix WorkerAdapterConfig -> WorkerManagerConfig rename
magniloquency 342735e
Work around ORB SDK app_config timing bug by writing temp config file
magniloquency 983589f
Use ORB_CONFIG_DIR env var to inject config into ORB singleton
magniloquency c086599
Add template_id, image_id, provider_api to configuration dict for ORB…
magniloquency 721acc5
Switch ORB storage from sql to json (SQLQueryBuilder is abstract in i…
magniloquency b2235e7
Monkey-patch ORB TemplateRepositoryImpl.get_by_id to accept plain str
magniloquency 380831d
Fix ORB 1.2.2 missing add() method on TemplateRepositoryImpl
magniloquency 67d1710
Patch Template.get_domain_events/clear_domain_events missing in ORB 1…
magniloquency d77718c
Merge origin/main into orb, resolving conflicts
magniloquency 071d4bc
Upgrade ORB dependency to 1.3 and adopt context-manager SDK API
magniloquency feee439
Update ORB worker manager adapter for post-WorkerGroup protocol
magniloquency e785ca9
Add opengris-scaler 1.15.0 AMI and move packer files to orb adapter d…
magniloquency af01940
Fix ORB create_template call to use flat kwargs instead of nested con…
magniloquency 89e01a7
Add validate_template call and logging after create_template in ORB s…
magniloquency 1c3821e
Rename _worker_groups to _workers in ORB worker adapter
magniloquency 6b69334
Remove hardcoded --num-of-workers from ORB cluster launch script
magniloquency 949348e
Remove inaccurate worker ID tracking comment from ORB cluster launch …
magniloquency 321ed08
Remove hardcoded attribute metadata from ORB create_template call
magniloquency 90633b7
Merge main into orb branch
magniloquency 3bd5c9c
Merge branch 'main' into orb
sharpener6 3f025de
Fix ymq import in ORB worker manager after e921fff3 refactor
magniloquency 81d3cef
Merge main into orb, resolving documentation reorganization conflicts
magniloquency a79a3f6
Update orb-py dependency to 1.5.1
magniloquency 325dcd4
Merge branch 'main' into orb
magniloquency 1c034c1
Merge origin/main into orb
magniloquency 602b736
Fix import order in orb worker_manager
magniloquency 2f95e5b
Add orb worker manager support to unified entry points
magniloquency 183f998
Remove dedicated scaler_worker_manager_orb entry point
magniloquency 9fdcb20
Work around ORB skipping strategy defaults when config_dict is provided
magniloquency 672ad72
Merge origin/main into orb
magniloquency 2d50d26
Remove run_worker_manager_orb script
magniloquency 1e8603b
Suppress repeated StartWorkers requests after TooManyWorkers
magniloquency 4da853c
Lazy-import orb to fix CI test failures
magniloquency 1177f26
Update ORB user data to use scaler_worker_manager with --mode fixed
magniloquency e254eac
fix io threads
magniloquency 68d7e68
Add AMI 1.26.4 to docs and fix build.sh version path
magniloquency 95f4fe7
Fix zero-worker default on single-core machines
magniloquency 1fe9667
Fix TooManyWorkers suppression not working during EC2 boot
magniloquency d1d9633
Merge remote-tracking branch 'origin/main' into orb
magniloquency a0c9198
Rename ORB worker manager to orb_aws_ec2
magniloquency File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -34,3 +34,6 @@ CMakeFiles/ | |
| .vs/ | ||
| src/scaler/protocol/capnp/*.c++ | ||
| src/scaler/protocol/capnp/*.h | ||
|
|
||
| orb/logs/ | ||
| orb/metrics/ | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| #!/bin/bash | ||
| set -e | ||
| set -x | ||
|
|
||
| # Get the directory where the script is located | ||
| SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" | ||
| VERSION_FILE="$SCRIPT_DIR/../src/scaler/version.txt" | ||
|
|
||
| if [ ! -f "$VERSION_FILE" ]; then | ||
| echo "Error: Version file not found at $VERSION_FILE" | ||
| exit 1 | ||
| fi | ||
|
|
||
| VERSION=$(cat "$VERSION_FILE" | tr -d '[:space:]') | ||
|
|
||
| echo "Building AMI for version: $VERSION" | ||
|
|
||
| cd "$SCRIPT_DIR" | ||
| packer build -var "version=$VERSION" opengris-scaler.pkr.hcl |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,69 @@ | ||
| packer { | ||
| required_plugins { | ||
| amazon = { | ||
| version = "~> 1" | ||
| source = "github.com/hashicorp/amazon" | ||
| } | ||
| } | ||
| } | ||
|
|
||
| variable "aws_region" { | ||
| type = string | ||
| default = "us-east-1" | ||
| } | ||
|
|
||
| variable "version" { | ||
| type = string | ||
| } | ||
|
|
||
| variable "ami_regions" { | ||
| type = list(string) | ||
| default = [] | ||
| description = "A list of regions to copy the AMI to." | ||
| } | ||
|
|
||
| variable "ami_groups" { | ||
| type = list(string) | ||
| default = ["all"] | ||
| description = "A list of groups to share the AMI with. Set to ['all'] to make public." | ||
| } | ||
|
|
||
| variable "python_version" { | ||
| type = string | ||
| default = "3.13" | ||
| } | ||
|
|
||
| source "amazon-ebs" "opengris-scaler" { | ||
| ami_name = "opengris-scaler-${var.version}-py${var.python_version}" | ||
| instance_type = "t2.small" | ||
| region = var.aws_region | ||
| ami_regions = var.ami_regions | ||
| ami_groups = var.ami_groups | ||
| source_ami_filter { | ||
| filters = { | ||
| name = "al2023-ami-2023.*-kernel-*-x86_64" | ||
| root-device-type = "ebs" | ||
| virtualization-type = "hvm" | ||
| } | ||
| most_recent = true | ||
| owners = ["amazon"] | ||
| } | ||
| ssh_username = "ec2-user" | ||
| } | ||
|
|
||
| build { | ||
| name = "opengris-scaler-build" | ||
| sources = ["source.amazon-ebs.opengris-scaler"] | ||
|
|
||
| provisioner "shell" { | ||
| inline = [ | ||
| "sudo dnf update -y", | ||
| "sudo dnf install -y python${var.python_version} python${var.python_version}-pip", | ||
| "sudo python${var.python_version} -m venv /opt/opengris-scaler", | ||
| "sudo /opt/opengris-scaler/bin/python -m pip install --upgrade pip", | ||
| "sudo /opt/opengris-scaler/bin/pip install opengris-scaler==${var.version}", | ||
| "sudo ln -sf /opt/opengris-scaler/bin/scaler_* /usr/local/bin/", | ||
| "sudo ln -sf /opt/opengris-scaler/bin/python /usr/local/bin/opengris-python" | ||
| ] | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| submit_tasks.py | ||
magniloquency marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
magniloquency marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,55 @@ | ||
| """ | ||
| This example demonstrates various ways to submit tasks to a Scaler scheduler. | ||
| It shows how to use the Client to: | ||
| 1. Submit a single task using .submit() | ||
| 2. Submit multiple tasks using .map() | ||
| 3. Submit tasks with multiple arguments using .map() and .starmap() | ||
| """ | ||
|
|
||
| import argparse | ||
| import math | ||
|
|
||
| from scaler import Client | ||
|
|
||
|
|
||
| def square(value: int): | ||
| return value * value | ||
|
|
||
|
|
||
| def add(x: int, y: int): | ||
| return x + y | ||
|
|
||
|
|
||
| def main(): | ||
| parser = argparse.ArgumentParser(description="Submit tasks to a Scaler scheduler.") | ||
| parser.add_argument("url", help="The URL of the Scaler scheduler (e.g., tcp://127.0.0.1:2345)") | ||
| args = parser.parse_args() | ||
|
|
||
| print(f"Connecting to scheduler at {args.url}...") | ||
|
|
||
| # Use the Client as a context manager to ensure proper cleanup | ||
| with Client(address=args.url) as client: | ||
| print("Submitting a single task using .submit()...") | ||
| future = client.submit(square, 4) | ||
| print(f"Result of square(4): {future.result()}") | ||
|
|
||
| print("\nSubmitting multiple tasks using .map()...") | ||
| # client.map() works like Python's built-in map() | ||
gxuu marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| results = client.map(math.sqrt, range(1, 6)) | ||
| print(f"Results of sqrt(1..5): {list(results)}") | ||
|
|
||
| print("\nSubmitting tasks with multiple arguments using .map()...") | ||
| # You can pass multiple iterables to map() for functions with multiple arguments | ||
| results_add = client.map(add, [1, 2, 3], [10, 20, 30]) | ||
| print(f"Results of add([1,2,3], [10,20,30]): {list(results_add)}") | ||
|
|
||
| print("\nSubmitting tasks with multiple arguments using .starmap()...") | ||
| # starmap() takes an iterable of argument tuples | ||
| results_starmap = client.starmap(add, [(5, 5), (10, 10)]) | ||
| print(f"Results of starmap(add, [(5,5), (10,10)]): {list(results_starmap)}") | ||
|
|
||
| print("\nAll tasks completed successfully.") | ||
|
|
||
|
|
||
| if __name__ == "__main__": | ||
| main() | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.