beacon-biosignals / julia_pod

k8s native julia development
MIT License
10 stars 3 forks source link

truncate RUNIDs to 44 chars before adding time and random hex #51

Closed kleinschmidt closed 2 years ago

kleinschmidt commented 2 years ago

This PR is one possible fix for #50: before adding the datetime stamp (which adds 12 characters, -dddHHhMMmSS) and the random hex (7 characters, -XXXXXX), this truncates the RUNID to be at most 44 characters so that the job name will always be 63 characters or fewer (44 + 12 + 7).

IIUC, this should still be compatible with things like K8sClusterManagers.jl which use generateName since that does its own truncation.

kleinschmidt commented 2 years ago

Wouldn't it be better to cut -c 1-44 after the sed, since the sed can contract the RUNID by replacing several contiguous non-alphanumeric chars with a single '-'?

good catch, I'd overlooked that.