Evo flink session job

From OpenLAIR/OpenSkill · View interactive version

Evo flink session job is an AI agent skill from the GitHub repository OpenLAIR/OpenSkill. Implement Flink jobs for Google Cluster Data analysis, specifically session-based analysis of task events. Handles parsing Google Cluster Data v2 CSV formats, session window computation on task SUBMIT events, and job completion filtering. Use for any task involving Flink + Google cluster trace data

How to use this skill

Skill file

Flink Session Job for Google Cluster Data

Overview

This skill implements a Flink job that processes Google Cluster Data v2 traces to find the longest stage (session of SUBMIT events) per finished job.

Key Concepts

Google Cluster Data v2 Schema

Task Events CSV (13 columns):

timestamp, missing_info, job_id, task_index, machine_id, event_type, user, scheduling_class, priority, cpu_request, memory_request, disk_request, different_machines_constraint

Job Events CSV (8 columns):

timestamp, missing_info, job_id, event_type, user, scheduling_class, job_name, logical_job_name

Event Types:

Timestamps are in microseconds.

Session/Stage Logic

Files

templates/

scripts/

Usage

import sys
sys.path.insert(0, '/app/environment/skills/evo-flink-session-job/scripts')
from generate_java import generate_all
generate_all('/app/workspace')

Build & Run

# Build
cd /app/workspace && mvn clean package -q

# Start Flink cluster
/opt/flink/bin/start-cluster.sh

# Run job
/opt/flink/bin/flink run /app/workspace/target/LongestSessionPerJob-jar-with-dependencies.jar \
  --task_input /app/workspace/data/task_events/part-00001-of-00500.csv.gz \
  --job_input /app/workspace/data/job_events/part-00001-of-00500.csv.gz \
  --output /app/workspace/output.txt

Implementation Notes

  1. The job reads gzipped CSV files directly using Java's GZIPInputStream
  2. Job events are read first to identify finished jobs (event_type=4)
  3. Task events are then filtered for SUBMIT events of finished jobs only
  4. Timestamps are sorted per job, and sessions are identified by gaps >= threshold
  5. The session gap comparison uses strict less-than (<) for same-session membership,

matching Flink's session window semantics

  1. Output is written directly to a file using PrintWriter
  2. The skeleton's env.execute() is not called since processing is done in main()

Troubleshooting

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.