File tree Expand file tree Collapse file tree 3 files changed +61
-2
lines changed
executors/python/src/main/kotlin/com/javaaidev/llmcodeexecutor/executor/python Expand file tree Collapse file tree 3 files changed +61
-2
lines changed Original file line number Diff line number Diff line change 1+ name : Create and publish a Docker image
2+
3+ on :
4+ push :
5+ branches : [ 'release' ]
6+
7+ env :
8+ REGISTRY : ghcr.io
9+ IMAGE_NAME : ${{ github.repository }}
10+
11+ jobs :
12+ build-and-push-image :
13+ runs-on : ubuntu-latest
14+ permissions :
15+ contents : read
16+ packages : write
17+ attestations : write
18+ id-token : write
19+ strategy :
20+ matrix :
21+ profile :
22+ - language : python
23+ version : base-3.12
24+ steps :
25+ - name : Checkout repository
26+ uses : actions/checkout@v4
27+ - name : Log in to the Container registry
28+ uses : docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1
29+ with :
30+ registry : ${{ env.REGISTRY }}
31+ username : ${{ github.actor }}
32+ password : ${{ secrets.GITHUB_TOKEN }}
33+ - name : Extract metadata (tags, labels) for Docker
34+ id : meta
35+ uses : docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7
36+ with :
37+ images : ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
38+ tags : |
39+ type=raw,value=${{ matrix.profile.language }}-${{ matrix.profile.version }}
40+ - name : Build and push Docker image
41+ id : push
42+ uses : docker/build-push-action@f2a1d5e99d037542a71f64918e516c093c6f3fc4
43+ with :
44+ context : container-image-generator/container-images/${{ matrix.profile.language }}/${{ matrix.profile.version }}
45+ push : true
46+ tags : ${{ steps.meta.outputs.tags }}
47+ labels : ${{ steps.meta.outputs.labels }}
48+
49+ - name : Generate artifact attestation
50+ uses : actions/attest-build-provenance@v2
51+ with :
52+ subject-name : ${{ env.REGISTRY }}/${{ env.IMAGE_NAME}}
53+ subject-digest : ${{ steps.push.outputs.digest }}
54+ push-to-registry : true
55+
Original file line number Diff line number Diff line change 1+ # LLM Code Executor
2+
3+ Execute code for LLM
Original file line number Diff line number Diff line change @@ -7,11 +7,12 @@ object PythonCodeExecutor {
77
88 fun execute (request : CodeExecutionRequest ): CodeExecutionResponse {
99 val codeDir = Files .createTempDirectory(" code_executor" )
10- Files .writeString(codeDir.resolve(" app.py" ), request.code)
10+ val codeFile = " app.py"
11+ Files .writeString(codeDir.resolve(codeFile), request.code)
1112 val codeExecutor = LLMCodeExecutor (
1213 CodeExecutorConfig (
1314 " python-executor" ,
14- listOf (" uv" , " run" , " app.py " ),
15+ listOf (" uv" , " run" , codeFile ),
1516 listOf (" /app/.venv" ),
1617 listOf (
1718 VolumeBind (
You can’t perform that action at this time.
0 commit comments