-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
rfc19: propose a standard (alternate) encoding for FLUIDs #255
Conversation
65de9e1
to
906cd63
Compare
Pushed a commit to update the example FLUID (to one with more human interest.) Also thinking that FSE is too close to FSD, and maybe a better name for this "standard" FLUID encoding is simply "f58". |
Fuzzbunny - Love it.! |
Yeah, who is against fuzzy bunnies? I dare you to speak up! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! :) Thanks @grondo!
Looks like the Wikipedia reference was literally just deleted. I have never seen that before (is un serendipitous a word?) Maybe drop the reference since the concept of baseN should be clear? There's also a rfc draft, but it is expired. |
Pushed a fixup commit to replace the Wikipedia reference with a reference to the Bitcoin wiki description of Base58. Honestly we could also probably drop the reference since we're just representing 64-bit integers in base58, not describing a generic binary encoding. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! Please set MWP when you're ready.
Unfortunately, once I had an implementation mostly complete, I did run into a problem with Unicode support as @SteVwonder feared. If the current locale is set to a non-UTF-8 locale, and attempt to print a jobid encoded in
It seems like this is a well known issue such that PEP 538 (coercion to UTF-8 locale) was proposed, but it seems like that PEP only made it into 3.7. Not sure if we can do a similar thing and coerce locales to a valid UTF-8. This kludge does seem to work:
Only needed in Also seems that I guess if these minor changes work around the issue in sharness, we shouldn't have troubles in various locales that might be set on production systems, but also maybe it would be safer to use ascii (Sorry for doubting you earlier @SteVwonder, this unicode thing in Python is indeed a mess!) |
I'm fine with the coersion as it seems like that's where python is heading. The unicode output looks cool and we do have a fallback plan if problems arise. |
In the implementation proposed in flux-framework/flux-core#3045, a new
E.g.: $ flux job id ƒLUX
65512
$ flux job id 0000.0000.0000.ffe8
65512
$ flux job id modular-archive-academy--academy-academy-academy
65512 Should these rules be made explicit in this RFC? Or is that overkill? Just throwing it out there. |
Yeah, that IMHO would be useful to document. |
I've pushed an update here that reworks the "Representation" section to include descriptions of all supported FLUID encodings, as well as a set of "rules" for decoding FLUID strings in supported representations. If this looks ok (might need some wordsmithing), then I can squash all the commits together. |
Nice! That works for me. Please squash and set MWP when you're ready. |
Expand the "Representation" section to detail the FLUID encodings which should be supported by a Flux instance, including the existing representations already supported: decimal, hex, dothex and "words" (mnemonic encoding). Additionally, introduce a preferred alternate encoding for FLUIDs (F58) based on Base58 (using the Bitcoin dictionary) which has been optimized for human readability by dropping similar letters and numbers. (See Bitcoin Wiki reference in the text). Add a set of "rules" that should be followed to unambiguously decode a FLUID encoded in one of the standard representations to a 64b integer.
Cast in stone! |
As discussed in flux-framework/flux-core#3038, this PR proposes a standard alternate encoding for FLUIDs, most useful in decreasing the space required for JOBID output in tools such as
flux jobs
. I figured we'd get the idea down in the RFC so we could refer to it during development (assuming there is concensus).