Skip to content

Commit

Permalink
Merge branch 'flyteorg:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
eapolinario authored May 22, 2024
2 parents eb5c6b9 + 2f7bedf commit da9fb08
Show file tree
Hide file tree
Showing 29 changed files with 576 additions and 889 deletions.
56 changes: 56 additions & 0 deletions .github/workflows/checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -117,3 +117,59 @@ jobs:
secrets:
FLYTE_BOT_PAT: ${{ secrets.FLYTE_BOT_PAT }}
FLYTE_BOT_USERNAME: ${{ secrets.FLYTE_BOT_USERNAME }}

dry_run_goreleaser:
name: Dry Run Goreleaser
runs-on: ubuntu-latest
needs:
- unpack-envvars
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: "0"
- uses: actions/setup-go@v4
with:
go-version: ${{ needs.unpack-envvars.outputs.go-version }}
- name: Run GoReleaser dry run
uses: goreleaser/goreleaser-action@v5
with:
distribution: goreleaser-pro
version: latest
args: --snapshot --skip-publish --rm-dist -f flytectl/.goreleaser.yml
env:
GORELEASER_KEY: ${{ secrets.GORELEASER_KEY }}

sandbox:
name: Test Getting started
runs-on: ubuntu-latest
defaults:
run:
working-directory: flytectl
needs:
- unpack-envvars
steps:
- uses: insightsengineering/disk-space-reclaimer@v1
- name: Checkout
uses: actions/checkout@v2
- uses: actions/cache@v2
with:
path: |
~/.cache/go-build
~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('go.sum') }}
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: ${{ needs.unpack-envvars.outputs.go-version }}
- name: Build Flytectl binary
run: make compile
- name: Create a sandbox cluster
run: |
bin/flytectl demo start
- name: Setup flytectl config
run: bin/flytectl config init
- name: Register cookbook
run: bin/flytectl register examples -d development -p flytesnacks
- name: Teardown Sandbox cluster
run: bin/flytectl demo teardown
2 changes: 1 addition & 1 deletion .github/workflows/end2end.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
echo "FLYTESNACKS_VERSION=${FLYTESNACKS_VERSION}" >> ${GITHUB_ENV}
- name: Checkout
uses: actions/checkout@v4
- uses: unionai/[email protected].1
- uses: unionai/[email protected].3
name: Setup flytectl
- uses: actions/setup-python@v3
with:
Expand Down
27 changes: 27 additions & 0 deletions .github/workflows/flytectl-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Flytectl release

on:
push:
tags:
- flytectl/v*.*.*

jobs:
release:
name: Goreleaser
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: "0"
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: "1.21"
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v5
with:
distribution: goreleaser-pro
args: release --rm-dist -f flytectl/.goreleaser.yml
env:
GORELEASER_KEY: ${{ secrets.GORELEASER_KEY }}
GITHUB_TOKEN: ${{ secrets.FLYTE_BOT_PAT }}
2 changes: 2 additions & 0 deletions .github/workflows/flyteidl-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ on:

