-
Notifications
You must be signed in to change notification settings - Fork 0
Update Modal examples with Codegen 0.52.19 and add deployment scripts #139
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
base: develop
Are you sure you want to change the base?
Conversation
# Motivation The **Codegen on OSS** package provides a pipeline that: - **Collects repository URLs** from different sources (e.g., CSV files or GitHub searches). - **Parses repositories** using the codegen tool. - **Profiles performance** and logs metrics for each parsing run. - **Logs errors** to help pinpoint parsing failures or performance bottlenecks. <!-- Why is this change necessary? --> # Content <!-- Please include a summary of the change --> see [codegen-on-oss/README.md](https://github.com/codegen-sh/codegen-sdk/blob/acfe3dc07b65670af33b977fa1e7bc8627fd714e/codegen-on-oss/README.md) # Testing <!-- How was the change tested? --> `uv run modal run modal_run.py` No unit tests yet 😿 # Please check the following before marking your PR as ready for review - [ ] I have added tests for my changes - [x] I have updated the documentation or added new documentation as needed
Original commit by Tawsif Kamal: Revert "Revert "Adding Schema for Tool Outputs"" (codegen-sh#894) Reverts codegen-sh#892 --------- Co-authored-by: Rushil Patel <rpatel@codegen.com> Co-authored-by: rushilpatel0 <171610820+rushilpatel0@users.noreply.github.com>
Original commit by Ellen Agarwal: fix: Workaround for relace not adding newlines (codegen-sh#907)
Reviewer's GuideThis PR standardizes all Modal examples to use Codegen v0.52.19, enriches documentation across examples, and introduces robust deployment tooling including an interactive Deployer script and per-example deploy scripts. Sequence Diagram for Deployer.sh Interaction FlowsequenceDiagram
actor User
participant Deployer_sh as "Deployer.sh"
participant Example_Deploy_sh as "example/deploy.sh"
participant Modal_CLI as "Modal CLI"
participant Modal_Platform as "Modal Platform"
User->>Deployer_sh: Execute script
Deployer_sh->>Modal_CLI: Check installed
Modal_CLI-->>Deployer_sh: Status
Deployer_sh->>Modal_CLI: Check authenticated
Modal_CLI-->>Deployer_sh: Status
alt Modal checks fail
Deployer_sh->>User: Show error and exit
end
Deployer_sh->>Deployer_sh: Find examples with deploy.sh
Deployer_sh->>User: Display available examples
User->>Deployer_sh: Select examples (numbers or 'all')
Deployer_sh->>User: Confirm selection
User->>Deployer_sh: Confirm (y)
loop For each selected example
Deployer_sh->>Example_Deploy_sh: Execute ./deploy.sh (concurrently)
Note over Example_Deploy_sh: Runs 'modal deploy ...'
Example_Deploy_sh->>Modal_Platform: Deploy application
Modal_Platform-->>Example_Deploy_sh: Deployment status
Example_Deploy_sh-->>Deployer_sh: Log status to /tmp/
end
Deployer_sh->>User: Report deployment status for all examples
Class Diagram for New 'hello_world' Modal ApplicationclassDiagram
direction LR
class App_hello_world {
<<ModalApp>>
name: "hello-world"
}
class Image_hw {
<<ModalImage>>
+pip_install(["codegen==0.52.19"])
# Based on debian_slim()
}
class Func_hello {
<<ModalFunction>>
+hello(name: str)
}
class Func_web_hello {
<<ModalWebEndpoint>>
+web_hello(name: str)
method: "GET"
keep_warm: 1
}
class Func_scheduled_hello {
<<ModalScheduledFunction>>
+scheduled_hello()
schedule_rate: "1 hour"
}
App_hello_world --o Image_hw : uses
App_hello_world --o Func_hello : defines
Func_hello ..> Image_hw : uses_image
App_hello_world --o Func_web_hello : defines
Func_web_hello ..> Image_hw : uses_image
App_hello_world --o Func_scheduled_hello : defines
Func_scheduled_hello ..> Image_hw : uses_image
note for App_hello_world "New Modal application demonstrating basic functionalities."
Class Diagram Highlighting Updated 'Modal.Image' Configuration for Codegen VersionclassDiagram
class ModalImage {
<<Modal.Image>>
+pip_install(dependencies: list)
+run_commands(commands: list)
# Other methods like debian_slim(), apt_install()
}
note for ModalImage "Updated to ensure 'codegen==0.52.19' is installed.\nThis affects image definitions in:\n- linear_webhooks/webhooks.py (via pip_install)
- modal_repo_analytics/api.py (via pip_install)
- modal_repo_rag/api.py (via pip_install)
- swebench_agent_run/.../entry_point.py (via run_commands)"
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Important Review skippedBot user detected. To trigger a single review, invoke the You can disable this status message by setting the 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Join our Discord community for assistance with any issues or questions. 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)
Other keywords and placeholders
CodeRabbit Configuration File (
|
I see a check failed - I'm on it! 🫡 |
…d duplicate module name
✅ Fixed the failing mypy check in this commit. The issue was a duplicate module name error because both This change ensures that mypy can properly analyze the codebase without confusion between the two modules. 💻 View my work • React 👍 or 👎 |
I see a check failed - I'm on it! 🫡 |
✅ Fixed the failing pre-commit check in this commit. The issues were related to formatting problems:
I've fixed all these issues by:
The PR should now pass all checks. 💻 View my work • React 👍 or 👎 |
This PR updates all Modal examples in the Codegen repository to use Codegen version 0.52.19 specifically and adds deployment infrastructure:
What's Changed
New Features
Deployer.sh
script in the examples folder that allows selecting and deploying multiple Modal examples concurrentlydeploy.sh
scripts for each Modal examplehello_world
example that demonstrates basic Modal functionalityUpdates
modal_repo_analytics
modal_repo_rag
linear_webhooks
swebench_agent_run
Technical Details
codegen==0.52.19
instead of using flexible version constraintsTesting
This PR ensures that all Modal examples are up-to-date, well-documented, and easy to deploy.
💻 View my work • About Codegen
Summary by Sourcery
Update all Modal examples to pin Codegen SDK at 0.52.19, add a new hello_world tutorial, and introduce deployment infrastructure with interactive and per-example deploy scripts alongside improved documentation.
New Features:
Enhancements:
Deployment:
Documentation: