-
Notifications
You must be signed in to change notification settings - Fork 72
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
bc57e53
commit 870825e
Showing
9 changed files
with
99 additions
and
121 deletions.
There are no files selected for viewing
51 changes: 39 additions & 12 deletions
51
libs/template/templates/default-python/template/{{.project_name}}/databricks.yml.tmpl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,56 @@ | ||
# This is a Databricks Asset Bundle definition for {{.project_name}}. | ||
# See https://docs.databricks.com/en/dev-tools/bundles for documentation. | ||
bundle: | ||
name: {{.project_name}} | ||
|
||
include: | ||
- resources/*.yml | ||
|
||
artifacts: | ||
{{.project_name}}: | ||
type: whl | ||
path: "." | ||
build: "python3 setup.py bdist_wheel" | ||
{{.project_name}}: | ||
type: whl | ||
path: "." | ||
build: "python3 setup.py bdist_wheel" | ||
|
||
targets: | ||
development: | ||
workspace: | ||
host: {{workspace_host}} | ||
# The 'dev' target, used development purposes. | ||
# Whenever a developer deploys using 'dev', they get their own copy. | ||
dev: | ||
# We use 'mode: development' to make everything deployed to this target gets a prefix | ||
# like '[dev my_user_name]'. Setting this mode also disables any schedules and | ||
# automatic triggers for jobs and enables the 'development' mode for DLT pipelines. | ||
mode: development | ||
default: true | ||
workspace: | ||
host: {{workspace_host}} | ||
|
||
# Optionally, there could be a 'staging' target here. | ||
# staging: | ||
# workspace: | ||
# host: {{workspace_host}} | ||
|
||
# The 'prod' target, used for production deployment. | ||
production: | ||
# For production deployments, we only have a single copy, so we override the | ||
# workspace.root_path default of | ||
# /Users/${workspace.current_user.userName}/.bundle/${bundle.environment}/${bundle.name} | ||
# to a path that is not specific to the current user. | ||
{{- /* | ||
Explaining 'mode: production' isn't as pressing as explaining 'mode: development'. | ||
As we already talked about the other mode above, users can just | ||
look at documentation or ask the assistant about 'mode: production'. | ||
# | ||
# By making use of 'mode: production' we enable strict checks | ||
# to make sure we have correctly configured this target. | ||
*/}} | ||
mode: production | ||
workspace: | ||
host: {{workspace_host}} | ||
root_path: /Shared/.bundle/prod/${bundle.name} | ||
mode: production | ||
{{if is_service_principal}} | ||
{{- else -}} | ||
{{- if not is_service_principal}} | ||
run_as: | ||
user_name: brackets user_name brackets | ||
{{- end -}} | ||
# This runs as {{user_name}} in production. Alternatively, | ||
# a service principal could be used here using service_principal_name | ||
# (see Databricks documentation). | ||
user_name: {{user_name}} | ||
{{end -}} |
1 change: 0 additions & 1 deletion
1
libs/template/templates/default-python/template/{{.project_name}}/fixtures/.gitkeep
This file was deleted.
Oops, something went wrong.
17 changes: 17 additions & 0 deletions
17
libs/template/templates/default-python/template/{{.project_name}}/fixtures/.gitkeep.tmpl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# Fixtures | ||
{{- /* | ||
We don't want to have too many README.md files, since they | ||
stand out so much. But we do need to have a file here to make | ||
sure the folder is added to Git. | ||
*/}} | ||
|
||
This folder is reserved for fixtures, such as csv files. | ||
|
||
Below is an example of how to load fixtures as a data frame: | ||
|
||
``` | ||
import pandas as pd | ||
|
||
df = pd.read_csv("../fixtures/mycsv.csv") | ||
display(df) | ||
``` |
30 changes: 0 additions & 30 deletions
30
...plates/default-python/template/{{.project_name}}/resources/{{.project_name}}-job.yml.tmpl
This file was deleted.
Oops, something went wrong.
43 changes: 43 additions & 0 deletions
43
...plates/default-python/template/{{.project_name}}/resources/{{.project_name}}_job.yml.tmpl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
# The main job for {{.project_name}} | ||
resources: | ||
|
||
jobs: | ||
{{.project_name}}_job: | ||
name: {{.project_name}}_job | ||
|
||
schedule: | ||
quartz_cron_expression: '44 37 8 * * ?' | ||
timezone_id: Europe/Amsterdam | ||
|
||
{{- if not is_service_principal}} | ||
email_notifications: | ||
on_failure: | ||
- {{user_name}} | ||
{{end -}} | ||
|
||
tasks: | ||
- task_key: notebook_task | ||
job_cluster_key: job_cluster | ||
notebook_task: | ||
notebook_path: ../src/notebook.ipynb | ||
|
||
- task_key: python_wheel_task | ||
depends_on: | ||
- task_key: notebook_task | ||
job_cluster_key: job_cluster | ||
python_wheel_task: | ||
package_name: "{{.project_name}}" | ||
entry_point: "main" | ||
libraries: | ||
{{- /* FIXME: this path is wrong, it should say ../dist/*.whl */}} | ||
- whl: dist/*.whl | ||
|
||
job_clusters: | ||
- job_cluster_key: job_cluster | ||
new_cluster: | ||
{{- /* we should always use an LTS version in our templates */}} | ||
spark_version: 13.3.x-scala2.12 | ||
node_type_id: {{smallest_node_type}} | ||
autoscale: | ||
min_workers: 1 | ||
max_workers: 4 |
4 changes: 0 additions & 4 deletions
4
.../template/templates/default-python/template/{{.project_name}}/scratch/README.md
This file was deleted.
Oops, something went wrong.
50 changes: 0 additions & 50 deletions
50
libs/template/templates/default-python/template/{{.project_name}}/scratch/exploration.ipynb
This file was deleted.
Oops, something went wrong.
24 changes: 0 additions & 24 deletions
24
libs/template/templates/default-python/template/{{.project_name}}/setup.py.tmpl
This file was deleted.
Oops, something went wrong.
File renamed without changes.