Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
akohlislb authored Feb 19, 2023
0 parents commit b48406e
Show file tree
Hide file tree
Showing 16 changed files with 952 additions and 0 deletions.
15 changes: 15 additions & 0 deletions .github/workflows/check-pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
name: Validate Pull Request
on:
pull_request:
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

# - name: Lint YAML files
# run: yamllint transformations_apikey/ --format=github

- name: Lint YAML files (OIDC)
run: yamllint config/transformations/ --format=github
52 changes: 52 additions & 0 deletions .github/workflows/deploy-bootstrap-cli.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
---
name: deploy-bootstrap-cli

on:
push:
branches:
#- main
- none

jobs:
bootstrap_cdf:
name: Bootstrap CDF
runs-on: ubuntu-latest
strategy:
matrix:
environment: [test, prod]
include:
- environment: test
# CDF cluster, like bluefield, greenfield or westeurope-1
CDF_CLUSTER: [CDF cluster]
# CDF Project name
CDF_PROJECT: [CDF project]
# Azure AD tenant id
IDP_TENANT: [AAD tenant id]
- environment: prod
# CDF cluster, like bluefield, greenfield or westeurope-1
CDF_CLUSTER: [CDF cluster]
# CDF Project name
CDF_PROJECT: [CDF project]
# Azure AD tenant id
IDP_TENANT: [AAD tenant id]

environment: ${{ matrix.environment}}
env:
CDF_HOST: https://${{ matrix.CDF_CLUSTER }}.cognitedata.com/

steps:
- uses: actions/checkout@v3
- uses: cognitedata/inso-bootstrap-cli@main
env:
BOOTSTRAP_IDP_CLIENT_ID: ${{ secrets.CLIENT_ID }}
BOOTSTRAP_CDF_HOST: ${{ env.CDF_HOST }}
BOOTSTRAP_CDF_PROJECT: ${{ matrix.CDF_PROJECT }}
BOOTSTRAP_IDP_CLIENT_SECRET: ${{ secrets.CLIENT_SECRET }}
BOOTSTRAP_IDP_TOKEN_URL: https://login.microsoftonline.com/${{ matrix.IDP_TENANT }}/oauth2/v2.0/token
BOOTSTRAP_IDP_SCOPES: ${{ env.CDF_HOST }}.default

with:
# Path to Bootstrap CLI configuration file
config_file: ./config/bootstrap/bootstrap-cli-config.yml
# "yes"|"no" deploy with special groups and aad_mappings
#with_special_groups: "yes"
52 changes: 52 additions & 0 deletions .github/workflows/deploy-extpipes-cli.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
---
name: deploy-extpipes-cli

on:
push:
branches:
#- main
- none

jobs:
deploy_extpipes:
name: deploy extpipes-cli
runs-on: ubuntu-latest
strategy:
matrix:
environment: [test, prod]
include:
- environment: test
# CDF cluster, like bluefield, greenfield or westeurope-1
CDF_CLUSTER: [CDF cluster]
# CDF Project name
CDF_PROJECT: [CDF project]
# Azure AD tenant id
IDP_TENANT: [AAD tenant id]
- environment: prod
# CDF cluster, like bluefield, greenfield or westeurope-1
CDF_CLUSTER: [CDF cluster]
# CDF Project name
CDF_PROJECT: [CDF project]
# Azure AD tenant id
IDP_TENANT: [AAD tenant id]

environment: ${{ matrix.environment}}
env:
CDF_HOST: https://${{ matrix.CDF_CLUSTER }}.cognitedata.com/

steps:
- uses: actions/checkout@v3
- uses: cognitedata/inso-extpipes-cli@main
env:
EXTPIPES_IDP_CLIENT_ID: ${{ secrets.CLIENT_ID }}
EXTPIPES_IDP_CLIENT_SECRET: ${{ secrets.CLIENT_SECRET }}
EXTPIPES_CDF_HOST: ${{ env.CDF_HOST }}
EXTPIPES_CDF_PROJECT: ${{ matrix.CDF_PROJECT }}
EXTPIPES_IDP_TOKEN_URL: https://login.microsoftonline.com/${{ matrix.IDP_TENANT }}/oauth2/v2.0/token
EXTPIPES_IDP_SCOPES: ${{ env.CDF_HOST }}.default

