I have a workflow that works remotely using pyflyt...
# ask-the-community
p
I have a workflow that works remotely using pyflyte run config.py. I would like to now be able to re-run this workflow with different flag / env variable values through the Flyte IDL (gRPC). Should I be using pyflyte package / serialize to somehow achieve that? Not sure how to generate the WorkflowCreateRequest request.
It's probably covered somewhere in the documentation, but I have not found it yet.
k
env vars is
Copy code
Usage: pyflyte run [OPTIONS] COMMAND [ARGS]...

 This command can execute either a workflow or a task from the command line, allowing for fully self-contained scripts. Tasks and workflows can be imported from other files.
 Note: This command is compatible with regular Python packages, but not with namespace packages. When determining the root of your project, it identifies the first folder without an ``__init__.py`` file.

╭─ Options ─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ --remote                                                   Whether to register and run the workflow on a Flyte deployment                                                                                                                         │
│ --project          -p  TEXT                                Project to register and run this workflow in                                                                                                                                           │
│ --domain           -d  TEXT                                Domain to register and run this workflow in                                                                                                                                            │
│ --name                 TEXT                                Name to assign to this execution                                                                                                                                                       │
│ --destination-dir      TEXT                                Directory inside the image where the tar file containing the code will be copied to                                                                                                    │
│ --copy-all                                                 Copy all files in the source root directory to the destination directory                                                                                                               │
│ --image            -i  TEXT                                Image used to register and run.                                                                                                                                                        │
│ --service-account      TEXT                                Service account used when executing this workflow                                                                                                                                      │
│ --wait-execution                                           Whether to wait for the execution to finish                                                                                                                                            │
│ --dump-snippet                                             Whether to dump a code snippet instructing how to load the workflow execution using flyteremote                                                                                        │
│ --overwrite-cache                                          Whether to overwrite the cache if it already exists                                                                                                                                    │
│ --envs                 JSON OBJECT OR JSON/YAML FILE PATH  Environment variables to set in the container                                                                                                                                          │
│ --tag                  TEXT                                Tags to set for the execution                                                                                                                                                          │
│ --help                                                     Show this message and exit.                                                                                                                                                            │
╰─────────
So you can simply
Copy code
pyflyte run --env ...
p
I would like to kick off the workflow from another service, hence why I was wondering about packaging the config.py to be able to use it with the gRPC API.
k
In that case, just check out flytekit. remote
p
Ah, I missed that, I will check how it's implemented there. Thanks 🙂
k
ya so flytekit.remote is a client and you can use this grpc interface to launch things