-
Notifications
You must be signed in to change notification settings - Fork 1
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
[feat]: deploy elementary report #468
Merged
Merged
Conversation
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
arthurfg
force-pushed
the
feat/deploy-elementary-report
branch
from
March 22, 2024 23:00
9bd513a
to
98dcd57
Compare
vncsna
suggested changes
Mar 25, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Recomendo adicionar o edr_target
ao gitignore e retirar arquivos desse PR
vncsna
reviewed
Mar 25, 2024
arthurfg
force-pushed
the
feat/deploy-elementary-report
branch
from
March 27, 2024 20:11
fb9e084
to
1739ac7
Compare
vncsna
approved these changes
Mar 27, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
close #467
Sobre o elementary: https://docs.elementary-data.com/introduction
Documentação para o deploy: https://docs.elementary-data.com/oss/deployment-and-configuration/elementary-in-production
O elementary possui um CLI que gera, dentre outras coisas, um report em .html com os resultados dos testes. A ideia é que possamos usar esse html na BD.
Exemplo do html:
A documentação sugere algumas maneiras para orquestrar a execução dos comandos cli em produção (docker, gh actions, prefect e etc), escolhi a action pq é a mesma ferramenta que usamos para orquestrar o deploy do dbt e por parecer ser mais simples de implementar.
Então a ideia seria que a cada push na main a action rodasse dois comandos: o
edr report
para gerar o html eedr send-report
para subir o arquivo html no gcs.Link para a action: https://github.com/elementary-data/run-elementary-action
O input
profiles-yml
na action não é necessário pq já existe um arquivoprofiles-yml
no repositório, ele usa esse por default. O que precisamos incluir são as secrets com ogcs-keyfile
egcs-bucket-name
e ogoogle-service-account-path
, que não sei qual é ao certoAtualização:
Fiz uma poc no meu repositório para testar a action e consegui rodar o processo de gerar o report + subir o html no gcs. Aqui o report hospedado no storage: https://storage.googleapis.com/arthur-data-engineering-course-terra-bucket/index.html. Dá pra mudar o domínio, deixar em um bucket separado e etc, mas não muda a funcionalidade.
Secrets que precisamos criar:
BIGQUERY_KEYFILE
: uma service account que tenha as permissõesBigQuery Data Editor
eBigQuery User
ELEMENTARY_PROFILES_YML
: o conteúdo doprofiles.yml
só que com okeyfile
apontando para/tmp/bigquery_keyfile.json
:GCS_BUCKET_NAME
: nome do bucketGCS_KEYFILE
: uma service account com as permissões para criar/subir dados no bucketDepois de subir verificar as permissões/visibilidadede bucket (segui esse tutorial), mas acho que não vamos precisar mudar nada pq o bucket de dev e prod já são abertos.