Skip to content

Commit

Permalink
add namespace template for the cluster resource controller (#3900)
Browse files Browse the repository at this point in the history
Signed-off-by: Yicheng-Lu-llll <[email protected]>
  • Loading branch information
Yicheng-Lu-llll authored Aug 15, 2023
1 parent 81a5555 commit 85861c9
Showing 1 changed file with 14 additions and 9 deletions.
23 changes: 14 additions & 9 deletions rsts/community/contribute.rst
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,19 @@ that integrates all Flyte components into a single binary.
# Replace occurrences of $HOME with the actual path of your home directory.
sed -i "s|\$HOME|${HOME}|g" ./flyte-single-binary-local.yaml
# Step4: Running the single binary.
# Step 4: Prepare a namespace template for the cluster resource controller.
# The configuration file "flyte-single-binary-local.yaml" has an entry named cluster_resources.templatePath.
# This entry needs to direct to a directory containing the templates for the cluster resource controller to use.
# We will now create a simple template that allows the automatic creation of required namespaces for projects.
# For example, with Flyte's default project "flytesnacks", the controller will auto-create the following namespaces:
# flytesnacks-staging, flytesnacks-development, and flytesnacks-production.
mkdir $HOME/.flyte/cluster-resource-templates/
echo "apiVersion: v1
kind: Namespace
metadata:
name: '{{ namespace }}'" > $HOME/.flyte/cluster-resource-templates/namespace.yaml
# Step5: Running the single binary.
# The POD_NAMESPACE environment variable is necessary for the webhook to function correctly.
# You may encounter an error due to `ERROR: duplicate key value violates unique constraint`. Running the command again will solve the problem.
POD_NAMESPACE=flyte ./flyte start --config flyte-single-binary-local.yaml
Expand Down Expand Up @@ -456,11 +468,7 @@ The following instructions provide guidance on how to build single binary with y
# Step2: The flytesnacks repository provides a lot of useful examples.
git clone https://github.com/flyteorg/flytesnacks && cd flytesnacks
# Step3: Before running the hello world workflow, create the flytesnacks-development namespace.
# This is necessary because, by default (without creating a new project), task Pods will run in the flytesnacks-development namespace.
kubectl create namespace flytesnacks-development
# Step4: Run a hello world example
# Step3: Run a hello world example
pyflyte run --remote examples/basics/basics/hello_world.py my_wf
# Go to http://localhost:30080/console/projects/flytesnacks/domains/development/executions/fd63f88a55fed4bba846 to see execution in the console.
Expand Down Expand Up @@ -574,9 +582,6 @@ the Flyte cluster, and finally submit the workflow.
# Step4: Submit a hello world workflow to the Flyte cluster
git clone https://github.com/flyteorg/flytesnacks
cd flytesnacks
# Note, create the flytesnacks-development namespace if not exists:
# This is necessary because, by default (without creating a new project), task Pods will run in the flytesnacks-development namespace.
# kubectl create namespace flytesnacks-development
pyflyte run --image ${FLYTE_INTERNAL_IMAGE} --remote examples/basics/basics/hello_world.py my_wf
# Go to http://localhost:30080/console/projects/flytesnacks/domains/development/executions/f5c17e1b5640c4336bf8 to see execution in the console.
Expand Down

0 comments on commit 85861c9

Please sign in to comment.