Skip to content

Commit

Permalink
chore: Changes for Arch (#685)
Browse files Browse the repository at this point in the history
  • Loading branch information
pnadolny13 authored Aug 5, 2024
1 parent 422f45c commit 3dde080
Show file tree
Hide file tree
Showing 20 changed files with 127 additions and 31 deletions.
31 changes: 31 additions & 0 deletions .github/workflows/el_ssa_ip_addresses.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Meltano - Spreadsheets Anywhere IP Addresses

on:
schedule:
- cron: '0 10 * * *'

workflow_dispatch:

jobs:
el_ssa_ip_addresses:
runs-on: ubuntu-latest
defaults:
run:
working-directory: data/
environment: prod
env:
MELTANO_ENVIRONMENT: prod
MELTANO_SEND_ANONYMOUS_USAGE_STATS: 'false'
SNOWFLAKE_PASSWORD: ${{ secrets.SNOWFLAKE_PASSWORD }}
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: '3.11'
cache: 'pip'
- run: pip install -r requirements.txt
- run: echo "${{secrets.MELTANO_ENV_FILE }}" > .env
# Install Plugins
- run: meltano install --schedule=spreadsheets_anywhere_el
# Run Test
- run: meltano run spreadsheets_anywhere_el
35 changes: 35 additions & 0 deletions .github/workflows/hub_metrics_publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Meltano - Hub Metrics Publish

on:
schedule:
- cron: '0 12 * * *'

workflow_dispatch:

jobs:
hub_metrics_publish:
runs-on: ubuntu-latest
defaults:
run:
working-directory: data/
environment: prod
env:
MELTANO_ENVIRONMENT: prod
MELTANO_SEND_ANONYMOUS_USAGE_STATS: 'false'
SNOWFLAKE_PASSWORD: ${{ secrets.SNOWFLAKE_PASSWORD }}
TAP_SNOWFLAKE_METRICS_TABLES: '["b${{ github.SHA }}_MELTANO_HUB.FACT_VARIANT_HUB_METRICS"]'
TAP_SNOWFLAKE_AUDIT_TABLES: '["b${{ github.SHA }}_MELTANO_HUB.HUB_METRICS_AUDIT"]'
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: '3.11'
cache: 'pip'
- run: pip install -r requirements.txt
- run: echo "${{secrets.MELTANO_ENV_FILE }}" > .env
# Install Plugins
- run: meltano install --schedule=hub_metrics_publish
# Run Test
- run: meltano run hub_metrics_publish
35 changes: 35 additions & 0 deletions .github/workflows/slack_notifications.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Meltano - Slack Publish

on:
schedule:
- cron: '0 12 * * *'

workflow_dispatch:

jobs:
slack_notifications:
runs-on: ubuntu-latest
defaults:
run:
working-directory: data/
environment: prod
env:
MELTANO_ENVIRONMENT: prod
MELTANO_SEND_ANONYMOUS_USAGE_STATS: 'false'
SNOWFLAKE_PASSWORD: ${{ secrets.SNOWFLAKE_PASSWORD }}
TAP_SNOWFLAKE_SINGER_ACTIVITY: '["MELTANO_HUB.SINGER_ACTIVITY_NOTIFICATIONS"]'
TAP_SNOWFLAKE_MELTANO_ACTIVITY: '["MELTANO_HUB.MELTANO_ACTIVITY_NOTIFICATIONS"]'
TARGET_APPRISE_SINGER_ACTIVITY_URIS: ${{ secrets.APPRISE_SINGER_ACTIVITY_WEBHOOK }}
TARGET_APPRISE_MELTANO_ACTIVITY_URIS: ${{ secrets.APPRISE_MELTANO_ACTIVITY_WEBHOOK }}
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: '3.11'
cache: 'pip'
- run: pip install -r requirements.txt
- run: echo "${{secrets.MELTANO_ENV_FILE }}" > .env
# Install Plugins
- run: meltano install --schedule=slack_notifications
# Run Test
- run: meltano run slack_notifications
10 changes: 5 additions & 5 deletions data/orchestrate/orchestrators.meltano.yml
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ jobs:

- name: slack_notifications
tasks:
- dbt-snowflake:run_slack_notifications
# - dbt-snowflake:run_slack_notifications
- tap-snowflake-singer-activity target-apprise-singer-activity
- tap-snowflake-meltano-activity target-apprise-meltano-activity

Expand All @@ -117,8 +117,8 @@ jobs:
- name: spreadsheets_anywhere_el
tasks:
- tap-spreadsheets-anywhere coalesce-gcp-ips target-snowflake
- dbt-snowflake:test_source_spreadsheets_anywhere
- dbt-snowflake:run_snapshot_spreadsheets_anywhere
# - dbt-snowflake:test_source_spreadsheets_anywhere
# - dbt-snowflake:run_snapshot_spreadsheets_anywhere

- name: snowplow_el
tasks:
Expand Down Expand Up @@ -160,8 +160,8 @@ jobs:

- name: hub_metrics_publish
tasks:
- dbt-snowflake:run_hub_metrics
- dbt-snowflake:test_hub_metrics
# - dbt-snowflake:run_hub_metrics
# - dbt-snowflake:test_hub_metrics
# - great_expectations:test_dbt_hub_metrics
- tap-snowflake-metrics target-yaml-metrics awscli:s3_copy_metrics
- tap-snowflake-audit target-yaml-audit awscli:s3_copy_audit
Expand Down
16 changes: 8 additions & 8 deletions data/transform/dbt_project.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,14 @@ clean-targets:
- dbt_packages
- logs

on-run-end: "{% if target.name in ('prod', 'cicd') %}{{ dbt_artifacts.upload_results(results) }}{% endif %}"
on-run-end: "{% if target.name in ('prod', 'cicd') %} {{ dbt_artifacts.upload_results(results) }} {% endif %}"

seeds:
quote_columns: false
+schema: SEED

snapshots:
target_database: "{{ env_var('DBT_SNOWFLAKE_DATABASE_PREP') }}"
target_database: "{{ env_var('DBT_SNOWFLAKE_DATABASE_PREP', 'PREP') }}"
target_schema: snapshots
transient: false

Expand All @@ -41,7 +41,7 @@ models:
# Staging
# ------------------
staging:
+database: "{{ env_var('DBT_SNOWFLAKE_DATABASE_PREP') }}"
+database: "{{ env_var('DBT_SNOWFLAKE_DATABASE_PREP', 'PREP') }}"
cloudwatch:
+schema: cloudwatch
dynamodb:
Expand Down Expand Up @@ -77,7 +77,7 @@ models:
# Common
# ------------------
common:
+database: "{{ env_var('DBT_SNOWFLAKE_DATABASE_PREP') }}"
+database: "{{ env_var('DBT_SNOWFLAKE_DATABASE_PREP', 'PREP') }}"
+schema: workspace
+materialized: view
# ------------------
Expand All @@ -87,21 +87,21 @@ models:
+materialized: table
telemetry:
base:
+database: "{{ env_var('DBT_SNOWFLAKE_DATABASE_PREP') }}"
+database: "{{ env_var('DBT_SNOWFLAKE_DATABASE_PREP', 'PREP') }}"
+schema: workspace
+materialized: view
+schema: telemetry
community:
base:
+database: "{{ env_var('DBT_SNOWFLAKE_DATABASE_PREP') }}"
+database: "{{ env_var('DBT_SNOWFLAKE_DATABASE_PREP', 'PREP') }}"
+schema: workspace
+materialized: view
+schema: community
dbt_artifacts:
+schema: dbt_artifacts
staging:
+database: "{{ env_var('DBT_SNOWFLAKE_DATABASE_PREP') }}"
+database: "{{ env_var('DBT_SNOWFLAKE_DATABASE_PREP', 'PREP') }}"
+schema: dbt_artifacts
sources:
+database: "{{ env_var('DBT_SNOWFLAKE_DATABASE_PREP') }}"
+database: "{{ env_var('DBT_SNOWFLAKE_DATABASE_PREP', 'PREP') }}"
+schema: "{{ env_var('DBT_SNOWFLAKE_SOURCE_SCHEMA_PREFIX', '') }}SOURCE_DBT_ARTIFACTS"
2 changes: 1 addition & 1 deletion data/transform/models/staging/cloudwatch/sources.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ config-version: 2
version: 2
sources:
- name: tap_cloudwatch
database: '{{ env_var("DBT_SNOWFLAKE_DATABASE_RAW") }}'
database: '{{ env_var("DBT_SNOWFLAKE_DATABASE_RAW", "RAW") }}'
schema: '{{ env_var("DBT_SNOWFLAKE_SOURCE_SCHEMA_PREFIX", "") }}TAP_CLOUDWATCH'
tables:
- name: log
2 changes: 1 addition & 1 deletion data/transform/models/staging/dynamodb/sources.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ config-version: 2
version: 2
sources:
- name: tap_dynamodb
database: '{{ env_var("DBT_SNOWFLAKE_DATABASE_RAW") }}'
database: '{{ env_var("DBT_SNOWFLAKE_DATABASE_RAW", "RAW") }}'
schema: '{{ env_var("DBT_SNOWFLAKE_SOURCE_SCHEMA_PREFIX", "") }}TAP_DYNAMODB'
tables:
- name: workload_metadata_table
Expand Down
2 changes: 1 addition & 1 deletion data/transform/models/staging/github_meltano/sources.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ config-version: 2
version: 2
sources:
- name: tap_github_meltano
database: '{{ env_var("DBT_SNOWFLAKE_DATABASE_RAW") }}'
database: '{{ env_var("DBT_SNOWFLAKE_DATABASE_RAW", "RAW") }}'
schema: '{{ env_var("DBT_SNOWFLAKE_SOURCE_SCHEMA_PREFIX", "") }}TAP_GITHUB_MELTANO'
tables:
- name: issues
Expand Down
2 changes: 1 addition & 1 deletion data/transform/models/staging/github_search/sources.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ config-version: 2
version: 2
sources:
- name: tap_github_search
database: '{{ env_var("DBT_SNOWFLAKE_DATABASE_RAW") }}'
database: '{{ env_var("DBT_SNOWFLAKE_DATABASE_RAW", "RAW") }}'
schema: '{{ env_var("DBT_SNOWFLAKE_SOURCE_SCHEMA_PREFIX", "") }}TAP_GITHUB_SEARCH'
tables:
- name: issues
Expand Down
4 changes: 2 additions & 2 deletions data/transform/models/staging/gitlab/sources.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@ config-version: 2
version: 2
sources:
- name: tap_gitlab
database: '{{ env_var("DBT_SNOWFLAKE_DATABASE_RAW") }}'
database: '{{ env_var("DBT_SNOWFLAKE_DATABASE_RAW", "RAW") }}'
schema: '{{ env_var("DBT_SNOWFLAKE_SOURCE_SCHEMA_PREFIX", "") }}TAP_GITLAB'
tables:
- name: issues
- name: merge_requests
- name: projects
- name: tap_gitlab_hotglue
database: '{{ env_var("DBT_SNOWFLAKE_DATABASE_RAW") }}'
database: '{{ env_var("DBT_SNOWFLAKE_DATABASE_RAW", "RAW") }}'
schema: '{{ env_var("DBT_SNOWFLAKE_SOURCE_SCHEMA_PREFIX", "") }}TAP_GITLAB_HOTGLUE'
tables:
- name: issues
Expand Down
2 changes: 0 additions & 2 deletions data/transform/models/staging/gitlab/stg_gitlab__issues.sql
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
{{ config(materialized='table') }}

WITH source_meltano AS (

SELECT
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
{{ config(materialized='table') }}

WITH source_meltano AS (

SELECT
Expand Down
2 changes: 0 additions & 2 deletions data/transform/models/staging/gitlab/stg_gitlab__projects.sql
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
{{ config(materialized='table') }}

WITH source AS (

SELECT
Expand Down
2 changes: 1 addition & 1 deletion data/transform/models/staging/google_analytics/sources.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ config-version: 2
version: 2
sources:
- name: tap_google_analytics
database: '{{ env_var("DBT_SNOWFLAKE_DATABASE_RAW") }}'
database: '{{ env_var("DBT_SNOWFLAKE_DATABASE_RAW", "RAW") }}'
schema: '{{ env_var("DBT_SNOWFLAKE_SOURCE_SCHEMA_PREFIX", "") }}TAP_GOOGLE_ANALYTICS'
tables:
- name: events
2 changes: 1 addition & 1 deletion data/transform/models/staging/meltanohub/sources.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ config-version: 2
version: 2
sources:
- name: tap_meltanohub
database: '{{ env_var("DBT_SNOWFLAKE_DATABASE_RAW") }}'
database: '{{ env_var("DBT_SNOWFLAKE_DATABASE_RAW", "RAW") }}'
schema: '{{ env_var("DBT_SNOWFLAKE_SOURCE_SCHEMA_PREFIX", "") }}TAP_MELTANOHUB'
tables:
- name: plugins
Expand Down
4 changes: 2 additions & 2 deletions data/transform/models/staging/slack/sources.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@ config-version: 2
version: 2
sources:
- name: tap_slack
database: '{{ env_var("DBT_SNOWFLAKE_DATABASE_RAW") }}'
database: '{{ env_var("DBT_SNOWFLAKE_DATABASE_RAW", "RAW") }}'
schema: '{{ env_var("DBT_SNOWFLAKE_SOURCE_SCHEMA_PREFIX", "") }}TAP_SLACK'
tables:
- name: users
- name: messages
- name: channels
- name: tap_slack_public
database: '{{ env_var("DBT_SNOWFLAKE_DATABASE_RAW") }}'
database: '{{ env_var("DBT_SNOWFLAKE_DATABASE_RAW", "RAW") }}'
schema: '{{ env_var("DBT_SNOWFLAKE_SOURCE_SCHEMA_PREFIX", "") }}TAP_SLACK_PUBLIC'
tables:
- name: messages
Expand Down
2 changes: 1 addition & 1 deletion data/transform/models/staging/snowplow/sources.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ config-version: 2
version: 2
sources:
- name: snowplow
database: '{{ env_var("DBT_SNOWFLAKE_DATABASE_RAW") }}'
database: '{{ env_var("DBT_SNOWFLAKE_DATABASE_RAW", "RAW") }}'
schema: '{{ env_var("DBT_SNOWFLAKE_SOURCE_SCHEMA_PREFIX", "") }}SNOWPLOW'
tables:
- name: events
Expand Down
2 changes: 1 addition & 1 deletion data/transform/snapshots/spreadsheets_anywhere/sources.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ config-version: 2
version: 2
sources:
- name: tap_spreadsheets_anywhere
database: '{{ env_var("DBT_SNOWFLAKE_DATABASE_RAW") }}'
database: '{{ env_var("DBT_SNOWFLAKE_DATABASE_RAW", "RAW") }}'
schema: '{{ env_var("DBT_SNOWFLAKE_SOURCE_SCHEMA_PREFIX", "") }}TAP_SPREADSHEETS_ANYWHERE'
tables:
- name: aws_ips
Expand Down
1 change: 1 addition & 0 deletions data/transform/transformers.meltano.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,3 +45,4 @@ plugins:
account: epa06486
database_raw: RAW
database_prep: PREP
profiles_dir: $MELTANO_PROJECT_ROOT/transform/profiles/squared_snowflake

0 comments on commit 3dde080

Please sign in to comment.