flux-core icon indicating copy to clipboard operation
flux-core copied to clipboard

flux-jobs: support emoji output formats

Open chu11 opened this issue 3 years ago • 22 comments

Problem: flux lacks a certain cuteness factor. This limits its potential to be liked by younger HPC users.

Solution: Support the {state_emoji}, {result_emoji}, and {status_emoji} fields, which will output the emojis representing job states or results respectively.

Fixes #4681

image

Note, while this was originally brought up as a joke in a discussion, this isn't actually that un-useful. When listing a bunch of jobs, it may be easier to visually scan for a poop instead of printed text like FAIL. So I selected emojis based on some visual "scan-ability".

Emoji alignment is difficult, but largely ignored it as it's going to be font and terminal specific.

Let the bike-shedding of emoji choices begin!

chu11 avatar Oct 13 '22 21:10 chu11

Take my money now!! :heart_eyes:

vsoch avatar Oct 13 '22 23:10 vsoch

Hotline, get ready.

User: Flux gave my job a poop emoji and I don't know why

Hotline: Hmm, your job was canceled so it should be a plucky little bomb. What sort of poop is it?

User: it has a maniacal grin

Hotline: I'm not familiar with that job result. Are you sure it wasn't exploding in some way?

User: not really

Hotline: (consults Flux documentation) Could it have been "Shocked Face with Exploding Head"? How about "Potato"?

garlick avatar Oct 14 '22 00:10 garlick

I am glad you are not using the thumbs-up emoji. On todays news: Thumbs-up emoji may hurt Gen Z! https://www.foxnews.com/lifestyle/gen-z-says-emoji-passive-aggressive-you-using-it

ELCapitanLLNL avatar Oct 14 '22 00:10 ELCapitanLLNL

Sadly, it is difficult to capture jobs stuck in the CLEAN state: https://unicode-table.com/en/1F9FB/

User: my job was stuck in the toilet paper state, then later flux said it was poop

chu11 avatar Oct 14 '22 02:10 chu11

Sadly, it is difficult to capture jobs stuck in the CLEAN state: https://unicode-table.com/en/1F9FB/

User: my job was stuck in the toilet paper state, then later flux said it was poop

Hotline: Please flux it down...

ELCapitanLLNL avatar Oct 14 '22 02:10 ELCapitanLLNL

Sadly, it is difficult to capture jobs stuck in the CLEAN state: https://unicode-table.com/en/1F9FB/

User: my job was stuck in the toilet paper state, then later flux said it was poop

🧼 or ✨ or perhaps even ❇️ might work for clean. I suppose 🧹 could too.

trws avatar Oct 14 '22 02:10 trws

I like the ✨ … Mr Clean approved!

vsoch avatar Oct 14 '22 02:10 vsoch

Oops, I really mean the "CLEANUP" state, so I think 🧼 or 🧹 seem like pretty good options. I considered 🗑 as well, but felt that was where trash goes, not the act of cleaning up.

These are critically important decisions we're making here. Gonna make sure we get this right!

chu11 avatar Oct 14 '22 03:10 chu11

🫧 or 🧽?

vsoch avatar Oct 14 '22 03:10 vsoch

I forgot about the bubbles, for cleanup based on the iOS iconography I like the soap, bubbles or broom best I think. They all look like something in active use for that purpose.


Sent from Workspace ONE Boxerhttps://whatisworkspaceone.com/boxer

On October 13, 2022 at 8:51:30 PM PDT, Vanessasaurus @.***> wrote:

🫧 or 🧽?

— Reply to this email directly, view it on GitHubhttps://urldefense.us/v3/__https://github.com/flux-framework/flux-core/pull/4687*issuecomment-1278444447__;Iw!!G2kpM7uM-TzIFchu!lq-iKCllaFzrGGSUd_gpG7grr1gTKdWbGUrQG3tqeuW7EuvuEJFCdB_J93crWJf-Xw$, or unsubscribehttps://urldefense.us/v3/__https://github.com/notifications/unsubscribe-auth/AAFBFNPEI3ZA66JRA6D5CVLWDDKD3ANCNFSM6AAAAAAREVEJQE__;!!G2kpM7uM-TzIFchu!lq-iKCllaFzrGGSUd_gpG7grr1gTKdWbGUrQG3tqeuW7EuvuEJFCdB_J93f71AcZlw$. You are receiving this because you commented.Message ID: @.***>

