Skip to content

Commit 6891d7e

Browse files
committed
Feature: add Perl 5.42
1 parent 77cfb18 commit 6891d7e

File tree

6 files changed

+56
-7
lines changed

6 files changed

+56
-7
lines changed
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
FROM python:2.7
2+
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
{
2+
"Template": "perl_5_42",
3+
"Groups": [],
4+
"Enabled": true,
5+
"Connections": [],
6+
"ContainerOptions": {
7+
"CompileTTL": 30,
8+
"RunTTL": 5
9+
},
10+
"IsSupportPackage": true,
11+
12+
"Actions": {
13+
"default": {
14+
"Id": "default",
15+
"IsDefault": true,
16+
"Name": "Perl 5.42",
17+
"CompileCmd": "",
18+
"RunCmd": "perl app.pl {ARGS} < {STDIN}",
19+
"ScriptOptions": {
20+
"SourceFile": "app.pl"
21+
}
22+
}
23+
}
24+
}

sandbox/dockerfiles/run_kotlin.http

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,21 @@ Content-Type: application/json
1212
"externalOptions": {
1313
}
1414
}
15+
16+
###"Main.kt": "abstract class Person(val name: String) {\n abstract fun greet()\n}\n\ninterface FoodConsumer {\n fun eat()\n fun pay(amount: Int) = println(\"Delicious! Here's $amount bucks!\")\n}\n\nclass RestaurantCustomer(name: String, val dish: String) : Person(name), FoodConsumer {\n fun order() = println(\"$dish, please!\")\n override fun eat() = println(\"*Eats $dish*\")\n override fun greet() = println(\"It's me, $name.\")\n}\n\nfun main() {\n val sam = RestaurantCustomer(\"Sam\", \"Mixed salad\")\n sam.greet() // An implementation of an abstract function\n sam.order() // A member function\n sam.eat() // An implementation of an interface function\n sam.pay(10) // A default implementation in an interface\n}\n"
17+
18+
### Kotlin 2.0.21
19+
POST {{url}}/run
20+
Content-Type: application/json
21+
22+
{
23+
"templateId": "kotlin_2",
24+
"files": {
25+
},
26+
"args": "--name Mark",
27+
"stdin": "100.00",
28+
"externalOptions": {
29+
"CompileCmd": "cp /provision/build.gradle.kts ./build.gradle.kts && cp /provision/gradle.properties ./gradle.properties",
30+
"RunCmd": "gradle -Dgradle.user.home=/gradle-deps/.gradle run --offline --quiet"
31+
}
32+
}

sandbox/dockerfiles/run_typescript.http

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ Content-Type: application/json
77
"files": {
88
"index.ts": "import {hello} from \"./hello\"\n\ntype TextNode = {\n name: string;\n body: string;\n};\n\ntype FileNode = {\n id: number;\n name: string;\n children?: FileNode[];\n};\n\nlet idCounter = 0; \nfunction buildFileTree(textNodes: TextNode[]): FileNode[] {\n const root: FileNode[] = []; \n textNodes.forEach((textNode) => {\n const pathParts = textNode.name.split('/'); \n insertNode(root, pathParts);\n });\n\n return root;\n}\n\nfunction insertNode(nodes: FileNode[], pathParts: string[]) {\n if (pathParts.length === 0) return; \n\n const name = pathParts[0]; \n let node = nodes.find((n) => n.name === name); \n\n if (!node) {\n \n node = { id: idCounter++, name: hello(name) };\n nodes.push(node); \n }\n\n if (pathParts.length > 1) {\n if (!node.children) {\n node.children = [];\n }\n insertNode(node.children, pathParts.slice(1)); }\n}\n\nconst textNodes: TextNode[] = [\n { name: \"/dir1/dir2/file1.txt\", body: \"Content of file1\" },\n { name: \"/dir1/dir2/file2.txt\", body: \"Content of file2\" },\n { name: \"/dir1/file3.txt\", body: \"Content of file3\" },\n { name: \"file4.txt\", body: \"Content of file4\" },\n];\n\nconst fileTree = buildFileTree(textNodes);\nconsole.log(JSON.stringify(fileTree, null, 2));",
99
"hello.ts": "export const hello = (val: string): string => {\n return \"Bla bla\" + val\n}",
10-
"tsconfig.json": "{\n \"compilerOptions\": {\n \"outDir\": \"./dist/\",\n \"lib\": [\n \"es6\",\n \"dom\"\n ],\n \"experimentalDecorators\": true,\n \"emitDecoratorMetadata\": true,\n \"moduleResolution\": \"node\",\n \"noImplicitAny\": true,\n \"skipLibCheck\": true\n }\n }"
10+
"tsconfig.json": "{\n \"compilerOptions\": {\n \"outDir\": \"./dist/\",\n \"typeRoots\": [\n \"/usr/local/lib/node_modules/@types\",\n \"./node_modules/@types\"\n ],\n \"lib\": [\n \"es6\",\n \"dom\"\n ],\n \"experimentalDecorators\": true,\n \"emitDecoratorMetadata\": true,\n \"moduleResolution\": \"node\",\n \"noImplicitAny\": true,\n \"skipLibCheck\": \"\"\n }\n}"
1111
},
1212
"args": "--name \"Elon Mask\" -age=45"
1313
}

sandbox/dockerfiles/typescript_5_7/config.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
},
1010
"IsSupportPackage": true,
1111

12+
"Workdir": "/app",
13+
1214
"Actions": {
1315
"default": {
1416
"IsDefault": true,
@@ -25,3 +27,5 @@
2527
}
2628
}
2729
}
30+
31+

sandbox/manager.go

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -327,11 +327,12 @@ func (m *CodenireOrchestrator) runSndContainer(img BuiltImage) (cont *StartedCon
327327
ctx := context.Background()
328328

329329
networkMode := network.NetworkNone
330-
var networkEnvs []string
330+
var envs []string
331+
331332
if img.IsSupportPackage {
332333
networkMode = *isolatedNetwork
333-
networkEnvs = append(
334-
networkEnvs,
334+
envs = append(
335+
envs,
335336
fmt.Sprintf("HTTP_PROXY=%s", *isolatedGateway),
336337
fmt.Sprintf("HTTPS_PROXY=%s", *isolatedGateway),
337338
)
@@ -357,8 +358,8 @@ func (m *CodenireOrchestrator) runSndContainer(img BuiltImage) (cont *StartedCon
357358

358359
log.Printf("Created PostgreSQL database %s", name)
359360

360-
networkEnvs = append(
361-
networkEnvs,
361+
envs = append(
362+
envs,
362363
fmt.Sprintf("PGHOST=%s", "postgres_host"),
363364
fmt.Sprintf("PGDATABASE=%s", name),
364365
fmt.Sprintf("PGUSER=%s", user),
@@ -391,7 +392,7 @@ func (m *CodenireOrchestrator) runSndContainer(img BuiltImage) (cont *StartedCon
391392
containerConfig := &docker.Config{
392393
Image: *img.imageID,
393394
Cmd: []string{"tail", "-f", "/dev/null"},
394-
Env: networkEnvs,
395+
Env: envs,
395396
}
396397

397398
name := stripImageName(*img.imageID)

0 commit comments

Comments
 (0)