Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Moves the S3 sink bucket configuration to the root configuration #2759

Merged
merged 2 commits into from
May 31, 2023

Conversation

dlvenable
Copy link
Member

Description

This moves the S3 bucket configurations to simplify the YAML.

New configuration:

my-pipeline:
  sink:
    - s3:
        bucket: my-bucket
        object_key:
          path_prefix: myprefix/%{yyyy}/%{MM}/%{dd}/
        aws:
          region: us-east-1
          sts_role_arn: "arn:aws:iam::123456789012:role/MyRole"
        codec:
          ndjson:
        threshold:
          event_count: 500
          maximum_size: 10mb
          event_collect_timeout: PT5M

Old configuration:

my-pipeline:
  sink:
    - s3:
        bucket:
          name: my-bucket
          object_key:
            path_prefix: myprefix/%{yyyy}/%{MM}/%{dd}/
        aws:
          region: us-east-1
          sts_role_arn: "arn:aws:iam::123456789012:role/MyRole"
        codec:
          ndjson:
        threshold:
          event_count: 500
          maximum_size: 10mb
          event_collect_timeout: PT5M

Issues Resolved

N/A

Check List

  • New functionality includes testing.
  • New functionality has been documented.
    • New functionality has javadoc added
  • Commits are signed with a real name per the DCO

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

@codecov
Copy link

codecov bot commented May 25, 2023

Codecov Report

Merging #2759 (54ed709) into main (269baea) will increase coverage by 0.01%.
The diff coverage is n/a.

@@             Coverage Diff              @@
##               main    #2759      +/-   ##
============================================
+ Coverage     94.12%   94.14%   +0.01%     
+ Complexity     2441     2440       -1     
============================================
  Files           278      278              
  Lines          6744     6744              
  Branches        551      551              
============================================
+ Hits           6348     6349       +1     
+ Misses          256      254       -2     
- Partials        140      141       +1     

see 2 files with indirect coverage changes

@@ -29,8 +29,10 @@ public class S3SinkConfig {

@JsonProperty("bucket")
@NotNull
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we add a min validation here to prevent against empty strings?

void get_bucket_option_test() {
assertThat(new S3SinkConfig().getBucketOptions(), equalTo(null));
void get_bucket_name_test() {
assertThat(new S3SinkConfig().getBucketName(), equalTo(null));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bucketName has a nonNull validation on it. Let's make this test be more realistic.

@@ -263,7 +260,7 @@ void test_output_with_uploadedToS3_success_records_byte_count() throws IOExcepti

@Test
void test_output_with_uploadedToS3_failed() throws IOException {
when(s3SinkConfig.getBucketOptions().getBucketName()).thenReturn(null);
when(s3SinkConfig.getBucketName()).thenReturn(null);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we use a random string here? We should be using realistic values. Same is true for test_retryFlushToS3_negative

chenqi0805
chenqi0805 previously approved these changes May 26, 2023
cmanning09
cmanning09 previously approved these changes May 30, 2023
@dlvenable dlvenable dismissed stale reviews from cmanning09 and chenqi0805 via 54ed709 May 31, 2023 14:55
@dlvenable dlvenable merged commit 29225c2 into opensearch-project:main May 31, 2023
26 checks passed
@dlvenable dlvenable deleted the s3-sink-top-level-bucket branch May 31, 2023 15:42
@dlvenable dlvenable mentioned this pull request Jun 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants