Skip to content

Commit

Permalink
Merge branch 'flyteorg:master' into patch-1
Browse files Browse the repository at this point in the history
  • Loading branch information
Sovietaced authored Apr 12, 2024
2 parents d3d8e0a + c7d1463 commit 776e32e
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,17 @@ conda activate flyte-example

Next, initialize your Flyte project. The [flytekit-python-template GitHub repository](https://github.com/flyteorg/flytekit-python-template) contains Flyte project templates with sample code that you can run as is or modify to suit your needs.

In this example, we will initialize the [basic-example-imagespec project template](https://github.com/flyteorg/flytekit-python-template/tree/main/basic-example-imagespec).
In this example, we will initialize the [basic-template-imagespec project template](https://github.com/flyteorg/flytekit-python-template/tree/main/basic-template-imagespec).

```{prompt} bash $
pyflyte init my_project
```

:::{note}

To initialize a Flyte project with a different template, use the `--template` parameter:
If you need to use a Dockerfile for your project, you can initialize the Dockerfile template:

`pyflyte init --template hello-world hello-world`
`pyflyte init --template basic-template-dockerfile my_project`
:::

### 3. Install additional requirements
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
(flyte_project_components)=
# Flyte project components

A Flyte project is a directory containing task and workflow code, internal Python source code, configuration files, and other artifacts required to package up your code so that it can be run on a Flyte cluster.
Expand Down Expand Up @@ -26,13 +27,13 @@ You can specify pip-installable Python dependencies in your project by adding th
`requirements.txt` file.

```{note}
We recommend using [pip-compile](https://pip-tools.readthedocs.io/en/latest/) to
We recommend using [pip-compile](https://pip-tools.readthedocs.io/en/stable/) to
manage your project's Python requirements.
```

````{dropdown} See requirements.txt
```{rli} https://raw.githubusercontent.com/flyteorg/flytekit-python-template/main/simple-example/%7B%7Bcookiecutter.project_name%7D%7D/requirements.txt
```{rli} https://raw.githubusercontent.com/flyteorg/flytekit-python-template/main/basic-template-imagespec/%7B%7Bcookiecutter.project_name%7D%7D/requirements.txt
:caption: requirements.txt
```
Expand Down
3 changes: 3 additions & 0 deletions docs/user_guide/data_types_and_io/dataclass.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ to serialize and deserialize dataclasses.
:::{important}
If you're using Flytekit version below v1.10, you'll need to decorate with `@dataclass_json` using
`from dataclass_json import dataclass_json` instead of inheriting from Mashumaro's `DataClassJSONMixin`.

If you're using Flytekit version >= v1.11.1, you don't need to decorate with `@dataclass_json` or
inherit from Mashumaro's `DataClassJSONMixin`.
:::

To begin, import the necessary dependencies.
Expand Down
3 changes: 1 addition & 2 deletions docs/user_guide/data_types_and_io/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,7 @@ Here's a breakdown of these mappings:
* - ``@dataclass``
- ``Struct``
- Automatic
- The class should be a pure value class that inherits from Mashumaro's DataClassJSONMixin,
and be annotated with the ``@dataclass`` decorator.
- The class should be a pure value class annotated with the ``@dataclass`` decorator.
* - ``np.ndarray``
- File
- Automatic
Expand Down
13 changes: 0 additions & 13 deletions flyteplugins/go/tasks/plugins/k8s/ray/ray.go
Original file line number Diff line number Diff line change
Expand Up @@ -380,19 +380,6 @@ func buildSubmitterPodTemplate(podSpec *v1.PodSpec, objectMeta *metav1.ObjectMet
func buildWorkerPodTemplate(primaryContainer *v1.Container, podSpec *v1.PodSpec, objectMetadata *metav1.ObjectMeta, taskCtx pluginsCore.TaskExecutionContext) v1.PodTemplateSpec {
// Some configs are copy from https://github.com/ray-project/kuberay/blob/b72e6bdcd9b8c77a9dc6b5da8560910f3a0c3ffd/apiserver/pkg/util/cluster.go#L185
// They should always be the same, so we could hard code here.
initContainers := []v1.Container{
{
Name: "init-myservice",
Image: "busybox:1.28",
Command: []string{
"sh",
"-c",
"until nslookup $RAY_IP.$(cat /var/run/secrets/kubernetes.io/serviceaccount/namespace).svc.cluster.local; do echo waiting for myservice; sleep 2; done",
},
Resources: primaryContainer.Resources,
},
}
podSpec.InitContainers = append(podSpec.InitContainers, initContainers...)

primaryContainer.Name = "ray-worker"

Expand Down

0 comments on commit 776e32e

Please sign in to comment.