-
Notifications
You must be signed in to change notification settings - Fork 64
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Feat/mw tasks (#61) * fix * init * Update README.md * Create tasks-phase1.md description of tasks for phase1 * Update tasks-phase1.md * Update README.md * Update main.tf * Update tasks-phase1.md * Update tasks-phase1.md * Update tasks-phase1.md * Update tasks-phase1.md * Update tasks-phase1.md * Update tasks-phase1.md * Add files via upload * Update tasks-phase1.md * Update tasks-phase1.md * Add files via upload * Update tasks-phase1.md * Update tasks-phase1.md * Update tasks-phase1.md * Update tasks-phase1.md * Update tasks-phase1.md * Update tasks-phase1.md * Update tasks-phase1.md * Small corrections --------- Co-authored-by: Tomasz Gambin <[email protected]> * Update envs --------- Co-authored-by: Tomasz Gambin <[email protected]>
- Loading branch information
Showing
59 changed files
with
3,001 additions
and
8 deletions.
There are no files selected for viewing
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
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
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,2 +1,2 @@ | ||
github_org = "tgambin" | ||
github_org = "bdg-tbd" | ||
github_repo = "tbd-workshop-1" |
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 +1 @@ | ||
bucket = "tbd-2023z-9903-state" | ||
bucket = "tbd-2023z-9910-state" |
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,3 +1,3 @@ | ||
project_name = "tbd-2023z-9903" | ||
iac_service_account = "tbd-2023z-9903-lab@tbd-2023z-9903.iam.gserviceaccount.com" | ||
ai_notebook_instance_owner = "tgambin@gmail.com" | ||
project_name = "tbd-2023z-9910" | ||
iac_service_account = "tbd-2023z-9910-lab@tbd-2023z-9910.iam.gserviceaccount.com" | ||
ai_notebook_instance_owner = "marek.wiewiorka@gmail.com" |
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
File renamed without changes.
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,42 @@ | ||
# dbt_docker_image | ||
|
||
<!-- BEGINNING OF PRE-COMMIT-TERRAFORM DOCS HOOK --> | ||
## Requirements | ||
|
||
| Name | Version | | ||
|------|---------| | ||
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | ~> 1.5.0 | | ||
| <a name="requirement_docker"></a> [docker](#requirement\_docker) | 3.0.2 | | ||
|
||
## Providers | ||
|
||
| Name | Version | | ||
|------|---------| | ||
| <a name="provider_docker"></a> [docker](#provider\_docker) | 3.0.2 | | ||
|
||
## Modules | ||
|
||
No modules. | ||
|
||
## Resources | ||
|
||
| Name | Type | | ||
|------|------| | ||
| [docker_image.dbt](https://registry.terraform.io/providers/kreuzwerker/docker/3.0.2/docs/resources/image) | resource | | ||
| [docker_registry_image.dbt](https://registry.terraform.io/providers/kreuzwerker/docker/3.0.2/docs/resources/registry_image) | resource | | ||
|
||
## Inputs | ||
|
||
| Name | Description | Type | Default | Required | | ||
|------|-------------|------|---------|:--------:| | ||
| <a name="input_dbt_spark_version"></a> [dbt\_spark\_version](#input\_dbt\_spark\_version) | dbt-spark version | `string` | `"1.7.1"` | no | | ||
| <a name="input_dbt_version"></a> [dbt\_version](#input\_dbt\_version) | dbt core version | `string` | `"1.7.3"` | no | | ||
| <a name="input_project_name"></a> [project\_name](#input\_project\_name) | Project name | `string` | n/a | yes | | ||
| <a name="input_registry_hostname"></a> [registry\_hostname](#input\_registry\_hostname) | Image registry hostname | `string` | n/a | yes | | ||
| <a name="input_registry_repo_name"></a> [registry\_repo\_name](#input\_registry\_repo\_name) | Image registry repository name | `string` | n/a | yes | | ||
| <a name="input_spark_version"></a> [spark\_version](#input\_spark\_version) | Apache Spark version | `string` | `"3.3.2"` | no | | ||
|
||
## Outputs | ||
|
||
No outputs. | ||
<!-- END OF PRE-COMMIT-TERRAFORM DOCS HOOK --> |
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,25 @@ | ||
resource "docker_image" "dbt" { | ||
name = "${var.registry_hostname}/${var.registry_repo_name}/dbt:${var.dbt_version}" | ||
build { | ||
context = "${path.module}/resources" | ||
build_args = { | ||
DBT_VERSION : var.dbt_version | ||
DBT_SPARK_VERSION : var.dbt_spark_version | ||
SPARK_VERSION : var.spark_version | ||
PROJECT_NAME : var.project_name | ||
} | ||
tag = ["${var.registry_hostname}/${var.registry_repo_name}/dbt:latest"] | ||
} | ||
triggers = { | ||
dir_sha1 = sha1(join("", [for f in fileset(path.cwd, "${path.module}/resources/*") : filesha1(f)])) | ||
} | ||
} | ||
|
||
|
||
resource "docker_registry_image" "dbt" { | ||
name = docker_image.dbt.name | ||
keep_remotely = true | ||
triggers = { | ||
dir_sha1 = sha1(join("", [for f in fileset(path.cwd, "${path.module}/resources/*") : filesha1(f)])) | ||
} | ||
} |
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,41 @@ | ||
FROM python:3.10-slim-bullseye as base | ||
ARG DBT_VERSION | ||
ARG DBT_SPARK_VERSION | ||
ARG SPARK_VERSION | ||
ARG HADOOP_CONF_DIR=/etc/hadoop/conf | ||
|
||
# System setup | ||
RUN apt-get update \ | ||
&& apt-get install -y --no-install-recommends \ | ||
git \ | ||
ssh-client \ | ||
software-properties-common \ | ||
make \ | ||
build-essential \ | ||
ca-certificates \ | ||
libpq-dev \ | ||
python-dev \ | ||
libsasl2-dev \ | ||
gcc \ | ||
unixodbc-dev \ | ||
&& apt-get clean \ | ||
&& rm -rf \ | ||
/var/lib/apt/lists/* \ | ||
/tmp/* \ | ||
/var/tmp/* | ||
|
||
# Env vars | ||
ENV PYTHONIOENCODING=utf-8 | ||
ENV LANG=C.UTF-8 | ||
|
||
# Update python and install packages | ||
RUN pip install --upgrade pip setuptools wheel --no-cache-dir \ | ||
dbt-core==$DBT_VERSION \ | ||
dbt-spark==$DBT_SPARK_VERSION \ | ||
pyspark==$SPARK_VERSION | ||
|
||
RUN mkdir -p $HADOOP_CONF_DIR | ||
COPY conf/* $HADOOP_CONF_DIR | ||
ENV HADOOP_CONF_DIR=$HADOOP_CONF_DIR | ||
|
||
WORKDIR /dbt |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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,32 @@ | ||
variable "registry_hostname" { | ||
type = string | ||
description = "Image registry hostname" | ||
} | ||
|
||
variable "registry_repo_name" { | ||
type = string | ||
description = "Image registry repository name" | ||
} | ||
|
||
variable "dbt_version" { | ||
type = string | ||
description = "dbt core version" | ||
default = "1.7.3" | ||
} | ||
|
||
variable "dbt_spark_version" { | ||
type = string | ||
description = "dbt-spark version" | ||
default = "1.7.1" | ||
} | ||
|
||
variable "spark_version" { | ||
type = string | ||
description = "Apache Spark version" | ||
default = "3.3.2" | ||
} | ||
|
||
variable "project_name" { | ||
type = string | ||
description = "Project name" | ||
} |
File renamed without changes.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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
File renamed without changes.
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
Oops, something went wrong.