Skip to content

Commit e518433

Browse files
committed
update docker image
1 parent a47f6ce commit e518433

File tree

10 files changed

+44
-70
lines changed

10 files changed

+44
-70
lines changed

container-image-generator/container-images/java/base-21/Dockerfile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,12 @@ ADD ./app/Main.java /app/src/main/java/Main.java
55

66
WORKDIR /app
77

8-
RUN mvn -Dexec.mainClass=Main compile exec:java
8+
RUN mvn compile exec:java
99

1010
FROM maven:3.9.9-eclipse-temurin-21
11+
12+
LABEL "com.javaaidev.llm-code-executor.description"="Java 21 with libraries: com.google.guava:guava:33.5.0-jre, org.apache.commons:commons-lang3:3.20.0, com.fasterxml.jackson.core:jackson-databind:2.20.1, com.squareup.okhttp3:okhttp:5.3.2"
13+
1114
COPY --from=build /root/.m2 /root/.m2
1215

1316
WORKDIR /app

container-image-generator/container-images/java/base-21/app/pom.xml

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<project xmlns="http://maven.apache.org/POM/4.0.0"
3-
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4-
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
55
<modelVersion>4.0.0</modelVersion>
66

77
<groupId>com.javaaidev.llmcodeexecutor</groupId>
@@ -16,31 +16,31 @@
1616
</properties>
1717

1818
<dependencies>
19-
19+
2020
<dependency>
2121
<groupId>com.google.guava</groupId>
2222
<artifactId>guava</artifactId>
23-
<version>33.4.6-jre</version>
23+
<version>33.5.0-jre</version>
2424
</dependency>
25-
25+
2626
<dependency>
2727
<groupId>org.apache.commons</groupId>
2828
<artifactId>commons-lang3</artifactId>
29-
<version>3.17.0</version>
29+
<version>3.20.0</version>
3030
</dependency>
31-
31+
3232
<dependency>
3333
<groupId>com.fasterxml.jackson.core</groupId>
3434
<artifactId>jackson-databind</artifactId>
35-
<version>2.18.3</version>
35+
<version>2.20.1</version>
3636
</dependency>
37-
37+
3838
<dependency>
3939
<groupId>com.squareup.okhttp3</groupId>
4040
<artifactId>okhttp</artifactId>
41-
<version>4.12.0</version>
41+
<version>5.3.2</version>
4242
</dependency>
43-
43+
4444
</dependencies>
4545

4646
<build>
@@ -56,6 +56,9 @@
5656
</goals>
5757
</execution>
5858
</executions>
59+
<configuration>
60+
<mainClass>Main</mainClass>
61+
</configuration>
5962
</plugin>
6063
</plugins>
6164
</build>

container-image-generator/container-images/python/base-3.12/Dockerfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
FROM ghcr.io/astral-sh/uv:python3.12-bookworm-slim
22

3+
LABEL "com.javaaidev.llm-code-executor.description"="Python 3.12 with libraries: numpy, pandas, seaborn, tabulate, sympy"
4+
35
ENV UV_COMPILE_BYTECODE=1
46

57
ADD ./app /app

container-image-generator/container-images/python/base-3.12/app/pyproject.toml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@ name = "llm-code-executor"
33
version = "0.2.0"
44
requires-python = ">=3.12"
55
dependencies = [
6-
"numpy",
7-
"pandas",
8-
"seaborn",
9-
"tabulate",
10-
"sympy"
6+
"numpy",
7+
"pandas",
8+
"seaborn",
9+
"tabulate",
10+
"sympy"
1111

1212
]

container-image-generator/profiles/java/base-21.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,22 +4,22 @@
44
{
55
"groupId": "com.google.guava",
66
"artifactId": "guava",
7-
"artifactVersion": "33.4.6-jre"
7+
"artifactVersion": "33.5.0-jre"
88
},
99
{
1010
"groupId": "org.apache.commons",
1111
"artifactId": "commons-lang3",
12-
"artifactVersion": "3.17.0"
12+
"artifactVersion": "3.20.0"
1313
},
1414
{
1515
"groupId": "com.fasterxml.jackson.core",
1616
"artifactId": "jackson-databind",
17-
"artifactVersion": "2.18.3"
17+
"artifactVersion": "2.20.1"
1818
},
1919
{
2020
"groupId": "com.squareup.okhttp3",
2121
"artifactId": "okhttp",
22-
"artifactVersion": "4.12.0"
22+
"artifactVersion": "5.3.2"
2323
}
2424
]
2525
}
Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,14 @@
11
package com.javaaidev.llmcodeexecutor.containerimagegenerator.java
22

3-
data class JavaProfile(val javaVersion: String, val dependencies: List<MavenDependency>)
3+
data class JavaProfile(val javaVersion: String, val dependencies: List<MavenDependency>) {
4+
val description: String
5+
get() = "Java $javaVersion with libraries: ${dependencies.joinToString(", ") { it.coordinate() }}"
6+
}
47

