Skip to content

Commit

Permalink
uploade all python packages
Browse files Browse the repository at this point in the history
  • Loading branch information
steven-mi committed Aug 9, 2023
1 parent 63258eb commit 062c0cb
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions rocket/rocket.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

from rocket.logger import logger
from rocket.utils import execute_shell_command, extract_project_name_from_wheel, \
extract_package_name_from_wheel
extract_python_package_dirs


def _add_index_urls_to_cmd(cmd, index_urls):
Expand Down Expand Up @@ -114,10 +114,12 @@ def _deploy(self):
execute_shell_command(
f"databricks fs cp --overwrite {self.wheel_path} {self.dbfs_folder}/{self.wheel_file}"
)
package_name = extract_package_name_from_wheel(self.wheel_file)
execute_shell_command(
f"databricks fs cp --recursive --overwrite {self.project_location}/{package_name} {self.dbfs_folder}/{package_name}"
)
package_dirs = extract_python_package_dirs(self.project_location)
print(package_dirs)
for package_dir in package_dirs:
execute_shell_command(
f"databricks fs cp --recursive --overwrite {package_dir} {self.dbfs_folder}/{os.path.basename(package_dirs)}"
)
except Exception as e:
raise Exception(
f"Error while copying files to databricks, is your databricks token set and valid? Try to generate a new token and update existing one with `databricks configure --token`. Error details: {e}"
Expand Down

0 comments on commit 062c0cb

Please sign in to comment.