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

Added best practices for CI/CD #5875

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

neelshah2409
Copy link

Tracking issue

Closes #4685

Why are the changes needed?

  • Added some of the best practices for CI/CD

Check all the applicable boxes

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

Copy link

welcome bot commented Oct 21, 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).

@@ -365,6 +365,15 @@ two GitHub actions that facilitates this:
of Flyte packages, for example, the `.tgz` archives that are created by
`pyflyte package`.

## Some of the best practices for CI/CD
Copy link
Contributor

Choose a reason for hiding this comment

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

It's important to add a disclaimer-like intro. Something like " In case your development process registers Flyte workflows on each commit, consider the following recommendations" or something along these lines. We don't want users to infer that this is the only way of doing CI/CD with Flyte.

Copy link
Author

Choose a reason for hiding this comment

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

updated it

- **Employ a standard naming scheme for the main and released versions** : This will provide uniformity and clarity. For example, main-<short-commit-hash> for the main version and <version-number> for the released versions.
- **Automate the process of deployment and build** : The consistent and dependable building and pushing of the Docker image and the registration of the Flyte processes are guaranteed by automating the build and deployment process.
- **Adapt the registration domain to the commit type** : Workflows are registered in the appropriate environment when the registration domain is modified according to the kind of commit (feature branch, main, or released version).
- **Adopt a uniform strategy for registration and serialization** : Flyte workflows are serialized and registered using a defined process, which guarantees consistent and dependable workflow registration.
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think this one is clear enough. Maybe we can replace this with a reference to the Registration patterns section

Copy link
Author

Choose a reason for hiding this comment

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

Added some examples for it with reference to Flyte workflow.

Copy link

codecov bot commented Oct 21, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 36.71%. Comparing base (bdaf79f) to head (ff79dcc).
Report is 3 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #5875   +/-   ##
=======================================
  Coverage   36.71%   36.71%           
=======================================
  Files        1304     1304           
  Lines      130081   130081           
=======================================
  Hits        47764    47764           
  Misses      78147    78147           
  Partials     4170     4170           
Flag Coverage Δ
unittests-datacatalog 51.58% <ø> (ø)
unittests-flyteadmin 54.41% <ø> (ø)
unittests-flytecopilot 11.73% <ø> (ø)
unittests-flytectl 62.40% <ø> (ø)
unittests-flyteidl 6.89% <ø> (ø)
unittests-flyteplugins 53.62% <ø> (ø)
unittests-flytepropeller 42.84% <ø> (ø)
unittests-flytestdlib 54.78% <ø> (ø)

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.

@neelshah2409
Copy link
Author

@davidmirror-ops please review the PR.

- **Using a consistent versioning strategy**: Use a consistent versioning strategy across different types of commits (feature branches, main, released versions) to ensure that versions are unique and identifiable.
- **Use a combination of branch name and commit hash for versioning** : Using a combination of branch name and short commit hash (e.g. <branch-name>-<short-commit-hash>) provides a unique and descriptive version identifier for feature branches.
- **Employ a standard naming scheme for the main and released versions** : This will provide uniformity and clarity. For example, main-<short-commit-hash> for the main version and <version-number> for the released versions.
- **Automate the process of deployment and build** : The consistent and dependable building and pushing of the Docker image and the registration of the Flyte processes are guaranteed by automating the build and deployment process.
- **Automate the process of deployment and build** : The consistent and dependable building and pushing of the Docker image and the registration of the Flyte processes are guaranteed by automating the build and deployment process.For example, you can use a GitHub Actions workflow to automate the build and deployment process.
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this is too opinionated and not part of the thread that motivated the original issue.

For example, the flytectl register action we typically use in examples (https://github.com/unionai-oss/flyte-register-action?tab=readme-ov-file#flyte-register-action) follows a different process and most likely every organization will have a different CI/CD system, not even mentioning a different GH Actions setup (if they happen to use GHA).

- **Adapt the registration domain to the commit type** : Workflows are registered in the appropriate environment when the registration domain is modified according to the kind of commit (feature branch, main, or released version).
- **Adopt a uniform strategy for registration and serialization** : Flyte workflows are serialized and registered using a defined process, which guarantees consistent and dependable workflow registration.
- **Adopt a uniform strategy for registration and serialization** : Flyte workflows are serialized and registered using a defined process, which guarantees consistent and dependable workflow registration.For example, you can use the flyte register command to register workflows, and use a consistent naming convention for workflow versions.
Copy link
Contributor

Choose a reason for hiding this comment

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

I'd refer here to the Registration patterns documentation that provides greater detail on it.

- **Adopt a uniform strategy for registration and serialization** : Flyte workflows are serialized and registered using a defined process, which guarantees consistent and dependable workflow registration.
- **Adopt a uniform strategy for registration and serialization** : Flyte workflows are serialized and registered using a defined process, which guarantees consistent and dependable workflow registration.For example, you can use the flyte register command to register workflows, and use a consistent naming convention for workflow versions.
```
import flyte
Copy link
Contributor

Choose a reason for hiding this comment

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

Not sure this is a known pattern

@davidmirror-ops
Copy link
Contributor

@neelshah2409 could you take a look at the comments I left?

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.

[Docs] document ci/cd best practices
2 participants