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

feat: add aws_region #38

Open
wants to merge 13 commits into
base: main
Choose a base branch
from
Open

feat: add aws_region #38

wants to merge 13 commits into from

Conversation

jakevc
Copy link

@jakevc jakevc commented Jan 31, 2025

This PR adds aws_region to StorageProviderSettings

Summary by CodeRabbit

  • New Features

    • Added support for specifying AWS S3 region when configuring storage.
    • Introduced a new Docker Compose configuration for local MinIO service.
  • Improvements

    • Enhanced S3 storage provider with optional region configuration.
    • Allows more precise control over S3 bucket creation and client initialization.
    • Updated CI configuration to integrate Docker and MinIO for testing.

Copy link

coderabbitai bot commented Jan 31, 2025

Warning

Rate limit exceeded

@jakevc has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 3 minutes and 38 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📥 Commits

Reviewing files that changed from the base of the PR and between 39fdc56 and 4b61978.

📒 Files selected for processing (3)
  • .github/workflows/ci.yml (2 hunks)
  • snakemake_storage_plugin_s3/__init__.py (3 hunks)
  • tests/tests.py (4 hunks)
📝 Walkthrough

Walkthrough

The pull request introduces an optional aws_region field to the S3 storage plugin for Snakemake, allowing users to specify a specific AWS S3 region when configuring storage. This enhancement modifies the StorageProviderSettings and StorageProvider classes to support region specification during S3 client setup and bucket creation, ensuring compliance with AWS S3's regional requirements. Additionally, the CI configuration is updated to include Docker and MinIO for testing, and a new Docker Compose file is introduced for the MinIO service.

Changes

File Change Summary
snakemake_storage_plugin_s3/__init__.py - Added optional aws_region field to StorageProviderSettings
- Updated __post_init__ method to configure S3 resource with specified region
- Modified store_object method to create buckets with region-specific configuration
.github/workflows/ci.yml - Updated testing job to use actions/checkout@v4
- Changed Python version from 3.11 to 3.12
- Added steps for Docker and MinIO setup
tests/docker-compose.yml - Introduced new Docker Compose file defining a minio service with specified configurations
tests/tests.py - Updated get_storage_provider_settings method to change endpoint URL, access key, and secret key for local MinIO setup

Sequence Diagram

sequenceDiagram
    participant User
    participant StorageProviderSettings
    participant StorageProvider
    participant S3Client

    User->>StorageProviderSettings: Configure with optional aws_region
    StorageProviderSettings->>StorageProvider: Pass configuration
    StorageProvider->>S3Client: Initialize with specified region
    StorageProvider->>S3Client: Create bucket with region constraint (if specified)
Loading

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR. (Beta)
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 3

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between bd5ac5d and 78114b2.

📒 Files selected for processing (1)
  • snakemake_storage_plugin_s3/__init__.py (3 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
snakemake_storage_plugin_s3/__init__.py (1)

Pattern **/*.py: Do not try to improve formatting.
Do not suggest type annotations for functions that are defined inside of functions or methods.
Do not suggest type annotation of the self argument of methods.
Do not suggest type annotation of the cls argument of classmethods.
Do not suggest return type annotation if a function or method does not contain a return statement.

🪛 Ruff (0.8.2)
snakemake_storage_plugin_s3/__init__.py

63-63: SyntaxError: Expected an expression or a '}'


64-64: SyntaxError: Expected ':', found string


64-64: SyntaxError: Expected ',', found ':'


65-65: SyntaxError: Expected ':', found '}'

🪛 GitHub Actions: CI
snakemake_storage_plugin_s3/__init__.py

[error] 63-63: SyntaxError: invalid syntax

snakemake_storage_plugin_s3/__init__.py Outdated Show resolved Hide resolved
snakemake_storage_plugin_s3/__init__.py Outdated Show resolved Hide resolved
snakemake_storage_plugin_s3/__init__.py Outdated Show resolved Hide resolved
jakevc and others added 4 commits January 30, 2025 21:12
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
@jakevc
Copy link
Author

jakevc commented Jan 31, 2025

I think play.mino.io is down tonight, which is why I started to stub out the ability to use a TestWorkflowsS3StorageBase, which then needed this aws_region parameter I implemented here, but then tests are still hanging because play.minio.io is unresponsive haha

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (1)
tests/docker-compose.yml (1)

1-11: LGTM! The MinIO service is properly configured for testing.

The Docker Compose configuration correctly sets up a local MinIO service with appropriate port mapping and credentials that match the test configuration.

Add a newline at the end of the file to comply with YAML formatting standards:

    command: server /data
+
🧰 Tools
🪛 YAMLlint (1.35.1)

[error] 11-11: no new line character at the end of file

(new-line-at-end-of-file)

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between d4819ef and 39fdc56.

📒 Files selected for processing (4)
  • .github/workflows/ci.yml (2 hunks)
  • snakemake_storage_plugin_s3/__init__.py (3 hunks)
  • tests/docker-compose.yml (1 hunks)
  • tests/tests.py (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • snakemake_storage_plugin_s3/init.py
🧰 Additional context used
📓 Path-based instructions (1)
tests/tests.py (1)

Pattern **/*.py: Do not try to improve formatting.
Do not suggest type annotations for functions that are defined inside of functions or methods.
Do not suggest type annotation of the self argument of methods.
Do not suggest type annotation of the cls argument of classmethods.
Do not suggest return type annotation if a function or method does not contain a return statement.

🪛 YAMLlint (1.35.1)
tests/docker-compose.yml

[error] 11-11: no new line character at the end of file

(new-line-at-end-of-file)

🔇 Additional comments (3)
tests/tests.py (1)

34-36: LGTM! The storage provider settings are correctly configured for local MinIO.

The endpoint URL and credentials are properly aligned with the local MinIO service configuration defined in the Docker Compose file.

.github/workflows/ci.yml (2)

85-89: LGTM! Docker Compose setup is properly configured.

The setup correctly updates and installs Docker Compose for the MinIO service.


90-92: LGTM! MinIO service is started correctly.

The Docker Compose file is properly referenced and the service is started in detached mode.

.github/workflows/ci.yml Outdated Show resolved Hide resolved
@jakevc
Copy link
Author

jakevc commented Jan 31, 2025

setting up and switch to a local server for CI/CD solves this problem as play.minio.io stilll looks to be down @johanneskoester

@jakevc
Copy link
Author

jakevc commented Jan 31, 2025

TestWorkflowsMinioLocalStorageBase could be placed with the others in snakemake.common.tests, but it's included here to prove the concept

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.

1 participant