Skip to content

Commit

Permalink
Use spot instances for PRs (#457)
Browse files Browse the repository at this point in the history
  • Loading branch information
bhearsum authored Feb 23, 2024
1 parent 3f135aa commit 9ae9d9a
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 3 deletions.
5 changes: 4 additions & 1 deletion taskcluster/kinds/train-backwards/kind.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,10 @@ tasks:
- dependencies
- attributes
- run.command
worker-type: b-largegpu-largedisk-standard
worker-type:
by-tasks-for:
github-pull-request: b-largegpu
default: b-largegpu-largedisk-standard
worker:
max-run-time: 2592000
env:
Expand Down
5 changes: 4 additions & 1 deletion taskcluster/kinds/train-student/kind.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,10 @@ tasks:
- pipeline/train/train.sh
from-parameters:
marian_args: training_config.marian-args.training-student
worker-type: b-largegpu-xlargedisk-standard
worker-type:
by-tasks-for:
github-pull-request: b-largegpu-largedisk
default: b-largegpu-xlargedisk-standard
worker:
max-run-time: 2592000
env:
Expand Down
5 changes: 4 additions & 1 deletion taskcluster/kinds/train-teacher/kind.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,10 @@ tasks:
marian_args: training_config.marian-args.training-teacher
teacher-ensemble: training_config.experiment.teacher-ensemble
pretrained_teacher: training_config.experiment.pretrained-models.train-teacher
worker-type: b-largegpu-xlargedisk-standard
worker-type:
by-tasks-for:
github-pull-request: b-largegpu
default: b-largegpu-xlargedisk-standard
worker:
max-run-time: 2592000
env:
Expand Down
14 changes: 14 additions & 0 deletions taskcluster/translations_taskgraph/transforms/worker_env.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,24 @@
# runtime, or adjust in kinds when changing worker types.

from taskgraph.transforms.base import TransformSequence
from taskgraph.util.schema import resolve_keyed_by

transforms = TransformSequence()


@transforms.add
def evaluate_keyed_by(config, jobs):
for job in jobs:
resolve_keyed_by(
job,
"worker-type",
item_name=job["description"],
**{"tasks-for": config.params["tasks_for"]},
)

yield job


@transforms.add
def inject_worker_env(config, jobs):
for job in jobs:
Expand Down

0 comments on commit 9ae9d9a

Please sign in to comment.