Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Nikki Everett <[email protected]>
Signed-off-by: Yee Hing Tong <[email protected]>
  • Loading branch information
wild-endeavor and neverett authored Sep 8, 2024
1 parent a4a2c38 commit e5fbee4
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
11 changes: 5 additions & 6 deletions docs/flyte_fundamentals/registering_workflows.md
Original file line number Diff line number Diff line change
Expand Up @@ -260,13 +260,12 @@ metadata/configuration, it's more secure if they're private.
Learn more about how to pull private image in the {ref}`User Guide <private_images>`.
```

##### Relationship between ImageSpec and Fast Registration
The `ImageSpec` construct available in flytekit also has a mechanism to copy files into the image being built. By default, the way it works is
* if fast register is used, then it's assumed that you don't also want to copy source files into built image.
* if fast register is not used (which is the default for `pyflyte package`, or if `pyflyte register --copy none` is specified), then it's assumed that
you do want source files copied.
##### Relationship between ImageSpec and fast registration
The `ImageSpec` construct available in flytekit also has a mechanism to copy files into the image being built. Its behavior depends on the type of registration used:
* If fast register is used, then it's assumed that you don't also want to copy source files into the built image.
* If fast register is not used (which is the default for `pyflyte package`, or if `pyflyte register --copy none` is specified), then it's assumed that you do want source files copied into the built image.

In any case, if your `ImageSpec` constructor specifies a `source_root` and the `copy` argument set to something other than `CopyFileDetection.NO_COPY`, then files will be copied regardless of fast registration status.
If your `ImageSpec` constructor specifies a `source_root` and the `copy` argument is set to something other than `CopyFileDetection.NO_COPY`, then files will be copied regardless of fast registration status.

#### Package your project with `pyflyte package`

Expand Down
6 changes: 4 additions & 2 deletions docs/user_guide/customizing_dependencies/imagespec.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,8 @@ image = ImageSpec(registry="ghcr.io/flyteorg", packages=["pandas"]).force_push()

## Getting source files into ImageSpec
Typically, getting source code files into a task's image at run time on a live Flyte backend is done through the fast registration mechanism.
If the `source_root` and `copy` fields to an `ImageSpec` are left blank, then whether or not your source files are copied into the built `ImageSpec` image is basically the inverse of whether fast register is used. Please see [registering workflows](https://docs.flyte.org/en/latest/flyte_fundamentals/registering_workflows.html#containerizing-your-project) for the full explanation.

Keep in mind that because files are sometimes copied into the built image, the tag that is published for an ImageSpec will change based on whether fast register is enabled, and the contents of any files copied.
However, if your `ImageSpec` constructor specifies a `source_root` and the `copy` argument is set to something other than `CopyFileDetection.NO_COPY`, then files will be copied regardless of fast registration status.
If the `source_root` and `copy` fields to an `ImageSpec` are left blank, then whether or not your source files are copied into the built `ImageSpec` image depends on whether or not you use fast registration. Please see [registering workflows](https://docs.flyte.org/en/latest/flyte_fundamentals/registering_workflows.html#containerizing-your-project) for the full explanation.

Since files are sometimes copied into the built image, the tag that is published for an ImageSpec will change based on whether fast register is enabled, and the contents of any files copied.

0 comments on commit e5fbee4

Please sign in to comment.