trws avatar Oct 14 '22 20:10 trws

ok, we'll go with broom ... mainly b/c the sponge looks like a peanut in some other font sets.

any opinions on

depend - ✋ sched - 📅 priority - 🏎

i think sched is pretty good (i tried clock but didn't like it as much), but depend and priority are meh ...

chu11 avatar Oct 14 '22 20:10 chu11

What about 🚦for priority?

lucpeterson avatar Oct 14 '22 21:10 lucpeterson

Could do ⏹️ or 🛑 for depend I guess, ⏸️ could also work unless we have a paused state?

I could see ⏸️ > 📅 > ▶️ > 🧹 > ⏹️ as a progression through the states. Has a certain internal consistency to it, though not as visually arresting as some of the options which is unfortunate.

🥇 (first place medal) could be for priority maybe?

The cancelled one likewise could be 🚫, completed and failed I think are ✅ and ❌ in ARC, but I kinda like what you chose, very whimsical.

trws avatar Oct 14 '22 21:10 trws

Oh I really like the orange - it stands out nicely.

vsoch avatar Oct 14 '22 21:10 vsoch

What about vertical_traffic_lightfor priority?

Oh I like that for priority, i.e. like "waiting for green" / "waiting to go" .... although I guess that could be for depend too.

chu11 avatar Oct 14 '22 22:10 chu11

@trws ohh pause is a good idea, i like that one for depend.

chu11 avatar Oct 14 '22 22:10 chu11

doh! the pause button displayed poorly in gnome (just two vertical bars). And for some reason, gnome is missing a chunk of emojis at the higher numbers, dunno if it was a more recent unicode addition and gnome just doesn't have in my version (which would be used by a fair amount of staff at the lab). So broom and soap didn't display.

So I went with

new -> wrapped gift (note, should be virtually impossible to ever see) depend -> stop sign (per @trws suggestion above) priority - vertical traffic light (per @lucpeterson suggestion above) cleanup - wastebasket inactive - skull

image

I've been using this dinky script to test if anyone wants to try on their terminal. flux start ./emoji.sh

(you may need to adjust the number of tasks to get both running & pending jobs on your machine)

#!/bin/sh
flux mini run /bin/true
flux mini run /bin/false
flux mini run -t=1s sleep 10
id=`flux mini submit sleep 30`
sleep 1
flux job cancel $id
flux mini submit -n 12 sleep 60
flux mini submit -n 12 sleep 60
flux mini submit -n 12 sleep 60
flux mini submit -n 12 sleep 60

flux jobs -a --format="{id:>12} {status:<10} {state_emoji:<5} {result_emoji:<6} {status_emoji:<6} {nodelist}"

chu11 avatar Oct 14 '22 23:10 chu11

(you may need to adjust the number of tasks to get both running & pending jobs on your machine)

flux jobs --from-stdin can take a list of entries on stdin so you don't have to jump through hoops to get a set of jobs in desired states or fields. This kind of testing is exactly why that option was added.

Also, I'll just mention that flux mini submit --cc=1-4 -n 12 sleep 60 is 4x faster than the serialized calls to flux mini submit in the example script.

grondo avatar Oct 14 '22 23:10 grondo

flux jobs --from-stdin can take a list of entries on stdin so you don't have to jump through hoops to get a set of jobs in desired states or fields. This kind of testing is exactly why that option was added.

Oh yeah, i totally forgot!

chu11 avatar Oct 14 '22 23:10 chu11

For the life of me I cannot get the wastebasket to align, i think its width is different than the rest:

image

#!/bin/sh
flux jobs -a --format="{id:>12} {status:<10} {state_emoji:<6} {result_emoji:<6} {status_emoji:<6} {nodelist}" --from-stdin < emojitest.txt

emojitest.txt

chu11 avatar Oct 15 '22 04:10 chu11

Yeah... It might well be, or its string width might be while its display width is the same. We would probably need ICU or similar to work it out right, which we actually have already through one of our other vendored dependencies but it's not a trivial amount of work.

Al Chu @.***> writes:

For the life of me I cannot get the wastebasket to align, i think its width is different than the rest:

image

#!/bin/sh flux jobs -a --format="{id:>12} {status:<10} {state_emoji:<6} {result_emoji:<6} {status_emoji:<6} {nodelist}" --from-stdin < emojitest.txt

emojitest.txt

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you were mentioned.

trws avatar Oct 15 '22 20:10 trws

Idea: add flux jobs -o cute support (a named format). I'm guessing there may be a user demographic that prefers emojis but eschews reading man pages? (It might include me)

garlick avatar Oct 18 '22 22:10 garlick

Idea: add flux jobs -o cute support (a named format). I'm guessing there may be a user demographic that prefers emojis but eschews reading man pages? (It might include me)

I like it! I could be the default output but with {status_emoji} instead of {status_abbrev}

chu11 avatar Oct 18 '22 23:10 chu11

re-pushed, adding --format=cute per @garlick suggestion

image

chu11 avatar Oct 19 '22 02:10 chu11

Should the heading be just ST or maybe itself an emoji?

grondo avatar Oct 19 '22 02:10 grondo

Should the heading be just ST or maybe itself an emoji?

I did "STATUS" b/c the abbreviated headings were a little narrow for potentially wide emojis.

hmmm, an emoji as a header may solve alignment. Nothing comes to mind on the emoji list, could just do a ❓

chu11 avatar Oct 19 '22 04:10 chu11

I don't think this would hurt to merge as is since it's not a default output format and discussion has tailed off - if you're ready that is. Looks like there's at least a conflict to fix up

garlick avatar Oct 24 '22 20:10 garlick

I don't think this would hurt to merge as is since it's not a default output format and discussion has tailed off - if you're ready that is. Looks like there's at least a conflict to fix up

Yup, I'm good with it, lemme fix up that conflict.

chu11 avatar Oct 24 '22 20:10 chu11

re-pushed fixing up conflict and a python isort issue that is now discovered

chu11 avatar Oct 24 '22 22:10 chu11

Codecov Report

Merging #4687 (f47fc0e) into master (b884d04) will decrease coverage by 0.89%. The diff coverage is 81.03%.

:exclamation: Current head f47fc0e differs from pull request most recent head c3c8d9c. Consider uploading reports for the commit c3c8d9c to get more accurate results

@@            Coverage Diff             @@
##           master    #4687      +/-   ##
==========================================
- Coverage   84.24%   83.35%   -0.90%     
==========================================
  Files         410      413       +3     
  Lines       61515    69664    +8149     
==========================================
+ Hits        51826    58069    +6243     
- Misses       9689    11595    +1906     
Impacted Files Coverage Δ
src/cmd/flux-jobs.py 95.52% <ø> (ø)
src/bindings/python/flux/job/info.py 87.78% <81.03%> (-1.55%) :arrow_down:
src/cmd/top/ucache.c 86.66% <0.00%> (-13.34%) :arrow_down:
src/modules/job-info/allow.c 76.66% <0.00%> (-12.70%) :arrow_down:
src/common/libzmqutil/monitor.c 80.00% <0.00%> (-11.03%) :arrow_down:
src/shell/builtins.c 91.66% <0.00%> (-8.34%) :arrow_down:
src/shell/kill.c 92.30% <0.00%> (-7.70%) :arrow_down:
src/common/libutil/timestamp.c 92.85% <0.00%> (-7.15%) :arrow_down:
src/modules/resource/acquire.c 65.04% <0.00%> (-7.05%) :arrow_down:
src/cmd/builtin/dmesg.c 87.58% <0.00%> (-6.86%) :arrow_down:
... and 331 more

codecov[bot] avatar Oct 24 '22 22:10 codecov[bot]