From 5dea53547619e3764be8018d92d677fafdf68c8e Mon Sep 17 00:00:00 2001 From: George Wu Date: Wed, 31 Jan 2024 10:58:41 -0500 Subject: [PATCH 1/3] Save web console changes --- .../ingestion-spec/ingestion-spec.tsx | 18 ++++++++--------- .../input-source/input-source.tsx | 20 +++++++++---------- .../views/load-data-view/load-data-view.tsx | 6 +++--- 3 files changed, 22 insertions(+), 22 deletions(-) diff --git a/web-console/src/druid-models/ingestion-spec/ingestion-spec.tsx b/web-console/src/druid-models/ingestion-spec/ingestion-spec.tsx index 41f77593d28a..5e67a2a93c74 100644 --- a/web-console/src/druid-models/ingestion-spec/ingestion-spec.tsx +++ b/web-console/src/druid-models/ingestion-spec/ingestion-spec.tsx @@ -97,7 +97,7 @@ export type IngestionComboType = | 'index_parallel:druid' | 'index_parallel:inline' | 'index_parallel:s3' - | 'index_parallel:azure' + | 'index_parallel:azureStorage' | 'index_parallel:google' | 'index_parallel:hdfs'; @@ -139,7 +139,7 @@ export function getIngestionComboType( case 'druid': case 'inline': case 's3': - case 'azure': + case 'azureStorage': case 'google': case 'hdfs': return `${ioConfig.type}:${inputSource.type}` as IngestionComboType; @@ -167,7 +167,7 @@ export function getIngestionTitle(ingestionType: IngestionComboTypeWithExtra): s case 'index_parallel:s3': return 'Amazon S3'; - case 'index_parallel:azure': + case 'index_parallel:azureStorage': return 'Azure Data Lake'; case 'index_parallel:google': @@ -225,7 +225,7 @@ export function getRequiredModule(ingestionType: IngestionComboTypeWithExtra): s case 'index_parallel:s3': return 'druid-s3-extensions'; - case 'index_parallel:azure': + case 'index_parallel:azureStorage': return 'druid-azure-extensions'; case 'index_parallel:google': @@ -776,7 +776,7 @@ export function getIoConfigFormFields(ingestionComboType: IngestionComboType): F }, ]; - case 'index_parallel:azure': + case 'index_parallel:azureStorage': return [ inputSourceType, { @@ -784,7 +784,7 @@ export function getIoConfigFormFields(ingestionComboType: IngestionComboType): F label: 'Azure URIs', type: 'string-array', placeholder: - 'azure://your-container/some-file1.ext, azure://your-container/some-file2.ext', + 'azureStorage://your-storage-account/your-container/some-file1.ext, azureStorage://your-storage-account/your-container/some-file2.ext', required: true, defined: ioConfig => !deepGet(ioConfig, 'inputSource.prefixes') && !deepGet(ioConfig, 'inputSource.objects'), @@ -802,7 +802,7 @@ export function getIoConfigFormFields(ingestionComboType: IngestionComboType): F name: 'inputSource.prefixes', label: 'Azure prefixes', type: 'string-array', - placeholder: 'azure://your-container/some-path1, azure://your-container/some-path2', + placeholder: 'azureStorage://your-storage-account/your-container/some-path1, azure://your-storage-account/your-container/some-path2', required: true, defined: ioConfig => !deepGet(ioConfig, 'inputSource.uris') && !deepGet(ioConfig, 'inputSource.objects'), @@ -817,7 +817,7 @@ export function getIoConfigFormFields(ingestionComboType: IngestionComboType): F name: 'inputSource.objects', label: 'Azure objects', type: 'json', - placeholder: '{"bucket":"your-container", "path":"some-file.ext"}', + placeholder: '{"bucket":"your-storage-account", "path":"your-container/some-file.ext"}', required: true, defined: ioConfig => deepGet(ioConfig, 'inputSource.objects'), info: ( @@ -1083,7 +1083,7 @@ export function getIoConfigTuningFormFields( switch (ingestionComboType) { case 'index_parallel:http': case 'index_parallel:s3': - case 'index_parallel:azure': + case 'index_parallel:azureStorage': case 'index_parallel:google': case 'index_parallel:hdfs': return [ diff --git a/web-console/src/druid-models/input-source/input-source.tsx b/web-console/src/druid-models/input-source/input-source.tsx index 4e0647320e50..74f2d2585d35 100644 --- a/web-console/src/druid-models/input-source/input-source.tsx +++ b/web-console/src/druid-models/input-source/input-source.tsx @@ -102,7 +102,7 @@ export type InputSourceDesc = }; } | { - type: 'google' | 'azure'; + type: 'google' | 'azureStorage'; uris?: string[]; prefixes?: string[]; objects?: { bucket: string; path: string }[]; @@ -147,7 +147,7 @@ export function issueWithInputSource(inputSource: InputSource | undefined): stri return; case 's3': - case 'azure': + case 'azureStorage': case 'google': if ( !nonEmptyArray(inputSource.uris) && @@ -169,7 +169,7 @@ export function issueWithInputSource(inputSource: InputSource | undefined): stri } } -const KNOWN_TYPES = ['inline', 'druid', 'http', 'local', 's3', 'azure', 'google', 'hdfs', 'sql']; +const KNOWN_TYPES = ['inline', 'druid', 'http', 'local', 's3', 'azureStorage', 'google', 'hdfs', 'sql']; export const INPUT_SOURCE_FIELDS: Field[] = [ // inline @@ -325,9 +325,9 @@ export const INPUT_SOURCE_FIELDS: Field[] = [ name: 'uris', label: 'Azure URIs', type: 'string-array', - placeholder: 'azure://your-container/some-file1.ext, azure://your-container/some-file2.ext', + placeholder: 'azureStorage://your-storage-account/your-container/some-file1.ext, azureStorage://your-storage-account/your-container/some-file2.ext', defined: inputSource => - inputSource.type === 'azure' && + inputSource.type === 'azureStorage' && !deepGet(inputSource, 'prefixes') && !deepGet(inputSource, 'objects'), required: true, @@ -345,9 +345,9 @@ export const INPUT_SOURCE_FIELDS: Field[] = [ name: 'prefixes', label: 'Azure prefixes', type: 'string-array', - placeholder: 'azure://your-container/some-path1, azure://your-container/some-path2', + placeholder: 'azureStorage://your-storage-account/your-container/some-path1, azureStorage://your-storage-accountyour-container/some-path2', defined: inputSource => - inputSource.type === 'azure' && + inputSource.type === 'azureStorage' && !deepGet(inputSource, 'uris') && !deepGet(inputSource, 'objects'), required: true, @@ -362,8 +362,8 @@ export const INPUT_SOURCE_FIELDS: Field[] = [ name: 'objects', label: 'Azure objects', type: 'json', - placeholder: '{"bucket":"your-container", "path":"some-file.ext"}', - defined: inputSource => inputSource.type === 'azure' && deepGet(inputSource, 'objects'), + placeholder: '{"bucket":"your-storage-account", "path":"your-container/some-file.ext"}', + defined: inputSource => inputSource.type === 'azureStorage' && deepGet(inputSource, 'objects'), required: true, info: ( <> @@ -445,7 +445,7 @@ export const INPUT_SOURCE_FIELDS: Field[] = [ type: 'string', suggestions: FILTER_SUGGESTIONS, placeholder: '*', - defined: typeIsKnown(KNOWN_TYPES, 's3', 'azure', 'google'), + defined: typeIsKnown(KNOWN_TYPES, 's3', 'azureStorage', 'google'), info: (

A wildcard filter for files. See{' '} diff --git a/web-console/src/views/load-data-view/load-data-view.tsx b/web-console/src/views/load-data-view/load-data-view.tsx index db7e8e0f093d..bd5bdf06c9d3 100644 --- a/web-console/src/views/load-data-view/load-data-view.tsx +++ b/web-console/src/views/load-data-view/load-data-view.tsx @@ -857,7 +857,7 @@ export class LoadDataView extends React.PureComponent {this.renderIngestionCard('index_parallel:s3')} - {this.renderIngestionCard('index_parallel:azure')} + {this.renderIngestionCard('index_parallel:azureStorage')} {this.renderIngestionCard('index_parallel:google')} {this.renderIngestionCard('index_parallel:hdfs')} {this.renderIngestionCard('index_parallel:druid')} @@ -942,7 +942,7 @@ export class LoadDataView extends React.PureComponentLoad text based, orc, or parquet data from Amazon S3.

; - case 'index_parallel:azure': + case 'index_parallel:azureStorage': return

Load text based, orc, or parquet data from Azure.

; case 'index_parallel:google': @@ -1007,7 +1007,7 @@ export class LoadDataView extends React.PureComponent Date: Wed, 31 Jan 2024 16:25:00 -0500 Subject: [PATCH 2/3] Working new input type --- .../assets/{azure.png => azureStorage.png} | Bin .../external-config/external-config.ts | 2 +- .../ingestion-spec/ingestion-spec.tsx | 21 +++++++++++++++--- .../input-source/input-source.tsx | 20 +++++++++++++++-- .../input-source-step/input-source-info.tsx | 2 +- .../input-source-step/input-source-step.tsx | 2 +- 6 files changed, 39 insertions(+), 8 deletions(-) rename web-console/assets/{azure.png => azureStorage.png} (100%) diff --git a/web-console/assets/azure.png b/web-console/assets/azureStorage.png similarity index 100% rename from web-console/assets/azure.png rename to web-console/assets/azureStorage.png diff --git a/web-console/src/druid-models/external-config/external-config.ts b/web-console/src/druid-models/external-config/external-config.ts index eb7aefefe924..05834d050f9c 100644 --- a/web-console/src/druid-models/external-config/external-config.ts +++ b/web-console/src/druid-models/external-config/external-config.ts @@ -75,7 +75,7 @@ export function summarizeInputSource(inputSource: InputSource, multiline: boolea case 's3': case 'google': - case 'azure': { + case 'azureStorage': { const possibleLines = inputSource.uris || inputSource.prefixes; if (nonEmptyArray(possibleLines)) { let lines: string[] = possibleLines; diff --git a/web-console/src/druid-models/ingestion-spec/ingestion-spec.tsx b/web-console/src/druid-models/ingestion-spec/ingestion-spec.tsx index 5e67a2a93c74..13f7f843fb0a 100644 --- a/web-console/src/druid-models/ingestion-spec/ingestion-spec.tsx +++ b/web-console/src/druid-models/ingestion-spec/ingestion-spec.tsx @@ -462,7 +462,7 @@ export function getIoConfigFormFields(ingestionComboType: IngestionComboType): F name: 'inputSource.type', label: 'Source type', type: 'string', - suggestions: ['local', 'http', 'inline', 's3', 'azure', 'google', 'hdfs'], + suggestions: ['local', 'http', 'inline', 's3', 'azureStorage', 'google', 'hdfs'], info: (

Druid connects to raw data through{' '} @@ -802,7 +802,7 @@ export function getIoConfigFormFields(ingestionComboType: IngestionComboType): F name: 'inputSource.prefixes', label: 'Azure prefixes', type: 'string-array', - placeholder: 'azureStorage://your-storage-account/your-container/some-path1, azure://your-storage-account/your-container/some-path2', + placeholder: 'azureStorage://your-storage-account/your-container/some-path1, azureStorage://your-storage-account/your-container/some-path2', required: true, defined: ioConfig => !deepGet(ioConfig, 'inputSource.uris') && !deepGet(ioConfig, 'inputSource.objects'), @@ -834,6 +834,21 @@ export function getIoConfigFormFields(ingestionComboType: IngestionComboType): F ), }, inputSourceFilter, + { + name: 'inputSource.properties.sharedAccessStorageToken', + label: 'Shared Access Storage Token', + type: 'string', + placeholder: '(sas token)', + info: ( + <> +

Shared Access Storage Token for this storage account.

+

+ Note: Inlining the sas token into the ingestion spec can be dangerous as it might + appear in server log files and can be seen by anyone accessing this console. +

+ + ), + }, ]; case 'index_parallel:google': @@ -1359,7 +1374,7 @@ export function guessDataSourceNameFromInputSource(inputSource: InputSource): st } case 's3': - case 'azure': + case 'azureStorage': case 'google': { const actualPath = (inputSource.objects || EMPTY_ARRAY)[0]; const uriPath = diff --git a/web-console/src/druid-models/input-source/input-source.tsx b/web-console/src/druid-models/input-source/input-source.tsx index 74f2d2585d35..978e387dc3e9 100644 --- a/web-console/src/druid-models/input-source/input-source.tsx +++ b/web-console/src/druid-models/input-source/input-source.tsx @@ -345,7 +345,7 @@ export const INPUT_SOURCE_FIELDS: Field[] = [ name: 'prefixes', label: 'Azure prefixes', type: 'string-array', - placeholder: 'azureStorage://your-storage-account/your-container/some-path1, azureStorage://your-storage-accountyour-container/some-path2', + placeholder: 'azureStorage://your-storage-account/your-container/some-path1, azureStorage://your-storage-account/your-container/some-path2', defined: inputSource => inputSource.type === 'azureStorage' && !deepGet(inputSource, 'uris') && @@ -378,7 +378,23 @@ export const INPUT_SOURCE_FIELDS: Field[] = [ ), }, - + { + name: 'properties.sharedAccessStorageToken', + label: 'Shared Access Storage Token', + type: 'string', + placeholder: '(sas token)', + defined: inputSource => + inputSource.type === 'azureStorage', + info: ( + <> +

Shared Access Storage Token for this storage account.

+

+ Note: Inlining the sas token into the ingestion spec can be dangerous as it might + appear in server log files and can be seen by anyone accessing this console. +

+ + ), + }, // google { name: 'uris', diff --git a/web-console/src/views/workbench-view/input-source-step/input-source-info.tsx b/web-console/src/views/workbench-view/input-source-step/input-source-info.tsx index 2a7e2361d5ea..03e27ba3b700 100644 --- a/web-console/src/views/workbench-view/input-source-step/input-source-info.tsx +++ b/web-console/src/views/workbench-view/input-source-step/input-source-info.tsx @@ -63,7 +63,7 @@ export const InputSourceInfo = React.memo(function InputSourceInfo(props: InputS case 's3': return

Load text based, avro, orc, or parquet data from Amazon S3.

; - case 'azure': + case 'azureStorage': return

Load text based, avro, orc, or parquet data from Azure.

; case 'google': diff --git a/web-console/src/views/workbench-view/input-source-step/input-source-step.tsx b/web-console/src/views/workbench-view/input-source-step/input-source-step.tsx index b8ed5a74131c..5cabe81d2830 100644 --- a/web-console/src/views/workbench-view/input-source-step/input-source-step.tsx +++ b/web-console/src/views/workbench-view/input-source-step/input-source-step.tsx @@ -224,7 +224,7 @@ export const InputSourceStep = React.memo(function InputSourceStep(props: InputS
{renderIngestionCard('s3')} - {renderIngestionCard('azure')} + {renderIngestionCard('azureStorage')} {renderIngestionCard('google')} {renderIngestionCard('hdfs')} {renderIngestionCard('http')} From 7a84f361457e4ff5de775550f211c9bc973a0ecc Mon Sep 17 00:00:00 2001 From: George Wu Date: Thu, 1 Feb 2024 10:44:22 -0500 Subject: [PATCH 3/3] fix tests --- .../ingestion-spec/ingestion-spec.tsx | 3 +- .../input-source/input-source.tsx | 33 ++++++++++++------- .../load-data-view.spec.tsx.snap | 4 +-- 3 files changed, 26 insertions(+), 14 deletions(-) diff --git a/web-console/src/druid-models/ingestion-spec/ingestion-spec.tsx b/web-console/src/druid-models/ingestion-spec/ingestion-spec.tsx index 13f7f843fb0a..99a7761e32f3 100644 --- a/web-console/src/druid-models/ingestion-spec/ingestion-spec.tsx +++ b/web-console/src/druid-models/ingestion-spec/ingestion-spec.tsx @@ -802,7 +802,8 @@ export function getIoConfigFormFields(ingestionComboType: IngestionComboType): F name: 'inputSource.prefixes', label: 'Azure prefixes', type: 'string-array', - placeholder: 'azureStorage://your-storage-account/your-container/some-path1, azureStorage://your-storage-account/your-container/some-path2', + placeholder: + 'azureStorage://your-storage-account/your-container/some-path1, azureStorage://your-storage-account/your-container/some-path2', required: true, defined: ioConfig => !deepGet(ioConfig, 'inputSource.uris') && !deepGet(ioConfig, 'inputSource.objects'), diff --git a/web-console/src/druid-models/input-source/input-source.tsx b/web-console/src/druid-models/input-source/input-source.tsx index 978e387dc3e9..33fca4f9670a 100644 --- a/web-console/src/druid-models/input-source/input-source.tsx +++ b/web-console/src/druid-models/input-source/input-source.tsx @@ -169,7 +169,17 @@ export function issueWithInputSource(inputSource: InputSource | undefined): stri } } -const KNOWN_TYPES = ['inline', 'druid', 'http', 'local', 's3', 'azureStorage', 'google', 'hdfs', 'sql']; +const KNOWN_TYPES = [ + 'inline', + 'druid', + 'http', + 'local', + 's3', + 'azureStorage', + 'google', + 'hdfs', + 'sql', +]; export const INPUT_SOURCE_FIELDS: Field[] = [ // inline @@ -325,7 +335,8 @@ export const INPUT_SOURCE_FIELDS: Field[] = [ name: 'uris', label: 'Azure URIs', type: 'string-array', - placeholder: 'azureStorage://your-storage-account/your-container/some-file1.ext, azureStorage://your-storage-account/your-container/some-file2.ext', + placeholder: + 'azureStorage://your-storage-account/your-container/some-file1.ext, azureStorage://your-storage-account/your-container/some-file2.ext', defined: inputSource => inputSource.type === 'azureStorage' && !deepGet(inputSource, 'prefixes') && @@ -345,7 +356,8 @@ export const INPUT_SOURCE_FIELDS: Field[] = [ name: 'prefixes', label: 'Azure prefixes', type: 'string-array', - placeholder: 'azureStorage://your-storage-account/your-container/some-path1, azureStorage://your-storage-account/your-container/some-path2', + placeholder: + 'azureStorage://your-storage-account/your-container/some-path1, azureStorage://your-storage-account/your-container/some-path2', defined: inputSource => inputSource.type === 'azureStorage' && !deepGet(inputSource, 'uris') && @@ -383,16 +395,15 @@ export const INPUT_SOURCE_FIELDS: Field[] = [ label: 'Shared Access Storage Token', type: 'string', placeholder: '(sas token)', - defined: inputSource => - inputSource.type === 'azureStorage', + defined: inputSource => inputSource.type === 'azureStorage', info: ( <> -

Shared Access Storage Token for this storage account.

-

- Note: Inlining the sas token into the ingestion spec can be dangerous as it might - appear in server log files and can be seen by anyone accessing this console. -

- +

Shared Access Storage Token for this storage account.

+

+ Note: Inlining the sas token into the ingestion spec can be dangerous as it might appear + in server log files and can be seen by anyone accessing this console. +

+ ), }, // google diff --git a/web-console/src/views/load-data-view/__snapshots__/load-data-view.spec.tsx.snap b/web-console/src/views/load-data-view/__snapshots__/load-data-view.spec.tsx.snap index f5956786afd9..3b9543273b14 100644 --- a/web-console/src/views/load-data-view/__snapshots__/load-data-view.spec.tsx.snap +++ b/web-console/src/views/load-data-view/__snapshots__/load-data-view.spec.tsx.snap @@ -181,8 +181,8 @@ exports[`LoadDataView matches snapshot batch 1`] = ` onClick={[Function]} > Ingestion tile for index_parallel:azure

Azure Data Lake