Hi, I still have a question about CI workflows, sp...
# flyte-support
g
Hi, I still have a question about CI workflows, specifically in github actions. I know there are the
setup-flytectl
and
flytectl-register-action
actions, but I'm assuming I would need to
package
the tasks/workflows in between using those, right? Is it best practice to do the packaging in the CI pipeline/GHA or do it locally and upload this to somewhere the CI pipeline can access?
Follow up on this is: I currently have hacked around this and instead opted for using
pyflyte register
which packages and registers my workflows for me as I have done locally instead. Doing this requires me to install all the python deps and a runner that has a GPU (because imports and global code are run on packaging). Would using the
pyflyte package
->
flytectl register
route of registration allow me to bypass this?
After testing it, doesn't work either. I do have an alternative idea though that might help me overcome both needing to install all the packages into my CI runner and require a GPU. One is: • Put imports inside of a task so that the imports are not run. • Add some flag that is by false during CI that makes the imports conditional for everything other than the flyte objects
Conditional imports seem to be a solution to my problem šŸ™‚
a
wow what a journey, thanks for sharing. So what command are you using?
g
pyflyte register [packages]
Just decided to go with a 1-1 of what I do locally, before making things nice and tidy and appropriate šŸ™‚
The hack to get around unwanted/GPU only imports is to specifiy a
if os.environ.get("import", False):
just before the import. And then to make it succeed (haven't tested this yet), I have added an env var in the
task
spec
@average-finland-92144 I have a question still relating to CI as is recommended in the documentation. https://docs.flyte.org/en/latest/user_guide/flyte_fundamentals/registering_workflows.html#productionizing-your-workflows I understand that
pyflyte package
and
flytectl register
are the way to go. However, I am confused about when
pyflyte package
is supposed to be run during the CI process? Is it in a docker container? Am I supposed to run it locally, store the package as an artifact in some blob storage before any CI deployment and then download it during deployment to run
flytectl register
with it?
a
Am I supposed to run it locally, store the package as an artifact in some blob storage before any CI deployment and then download it during deployment to run
flytectl register
with it?
Pretty much that's my understanding too. It's what fast registration does
btw and not to distract your efforts, but the cool people from Adarga recently open sourced an operator that does this from inside K8s. I know it's not what you're looking to achieve but can shed some lights on how others are approaching this challenge
g
Oooh
Nice, thanks for sharing!