58
data class MavenDependency(
69
val groupId: String,
710
val artifactId: String,
811
val artifactVersion: String
912
)
13+
14+
fun MavenDependency.coordinate() = "$groupId:$artifactId:$artifactVersion"

container-image-generator/src/main/kotlin/com/javaaidev/llmcodeexecutor/containerimagegenerator/python/PythonProfile.kt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,7 @@ package com.javaaidev.llmcodeexecutor.containerimagegenerator.python
33
data class PythonProfile(
44
val pythonVersion: String,
55
val dependencies: List<String>,
6-
)
6+
) {
7+
val description: String
8+
get() = "Python $pythonVersion with libraries: ${dependencies.joinToString(", ")}"
9+
}

container-image-generator/src/main/resources/templates/java/Dockerfile.hbs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ WORKDIR /app
88
RUN mvn compile exec:java
99

1010
FROM maven:3.9.9-eclipse-temurin-{{javaVersion}}
11+
12+
LABEL "com.javaaidev.llm-code-executor.description"="{{description}}"
13+
1114
COPY --from=build /root/.m2 /root/.m2
1215

1316
WORKDIR /app

container-image-generator/src/main/resources/templates/python/Dockerfile.hbs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
FROM ghcr.io/astral-sh/uv:python{{pythonVersion}}-bookworm-slim
22

3+
LABEL "com.javaaidev.llm-code-executor.description"="{{description}}"
4+
35
ENV UV_COMPILE_BYTECODE=1
46

57
ADD ./app /app

justfile

Lines changed: 0 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -12,50 +12,3 @@ generatePythonContainerImages: build
1212
generateJavaContainerImages: build
1313
java -jar target/container-image-generator.jar java \
1414
profiles/java/base-21.json --output=container-images/java/base-21
15-
16-
downloadCodeGeneratorCli:
17-
mvn dependency:copy -Dartifact=com.javaaidev.easyllmtools:code-generator-cli:0.1.9 -DoutputDirectory=target -Dmdep.stripVersion=true
18-
19-
generateCodeExecutorModel: downloadCodeGeneratorCli
20-
java -jar target/code-generator-cli.jar simple \
21-
--output=executor-model \
22-
--model-files-only \
23-
--parent-group-id=com.javaaidev.llmcodeexecutor \
24-
--parent-artifact-id=llm-code-executor \
25-
--parent-artifact-version=0.2.0 \
26-
--group-id=com.javaaidev.llmcodeexecutor \
27-
--artifact-id=code-executor-model --artifact-version=0.2.0 \
28-
--package-name=com.javaaidev.llmcodeexecutor.executor \
29-
llm-tool-spec/code-executor.json
30-
31-
generateCodeExecutorJava: downloadCodeGeneratorCli
32-
java -jar target/code-generator-cli.jar simple \
33-
--output=tools/java \
34-
--no-model-files \
35-
--tool-id-prefix=java \
36-
--parent-group-id=com.javaaidev.llmcodeexecutor \
37-
--parent-artifact-id=tools \
38-
--parent-artifact-version=0.2.0 \
39-
--group-id=com.javaaidev.llmcodeexecutor \
40-
--artifact-id=tool-java --artifact-version=0.2.0 \
41-
--model-package-name=com.javaaidev.llmcodeexecutor.executor.model \
42-
--package-name=com.javaaidev.llmcodeexecutor.executor.java \
43-
--llm-tool-name="ExecuteJavaCode" \
44-
--tool-description="Execute Java code with following libraries: guava, commons-lang3, jackson, okhttp. Code is executed in a container. Always write files to the current directory." \
45-
llm-tool-spec/code-executor.json
46-
47-
generateCodeExecutorPython: downloadCodeGeneratorCli
48-
java -jar target/code-generator-cli.jar simple \
49-
--output=tools/python \
50-
--no-model-files \
51-
--tool-id-prefix=python \
52-
--parent-group-id=com.javaaidev.llmcodeexecutor \
53-
--parent-artifact-id=tools \
54-
--parent-artifact-version=0.2.0 \
55-
--group-id=com.javaaidev.llmcodeexecutor \
56-
--artifact-id=tool-python --artifact-version=0.2.0 \
57-
--model-package-name=com.javaaidev.llmcodeexecutor.executor.model \
58-
--package-name=com.javaaidev.llmcodeexecutor.executor.python \
59-
--llm-tool-name="ExecutePythonCode" \
60-
--tool-description="Execute Python code with following libraries: numpy, pandas, seaborn, tabulate, sympy. Code is executed in a container. Always write files to the current directory." \
61-
llm-tool-spec/code-executor.json

0 commit comments

Comments
 (0)