Dependency Handling in On-Demand Code Execution

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Existing computing systems face challenges in rapid code execution due to latency in resolving dependencies and inefficiencies caused by data duplication, particularly in on-demand code execution environments where pre-initialization of virtual machine instances is not fully utilized.

Innovation Solution

The on-demand code execution system employs graph analysis to generate packages that include all necessary code objects and dependencies, reducing latency and data duplication by pre-warming virtual machine instances and using identifiers to reference code objects rather than duplicating them, thus enabling rapid task execution.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Speed

If code objects and dependencies are resolved at runtime in existing computing systems, then execution flexibility is maintained, but execution latency increases significantly

Engineering Contradiction:
Improvecode execution speedVSAvoiddependency resolution latency
Core Design Contradiction:
SpeedVSLoss of time

Solution Approach 1:

The system performs preliminary actions by pre-resolving dependencies and generating execution packages before code execution is triggered. When code is submitted, the system immediately resolves all dependencies and creates a complete execution package, eliminating runtime dependency resolution latency. This allows the code to be executed as soon as the package is ready, achieving sub-100-millisecond execution times.

Inventive Principle:
Principle #10Preliminary action

2Speed

If virtual machine instances are pre-initialized with all possible code objects, then execution speed improves, but resource utilization and storage requirements worsen

Engineering Contradiction:
Improvetask execution speedVSAvoiddata duplication
Core Design Contradiction:
SpeedVSQuantity of substance

Solution Approach 1:

The system segments the execution environment into modular packages, where each package contains only the specific code objects and dependencies needed for a particular task. Instead of pre-loading all possible code objects into every virtual machine instance, the system creates lightweight packages that are generated on-demand and contain only the necessary components, reducing data duplication while maintaining fast execution.

Inventive Principle:
Principle #1Segmentation

Solution Approach 2:

The system creates a universal package structure that can be reused across multiple tasks. By resolving dependencies and creating standardized execution packages, the same package can be instantiated and executed multiple times without duplicating the underlying dependency resolution work, improving resource efficiency while maintaining execution speed.

Inventive Principle:
Principle #6Universality (Multi-functionality)

3Productivity

If dependencies are resolved dynamically during code execution, then system adaptability is maintained, but operational complexity and overhead increase

Engineering Contradiction:
Improvetask execution throughputVSAvoiddependency resolution complexity
Core Design Contradiction:
ProductivityVSDevice complexity

Solution Approach 1:

The system extracts the complex dependency resolution process from the runtime execution environment and performs it beforehand during package generation. By taking out the dependency resolution step and completing it during package creation, the system eliminates the operational complexity during actual code execution, allowing simple and fast package instantiation while maintaining the adaptability to handle different code and dependency scenarios.

Inventive Principle:
Principle #2Taking out (Extraction)

Data Source

PatentUS10564946B1Dependency handling in an on-demand network code execution system
Publication Date: 2020.02.18 AMAZON TECH INC
  • US10564946B1 patent drawing
  • US10564946B1 patent drawing
  • US10564946B1 patent drawing

AI summary

Systems and methods are described for managing dependencies among code in an on-demand code execution system in a manner that enables efficient execution of the code. A user may generate a task on the system by submitting code, which may reference additional code on the system. The system can determine a dependency graph for the submitted code, and generate packages for the task based at least partly on the dependency graph. On receiving a request to execute the task, the system can provision an execution environment with the packages, and execute the code of the task. The packages may be selected based on analysis of the dependency graph, such that execution of the task on the on-demand code execution system is expected to satisfy a desired execution metric, which may include a maximum time to begin executing code of a task subsequent to receiving a request to execute the task.