Skip to content

Commit 498031e

Browse files
committed
Remove mingw, update README.md
1 parent 132fdd4 commit 498031e

File tree

6 files changed

+37
-23
lines changed

6 files changed

+37
-23
lines changed

README.md

Lines changed: 27 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,27 @@
1-
#To run local runtime tests using using aws runtime simulator:
2-
1. Gradlew build ./gradlew build to build lambda executable
3-
2. Modify docker file to set proper path to lambda function executable
4-
3. Run docker build -t sample:latest .
5-
4. Start server docker run -p 9000:8080 sample:latest
6-
5. Execute function via curl -XPOST "http://localhost:9000/2015-03-31/functions/function/invocations" -d '{}'
7-
6. docker ps; docker stop CONTAINER_ID to stop the execution
1+
# Kotlin Native Runtime for AWS Lambda
2+
[![Maven Central](https://maven-badges.herokuapp.com/maven-central/io.github.trueangle/lambda-runtime/badge.svg)](https://maven-badges.herokuapp.com/maven-central/io.github.trueangle/lambda-runtime/badge.svg)
3+
4+
A runtime for executing AWS Lambda Functions powered by Kotlin Native, designed to mitigate known
5+
cold start issues associated with the JVM platform.
6+
7+
Project structure:
8+
9+
- lambda-runtime — is a library that provides a Lambda runtime.
10+
- lambda-events — is a library with strongly-typed Lambda event models, such
11+
as `APIGatewayRequest`, `DynamoDBEvent`, `S3Event`, `KafkaEvent`, `SQSEvent` and so on.
12+
13+
The runtime supports the
14+
following [OS-only runtime machines](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html):
15+
16+
- Amazon Linux 2023 (provided.al2023) with x86_64 architecture
17+
- Amazon Linux 2 (provided.al2) with x86_64 architecture
18+
19+
## Performance
20+
21+
Performance benchmarks reveal that Kotlin Native's "Hello World" Lambda function, executed on Amazon
22+
Linux 2023 (x86_64) with 1024MB of memory, ranks among the top 5 fastest cold starts. Its
23+
performance is on par with Python and .NET implementations. For a comparison with other languages (
24+
including Java), visit https://maxday.github.io/lambda-perf/.
25+
26+
![screenshot](docs/performance_hello_world.png)
27+
<img src="" alt="Kotlin Native AWS Lambda Runtime benchmarks" width="800"/>

build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,5 @@ plugins {
88

99
allprojects {
1010
group = "io.github.trueangle"
11-
version = "0.0.1"
11+
version = "0.0.2"
1212
}

docs/performance_hello_world.png

77.5 KB
Loading

lambda-events/build.gradle.kts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ kotlin {
1010
macosX64()
1111
linuxArm64()
1212
linuxX64()
13-
mingwX64()
1413

1514
sourceSets {
1615
commonMain.dependencies {

lambda-runtime/build.gradle.kts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ kotlin {
1313
macosX64()
1414
linuxArm64()
1515
linuxX64()
16-
mingwX64()
1716

1817
sourceSets {
1918
commonMain.dependencies {

sample/build.gradle.kts

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,14 @@ plugins {
33
alias(libs.plugins.kotlin.serialization)
44
}
55

6-
// todo is it a right way to specify main entry point for linux64?
76
kotlin {
8-
val isArm64 = System.getProperty("os.arch") == "aarch64"
9-
val hostOs = System.getProperty("os.name")
10-
val isMingwX64 = hostOs.startsWith("Windows")
11-
val nativeTarget = when {
12-
hostOs == "Mac OS X" -> if(isArm64) macosArm64() else macosX64()
13-
hostOs == "Linux" -> if (isArm64) linuxArm64() else linuxX64()
14-
isMingwX64 -> mingwX64("native")
15-
else -> throw GradleException("Host OS is not supported in Kotlin/Native.")
16-
}
17-
18-
nativeTarget.apply {
19-
binaries {
7+
listOf(
8+
macosArm64(),
9+
macosX64(),
10+
linuxArm64(),
11+
linuxX64(),
12+
).forEach {
13+
it.binaries {
2014
executable {
2115
entryPoint = "com.github.trueangle.knative.lambda.runtime.sample.main"
2216
}
@@ -28,6 +22,8 @@ kotlin {
2822
implementation(projects.lambdaRuntime)
2923
implementation(projects.lambdaEvents)
3024
implementation(libs.kotlin.serialization.json)
25+
/*implementation("io.github.trueangle:lambda-runtime:0.0.1")
26+
implementation("io.github.trueangle:lambda-events:0.0.1")*/
3127
}
3228
}
3329
}

0 commit comments

Comments
 (0)