with:
# Path to extpipes cli configuration file
config_file: ./config/extpipes/extpipes-cli-config.yml
# "yes"|"no" deploy with special groups and aad_mappings
#with_special_groups: "yes"
55 changes: 55 additions & 0 deletions .github/workflows/deploy-tranformations.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
---
#######################################
# AUTHENTICATION OPTION 1: #
# Using OIDC #
#######################################
name: Deploy transformations

on:
push:
#branches: [main]
branches: [none]

jobs:
deploy:
name: Deploy transformations
runs-on: ubuntu-latest
strategy:
matrix:
environment: [test, prod]
include:
- environment: test
# CDF cluster, like bluefield, greenfield or westeurope-1
CDF_CLUSTER: <CDF cluster>
# CDF Project name
CDF_PROJECT: <CDF project>
# Azure AD tenant id
IDP_TENANT: <AAD tenant id>
- environment: prod
# CDF cluster, like bluefield, greenfield or westeurope-1
CDF_CLUSTER: <CDF cluster>
# CDF Project name
CDF_PROJECT: <CDF project>
# Azure AD tenant id
IDP_TENANT: <AAD tenant id>

environment: ${{ matrix.environment}}
env:
CDF_HOST: https://${{ matrix.CDF_CLUSTER }}.cognitedata.com/
# Credentials to be used when running your transformations,
# as referenced in your manifests
COGNITE_CLIENT_ID: ${{ secrets.CLIENT_ID }}
COGNITE_CLIENT_SECRET: ${{ secrets.CLIENT_SECRET }}
CDF_PROJECT_NAME: ${{ matrix.CDF_PROJECT }}

steps:
- uses: actions/checkout@v2
- uses: cognitedata/transformations-cli@main
with:
path: config/transformations
client-id: ${{ secrets.CLIENT_ID }}
client-secret: ${{ secrets.CLIENT_SECRET }}
cdf-project-name: ${{ matrix.CDF_PROJECT }}
token-url: https://login.microsoftonline.com/${{ matrix.IDP_TENANT }}/oauth2/v2.0/token
scopes: ${{ env.CDF_HOST }}.default
cluster: ${{ matrix.CDF_CLUSTER }}
132 changes: 132 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,132 @@
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
pip-wheel-metadata/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
*.py,cover
.hypothesis/
.pytest_cache/

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py
db.sqlite3
db.sqlite3-journal

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
target/

# Jupyter Notebook
.ipynb_checkpoints

# IPython
profile_default/
ipython_config.py

# pyenv
.python-version

# pipenv
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
# However, in case of collaboration, if having platform-specific dependencies or dependencies
# having no cross-platform support, pipenv may install dependencies that don't work, or not
# install all needed dependencies.
#Pipfile.lock

# PEP 582; used by e.g. github.com/David-OConnor/pyflow
__pypackages__/

# Celery stuff
celerybeat-schedule
celerybeat.pid

# SageMath parsed files
*.sage.py

# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/

# Spyder project settings
.spyderproject
.spyproject

# Rope project settings
.ropeproject

# mkdocs documentation
/site

# mypy
.mypy_cache/
.dmypy.json
dmypy.json

# Pyre type checker
.pyre/

#pyCharm
.idea
24 changes: 24 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
---
repos:
- repo: https://github.com/adrienverge/yamllint.git
rev: v1.21.0 # or higher tag
hooks:
- id: yamllint
args: [--format, parsable]

- repo: https://github.com/jumanjihouse/pre-commit-hook-yamlfmt
rev: 0.2.1 # or specific tag
hooks:
- id: yamlfmt
args: [--width, '150']

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v3.4.0
hooks:
- id: debug-statements
- id: trailing-whitespace
- id: check-yaml
- id: check-builtin-literals
- id: end-of-file-fixer
- id: check-ast
- id: check-docstring-first
9 changes: 9 additions & 0 deletions .yamllint
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
extends: default

rules:
truthy: disable
comments-indentation: disable # don't bother me with this rule
line-length: # don't fail if longer
max: 150
level: warning
Loading

0 comments on commit b48406e

Please sign in to comment.