Hello, how can I change the namespaces of where th...
# ask-the-community
m
Hello, how can I change the namespaces of where the flyte-tasks will be run? What if I don't want staging-dev-prod for example, can I create only one namespace (or reuse an existing one) for a specific project? I'm using the helm chart for flyte-binary
k
You can change that on cluster resources and adjust admin config
y
the default domains are set here in admin. it’s just a top level config so if you just add a top level
domains
section to the inline section of the values file it should just work.
let me find the mapping of proj/domain to namespace later
m
Thanks! Tell me if you find it 🙇 will try to fix it during the day or tmrw
top level in the flyte config object, use
namespace_mapping
key
you can see the default on line 13
m
Thanks a lot! So does that mean I can override it with
Copy code
configuration:
  ...
  inline:
    namespace_mapping: "my_namespace"
How would this work if I still have would have the multiple domains, e.g. would it work or do the domains need different namespaces? Would the tasks collide? I will probably reduce it to 1 atm, but just wondering of you know
y
Copy code
configuration:
  ...
  inline:
    namespace_mapping:
      template: "my_namespace"
m
It worked (well flytesnack namespace is still created with staging/dev/prod, but I have my own namespace as well + my project name). However, when I try to run an example which worked before with --remote, it tries to send the task to project flytesnacks. Where and how is this changed? Sorry for the additional questions. I'm running
pyflyte run --remote test-flyte.py my_wf
locally, and this command worked before the change Error output: Failed with Exception Code: USER:BadInputToAPI Request rejected by the API, due to Invalid input.     Input Request: { "id": { "resourceType": "TASK", "project": "flytesnacks", "domain": "development", "name": "test-flyte.say_hello", "version": "b_d_E4Z_z_rT29-NTEMwJg==" }, "spec": { "template": { "id": { "resourceType": "TASK", "project": "flytesnacks", "domain": "development", "name": "test-flyte.say_hello", "version": "b_d_E4Z_z_rT29-NTEMwJg==" }, "type": "python-task", "metadata": { "runtime": { "type": "FLYTE_SDK", "version": "1.10.0", "flavor": "python" }, "retries": {} }, "interface": { "inputs": {}, "outputs": { "variables": { "o0": { "type": { "simple": "STRING" }, "description": "o0" } } } }, "container": { "image": "cr.flyte.org/flyteorg/flytekit:py3.9-1.10.0", "args": [ "pyflyte-fast-execute", "--additional-distribution", "s3://my-s3-bucket/flytesnacks/development/VFHXBA7JMPJY6JJ5JPTO276N2Q======/script_mode.tar.gz", "--dest-dir", "/root", "--", "pyflyte-execute", "--inputs", "{{.input}}", "--output-prefix", "{{.outputPrefix}}", "--raw-output-data-prefix", "{{.rawOutputDataPrefix}}", "--checkpoint-path", "{{.checkpointOutputPrefix}}", "--prev-checkpoint", "{{.prevCheckpointPrefix}}", "--resolver", "flytekit.core.python_auto_container.default_task_resolver", "--", "task-module", "test-flyte", "task-name", "say_hello" ], "resources": {} } }, "description": { "longDescription": { "format": "DESCRIPTION_FORMAT_RST" } } }
Nvm realized my issue, missed the existence of --project flag
That solved it, thanks for all the help!