Skip to content
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

Improve execution name readability #5637

Merged
merged 28 commits into from
Aug 30, 2024

Conversation

wayner0628
Copy link
Contributor

@wayner0628 wayner0628 commented Aug 6, 2024

Tracking issue

Why are the changes needed?

  • Improve execution name readability

What changes were proposed in this pull request?

How was this patch tested?

unit testing and integration testing

Setup process

To enable human-readable execution names, add the following configuration:

flyteadmin:
  featureGates:
    enableFriendlyNames: true

Screenshots

Screenshot 2024-08-11 at 9 55 04 PM

Check all the applicable boxes

  • I updated the documentation accordingly.
  • All new and existing tests passed.
  • All commits are signed-off.

Related PRs

flyteorg/flytekit#2678

Docs link

Signed-off-by: wayner0628 <a901639@gmail.com>
Signed-off-by: wayner0628 <a901639@gmail.com>
Signed-off-by: wayner0628 <a901639@gmail.com>
Signed-off-by: wayner0628 <a901639@gmail.com>
Copy link

welcome bot commented Aug 6, 2024

Thank you for opening this pull request! 🙌

These tips will help get your PR across the finish line:

  • Most of the repos have a PR template; if not, fill it out to the best of your knowledge.
  • Sign off your commits (Reference: DCO Guide).

Signed-off-by: wayner0628 <a901639@gmail.com>
Copy link

codecov bot commented Aug 6, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 36.17%. Comparing base (5c147ef) to head (f2b7b7f).
Report is 5 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #5637      +/-   ##
==========================================
- Coverage   36.17%   36.17%   -0.01%     
==========================================
  Files        1302     1303       +1     
  Lines      109614   109611       -3     
==========================================
- Hits        39653    39649       -4     
- Misses      65816    65819       +3     
+ Partials     4145     4143       -2     
Flag Coverage Δ
unittests-datacatalog 51.37% <ø> (ø)
unittests-flyteadmin 55.28% <100.00%> (-0.02%) ⬇️
unittests-flytecopilot 12.17% <ø> (ø)
unittests-flytectl 62.18% <ø> (ø)
unittests-flyteidl 7.12% <ø> (ø)
unittests-flyteplugins 53.34% <ø> (ø)
unittests-flytepropeller 41.71% <ø> (ø)
unittests-flytestdlib 55.35% <ø> (+0.02%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Signed-off-by: wayner0628 <a901639@gmail.com>
Signed-off-by: wayner0628 <a901639@gmail.com>
Signed-off-by: wayner0628 <a901639@gmail.com>
Signed-off-by: wayner0628 <a901639@gmail.com>
Signed-off-by: wayner0628 <a901639@gmail.com>
Signed-off-by: wayner0628 <a901639@gmail.com>
@wayner0628 wayner0628 marked this pull request as ready for review August 11, 2024 14:00
@wayner0628 wayner0628 changed the title Create exec id through humanhash Improve execution name readability Aug 11, 2024
flytectl/go.mod Outdated
@@ -15,6 +15,7 @@ require (
github.com/docker/docker v26.1.5+incompatible
github.com/docker/go-connections v0.4.0
github.com/enescakir/emoji v1.0.0
github.com/flyteorg/flyte/flyteadmin v0.0.0-00010101000000-000000000000
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should not import flyteadmin here

flytectl/cmd/create/execution_util.go Outdated Show resolved Hide resolved
flyteadmin/pkg/common/executions.go Outdated Show resolved Hide resolved
Signed-off-by: wayner0628 <a901639@gmail.com>
Signed-off-by: wayner0628 <a901639@gmail.com>
Signed-off-by: wayner0628 <a901639@gmail.com>
Signed-off-by: wayner0628 <a901639@gmail.com>
Signed-off-by: wayner0628 <a901639@gmail.com>
Signed-off-by: wayner0628 <a901639@gmail.com>
Signed-off-by: wayner0628 <a901639@gmail.com>
flyteadmin/go.mod Outdated Show resolved Hide resolved
flyteadmin/pkg/async/schedule/aws/workflow_executor.go Outdated Show resolved Hide resolved
flyteadmin/pkg/async/schedule/aws/workflow_executor.go Outdated Show resolved Hide resolved
flyteadmin/pkg/common/executions.go Outdated Show resolved Hide resolved
flyteadmin/pkg/manager/impl/util/shared.go Outdated Show resolved Hide resolved
Comment on lines 71 to 81
executionName := ""
config := runtime.NewApplicationConfigurationProvider()
if config.GetTopLevelConfig().FeatureGates.EnableHumanHash {
executionName, err = common.GetExecutionName(time.Now().UnixNano(), config.GetTopLevelConfig().FeatureGates.EnableHumanHash)
if err != nil {
logger.Errorf(ctx, "failed to generate execution name for schedule %+v due to %v", s, err)
return err
}
} else {
executionName = "f" + strings.ReplaceAll(executionIdentifier.String(), "-", "")[:19]
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are friendly names important for scheduled executions?

Signed-off-by: wayner0628 <a901639@gmail.com>
Signed-off-by: wayner0628 <a901639@gmail.com>
Signed-off-by: wayner0628 <a901639@gmail.com>
Signed-off-by: wayner0628 <a901639@gmail.com>
@wayner0628
Copy link
Contributor Author

Hello @pingsutw @eapolinario,

I've made the following changes based on your feedback:

  1. Removed all unnecessary error handlers.
  2. Added a comment explaining why errors in humanhash generation can be safely ignored.
  3. Updated the humanhash package version to v1.1.0.
  4. Renamed the configuration setting to EnableFriendlyNames.
  5. Extend the name to 4 subwords.
  6. Now reading the config directly within the getExecutionName function, and adjusted the file path accordingly.
  7. Updated the unit tests to use mocking objects, as the config is now read within the function.

Please review these changes and let me know if you have any suggestions or concerns.

Thank you!

Signed-off-by: wayner0628 <a901639@gmail.com>
@wayner0628
Copy link
Contributor Author

Hi @pingsutw @eapolinario,

I've thoroughly investigated the issue but couldn't find any connection between my changes and the CI unit test failure. Additionally, there are no error messages logged that could provide further insight. Could you please help retrigger the CI build? Thank you!

Signed-off-by: Kevin Su <pingsutw@apache.org>
Signed-off-by: Kevin Su <pingsutw@apache.org>
Signed-off-by: Kevin Su <pingsutw@apache.org>
Signed-off-by: Kevin Su <pingsutw@apache.org>
Copy link
Member

@pingsutw pingsutw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just reverted the flytectl changes. It seems like we can't change that in the same PR. You could create a follow-up PR to update flytectl.

@wayner0628
Copy link
Contributor Author

I just reverted the flytectl changes. It seems like we can't change that in the same PR. You could create a follow-up PR to update flytectl.

I noticed some issues still persist, so I'll continue checking them.

@pingsutw pingsutw merged commit 2ed2408 into flyteorg:master Aug 30, 2024
50 checks passed
Copy link

welcome bot commented Aug 30, 2024

Congrats on merging your first pull request! 🎉

@wayner0628 wayner0628 deleted the feature/humanhash-execution-id branch August 31, 2024 15:18
@ddl-ebrown
Copy link
Contributor

ddl-ebrown commented Sep 3, 2024

FYI - we implemented something similar in our custom auth gateway, as we weren't sure if this would be something Flyte would use.

A few differences with our implementation:

  • We use https://github.com/dustinkirkland/golang-petname for the names
  • To create enough uniqueness, we use 3 terms PLUS a 4 character suffix (we wanted execution names to be unique across all of Flyte, not just within a specific project / domain). The suffix is produced using https://github.com/matoous/go-nanoid
    • Humanhash looks to be using a similar or the same word list as golang-petname. 3 words in golang-petname is about 53 million combinations, which we didn't think was enough uniqueness. With the 4 character suffix, we end up with about 89 trillion combinations.

We would consider removing our implementation in favor of upstream if we can get a better uniqueness guarantee. Would you be willing to modify the friendly naming here to support that?

We get names like hardly-maximum-sculpin-rax1, commonly-maximum-narwhal-jubn, officially-pure-alien-tm9a , etc

@pingsutw
Copy link
Member

pingsutw commented Sep 3, 2024

@ddl-ebrown, we could make suffix opt-in. Need to add one more field to the config map. something like

flyteadmin
  featureGates:
    enableFriendlyNames: true
  execution_name_with_random_suffix: true

Feel free to open a PR!

@kumare3
Copy link
Contributor

kumare3 commented Sep 5, 2024

This is pretty cool - cc @katrogan

pmahindrakar-oss pushed a commit that referenced this pull request Sep 9, 2024
Signed-off-by: wayner0628 <a901639@gmail.com>
Signed-off-by: Kevin Su <pingsutw@apache.org>
Co-authored-by: Kevin Su <pingsutw@apache.org>
Signed-off-by: pmahindrakar-oss <prafulla.mahindrakar@gmail.com>
pmahindrakar-oss pushed a commit that referenced this pull request Sep 9, 2024
Signed-off-by: wayner0628 <a901639@gmail.com>
Signed-off-by: Kevin Su <pingsutw@apache.org>
Co-authored-by: Kevin Su <pingsutw@apache.org>
Signed-off-by: pmahindrakar-oss <prafulla.mahindrakar@gmail.com>
pingsutw added a commit that referenced this pull request Sep 11, 2024
bgedik pushed a commit to bgedik/flyte that referenced this pull request Sep 12, 2024
Signed-off-by: wayner0628 <a901639@gmail.com>
Signed-off-by: Kevin Su <pingsutw@apache.org>
Co-authored-by: Kevin Su <pingsutw@apache.org>
Signed-off-by: Bugra Gedik <bgedik@gmail.com>
eapolinario pushed a commit that referenced this pull request Sep 26, 2024
* Revert "fix: Use deterministic execution names in scheduler (#5724)"

This reverts commit a058fd1.

* Revert "Improve execution name readability (#5637)"

This reverts commit 2ed2408.

* nit

Signed-off-by: Kevin Su <pingsutw@apache.org>

* make helm

Signed-off-by: Kevin Su <pingsutw@apache.org>

---------

Signed-off-by: Kevin Su <pingsutw@apache.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants