Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

8 lesson #10

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
106 changes: 53 additions & 53 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,53 +1,53 @@
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
// README at: https://github.com/devcontainers/templates/tree/main/src/docker-existing-dockerfile
{
"name": "Existing Dockerfile",
"build": {
// Sets the run context to one level up instead of the .devcontainer folder.
// "context": "."
// Update the 'dockerFile' property if you aren't using the standard 'Dockerfile' filename.
"dockerfile": "../Dockerfile"
},

// Features to add to the dev container. More info: https://containers.dev/features.
// "features": {},

// Use 'forwardPorts' to make a list of ports inside the container available locally.
"forwardPorts": [
8080
],
"customizations": {
"vscode": {
"extensions": [
"innoverio.vscode-dbt-power-user",
"ms-python.python",
"eamodio.gitlens",
"GitHub.vscode-pull-request-github",
"nemesv.copy-file-name"
]
}
},
"features": {
"ghcr.io/devcontainers/features/common-utils:2": {
"installZsh": true,
"configureZshAsDefaultShell": true,
"installOhMyZsh": true,
"upgradePackages": true,
"username": "automatic",
"userUid": "automatic",
"userGid": "automatic"
},
"ghcr.io/stuartleeks/dev-container-features/shell-history:0": {}
},

"runArgs": ["--env-file",".env", "--network=mybi-dbt-showcase_default"]

// Uncomment the next line to run commands after the container is created.
// "postCreateCommand": "cat /etc/os-release",

// Configure tool-specific properties.
// "customizations": {},

// Uncomment to connect as an existing user other than the container default. More info: https://aka.ms/dev-containers-non-root.
// "remoteUser": "devcontainer"
}
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
// README at: https://github.com/devcontainers/templates/tree/main/src/docker-existing-dockerfile
{
"name": "Existing Dockerfile",
"build": {
// Sets the run context to one level up instead of the .devcontainer folder.
// "context": "."
// Update the 'dockerFile' property if you aren't using the standard 'Dockerfile' filename.
"dockerfile": "../Dockerfile"
},
// Features to add to the dev container. More info: https://containers.dev/features.
// "features": {},
// Use 'forwardPorts' to make a list of ports inside the container available locally.
"forwardPorts": [
8080
],
"customizations": {
"vscode": {
"extensions": [
"innoverio.vscode-dbt-power-user",
"ms-python.python",
"eamodio.gitlens",
"GitHub.vscode-pull-request-github",
"nemesv.copy-file-name"
]
}
},
"features": {
"ghcr.io/devcontainers/features/common-utils:2": {
"installZsh": true,
"configureZshAsDefaultShell": true,
"installOhMyZsh": true,
"upgradePackages": true,
"username": "automatic",
"userUid": "automatic",
"userGid": "automatic"
},
"ghcr.io/stuartleeks/dev-container-features/shell-history:0": {}
},
"runArgs": ["--env-file",".env", "--network=mybi-dbt-showcase_default"]
// Uncomment the next line to run commands after the container is created.
// "postCreateCommand": "cat /etc/os-release",
// Configure tool-specific properties.
// "customizations": {},
// Uncomment to connect as an existing user other than the container default. More info: https://aka.ms/dev-containers-non-root.
// "remoteUser": "devcontainer"
}
20 changes: 10 additions & 10 deletions .env
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
CUBEJS_DEV_MODE=true

CUBEJS_DB_TYPE=clickhouse
CUBEJS_DB_HOST=clickhouse
CUBEJS_DB_PORT=8123
CUBEJS_DB_NAME=analytics
CUBEJS_DB_USER=default
CUBEJS_DB_PASS=

CUBEJS_DB_SSL=false
CUBEJS_DEV_MODE=true
CUBEJS_DB_TYPE=clickhouse
CUBEJS_DB_HOST=clickhouse
CUBEJS_DB_PORT=8123
CUBEJS_DB_NAME=analytics
CUBEJS_DB_USER=default
CUBEJS_DB_PASS=
CUBEJS_DB_SSL=false
# NODE_TLS_REJECT_UNAUTHORIZED=0
96 changes: 48 additions & 48 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,49 +1,49 @@
name: Continuous Integration Tests

on:
pull_request:
branches: [ main ]
concurrency:
group: ${{ github.ref }}
cancel-in-progress: true

jobs:
ci:
name: Continuous Integration Tests
timeout-minutes: 30
services:
clickhouse:
image: clickhouse/clickhouse-server:22.3
ports:
- 9000:9000
- 8123:8123
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: wait for services to start up
run: sleep 10
- name: dbt version
uses: kzzzr/mybi-dbt-action@v4
with:
command: dbt --version
- name: dbt debug
uses: kzzzr/mybi-dbt-action@v4
with:
command: dbt debug
- name: dbt deps
uses: kzzzr/mybi-dbt-action@v4
with:
command: dbt deps
- name: dbt init_source_data
uses: kzzzr/mybi-dbt-action@v4
with:
command: dbt run-operation init_source_data
- name: dbt build
uses: kzzzr/mybi-dbt-action@v4
with:
command: dbt build --full-refresh
# - name: Setup tmate session
# uses: mxschmitt/action-tmate@v3
# if: ${{ failure() }}
# timeout-minutes: 30
name: Continuous Integration Tests
on:
pull_request:
branches: [ main ]
concurrency:
group: ${{ github.ref }}
cancel-in-progress: true
jobs:
ci:
name: Continuous Integration Tests
timeout-minutes: 30
services:
clickhouse:
image: clickhouse/clickhouse-server:22.3
ports:
- 9000:9000
- 8123:8123
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: wait for services to start up
run: sleep 10
- name: dbt version
uses: kzzzr/mybi-dbt-action@v4
with:
command: dbt --version
- name: dbt debug
uses: kzzzr/mybi-dbt-action@v4
with:
command: dbt debug
- name: dbt deps
uses: kzzzr/mybi-dbt-action@v4
with:
command: dbt deps
- name: dbt init_source_data
uses: kzzzr/mybi-dbt-action@v4
with:
command: dbt run-operation init_source_data
- name: dbt build
uses: kzzzr/mybi-dbt-action@v4
with:
command: dbt build --full-refresh
# - name: Setup tmate session
# uses: mxschmitt/action-tmate@v3
# if: ${{ failure() }}
# timeout-minutes: 30

116 changes: 58 additions & 58 deletions .github/workflows/publish_docs.yml
Original file line number Diff line number Diff line change
@@ -1,58 +1,58 @@
name: Publish dbt Documentation on PR Closed


# triggers for the workflow
on:
workflow_dispatch:
# See https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#pull_request_target
pull_request_target:
types:
- closed
branches:
- main


jobs:
generate-dbt-docs:
name: Generate dbt docs
runs-on: ubuntu-latest
services:
clickhouse:
image: clickhouse/clickhouse-server:22.3
ports:
- 9000:9000
- 8123:8123

# Grant GITHUB_TOKEN the permissions required to make a Pages deployment
permissions:
pages: write # to deploy to Pages
id-token: write # to verify the deployment originates from an appropriate source

environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}

steps:
- uses: actions/checkout@v3
- name: dbt debug
uses: kzzzr/mybi-dbt-action@v4
with:
command: dbt debug
- name: dbt deps
uses: kzzzr/mybi-dbt-action@v4
with:
command: dbt deps
- name: dbt docs
uses: kzzzr/mybi-dbt-action@v4
with:
command: dbt docs generate
- name: Setup Pages
uses: actions/configure-pages@v2
- name: Upload artifact
uses: actions/upload-pages-artifact@v1
with:
path: 'target'
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v1

name: Publish dbt Documentation on PR Closed
# triggers for the workflow
on:
workflow_dispatch:
# See https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#pull_request_target
pull_request_target:
types:
- closed
branches:
- main
jobs:
generate-dbt-docs:
name: Generate dbt docs
runs-on: ubuntu-latest
services:
clickhouse:
image: clickhouse/clickhouse-server:22.3
ports:
- 9000:9000
- 8123:8123
# Grant GITHUB_TOKEN the permissions required to make a Pages deployment
permissions:
pages: write # to deploy to Pages
id-token: write # to verify the deployment originates from an appropriate source
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- uses: actions/checkout@v3
- name: dbt debug
uses: kzzzr/mybi-dbt-action@v4
with:
command: dbt debug
- name: dbt deps
uses: kzzzr/mybi-dbt-action@v4
with:
command: dbt deps
- name: dbt docs
uses: kzzzr/mybi-dbt-action@v4
with:
command: dbt docs generate
- name: Setup Pages
uses: actions/configure-pages@v2
- name: Upload artifact
uses: actions/upload-pages-artifact@v1
with:
path: 'target'
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v1
20 changes: 10 additions & 10 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@

target/
dbt_packages/
logs/

/metabase/plugins/*
!clickhouse.metabase-driver.jar

.DS_Store

target/
dbt_packages/
logs/
/metabase/plugins/*
!clickhouse.metabase-driver.jar
.DS_Store
.cubestore/
22 changes: 11 additions & 11 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
ARG DBT_VERSION=1.0.0
FROM fishtownanalytics/dbt:${DBT_VERSION}

RUN set -ex \
&& python -m pip install --upgrade pip setuptools \
&& python -m pip install --upgrade dbt-clickhouse numpy

WORKDIR /usr/app/
ENV DBT_PROFILES_DIR=.

ENTRYPOINT ["tail", "-f", "/dev/null"]
ARG DBT_VERSION=1.0.0
FROM fishtownanalytics/dbt:${DBT_VERSION}
RUN set -ex \
&& python -m pip install --upgrade pip setuptools \
&& python -m pip install --upgrade dbt-clickhouse numpy
WORKDIR /usr/app/
ENV DBT_PROFILES_DIR=.
ENTRYPOINT ["tail", "-f", "/dev/null"]
Loading