Skip to content

Commit

Permalink
add readme for worker system
Browse files Browse the repository at this point in the history
  • Loading branch information
favyen2 committed Dec 19, 2024
1 parent 9f94514 commit 0f1a7db
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 315 deletions.
27 changes: 27 additions & 0 deletions rslp/common/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
This contains infrastructure intended to be shared across several rslp projects.


Worker
------

`worker.py` provides a system for launching Beaker jobs that run workers to execute
tasks from a queue.

Each task specifies an rslp project, pipeline (workflow), and arguments to pass to the
pipeline. The queue is implemented with Google Cloud Pub/Sub.

First create the topic and subscription via CLI:

gcloud pubsub topics create --project skylight-proto-1 rslp-job-queue-YOURNAME
gcloud pubsub subscriptions create --project skylight-proto-1 rslp-job-queue-YOURNAME-sub --topic rslp-job-queue-YOURNAME

You will then need to write code that writes tasks to the topic.
See `satlas/write_jobs.py` for an example of this.

Then you can launch the worker. To test on one machine:

python -m rslp.main common worker skylight-proto-1 rslp-job-queue-YOURNAME-sub

And to launch 100 workers on Beaker:

python -m rslp.main common launch skylight-proto-1 rslp-job-queue-YOURNAME-sub 100 --gpus 1 --shared_memory 256GiB
2 changes: 1 addition & 1 deletion rslp/satlas/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@
- Tree cover
"""

from .job_launcher_worker import write_jobs, write_jobs_for_year_months
from .postprocess import merge_points, smooth_points
from .predict_pipeline import predict_multi, predict_pipeline
from .publish import publish_points
from .write_jobs import write_jobs, write_jobs_for_year_months

workflows = {
"predict": predict_pipeline,
Expand Down
314 changes: 0 additions & 314 deletions rslp/satlas/job_launcher.py

This file was deleted.

File renamed without changes.

0 comments on commit 0f1a7db

Please sign in to comment.