-
Notifications
You must be signed in to change notification settings - Fork 674
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
Updated fast register instructions for native typing flytekit #678
Merged
wild-endeavor
merged 1 commit into
flyteorg:master
from
nuclyde-io:fast-register-new-flyte
Jan 27, 2021
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,10 +9,67 @@ Fast Registration | |
Are you frustrated by having to wait for an image build in order to test out simple code changes to your Flyte workflows? If you're interested in reducing to your iteration cycle to mere seconds, read on below. | ||
|
||
Caveats | ||
####### | ||
======= | ||
|
||
Fast-registration only works when you're testing out code changes. If you need to update your container, say by installing a dependency or modifying a Dockerfile, you **must** use the conventional method of committing your changes and rebuilding a container image. | ||
|
||
Prerequisites | ||
============= | ||
|
||
* Upgrade your flytekit dependency to ``>=0.16.0`` and re-run piptools if necessary | ||
|
||
|
||
You'll need to build a base image with these changes incorporated before you can use fast registration. | ||
|
||
|
||
Fast-registering | ||
================ | ||
|
||
How-to: | ||
|
||
* After the above prerequisite changes are merged, pull the latest master and create a development branch on your local machine. | ||
* Make some code changes. Save your files. | ||
* Clear and/or create the directory used to store your serialized code archive: | ||
|
||
.. code-block:: text | ||
|
||
mkdir _pb_output || true | ||
rm -f _pb_output/*.tar.gz | ||
|
||
* Using a python environment with flytekit installed fast-register your changes: | ||
|
||
.. code-block:: python | ||
|
||
pyflyte -c sandbox.config --pkgs recipes serialize --in-container-config-path /root/sandbox.config \ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. sorry remind me again, these commands work for both new and old style tasks/classes? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. they should since presumably we didn't break serialization 🤞 |
||
--local-source-root <path to your code> --image <older/existing docker image here> fast workflows -f _pb_output/ | ||
|
||
|
||
Or, from within your container: | ||
|
||
.. code-block:: python | ||
|
||
pyflyte --config /root/sandbox.config serialize fast workflows -f _pb_output/ | ||
|
||
* Assume a role that has write access to the intermittent directory you'll use to store fast registration code distributions . | ||
* Fast-register your serialized files. You'll note the overlap with the existing register command (auth role and output location) | ||
but with an new flag pointing to an additional distribution dir. This must be writable from the role you assume and readable from | ||
the role your flytepropeller assumes: | ||
|
||
.. code-block:: python | ||
|
||
flyte-cli fast-register-files -p flytetester -d development --kubernetes-service-account ${FLYTE_AUTH_KUBERNETES_SERVICE_ACCOUNT} \ | ||
--output-location-prefix ${FLYTE_AUTH_RAW_OUTPUT_DATA_PREFIX} -h ${FLYTE_PLATFORM_URL} \ | ||
--additional-distribution-dir ${FLYTE_SDK_FAST_REGISTRATION_DIR} _pb_output/* | ||
|
||
|
||
* Open the Flyte UI and launch the latest version of your workflow (under the domain you fast-registered above). It should run with your new code! | ||
|
||
|
||
Older flytekit instructions (flytekit <0.16.0) | ||
============================================== | ||
|
||
Flytekit releases prior to the introduction of native typing have a slightly modified workflow for fast-registering. | ||
|
||
Prerequisites | ||
############# | ||
|
||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
this has to be beta still.
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.
but eventually it won't be?
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.
Yeah i think in a couple more weeks maybe we'll release everything as 0.16.0
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.
@EngHabu