GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - codebench-dev/agent: The CodeBench agent, to run workloads inside microVMs

BranchesTags
Open more actions menu

Latest commit

 

History

50 Commits
50 Commits

Folders and files

NameName
Last commit message
Last commit date
.github/workflows
.github/workflows
 
 
archive/rust
archive/rust
 
 
.gitignore
.gitignore
 
 
.releaserc.json
.releaserc.json
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
build-kernel.sh
build-kernel.sh
 
 
build-rootfs.sh
build-rootfs.sh
 
 
build-static.sh
build-static.sh
 
 
exec.go
exec.go
 
 
go.mod
go.mod
 
 
go.sum
go.sum
 
 
handle_c.go
handle_c.go
 
 
handle_cpp.go
handle_cpp.go
 
 
handle_golang.go
handle_golang.go
 
 
handle_python.go
handle_python.go
 
 
main.go
main.go
 
 
openrc-service.sh
openrc-service.sh
 
 
setup-alpine.sh
setup-alpine.sh
 
 

Repository files navigation

CodeBench Agent

To build the filesystem of the agent VM, see details in codebench-dev/worker

Build

go build

Static (for Alpine Linux):

go build -tags netgo -ldflags '-extldflags "-static"'

Run

./agent

Demo

Healthcheck

» curl -i 127.0.0.1:8080/health
HTTP/1.1 200 OK
Content-Type: text/plain; charset=UTF-8
Date: Sat, 31 Jul 2021 20:02:45 GMT
Content-Length: 2

Compile and run standalone code

C

» curl -i localhost:8080/run -X POST --data '{"code":"#include <stdio.h>\r\nint main() {\r\n   printf(\"Hello, C!\");\r\n   return 0;\r\n}","id":"123","variant":"gcc","language":"c"}' -H 'Content-Type: application/json'
HTTP/1.1 200 OK
Content-Type: application/json; charset=UTF-8
Date: Sat, 31 Jul 2021 20:04:04 GMT
Content-Length: 104

{"message":"Success","error":"","stdout":"Hello, C!","stderr":"","exec_duration":1843,"mem_usage":9432}

C++

» curl -i -H 'Content-Type: application/json' -X POST http://localhost:8080/run --data '{"id":"1235","code":"#include <iostream>\n\nint main() {\n    std::cout << \"Hello, C++!\";\n    return 0;\n}\n","language":"cpp", "variant":"cpp"}'
HTTP/1.1 200 OK
Content-Type: application/json; charset=UTF-8
Date: Sat, 31 Jul 2021 20:04:50 GMT
Content-Length: 106

{"message":"Success","error":"","stdout":"Hello, C++!","stderr":"","exec_duration":3899,"mem_usage":9972}

Python

» curl -i -H 'Content-Type: application/json' -X POST http://localhost:8080/run --data '{"id":"1234","code":"print(\"Hello, Python!\")","language":"python", "variant":"cpython3"}'
HTTP/1.1 200 OK
Content-Type: application/json; charset=UTF-8
Date: Sat, 31 Jul 2021 20:06:31 GMT
Content-Length: 113

{"message":"Success","error":"","stdout":"Hello, Python!\n","stderr":"","exec_duration":20958,"mem_usage":10620}

Go

» curl -i localhost:8080/run -X POST --data '{"code":"package main\r\n\r\nimport \"fmt\"\r\n\r\nfunc main() {\r\n    fmt.Println(\"Hello, Go!\")\r\n}","id":"123","variant":"go","language":"go"}' -H 'Content-Type: application/json'
HTTP/1.1 200 OK
Content-Type: application/json; charset=UTF-8
Date: Sat, 31 Jul 2021 20:07:14 GMT
Content-Length: 108

{"message":"Success","error":"","stdout":"Hello, Go!\n","stderr":"","exec_duration":4706,"mem_usage":10620}

About

The CodeBench agent, to run workloads inside microVMs

stanislas.blog/2021/08/firecracker/

Resources

Readme
MIT license
Activity
Custom properties

Stars

29 stars

Watchers

1 watching

Forks

6 forks
Report repository

Releases

Used by

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.