Skip to content

[HWORKS-3856] Run a job with resources of its own for a single execution - #838

Open
gibchikafa wants to merge 2 commits into
logicalclocks:mainfrom
gibchikafa:HWORKS-3856-execution-resources
Open

gibchikafa wants to merge 2 commits into
logicalclocks:mainfrom
gibchikafa:HWORKS-3856-execution-resources

Conversation

@gibchikafa

Copy link
Copy Markdown
Contributor

Docs for https://hopsworks.atlassian.net/browse/HWORKS-3856.

  • New guide user_guides/projects/jobs/run_with_resources.md: giving one execution different resources from the UI, the Python API, the CLI and Airflow (job_resources), and the fields each job type takes.
  • Nav entry under Jobs, and a pointer from the Airflow guide.

Goes with hopsworks-ee #3818, hopsworks-api #1482, docker-images #1261, hopsworks-front #2298 and loadtest #1315.
The API reference links (Execution.resources) resolve only once hopsworks-api #1482 is merged, so the strict build fails until then.

Not done yet: screenshots of the run dialog and of the execution details.

🤖 Generated with Claude Code

New guide for giving one execution different resources from the UI, the
Python API, the CLI and Airflow, with the fields each job type takes.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>

@jimdowling jimdowling left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review of HWORKS-3856 against the JIRA description.

  • [P2] The Airflow example passes wait_for_completion, which HopsworksLaunchOperator does not take (inline).
  • [P2] The fields table offers hopsfsMountConfig where the backend refuses it (inline).
  • [P2] The Spark example sets spark.executor.instances, which does nothing while dynamic allocation is on, the Spark default (inline).

Review: Codex deep review (built-in review, then adversarial review) plus Claude, each finding checked against the code. P0 to P2 posted; P3 nits left out.

project_id=42,
job_name="profiles_fg",
job_resources={"resourceConfig": {"memory": 16384}},
wait_for_completion=True,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[P2] HopsworksLaunchOperator takes no wait_for_completion

The provider operator imported here, hopsworks.airflow.operators, takes project_id, job_name, args, job_resources, hopsworks_url and conn_id, and hands everything else to BaseOperator (launch.py:36-47 in docker-images#1261). Airflow then rejects the DAG for the unknown argument. Drop the argument and show a HopsworksJobSuccessSensor downstream if the example should wait.

The existing example in user_guides/projects/airflow/airflow.md has the same argument and the sentence "Set wait_for_completion=True ..." next to the line this PR adds, so it is worth fixing there too.

Comment on lines +106 to +107
| Python, Jupyter Notebook, Docker, ingestion and agent jobs | `resourceConfig`: `cores`, `memory`, `gpus`, `shmSize`, `diskGb` |
| | `hopsfsMountConfig`: `memory`, `cores`, `namenodeConnections` |

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[P2] hopsfsMountConfig is refused for Docker jobs, and partly for ingestion

HopsfsMountConfigurationValidator.validateJobConfiguration refuses any hopsfsMountConfig on a Docker job ("Docker jobs do not mount HopsFS"). On a cluster without the CSI driver, it also refuses memory and cores of the mount on an ingestion job, since the mount runs inside the ingestion container. The table offers both, so a reader following it gets a 400. Put Docker on its own row with resourceConfig only, and add a note on ingestion without the CSI driver. The job.run docstring in hopsworks-api#1482 has the same list.

```python
spark_job = project.get_job_api().get_job("my_spark_job")
execution = spark_job.run(
resources={"spark.executor.memory": 16384, "spark.executor.instances": 8}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[P2] spark.executor.instances does nothing while dynamic allocation is on

A Spark job's configuration defaults to spark.dynamicAllocation.enabled: true (SparkJobConfiguration.java:104-105 in hopsworks-ee). With it on, the launcher sizes executors from spark.dynamicAllocation.* and ignores spark.executor.instances (SparkConfigurationUtil.java:160 vs :214). Outside Kueue this example runs with the job's executor count, not 8.

Either add "spark.dynamicAllocation.enabled": False to the example, or use spark.dynamicAllocation.maxExecutors, and say that spark.executor.instances applies to static allocation (which every Spark job uses under Kueue). The same example is in the job.run docstring of hopsworks-api#1482.

…ocker takes no mount, Spark executors under dynamic allocation

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@gibchikafa
gibchikafa marked this pull request as ready for review November 23, 2026 13:31

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants