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

Update ImageSpec documentation #5748

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

Update ImageSpec documentation #5748

wants to merge 3 commits into from

Conversation

pingsutw
Copy link
Member

@pingsutw pingsutw commented Sep 14, 2024

What changes were proposed in this pull request?

Update doc and add more examples

Preview: https://flyte--5748.org.readthedocs.build/en/5748/user_guide/customizing_dependencies/imagespec.html

Signed-off-by: Kevin Su <pingsutw@apache.org>
@pingsutw pingsutw marked this pull request as draft September 14, 2024 07:05
Copy link

codecov bot commented Sep 14, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 36.22%. Comparing base (59bf191) to head (c6e34a5).

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #5748   +/-   ##
=======================================
  Coverage   36.21%   36.22%           
=======================================
  Files        1303     1303           
  Lines      109644   109644           
=======================================
+ Hits        39710    39718    +8     
+ Misses      65810    65802    -8     
  Partials     4124     4124           
Flag Coverage Δ
unittests-datacatalog 51.37% <ø> (ø)
unittests-flyteadmin 55.63% <ø> (+0.03%) ⬆️
unittests-flytecopilot 12.17% <ø> (ø)
unittests-flytectl 62.26% <ø> (+0.04%) ⬆️
unittests-flyteidl 7.12% <ø> (ø)
unittests-flyteplugins 53.35% <ø> (ø)
unittests-flytepropeller 41.75% <ø> (ø)
unittests-flytestdlib 55.19% <ø> (-0.03%) ⬇️

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: Kevin Su <pingsutw@apache.org>
Signed-off-by: Kevin Su <pingsutw@apache.org>
@pingsutw pingsutw marked this pull request as ready for review September 15, 2024 06:39
Copy link
Contributor

@neverett neverett left a comment

Choose a reason for hiding this comment

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

Some changes requested, otherwise LGTM!

the image using other tools.
This guide demonstrates how to use the `ImageSpec` to customize the container image for your Flyte tasks.

`ImageSpec` is a mechanism that allows you to specify how to build a container image without requiring a Dockerfile.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
`ImageSpec` is a mechanism that allows you to specify how to build a container image without requiring a Dockerfile.
`ImageSpec` allows you to customize the container image for your Flyte tasks without a Dockerfile.

`ImageSpec` is a way to specify how to build a container image without a Dockerfile. The `ImageSpec` by default will be
converted to an [Envd](https://envd.tensorchord.ai/) config, and the [Envd builder](https://github.com/flyteorg/flytekit/blob/master/plugins/flytekit-envd/flytekitplugins/envd/image_builder.py#L12-L34) will build the image for you. However, you can also register your own builder to build
the image using other tools.
This guide demonstrates how to use the `ImageSpec` to customize the container image for your Flyte tasks.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
This guide demonstrates how to use the `ImageSpec` to customize the container image for your Flyte tasks.

This guide demonstrates how to use the `ImageSpec` to customize the container image for your Flyte tasks.

`ImageSpec` is a mechanism that allows you to specify how to build a container image without requiring a Dockerfile.
This feature provides a flexible and user-friendly way to define the containerization process.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
This feature provides a flexible and user-friendly way to define the containerization process.


`ImageSpec` is a mechanism that allows you to specify how to build a container image without requiring a Dockerfile.
This feature provides a flexible and user-friendly way to define the containerization process.
One of the significant advantages of using ImageSpec is its ability to optimize the image-building process by reusing previously
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
One of the significant advantages of using ImageSpec is its ability to optimize the image-building process by reusing previously

`ImageSpec` is a mechanism that allows you to specify how to build a container image without requiring a Dockerfile.
This feature provides a flexible and user-friendly way to define the containerization process.
One of the significant advantages of using ImageSpec is its ability to optimize the image-building process by reusing previously
downloaded packages from the PyPI and APT caches, thereby speeding up the entire build process.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
downloaded packages from the PyPI and APT caches, thereby speeding up the entire build process.
`ImageSpec` speeds up the build process by allowing you to reuse previously downloaded packages from the PyPI and APT caches.

```

There exists an option to override the container image by providing an Image Spec YAML file to the `pyflyte run` or `pyflyte register` command.
## Define ImageSpec in a YAML File
There is an option to override the container image by providing an ImageSpec YAML file to the `pyflyte run` or `pyflyte register` command.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
There is an option to override the container image by providing an ImageSpec YAML file to the `pyflyte run` or `pyflyte register` command.
You can override the container image by providing an ImageSpec YAML file to the `pyflyte run` or `pyflyte register` command.

@@ -85,19 +200,22 @@ env:
pyflyte run --remote --image image.yaml image_spec.py wf
```

## Build the image without registering the workflow
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
## Build the image without registering the workflow
## Build the image without registering the workflow

If you only want to build the image without registering the workflow, you can use the `pyflyte build` command.

```
pyflyte build --remote image_spec.py wf
```

In some cases, you may want to force an image to rebuild, even if the image spec hasn’t changed. If you want to overwrite an existing image, you can pass the `FLYTE_FORCE_PUSH_IMAGE_SPEC=True` to `pyflyte` command or add `force_push()` to the ImageSpec.
## Force Push an Image
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
## Force Push an Image
## Force push an image

If you only want to build the image without registering the workflow, you can use the `pyflyte build` command.

```
pyflyte build --remote image_spec.py wf
```

In some cases, you may want to force an image to rebuild, even if the image spec hasn’t changed. If you want to overwrite an existing image, you can pass the `FLYTE_FORCE_PUSH_IMAGE_SPEC=True` to `pyflyte` command or add `force_push()` to the ImageSpec.
## Force Push an Image
In some cases, you may want to force an image to rebuild, even if the image spec hasn’t changed.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
In some cases, you may want to force an image to rebuild, even if the image spec hasn’t changed.
In some cases, you may want to force an image to rebuild, even if the ImageSpec hasn’t changed.

In some cases, you may want to force an image to rebuild, even if the image spec hasn’t changed. If you want to overwrite an existing image, you can pass the `FLYTE_FORCE_PUSH_IMAGE_SPEC=True` to `pyflyte` command or add `force_push()` to the ImageSpec.
## Force Push an Image
In some cases, you may want to force an image to rebuild, even if the image spec hasn’t changed.
If you want to overwrite an existing image, you can pass the `FLYTE_FORCE_PUSH_IMAGE_SPEC=True` to `pyflyte` command.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
If you want to overwrite an existing image, you can pass the `FLYTE_FORCE_PUSH_IMAGE_SPEC=True` to `pyflyte` command.
To overwrite an existing image, pass the `FLYTE_FORCE_PUSH_IMAGE_SPEC=True` to the `pyflyte` command.

@davidmirror-ops
Copy link
Contributor

Thank you @pingsutw! This is going to be very helpful

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.

3 participants