Compare commits

...
8 Commits
Author SHA1 Message Date
Gabriel Amorim c416a2cb97 Merge pull request #219 from dadosfera/feat/pipeline-monitoring-dashboard
Feat: pipeline monitoring dashboard
2024-05-06 16:52:26 -03:00
Gabriel Rosa d03021fc9d new protospack release 2024-05-06 15:28:26 -03:00
Gabriel Rosa 574cf48726 FIX: npm audit fix 2024-05-02 12:11:46 -03:00
Gabriel Rosa 7cef404acf FEAT: get monitoring dashboard url 2024-05-02 12:11:35 -03:00
Gabriel Rosa 3c32c3c7d4 CI: Update actions/checkout to v4 2024-04-22 14:57:01 -03:00
Gabriel Amorim d44531b963 Merge pull request #218 from dadosfera/feat/choose-deploy-dockerhub
[ TECN-6603 ] CI: update action versions and choose wether to upload to dockerhub
2024-01-10 10:05:47 -03:00
Gabriel Rosa 36c80b480e CI: update action versions and choose wether to upload to dockerhub 2024-01-04 14:58:47 -03:00
Rafael Santana eeef97679c Merge pull request #217 from dadosfera/ci/dockerhub
UPDATE: updating maestro to deploy image to dockerhub
2023-11-26 21:18:32 -03:00
9 changed files with 2385 additions and 1781 deletions
+1 -1
View File
@@ -8,7 +8,7 @@ module.exports = {
extends: [ extends: [
'eslint:recommended', 'eslint:recommended',
'plugin:@typescript-eslint/recommended', 'plugin:@typescript-eslint/recommended',
'plugin:prettier/recommended', 'prettier',
], ],
root: true, root: true,
env: { env: {
+16 -10
View File
@@ -13,6 +13,11 @@ on:
- stg - stg
- stg2 - stg2
- prd - prd
push_to_dockerhub:
description: "Push image to Dockerhub?"
required: true
type: boolean
default: false
jobs: jobs:
extract_environment: extract_environment:
@@ -39,11 +44,11 @@ jobs:
new_release_version: ${{ (steps.semantic.outputs.new_release_published == 'true' && steps.semantic.outputs.new_release_version) || (github.event_name == 'workflow_dispatch' && '0.0.0') }} new_release_version: ${{ (steps.semantic.outputs.new_release_published == 'true' && steps.semantic.outputs.new_release_version) || (github.event_name == 'workflow_dispatch' && '0.0.0') }}
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v3 uses: actions/checkout@v4
- if: github.event_name != 'workflow_dispatch' - if: github.event_name != 'workflow_dispatch'
name: Semantic Release name: Semantic Release
uses: cycjimmy/semantic-release-action@v3 uses: cycjimmy/semantic-release-action@v4
id: semantic id: semantic
with: with:
extra_plugins: | extra_plugins: |
@@ -76,7 +81,7 @@ jobs:
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v3 uses: actions/checkout@v4
- name: Update Pip - name: Update Pip
run: | run: |
@@ -95,14 +100,14 @@ jobs:
python3 -m pip install awsebcli --upgrade python3 -m pip install awsebcli --upgrade
- name: Configure AWS Region - name: Configure AWS Region
uses: aws-actions/configure-aws-credentials@v1-node16 uses: aws-actions/configure-aws-credentials@v4
id: aws id: aws
with: with:
aws-region: us-east-1 aws-region: us-east-1
- name: Login to AWS ECR - name: Login to AWS ECR
id: login_ecr id: login_ecr
uses: aws-actions/amazon-ecr-login@v1 uses: aws-actions/amazon-ecr-login@v2
- name: Build, Tag, and Push Image to AWS ECR - name: Build, Tag, and Push Image to AWS ECR
env: env:
@@ -114,20 +119,21 @@ jobs:
docker-compose -f build.docker-compose.yml push docker-compose -f build.docker-compose.yml push
- name: Login to Docker Hub - name: Login to Docker Hub
if: ${{inputs.push_to_dockerhub}}
uses: docker/login-action@v2 uses: docker/login-action@v2
with: with:
username: dadosfera username: dadosfera
password: ${{ secrets.DOCKERHUB_PASSWORD }} password: ${{ secrets.DOCKERHUB_PASSWORD }}
- name: Build, Tag, and Push Image to Dockerhub - name: Build, Tag, and Push Image to Dockerhub
if: ${{inputs.push_to_dockerhub}}
env: env:
ENV: ${{ needs.extract_environment.outputs.environment }} ENV: ${{ needs.extract_environment.outputs.environment }}
IMAGE_TAG: ${{ needs.semantic_release.outputs.new_release_version }} IMAGE_TAG: ${{ needs.semantic_release.outputs.new_release_version }}
ACCOUNT_ID: ${{ steps.aws.outputs.aws-account-id }} ACCOUNT_ID: ${{ steps.aws.outputs.aws-account-id }}
run: | run: |
docker-compose -f build.docker-compose.dockerhub.yml build docker-compose -f build.docker-compose.dockerhub.yml build
docker-compose -f build.docker-compose.dockerhub.yml push docker-compose -f build.docker-compose.dockerhub.yml push
- name: Create ZIP file to Deploy AWS Beanstalk - name: Create ZIP file to Deploy AWS Beanstalk
env: env:
@@ -162,7 +168,7 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v3 uses: actions/checkout@v4
- name: Extract Docs BlockId and PageId - name: Extract Docs BlockId and PageId
env: env:
+1
View File
@@ -12,6 +12,7 @@
"start:debug" "start:debug"
], ],
"runtimeExecutable": "npm", "runtimeExecutable": "npm",
"runtimeVersion": "18.10.0",
"skipFiles": [ "skipFiles": [
"<node_internals>/**" "<node_internals>/**"
], ],
+40 -1
View File
@@ -2663,6 +2663,45 @@
] ]
} }
}, },
"/pipelinesV2/monitoring-dashboard": {
"get": {
"operationId": "PipelinesController_getMonitoringDashboard",
"parameters": [
{
"name": "dadosfera-lang",
"in": "header",
"required": false,
"schema": {
"enum": [
"pt-br",
"en-us"
],
"type": "string"
}
}
],
"responses": {
"200": {
"description": "",
"content": {
"application/json": {
"schema": {
"type": "object"
}
}
}
}
},
"tags": [
"PipelinesV2"
],
"security": [
{
"access-token": []
}
]
}
},
"/pipelinesV2": { "/pipelinesV2": {
"post": { "post": {
"operationId": "PipelinesController_create", "operationId": "PipelinesController_create",
@@ -5076,7 +5115,7 @@
} }
}, },
"info": { "info": {
"title": "Maestro - feat/generate-token", "title": "Maestro - feat/pipeline-monitoring-dashboard",
"description": "This is the Maestro API", "description": "This is the Maestro API",
"version": "1.0.0", "version": "1.0.0",
"contact": {} "contact": {}
+2290 -1764
View File
File diff suppressed because it is too large Load Diff
+3 -4
View File
@@ -29,7 +29,7 @@
"dependencies": { "dependencies": {
"@aws-sdk/client-secrets-manager": "^3.112.0", "@aws-sdk/client-secrets-manager": "^3.112.0",
"@dadosfera/dadosfera-logs": "^1.0.0-beta.4", "@dadosfera/dadosfera-logs": "^1.0.0-beta.4",
"@dadosfera/protospack-v2": "3.31.0", "@dadosfera/protospack-v2": "3.33.0",
"@grpc/grpc-js": "^1.6.7", "@grpc/grpc-js": "^1.6.7",
"@grpc/proto-loader": "^0.6.13", "@grpc/proto-loader": "^0.6.13",
"@nestjs/cli": "^9.4.2", "@nestjs/cli": "^9.4.2",
@@ -80,11 +80,10 @@
"@types/passport-google-oauth20": "^2.0.11", "@types/passport-google-oauth20": "^2.0.11",
"@types/passport-oauth2": "^1.4.11", "@types/passport-oauth2": "^1.4.11",
"@types/supertest": "^2.0.12", "@types/supertest": "^2.0.12",
"@typescript-eslint/eslint-plugin": "^5.29.0", "@typescript-eslint/eslint-plugin": "^5.62.0",
"@typescript-eslint/parser": "^5.29.0", "@typescript-eslint/parser": "^5.62.0",
"eslint": "^8.18.0", "eslint": "^8.18.0",
"eslint-config-prettier": "^8.5.0", "eslint-config-prettier": "^8.5.0",
"eslint-plugin-prettier": "^4.0.0",
"jest": "^27.5.1", "jest": "^27.5.1",
"nock": "^13.2.7", "nock": "^13.2.7",
"prettier": "^2.7.1", "prettier": "^2.7.1",
+3 -1
View File
@@ -164,6 +164,8 @@ export class AuthClientService implements OnModuleInit {
async oauthSignIn(data: { username: string; token: string }) { async oauthSignIn(data: { username: string; token: string }) {
const { username, token } = data; const { username, token } = data;
return lastValueFrom(this.authService.AuthOauthSignIn({ token, username })); return lastValueFrom(
this.authService.AuthOauthSignIn({ token, username, refreshToken: '' }),
);
} }
} }
@@ -14,6 +14,7 @@ import {
Patch, Patch,
HttpException, HttpException,
BadRequestException, BadRequestException,
CacheTTL,
} from '@nestjs/common'; } from '@nestjs/common';
import { import {
ApiCreatedResponse, ApiCreatedResponse,
@@ -86,6 +87,18 @@ export class PipelinesController {
this.logger = dadosferaLogger.logger; this.logger = dadosferaLogger.logger;
} }
@Get('monitoring-dashboard')
async getMonitoringDashboard(@User() user: RequestUser) {
this.logger.info('PipelinesController - getMonitoringDashboard', { user });
const metadata = PackTheMetadata(user);
const response =
await this.pipelinesClientService.getMonitoringDashboardUrl(metadata);
return response;
}
@Post() @Post()
@ApiCreatedResponse({ type: IPipelineV2 }) @ApiCreatedResponse({ type: IPipelineV2 })
async create( async create(
@@ -321,4 +321,22 @@ export class PipelinesService implements OnModuleInit {
); );
}); });
} }
async getMonitoringDashboardUrl(metadata: Metadata) {
this.logger.info('PipelinesClientService - getMonitoringDashboardUrl');
const res = await lastValueFrom(
this.pipelineReadService.PipelineV2GetDashboardUrl(
{
dashboard_id: '83',
exp: '15m',
metabase_customer_name: 'dadosferatech',
},
metadata,
),
);
this.logger.info('Done');
return res;
}
} }