jobs:
deploy-to-pypi:
if: "!startsWith(github.event.release.tag_name, 'flytectl/')"
runs-on: ubuntu-latest
defaults:
run:
Expand All @@ -28,6 +29,7 @@ jobs:
python -m build
twine upload dist/*
deploy-to-npm:
if: "!startsWith(github.event.release.tag_name, 'flytectl/')"
runs-on: ubuntu-latest
defaults:
run:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/single-binary.yml
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ jobs:
uses: actions/setup-python@v4
with:
python-version: "3.12"
- uses: unionai/[email protected].1
- uses: unionai/[email protected].3
- name: Setup sandbox
run: |
mkdir -p ~/.flyte/sandbox
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/validate-helm-charts.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
python-version: "3.10"
check-latest: true

- uses: unionai/[email protected].1
- uses: unionai/[email protected].3
name: Setup flytectl

- name: Set up chart-testing
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -166,3 +166,5 @@ There are many ways to get involved in Flyte, including:
## License

Flyte is available under the Apache License 2.0. Use it wisely.

<img referrerpolicy="no-referrer-when-downgrade" src="https://static.scarf.sh/a.png?x-pxid=6a6b21ca-61bb-444f-aecd-4a6ba5372be5" />
5 changes: 2 additions & 3 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,6 @@
# is useful for building the docs in the CI/CD of the corresponding repos.
flytesnacks_local_path = os.environ.get("FLYTESNACKS_LOCAL_PATH", None)
flytekit_local_path = os.environ.get("FLYTEKIT_LOCAL_PATH", None)
flytectl_local_path = os.environ.get("FLYTECTL_LOCAL_PATH", None)

flytesnacks_path = flytesnacks_local_path or "_projects/flytesnacks"
flytekit_path = flytekit_local_path or "_projects/api/flytekit"
Expand Down Expand Up @@ -417,10 +416,10 @@
},
{
"name": "flytectl",
"source": flytectl_local_path or "https://github.com/flyteorg/flytectl",
"source": "../flytectl",
"docs_path": "docs/source",
"dest": "flytectl",
"local": flytectl_local_path is not None,
"local": True,
},
{
"name": "flyteidl",
Expand Down
3 changes: 3 additions & 0 deletions docs/deployment/agents/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ If you are using a managed deployment of Flyte, you will need to contact your de
- Configuring your Flyte deployment for the sensor agent.
* - {ref}`SageMaker Inference <deployment-agent-setup-sagemaker-inference>`
- Deploy models and create, as well as trigger inference endpoints on SageMaker.
* - {ref}`OpenAI Batch <deployment-agent-setup-openai-batch>`
- Submit requests to OpenAI GPT models for asynchronous batch processing.
```

```{toctree}
Expand All @@ -44,4 +46,5 @@ mmcloud
sagemaker_inference
sensor
snowflake
openai_batch
```
134 changes: 134 additions & 0 deletions docs/deployment/agents/openai_batch.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,134 @@
.. _deployment-agent-setup-openai-batch:

OpenAI Batch Agent
==================

This guide provides an overview of how to set up the OpenAI Batch agent in your Flyte deployment.

Specify agent configuration
---------------------------

.. tabs::

.. group-tab:: Flyte binary

Edit the relevant YAML file to specify the agent.

.. code-block:: bash
kubectl edit configmap flyte-sandbox-config -n flyte
.. code-block:: yaml
:emphasize-lines: 7,11,15
tasks:
task-plugins:
enabled-plugins:
- container
- sidecar
- k8s-array
- agent-service
default-for-task-types:
- container: container
- container_array: k8s-array
- openai-batch: agent-service
plugins:
agent-service:
supportedTaskTypes:
- openai-batch
.. group-tab:: Flyte core

Create a file named ``values-override.yaml`` and add the following configuration to it:

.. code-block:: yaml
:emphasize-lines: 9,14,18
configmap:
enabled_plugins:
tasks:
task-plugins:
enabled-plugins:
- container
- sidecar
- k8s-array
- agent-service
default-for-task-types:
container: container
sidecar: sidecar
container_array: k8s-array
openai-batch: agent-service
plugins:
agent-service:
supportedTaskTypes:
- openai-batch
Add the OpenAI API token
------------------------

1. Install flyteagent pod using helm:

.. code-block::
helm repo add flyteorg https://flyteorg.github.io/flyte
helm install flyteagent flyteorg/flyteagent --namespace flyte
2. Get the base64 value of your OpenAI API token:

.. code-block::
echo -n "<OPENAI_API_TOKEN>" | base64
3. Edit the flyteagent secret:

.. code-block:: bash
kubectl edit secret flyteagent -n flyte
.. code-block:: yaml
:emphasize-lines: 3
apiVersion: v1
data:
FLYTE_OPENAI_API_KEY: <BASE64_ENCODED_OPENAI_API_TOKEN>
kind: Secret
metadata:
annotations:
meta.helm.sh/release-name: flyteagent
meta.helm.sh/release-namespace: flyte
creationTimestamp: "2023-10-04T04:09:03Z"
labels:
app.kubernetes.io/managed-by: Helm
name: flyteagent
namespace: flyte
resourceVersion: "753"
uid: 5ac1e1b6-2a4c-4e26-9001-d4ba72c39e54
type: Opaque
Upgrade the Flyte Helm release
------------------------------

.. tabs::

.. group-tab:: Flyte binary

.. code-block:: bash
helm upgrade <RELEASE_NAME> flyteorg/flyte-binary -n <YOUR_NAMESPACE> --values <YOUR_YAML_FILE>
Replace ``<RELEASE_NAME>`` with the name of your release (e.g., ``flyte-backend``),
``<YOUR_NAMESPACE>`` with the name of your namespace (e.g., ``flyte``),
and ``<YOUR_YAML_FILE>`` with the name of your YAML file.

.. group-tab:: Flyte core

.. code-block:: bash
helm upgrade <RELEASE_NAME> flyte/flyte-core -n <YOUR_NAMESPACE> --values values-override.yaml
Replace ``<RELEASE_NAME>`` with the name of your release (e.g., ``flyte``)
and ``<YOUR_NAMESPACE>`` with the name of your namespace (e.g., ``flyte``).

You can refer to the `documentation <https://docs.flyte.org/en/latest/flytesnacks/examples/openai_batch_agent/index.html>`__
to run the agent on your Flyte cluster.
Loading

0 comments on commit da9fb08

Please sign in to comment.