oraclecloud-sdk-patterns

Featured

Production-grade OCI SDK patterns for client lifecycle, retry logic, and memory leak avoidance. Use when building long-running OCI services, fixing memory leaks with Instance Principal auth, or implementing retry/backoff. Trigger with "oci sdk patterns", "oci retry", "oci memory leak", "oraclecloud client lifecycle".

AI & Automation 2,266 stars 315 forks Updated today MIT

Install

View on GitHub

Quality Score: 99/100

Stars 20%
100
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
50
License 10%
100
Description 5%
100

Skill Content

# Oracle Cloud SDK Patterns ## Overview Production patterns for the OCI Python SDK that avoid the most common pitfalls: memory leaks from Instance Principal authentication (~10 MiB/hour if clients are recreated per request), missing retry logic for 429/500 errors, and timeout misconfiguration across different service clients. The OCI SDK has different timeout defaults depending on the service (Compute: 60s, Object Storage: 300s for uploads), and none of them set connection timeouts by default. **Purpose:** Provide correct client lifecycle (create once, reuse, close), exponential backoff retry, singleton patterns that prevent the Instance Principal memory leak, and per-service timeout configuration. ## Prerequisites - **Completed `oraclecloud-install-auth`** — valid `~/.oci/config` - **Python 3.8+** with `pip install oci` - Familiarity with OCI service clients (`ComputeClient`, `ObjectStorageClient`, etc.) ## Instructions ### Step 1: Singleton Client Pattern (Avoids Memory Leak) Instance Principal authentication allocates new security tokens on each client instantiation. Creating clients per-request leaks ~10 MiB/hour. Use a singleton: ```python import oci import threading class OCIClients: """Thread-safe singleton for OCI service clients. Prevents the Instance Principal memory leak by reusing clients instead of creating new ones per request. """ _lock = threading.Lock() _instance = None def __init__(self): self._config = oci.con...

Details

Author
jeremylongshore
Repository
jeremylongshore/claude-code-plugins-plus-skills
Created
7 months ago
Last Updated
today
Language
Python
License
MIT

Integrates with

Similar Skills

Semantically similar based on skill content — not just same category

AI & Automation Featured

oraclecloud-rate-limits

Handle OCI API rate limits with defensive retry patterns and known limits by service. Use when automating bulk OCI operations, hitting 429 TooManyRequests errors, or building resilient API clients. Trigger with "oraclecloud rate limits", "oci 429 error", "oci throttling", "oci backoff".

2,266 Updated today
jeremylongshore
AI & Automation Featured

customerio-sdk-patterns

Apply production-ready Customer.io SDK patterns. Use when implementing typed clients, retry logic, event batching, or singleton management for customerio-node. Trigger: "customer.io best practices", "customer.io patterns", "production customer.io", "customer.io architecture", "customer.io singleton".

2,266 Updated today
jeremylongshore
AI & Automation Featured

cohere-sdk-patterns

Apply production-ready Cohere SDK patterns for TypeScript and Python. Use when implementing Cohere integrations, refactoring SDK usage, or establishing team coding standards for Cohere API v2. Trigger with phrases like "cohere SDK patterns", "cohere best practices", "cohere code patterns", "idiomatic cohere", "cohere wrapper".

2,266 Updated today
jeremylongshore
AI & Automation Featured

elevenlabs-sdk-patterns

Apply production-ready ElevenLabs SDK patterns for TypeScript and Python. Use when implementing ElevenLabs integrations, refactoring SDK usage, or establishing team coding standards for audio AI applications. Trigger: "elevenlabs SDK patterns", "elevenlabs best practices", "elevenlabs code patterns", "idiomatic elevenlabs", "elevenlabs typescript".

2,266 Updated today
jeremylongshore
AI & Automation Featured

palantir-sdk-patterns

Apply production-ready Palantir Foundry SDK patterns for Python and TypeScript. Use when implementing Foundry integrations, refactoring SDK usage, or establishing team coding standards for Foundry API calls. Trigger with phrases like "palantir SDK patterns", "foundry best practices", "palantir code patterns", "idiomatic foundry SDK".

2,266 Updated today
jeremylongshore