feat(webui): Add S3 compression job submission support with browsable S3 key selection.#2169
Draft
junhaoliao wants to merge 3 commits intoy-scope:mainfrom
Draft
feat(webui): Add S3 compression job submission support with browsable S3 key selection.#2169junhaoliao wants to merge 3 commits intoy-scope:mainfrom
junhaoliao wants to merge 3 commits intoy-scope:mainfrom
Conversation
Contributor
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
This file contains hidden or 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
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.
Description
Add S3 compression job submission support to the WebUI. When
logs_input.typeiss3in the CLPdeployment config, the WebUI now shows an S3 compression form (instead of the filesystem form) that
allows users to browse S3 bucket contents via a TreeSelect and submit compression jobs targeting
specific S3 objects or prefixes.
Design:
aws_authentication) comes from the CLP deployment config(
S3IngestionConfig) and is propagated to the WebUI server at startup via flat settings keys(e.g.,
LogsInputS3AwsAuthType,LogsInputS3AwsProfile). Credentials are passed throughenvironment variables (
CLP_LOGS_INPUT_AWS_ACCESS_KEY_ID/CLP_LOGS_INPUT_AWS_SECRET_ACCESS_KEY), matching the existingCLP_STREAM_OUTPUTpattern.bucket,regionCode,keyPrefix/keys) come from the user's formsubmission. The region is per-request since different buckets may reside in different regions.
Key changes:
Common schemas (
compression.ts,s3.ts):CompressionJobCreationSchemainto aType.Uniondiscriminated oninputType(
"fs"|"s3"). Extract shared CLP-S fields (dataset,timestampKey,unstructured) intoa
clpSFieldsspread object to eliminate duplication.S3CompressionJobCreationSchemawithbucket(required),regionCode(required),keyPrefix(optional), andkeys(optional) fields.region(required) toS3ListRequestSchemafor per-request region support.s3.tswithAwsAuthTypeenum,AwsAuthenticationSchema,S3ListRequestSchema,S3ListResponseSchema, andS3EntrySchema.S3Manager plugin (
S3Manager/):resolveAwsCredentials()helper to deduplicate credential resolution across logs inputand stream files configs. Priority: env var credentials > named profile > SDK default chain.
S3ListManager(separate file) with per-request region support — creates anS3Clientforeach listing call with the user-provided region.
AWS_ACCESS_KEY_ID/AWS_SECRET_ACCESS_KEYtoCLP_STREAM_OUTPUT_AWS_ACCESS_KEY_ID/CLP_STREAM_OUTPUT_AWS_SECRET_ACCESS_KEYin both docker-compose and Helm chart.CLP_LOGS_INPUT_AWS_ACCESS_KEY_ID/CLP_LOGS_INPUT_AWS_SECRET_ACCESS_KEYenv vars todocker-compose and Helm webui-deployment (conditional on
logs_input.type: "s3"withaws_authentication.type: "credentials").LogsInputS3AwsAuthTypeandLogsInputS3AwsProfileto Helm configmap'swebui-server-settings.json(conditional onlogs_input.type: "s3").S3 listing API (
routes/api/s3/index.ts): NewGET /api/s3/lsendpoint that delegates toS3ListManager.listObjects()with bucket, prefix, and region from query params.Compress route (
routes/api/compress/index.ts): Refactor intobuildFsJobConfig()andbuildS3JobConfig()builders. The S3 builder populatesaws_authenticationfrom server settingsand env vars, while
bucket,regionCode,keyPrefix, andkeyscome from the request body.Client S3 form (
S3InputFormItems.tsx,S3KeySelectFormItem/):automatic reset on bucket/region change,
SHOW_PARENTdisplay strategy.keyPrefix(prefix selections) orkeys(object selections) on the payload.Python config (
clp_config.py): Removeendpoint_urlandregion_codefromS3IngestionConfig— region is per-job (from the form), and custom endpoints are not supported.Controller (
controller.py): Propagate onlyLogsInputS3AwsAuthTypeandLogsInputS3AwsProfile(noLogsInputS3EndpointUrlorLogsInputS3Region) fromS3IngestionConfigto WebUI server settings.Stream-files route (
stream-files/index.ts): UpdateS3Managerreference to renamedStreamFilesS3Managerdecorator.Checklist
breaking change.
Validation performed
1. Build and lint checks pass
Task: Verify all WebUI workspaces build and pass lint checks with zero warnings.
Command:
Output:
2. Package build succeeds
Task: Verify the full CLP package builds without errors.
Command:
Output:
3. CLP starts with S3 input configured
Task: Configure
logs_input.type: "s3"with AWS credentials and start the CLP package.Command:
cd build/clp-package ./sbin/start-clp.shOutput:
4. S3 listing API returns bucket contents with per-request region
Task: Verify the
/api/s3/lsendpoint acceptsregionand correctly lists S3 objects.Command:
Output:
{ "entries": [ {"isPrefix": true, "key": "/"}, {"isPrefix": true, "key": "archives/"}, {"isPrefix": true, "key": "clp-archives/"}, {"isPrefix": true, "key": "streams/"}, {"isPrefix": false, "key": "postgresql-simple.jsonl"}, {"isPrefix": false, "key": "yarn.log"} ], "isTruncated": false, "nextContinuationToken": null }Explanation: The listing endpoint creates an S3Client with the provided region and returns both
common prefixes and objects. The
regionparameter enables listing buckets in different regionswithout restarting CLP.
5. End-to-end S3 compression job completes with per-job region
Task: Submit an S3 compression job with
regionCodein the request body.Command:
Output:
{"jobId":1}Command:
Output:
Explanation: The compression job completed successfully. The
aws_authenticationcame fromserver settings, while
bucket,regionCode, andkeyscame from the request body.6. Stop CLP
Command:
Output: