Skip to content

Commit

Permalink
Fix extractor submission related bugs (#1154)
Browse files Browse the repository at this point in the history
* new parameters need to be reflected on frontend

* add more default core extractors

* in the catch need to match input params too
  • Loading branch information
longshuicy authored Jul 24, 2024
1 parent 5ea5e46 commit bb35e0b
Show file tree
Hide file tree
Showing 5 changed files with 66 additions and 5 deletions.
44 changes: 44 additions & 0 deletions docker-compose.extractors.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,50 @@ services:
- clowder2
restart: unless-stopped

wordcount:
image: clowder/extractors-wordcount:latest
environment:
CLOWDER_VERSION: 2
RABBITMQ_URI: amqp://guest:guest@rabbitmq:5672/%2F
networks:
- clowder2
restart: unless-stopped

image-preview:
image: clowder/extractors-image-preview:latest
environment:
CLOWDER_VERSION: 2
RABBITMQ_URI: amqp://guest:guest@rabbitmq:5672/%2F
networks:
- clowder2
restart: unless-stopped

image-metadata:
image: clowder/extractors-image-metadata:latest
environment:
CLOWDER_VERSION: 2
RABBITMQ_URI: amqp://guest:guest@rabbitmq:5672/%2F
networks:
- clowder2
restart: unless-stopped

audio-preview:
image: clowder/extractors-audio-preview:latest
environment:
CLOWDER_VERSION: 2
RABBITMQ_URI: amqp://guest:guest@rabbitmq:5672/%2F
networks:
- clowder2
restart: unless-stopped

file-digest:
image: clowder/extractors-digest:latest
environment:
CLOWDER_VERSION: 2
RABBITMQ_URI: amqp://guest:guest@rabbitmq:5672/%2F
networks:
- clowder2
restart: unless-stopped

networks:
clowder2:
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ services:
RABBITMQ_HOST: ${RABBITMQ_HOST:-rabbitmq}
RABBITMQ_USER: ${RABBITMQ_USER:-guest}
RABBITMQ_PASS: ${RABBITMQ_PASS:-guest}
API_HOST: ${API_HOST:-http://localhost}
API_HOST: ${API_HOST:-http://backend}
elasticsearch_url: http://elasticsearch:9200
auth_base: http://localhost
auth_realm: clowder
Expand Down
1 change: 1 addition & 0 deletions frontend/src/actions/dataset.js
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@ export function submitDatasetExtractionAction(
return V2.DatasetsService.getDatasetExtractApiV2DatasetsDatasetIdExtractPost(
datasetId,
extractorName,
null,
requestBody
)
.then((json) => {
Expand Down
16 changes: 14 additions & 2 deletions frontend/src/actions/file.js
Original file line number Diff line number Diff line change
Expand Up @@ -344,12 +344,18 @@ export function generateFilePresignedUrl(

export const SUBMIT_FILE_EXTRACTION = "SUBMIT_FILE_EXTRACTION";

export function submitFileExtractionAction(fileId, extractorName, requestBody) {
export function submitFileExtractionAction(
fileId,
extractorName,
datasetId,
requestBody
) {
return (dispatch) => {
return V2.FilesService.postFileExtractApiV2FilesFileIdExtractPost(
fileId,
extractorName,
null,
datasetId,
requestBody
)
.then((json) => {
Expand All @@ -363,7 +369,13 @@ export function submitFileExtractionAction(fileId, extractorName, requestBody) {
dispatch(
handleErrors(
reason,
submitFileExtractionAction(fileId, extractorName, requestBody)
submitFileExtractionAction(
fileId,
extractorName,
null,
datasetId,
requestBody
)
)
);
});
Expand Down
8 changes: 6 additions & 2 deletions frontend/src/components/listeners/SubmitExtraction.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,12 @@ export default function SubmitExtraction(props: SubmitExtractionProps) {
const submitFileExtraction = (
fileId: string | undefined,
extractorName: string | undefined,
datasetId: string | undefined,
requestBody: FormData
) => dispatch(submitFileExtractionAction(fileId, extractorName, requestBody));
) =>
dispatch(
submitFileExtractionAction(fileId, extractorName, datasetId, requestBody)
);
const submitDatasetExtraction = (
datasetId: string | undefined,
extractorName: string | undefined,
Expand All @@ -74,7 +78,7 @@ export default function SubmitExtraction(props: SubmitExtractionProps) {
submitDatasetExtraction(datasetId, extractorName, formData);
handleNext();
} else if (fileId !== undefined) {
submitFileExtraction(fileId, extractorName, formData);
submitFileExtraction(fileId, extractorName, datasetId, formData);
handleNext();
}
};
Expand Down

0 comments on commit bb35e0b

Please sign in to comment.