简体   繁体   中英

How to add whole python application into azure databricks and run it?

we have a functional model written in Python. I would like to copy all of code at once and run it from azure databricks - I saw there is a way to run python code from azure data factory, but I see its only for one python file, is it correct?

I know, I could upload a wheel, or an egg, but in that way, I probably have to import it into notebook. will I be able to access this wheel through CLI or azure data factory? Will I lose option to set parameters?

We use gitlab, so this option is off table, for now.

Thx a lot

Edit I want to summarize what I have found, some of below might be really wrong.

  • I can upload a wheel and use the python app as a library -> I can rewrite the main for CLI app to the notebook and just import the library.
  • I can rewrite all of code into notebooks -> this might be the best way, but for existing app with no small size it is painful
  • I can create folders and upload python code into FS, to simulate the Python project and call in the notebook... (did not tried yet)
  • I can use the github to import code (I did not tried it yet, i can't move the code from gitlab to github because of nda)
  • I can run the code from may IDE connected to databricks
  • I can run start python script in Data azure pipeline, but I'm not sure about the wheel.
  • I can probably use another azure module (which one? Where to put the code?) then databricks to run python code from CLI -> but in case of python spark it does not make sense (I did not tried it yet because of this)
  • I can probably run from the notebook trough %sh script the python somewhere saved in the azure space (again, where it shoudl be?) and pass parameters. (I did not tried it yet

You can copy your python code and paste it into a cell in a Databricks notebook and run it that way.

You could also use the Databricks CLI to upload your import your file to a Databricks workspace.
See https://docs.databricks.com/dev-tools/cli/workspace-cli.html

Databricks python notebooks are just .py files anyways with some special comments.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM