Skip to content
This repository has been archived by the owner on Jun 25, 2024. It is now read-only.

data flow service #661

Open
wants to merge 6 commits into
base: Milestone3-dev
Choose a base branch
from
Open
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
39 changes: 36 additions & 3 deletions src/getStepStartStates.ts
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,19 @@ import { WebSecurityScannerSteps } from './steps/web-security-scanner/constants'
import { IntegrationConfig } from './types';
import { isMasterOrganizationInstance } from './utils/isMasterOrganizationInstance';
import { isSingleProjectInstance } from './utils/isSingleProjectInstance';
import {
STEP_GOOGLE_CLOUD_DATAFLOW_JOB,
STEP_GOOGLE_CLOUD_DATAFLOW,
STEP_GOOGLE_CLOUD_DATAFLOW_DATASTORE,
STEP_GOOGLE_CLOUD_DATAFLOW_SNAPSHOT,
STEP_GOOGLE_CLOUD_PROJECT_HAS_GOOGLE_CLOUD_DATAFLOW_JOB,
STEP_GOOGLE_CLOUD_DATAFLOW_JOB_HAS_GOOGLE_CLOUD_DATAFLOW_SNAPSHOT,
STEP_GOOGLE_CLOUD_DATAFLOW_JOB_USES_GOOGLE_CLOUD_DATAFLOW_DATASTORE,
// STEP_GOOGLE_CLOUD_DATAFLOW_SNAPSHOT_USES_GOOGLE_PUBSUB_TOPIC,
STEP_GOOGLE_CLOUD_PROJECT_HAS_GOOGLE_CLOUD_DATAFLOW,
STEP_GOOGLE_CLOUD_DATAFLOW_USES_GOOGLE_SPANNER_INSTANCE,
STEP_GOOGLE_CLOUD_PROJECT_HAS_GOOGLE_CLOUD_DATAFLOW_DATASTORE
} from './steps/data-flow/constants';

function makeStepStartStates(
stepIds: string[],
Expand Down Expand Up @@ -243,9 +256,8 @@ export default async function getStepStartStates(

logger.publishEvent({
name: 'integration_config',
description: `Starting Google Cloud integration with service account (email=${
config.serviceAccountKeyConfig.client_email
}, configureOrganizationProjects=${!!config.configureOrganizationProjects})`,
description: `Starting Google Cloud integration with service account (email=${config.serviceAccountKeyConfig.client_email
}, configureOrganizationProjects=${!!config.configureOrganizationProjects})`,
});

const masterOrgInstance = isMasterOrganizationInstance(config);
Expand Down Expand Up @@ -333,6 +345,16 @@ function getDefaultStepStartStates(params: {
[STEP_AUDIT_CONFIG_IAM_POLICY]: {
disabled: !!config.configureOrganizationProjects,
},
[STEP_GOOGLE_CLOUD_DATAFLOW]: { disabled: false },
[STEP_GOOGLE_CLOUD_DATAFLOW_DATASTORE]: { disabled: false },
[STEP_GOOGLE_CLOUD_DATAFLOW_SNAPSHOT]: { disabled: false },
[STEP_GOOGLE_CLOUD_PROJECT_HAS_GOOGLE_CLOUD_DATAFLOW_JOB]: { disabled: false },
[STEP_GOOGLE_CLOUD_DATAFLOW_JOB_HAS_GOOGLE_CLOUD_DATAFLOW_SNAPSHOT]: { disabled: false },
[STEP_GOOGLE_CLOUD_DATAFLOW_JOB_USES_GOOGLE_CLOUD_DATAFLOW_DATASTORE]: { disabled: false },
// [STEP_GOOGLE_CLOUD_DATAFLOW_SNAPSHOT_USES_GOOGLE_PUBSUB_TOPIC]: { disabled: false },
[STEP_GOOGLE_CLOUD_PROJECT_HAS_GOOGLE_CLOUD_DATAFLOW]: { disabled: false },
[STEP_GOOGLE_CLOUD_PROJECT_HAS_GOOGLE_CLOUD_DATAFLOW_DATASTORE]: { disabled: false },
[STEP_GOOGLE_CLOUD_DATAFLOW_USES_GOOGLE_SPANNER_INSTANCE]: { disabled: false },
[STEP_COMPUTE_DISKS]: { disabled: false },
[STEP_COMPUTE_REGION_DISKS]: { disabled: false },
[STEP_COMPUTE_IMAGES]: { disabled: false },
Expand Down Expand Up @@ -648,6 +670,17 @@ async function getStepStartStatesUsingServiceEnablements(params: {
[STEP_AUDIT_CONFIG_IAM_POLICY]: config.configureOrganizationProjects
? { disabled: true }
: createStepStartState(ServiceUsageName.RESOURCE_MANAGER),
[STEP_GOOGLE_CLOUD_DATAFLOW_JOB]: createStepStartState(ServiceUsageName.DATA_FLOW),
[STEP_GOOGLE_CLOUD_DATAFLOW]: createStepStartState(ServiceUsageName.DATA_FLOW),
[STEP_GOOGLE_CLOUD_DATAFLOW_DATASTORE]: createStepStartState(ServiceUsageName.DATA_FLOW),
[STEP_GOOGLE_CLOUD_DATAFLOW_SNAPSHOT]: createStepStartState(ServiceUsageName.DATA_FLOW),
[STEP_GOOGLE_CLOUD_PROJECT_HAS_GOOGLE_CLOUD_DATAFLOW_JOB]: createStepStartState(ServiceUsageName.DATA_FLOW),
[STEP_GOOGLE_CLOUD_DATAFLOW_JOB_HAS_GOOGLE_CLOUD_DATAFLOW_SNAPSHOT]: createStepStartState(ServiceUsageName.DATA_FLOW),
[STEP_GOOGLE_CLOUD_DATAFLOW_JOB_USES_GOOGLE_CLOUD_DATAFLOW_DATASTORE]: createStepStartState(ServiceUsageName.DATA_FLOW),
// [STEP_GOOGLE_CLOUD_DATAFLOW_SNAPSHOT_USES_GOOGLE_PUBSUB_TOPIC]: createStepStartState(ServiceUsageName.DATA_FLOW),
[STEP_GOOGLE_CLOUD_PROJECT_HAS_GOOGLE_CLOUD_DATAFLOW]: createStepStartState(ServiceUsageName.DATA_FLOW),
[STEP_GOOGLE_CLOUD_PROJECT_HAS_GOOGLE_CLOUD_DATAFLOW_DATASTORE]: createStepStartState(ServiceUsageName.DATA_FLOW),
[STEP_GOOGLE_CLOUD_DATAFLOW_USES_GOOGLE_SPANNER_INSTANCE]: createStepStartState(ServiceUsageName.DATA_FLOW),
[STEP_COMPUTE_DISKS]: createStepStartState(ServiceUsageName.COMPUTE),
[STEP_COMPUTE_REGION_DISKS]: createStepStartState(ServiceUsageName.COMPUTE),
[STEP_COMPUTE_IMAGES]: createStepStartState(ServiceUsageName.COMPUTE),
Expand Down
1 change: 1 addition & 0 deletions src/google-cloud/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,5 @@ export enum ServiceUsageName {
CLOUD_SOURCE_REPOSITORIES = 'sourcerepo.googleapis.com',
WEB_SECURITY_SCANNER = 'websecurityscanner.googleapis.com',
ORG_POLICY = 'orgpolicy.googleapis.com',
DATA_FLOW = 'dataflow.googleapis.com'
}
2 changes: 2 additions & 0 deletions src/ingestSources.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ import { SpannerIngestionConfig } from './steps/spanner/constants';
import { SQLAdminIngestionConfig } from './steps/sql-admin';
import { StorageIngestionConfig } from './steps/storage/constants';
import { WebSecurityScannerIngestionConfig } from './steps/web-security-scanner/constants';
import { DataflowIngestionConfig } from './steps/data-flow/constants';

export const ingestionConfig: IntegrationIngestionConfigFieldMap = {
...AccessContextManagerIngestionConfig,
Expand Down Expand Up @@ -66,4 +67,5 @@ export const ingestionConfig: IntegrationIngestionConfigFieldMap = {
...SQLAdminIngestionConfig,
...StorageIngestionConfig,
...WebSecurityScannerIngestionConfig,
...DataflowIngestionConfig
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,250 @@
{
"log": {
"_recordingName": "fetch-google-cloud-dataflow-job-uses-google-cloud-dataflow-datastore",
"creator": {
"comment": "persister:JupiterOneIntegationFSPersister",
"name": "Polly.JS",
"version": "6.0.5"
},
"entries": [
{
"_id": "acea721c8193b51ced888cae721cc423",
"_order": 0,
"cache": {},
"request": {
"bodySize": 727,
"cookies": [],
"headers": [
{
"_fromType": "array",
"name": "content-type",
"value": "application/x-www-form-urlencoded"
},
{
"_fromType": "array",
"name": "user-agent",
"value": "google-api-nodejs-client/9.4.1"
},
{
"_fromType": "array",
"name": "x-goog-api-client",
"value": "gl-node/18.17.0"
},
{
"_fromType": "array",
"name": "accept",
"value": "application/json"
},
{
"_fromType": "array",
"name": "content-length",
"value": "727"
},
{
"_fromType": "array",
"name": "accept-encoding",
"value": "gzip,deflate"
},
{
"name": "host",
"value": "www.googleapis.com"
}
],
"headersSize": 293,
"httpVersion": "HTTP/1.1",
"method": "POST",
"postData": {
"mimeType": "application/x-www-form-urlencoded",
"params": [],
"text": "[REDACTED]"
},
"queryString": [],
"url": "https://www.googleapis.com/oauth2/v4/token"
},
"response": {
"bodySize": 1222,
"content": {
"encoding": "utf-8",
"mimeType": "application/json; charset=UTF-8",
"size": 1222,
"text": "{\"access_token\":\"[REDACTED]\",\"expires_in\":9999,\"token_type\":\"Bearer\"}"
},
"cookies": [],
"headers": [
{
"name": "content-type",
"value": "application/json; charset=UTF-8"
},
{
"name": "vary",
"value": "Origin, X-Origin, Referer"
},
{
"name": "date",
"value": "Tue, 07 May 2024 12:39:39 GMT"
},
{
"name": "server",
"value": "scaffolding on HTTPServer2"
},
{
"name": "cache-control",
"value": "private"
},
{
"name": "x-xss-protection",
"value": "0"
},
{
"name": "x-frame-options",
"value": "SAMEORIGIN"
},
{
"name": "x-content-type-options",
"value": "nosniff"
},
{
"name": "alt-svc",
"value": "h3=\":443\"; ma=2592000,h3-29=\":443\"; ma=2592000"
},
{
"name": "connection",
"value": "close"
}
],
"headersSize": 390,
"httpVersion": "HTTP/1.1",
"redirectURL": "",
"status": 200,
"statusText": "OK"
},
"startedDateTime": "2024-05-07T12:39:38.864Z",
"time": 187,
"timings": {
"blocked": -1,
"connect": -1,
"dns": -1,
"receive": 0,
"send": 0,
"ssl": -1,
"wait": 187
}
},
{
"_id": "45fdb1f844a17b6d6ec371710879c815",
"_order": 0,
"cache": {},
"request": {
"bodySize": 0,
"cookies": [],
"headers": [
{
"_fromType": "array",
"name": "x-goog-api-client",
"value": "gdcl/7.0.1 gl-node/18.17.0"
},
{
"_fromType": "array",
"name": "accept-encoding",
"value": "gzip"
},
{
"_fromType": "array",
"name": "user-agent",
"value": "google-api-nodejs-client/7.0.1 (gzip)"
},
{
"_fromType": "array",
"name": "authorization",
"value": "[REDACTED]"
},
{
"_fromType": "array",
"name": "accept",
"value": "*/*"
},
{
"name": "host",
"value": "dataflow.googleapis.com"
}
],
"headersSize": 1305,
"httpVersion": "HTTP/1.1",
"method": "GET",
"queryString": [],
"url": "https://dataflow.googleapis.com/v1b3/projects/j1-gc-integration-dev-v3/jobs"
},
"response": {
"bodySize": 763,
"content": {
"encoding": "utf-8",
"mimeType": "application/json; charset=UTF-8",
"size": 763,
"text": "{\"jobs\":[{\"id\":\"2024-05-02_05_25_02-17305733872805367843\",\"projectId\":\"j1-gc-integration-dev-v3\",\"name\":\"test-job3\",\"type\":\"JOB_TYPE_BATCH\",\"currentState\":\"JOB_STATE_FAILED\",\"currentStateTime\":\"2024-05-02T13:28:54.170517Z\",\"createTime\":\"2024-05-02T12:25:06.098727Z\",\"location\":\"us-central1\",\"jobMetadata\":{\"sdkVersion\":{\"version\":\"2.55.1\",\"versionDisplayName\":\"Apache Beam SDK for Java\",\"sdkSupportStatus\":\"SUPPORTED\"}},\"startTime\":\"2024-05-02T12:25:06.098727Z\"},{\"id\":\"2024-04-29_06_54_21-11420805499054724452\",\"projectId\":\"j1-gc-integration-dev-v3\",\"name\":\"test-metron-job2\",\"currentState\":\"JOB_STATE_FAILED\",\"currentStateTime\":\"2024-04-29T14:01:46.604199Z\",\"createTime\":\"2024-04-29T13:54:22.225266Z\",\"location\":\"us-central1\",\"startTime\":\"2024-04-29T13:54:22.225266Z\"},{\"id\":\"2024-04-29_06_40_47-701576625030004708\",\"projectId\":\"j1-gc-integration-dev-v3\",\"name\":\"test-metron-job1\",\"currentState\":\"JOB_STATE_FAILED\",\"currentStateTime\":\"2024-04-29T13:46:31.741443Z\",\"createTime\":\"2024-04-29T13:40:48.311738Z\",\"location\":\"us-central1\",\"startTime\":\"2024-04-29T13:40:48.311738Z\"}]}"
},
"cookies": [],
"headers": [
{
"name": "content-type",
"value": "application/json; charset=UTF-8"
},
{
"name": "vary",
"value": "Origin, X-Origin, Referer"
},
{
"name": "date",
"value": "Tue, 07 May 2024 12:39:40 GMT"
},
{
"name": "server",
"value": "ESF"
},
{
"name": "cache-control",
"value": "private"
},
{
"name": "x-xss-protection",
"value": "0"
},
{
"name": "x-frame-options",
"value": "SAMEORIGIN"
},
{
"name": "x-content-type-options",
"value": "nosniff"
},
{
"name": "alt-svc",
"value": "h3=\":443\"; ma=2592000,h3-29=\":443\"; ma=2592000"
},
{
"name": "connection",
"value": "close"
}
],
"headersSize": 367,
"httpVersion": "HTTP/1.1",
"redirectURL": "",
"status": 200,
"statusText": "OK"
},
"startedDateTime": "2024-05-07T12:39:39.060Z",
"time": 1774,
"timings": {
"blocked": -1,
"connect": -1,
"dns": -1,
"receive": 0,
"send": 0,
"ssl": -1,
"wait": 1774
}
}
],
"pages": [],
"version": "1.2"
}
}
Loading
Loading