Skip to content

Auto Submission Of Flink Job#156

Open
prashanthShiksha wants to merge 1 commit intoELEVATE-Project:release-3.1.0from
prashanthShiksha:autosubmission-release-3.1.0
Open

Auto Submission Of Flink Job#156
prashanthShiksha wants to merge 1 commit intoELEVATE-Project:release-3.1.0from
prashanthShiksha:autosubmission-release-3.1.0

Conversation

@prashanthShiksha
Copy link
Contributor

@prashanthShiksha prashanthShiksha commented Jan 19, 2026

Summary by CodeRabbit

  • Chores
    • Enhanced Docker setup with improved JobManager initialization process for better container reliability.
    • Pinned elevate-data image to specific version (v3.1.0) for consistent deployments.
    • Streamlined container configuration and volume mounting structure.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link

coderabbitai bot commented Jan 19, 2026

📝 Walkthrough

Walkthrough

The changes modify Docker Compose configuration to use a new entrypoint script for the jobmanager container that orchestrates service startup and job submission. The elevate-data service is simplified by pinning its image to version v3.1.0 and removing custom volume mounts and entrypoint overrides.

Changes

Cohort / File(s) Summary
JobManager Orchestration
Documentation/Docker-setup/docker-compose.yml
Updated jobmanager service to use new entrypoint script (/jobmanager-entrypoint.sh) with volume mounts for Flink job JARs and configuration files; simplified elevate-data service by removing custom entrypoint and volume overrides, pinning image to v3.1.0
Entrypoint Script
Documentation/Docker-setup/jobmanager-entrypoint.sh
New Bash script implementing JobManager lifecycle management: starts JobManager in background, polls for readiness (up to 30 iterations), submits two Flink jobs with respective JARs and configs via helper function, waits for JobManager process termination

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐰 A docker dance with care and grace,
Jobs submitted to their place,
Entrypoint scripts and startup cheer,
The JobManager holds them near—
Orchestration from a rabbit engineer! 🐇

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: automating the submission of Flink jobs via a new entrypoint script and docker-compose configuration updates.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 70.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 Fix all issues with AI agents
In `@Documentation/Docker-setup/docker-compose.yml`:
- Around line 48-55: The docker-compose command references
/jobmanager-entrypoint.sh which may not be executable when bind-mounted; either
ensure the repository's Documentation/Docker-setup/jobmanager-entrypoint.sh has
executable mode set in git (chmod +x and commit) or change the service command
to invoke the script via an explicit shell (e.g., bash
/jobmanager-entrypoint.sh) so container startup doesn't fail; update the command
entry for the jobmanager service accordingly and verify the tracked file mode
for jobmanager-entrypoint.sh.

In `@Documentation/Docker-setup/jobmanager-entrypoint.sh`:
- Around line 10-20: Remove the duplicate "Waiting for JobManager to be
ready..." echo and make the readiness loop deterministic by adding an explicit
timeout failure path: keep the for loop that checks /dev/tcp on port 8081, but
after the loop verify whether the service became ready (i.e., whether
"JobManager is up!" was reached) and if not print a clear error like "JobManager
failed to become ready after timeout" and exit with a non-zero status (exit 1)
so callers can detect failure; update the loop messages accordingly so only one
initial waiting message exists and a success or failure message is printed.

Comment on lines +48 to +55
command: /jobmanager-entrypoint.sh
environment:
- |
FLINK_PROPERTIES=
jobmanager.rpc.address: jobmanager
volumes:
- ./Documentation/Docker-setup/jobmanager-entrypoint.sh:/jobmanager-entrypoint.sh
- ./stream-jobs/combined-stream-processor/target/combined-stream-processor-1.0.0.jar:/job-jars/combined-stream-processor-1.0.0.jar
Copy link

@coderabbitai coderabbitai bot Jan 19, 2026

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

Ensure the entrypoint script is executable (or invoke via bash).

When bind-mounting a script, host file permissions apply. If the script isn’t executable, the container fails to start. To make this robust, either ensure the file mode is executable in the repo or invoke it via bash.

🔧 Safer command form
-    command: /jobmanager-entrypoint.sh
+    command: ["bash", "/jobmanager-entrypoint.sh"]

Please verify the file mode in the repo:

#!/bin/bash
# Check tracked file mode and current permissions
git ls-files -s Documentation/Docker-setup/jobmanager-entrypoint.sh
stat -c '%a %n' Documentation/Docker-setup/jobmanager-entrypoint.sh
🤖 Prompt for AI Agents
In `@Documentation/Docker-setup/docker-compose.yml` around lines 48 - 55, The
docker-compose command references /jobmanager-entrypoint.sh which may not be
executable when bind-mounted; either ensure the repository's
Documentation/Docker-setup/jobmanager-entrypoint.sh has executable mode set in
git (chmod +x and commit) or change the service command to invoke the script via
an explicit shell (e.g., bash /jobmanager-entrypoint.sh) so container startup
doesn't fail; update the command entry for the jobmanager service accordingly
and verify the tracked file mode for jobmanager-entrypoint.sh.

