Evo Flink Session Job logo

Evo Flink Session Job

Community
Zhang-Henry
evo-flink-session-job

Implement a Flink streaming job that analyzes Google cluster trace data to find the longest session (stage) of task SUBMIT events per finished job. Use when the task involves Flink session windows on cluster trace task/job events, session gap detection, or counting events in session windows keyed by job ID.

Overview

PublisherZhang-Henry
RepositoryCoEvoSkills
Skill nameevo-flink-session-job
Stars
83
Forks
9
Bundled files
3
LicenseApache-2.0
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • 3 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by Zhang-Henry on GitHub. Read the source before you install it.

Installation

Install the Evo Flink Session Job AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/Zhang-Henry/CoEvoSkills/tree/main/artifacts/skills/flink-query/evo-flink-session-job
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/Zhang-Henry/CoEvoSkills.git /tmp/CoEvoSkills
mkdir -p .claude/skills
cp -r /tmp/CoEvoSkills/artifacts/skills/flink-query/evo-flink-session-job .claude/skills/evo-flink-session-job
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Evo Flink Session Job in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Evo Flink Session Job on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Evo Flink Session Job is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

Flink Longest Session Per Job

This skill implements a Flink streaming job that:

  1. Reads Google cluster trace task events and job events from gzipped CSV files
  2. Filters task SUBMIT events (eventType=0)
  3. Groups by jobId and applies EventTimeSessionWindows with a configurable gap (default 10 minutes)
  4. Counts tasks per session window per job
  5. Finds the session with the maximum task count per job
  6. Only outputs results for jobs that have FINISH events (eventType=4)
  7. Output format: (jobId,maxTaskCount) one per line

Key Technical Details

Data Schema (Google Cluster Trace)

Task Events CSV columns: timestamp, missingInfo, jobId, taskIndex, machineId, eventType, user, schedulingClass, priority, cpuRequest, memoryRequest, diskSpaceRequest, differentMachinesRestriction

Job Events CSV columns: timestamp, missingInfo, jobId, eventType, user, schedulingClass, jobName, logicalJobName

Event Types: 0=SUBMIT, 1=SCHEDULE, 2=EVICT, 3=FAIL, 4=FINISH, 5=KILL, 6=LOST, 7=UPDATE_PENDING, 8=UPDATE_RUNNING

Timestamp Handling

  • Dataset timestamps are in microseconds
  • Flink event time uses milliseconds
  • Convert: event.timestamp / 1000

Session Window Strategy

  • A "stage" is a period of SUBMIT events close together in event time
  • Gap of 10 minutes (600 seconds) with no SUBMIT events ends a stage
  • Uses EventTimeSessionWindows.withGap(Time.seconds(600))
  • Each resubmission of a task counts separately

Join Strategy

  • Uses KeyedCoProcessFunction to join session counts with job finish events
  • Registers event-time timer at Long.MAX_VALUE - 1 to emit final results
  • For bounded streams, this timer fires when the watermark reaches MAX_VALUE at stream end
  • Only emits for jobs where both session counts AND finish event exist

Project Structure

workspace/
  pom.xml                    # Do not modify
  src/main/java/clusterdata/
    datatypes/
      TaskEvent.java         # Generated by skill
      JobEvent.java          # Generated by skill
    query/
      LongestSessionPerJob.java  # Generated by skill
    utils/
      AppBase.java           # Provided skeleton

End-to-End Usage

python
import sys
import os

# Add skill scripts to path
sys.path.insert(0, '/app/environment/skills/evo-flink-session-job/scripts')

from generate_java_sources import write_java_sources
from build_and_run import run_end_to_end
from validate_output import validate_output_format, validate_against_data

# Configuration - adapt these paths to your environment
workspace_dir = '/app/workspace'
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_path = '/app/workspace/output.txt'

# Run end-to-end
run_end_to_end(workspace_dir, task_input, job_input, output_path)

# Validate output format
result = validate_output_format(output_path)
assert result['valid'], f"Output format invalid: {result['errors']}"

# Cross-validate against input data
result2 = validate_against_data(output_path, task_input, job_input)
assert result2['valid'], f"Cross-validation failed: {result2['errors']}"

print(f"SUCCESS: {result['line_count']} jobs output")

Individual Function Usage

Generate Java Sources Only

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

Build Only

python
import sys
sys.path.insert(0, '/app/environment/skills/evo-flink-session-job/scripts')
from build_and_run import build_maven_project
jar_path = build_maven_project('/app/workspace')

Validate Only

python
import sys
sys.path.insert(0, '/app/environment/skills/evo-flink-session-job/scripts')
from validate_output import validate_output_format, validate_against_data
result = validate_output_format('/app/workspace/output.txt')

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Evo Flink Session Job AI skill do?

Implement a Flink streaming job that analyzes Google cluster trace data to find the longest session (stage) of task SUBMIT events per finished job. Use when the task involves Flink session windows on cluster trace task/job events, session gap detection, or counting events in session windows keyed by job ID.

Why use Evo Flink Session Job on TypingMind?

Because you install it once and use it with any model. Evo Flink Session Job is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Evo Flink Session Job in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/Zhang-Henry/CoEvoSkills/tree/main/artifacts/skills/flink-query/evo-flink-session-job. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Evo Flink Session Job?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Evo Flink Session Job?

As many as you like. As long as a model supports skills, you can use Evo Flink Session Job with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Evo Flink Session Job AI skill free?

Yes. It is published on GitHub by Zhang-Henry under the Apache-2.0 license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