EMR executor market type is not validated and any value other than ON_DEMAND is treated as SPOT

Open Beginner friendly
#8,633 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
72/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
aws, java
Domain
backend, cloud

Research direction

Find the table property definition for sleeper.table.bulk.import.emr.executor.market.type and compare its validation with sleeper.default.table.bulk.import.emr.executor.market.type. Then inspect BulkImportExecutor.validateJob for platform spec overrides; add validation in both paths and confirm invalid values are rejected while ON_DEMAND and SPOT are accepted.

Written by the indexing model from the issue text.

Description

bug bulk-import-module
Description

The table property sleeper.table.bulk.import.emr.executor.market.type says the valid values are ON_DEMAND or SPOT, but it has no validation predicate. The instance property sleeper.default.table.bulk.import.emr.executor.market.type does have one. The value can also be set in the platform spec of a bulk import job, which is not validated either.

In EmrInstanceFleets we check "ON_DEMAND".equals(...) and use spot capacity otherwise, so a value like on_demand gives spot executors without any error. In EmrInstanceGroups, MarketType.fromValue turns an unknown value into UNKNOWN_TO_SDK_VERSION.

Technical Notes / Implementation Details

Add the same validation as the instance property to the table property, so that only ON_DEMAND or SPOT are accepted.
The market type can also be overridden per job in the platform spec, which doesn't go through property validation. We should also check it in BulkImportExecutor.validateJob, so a job with an invalid market type is rejected

Dominant language
Java
Stars
107
Forks
29
Avg merge
1d 33m
Merged PRs (30d)
115

Getting set up

Open in Codespaces

Starts the project's dev container in your browser, under your own GitHub account.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from gchq/sleeper

All issues in gchq/sleeper

Similar issues

More Java issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.