Copy link
Collaborator

Choose a reason for hiding this comment

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

@prashanthShiksha - Change the file mode to executable

Copy link

Choose a reason for hiding this comment

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

Seems like the humans are having a chat. I'll hop back into my burrow for now. If you need me again, just tag @coderabbitai in a new comment, and I'll come hopping out!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes it is executable .
-rwxrwxr-x 1 user2 user2 1614 Jan 19 19:19 jobmanager-entrypoint.sh

Comment on lines +10 to +20
echo "Waiting for JobManager to be ready..."
# Wait for JobManager to be ready
echo "Waiting for JobManager to be ready..."
for i in {1..30}; do
if (echo > /dev/tcp/localhost/8081) >/dev/null 2>&1; then
echo "JobManager is up!"
break
fi
echo "Waiting..."
sleep 2
done
Copy link

@coderabbitai coderabbitai bot Jan 19, 2026

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Handle readiness timeout (and remove the duplicate log line).

Line 10 and Line 12 print the same message, and the loop proceeds even if JobManager never becomes ready. Add an explicit timeout check so failures are clear and deterministic.

💡 Proposed fix
-# Wait for JobManager to be ready
-echo "Waiting for JobManager to be ready..."
-# Wait for JobManager to be ready
-echo "Waiting for JobManager to be ready..."
-for i in {1..30}; do
+echo "Waiting for JobManager to be ready..."
+ready=false
+for i in {1..30}; do
     if (echo > /dev/tcp/localhost/8081) >/dev/null 2>&1; then
         echo "JobManager is up!"
+        ready=true
         break
     fi
-    echo "Waiting..."
+    echo "Waiting... ($i/30)"
     sleep 2
 done
+if [ "$ready" != "true" ]; then
+    echo "JobManager did not become ready after 60s; exiting."
+    kill "$JM_PID" || true
+    exit 1
+fi
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
echo "Waiting for JobManager to be ready..."
# Wait for JobManager to be ready
echo "Waiting for JobManager to be ready..."
for i in {1..30}; do
if (echo > /dev/tcp/localhost/8081) >/dev/null 2>&1; then
echo "JobManager is up!"
break
fi
echo "Waiting..."
sleep 2
done
echo "Waiting for JobManager to be ready..."
ready=false
for i in {1..30}; do
if (echo > /dev/tcp/localhost/8081) >/dev/null 2>&1; then
echo "JobManager is up!"
ready=true
break
fi
echo "Waiting... ($i/30)"
sleep 2
done
if [ "$ready" != "true" ]; then
echo "JobManager did not become ready after 60s; exiting."
kill "$JM_PID" || true
exit 1
fi
🧰 Tools
🪛 Shellcheck (0.11.0)

[warning] 13-13: i appears unused. Verify use (or export if used externally).

(SC2034)

🤖 Prompt for AI Agents
In `@Documentation/Docker-setup/jobmanager-entrypoint.sh` around lines 10 - 20,
Remove the duplicate "Waiting for JobManager to be ready..." echo and make the
readiness loop deterministic by adding an explicit timeout failure path: keep
the for loop that checks /dev/tcp on port 8081, but after the loop verify
whether the service became ready (i.e., whether "JobManager is up!" was reached)
and if not print a clear error like "JobManager failed to become ready after
timeout" and exit with a non-zero status (exit 1) so callers can detect failure;
update the loop messages accordingly so only one initial waiting message exists
and a success or failure message is printed.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

removed the duplicate log line

Copy link

Choose a reason for hiding this comment

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

@prashanthShiksha, thank you for removing the duplicate log line!

Just a gentle reminder that the review also suggested adding explicit timeout handling after the loop to ensure the script exits with a clear error message if JobManager doesn't become ready within the 60-second window. This would make failures more deterministic and easier to debug.

@Vivek-M-08
Copy link
Collaborator

@coderabbitai review

@coderabbitai
Copy link

coderabbitai bot commented Jan 22, 2026

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

Comment on lines -159 to -160
- ./config_files/config.ini:/app/Documentation/batch-scripts/config.ini
- ./logs:/app/logs
Copy link
Collaborator

Choose a reason for hiding this comment

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

These 2 lines are required, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

added

- ./config_files/metabase-mentoring-dashboard.conf:/app/metabase-jobs/mentoring-dashboard-creator/src/main/resources/metabase-mentoring-dashboard.conf
- ./config_files/config.ini:/app/Documentation/batch-scripts/config.ini
- ./logs:/app/logs
entrypoint: ["/bin/bash", "-c", "/app/Documentation/Docker-setup/submit-jobs.sh jobmanager && sleep infinity"]
Copy link
Collaborator

Choose a reason for hiding this comment

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

Also, if we are not using submit-jobs.sh can we remove the file?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

removed

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