Skip to content

Instantly share code, notes, and snippets.

@julz
julz / runtime.md
Last active September 15, 2015 03:17
Example Runtime Spec

Operations:

The command line should support each operation listed below as its first argument. It operates by default on the 'config.json' in the current directory.

Start

Starts a container from a bundle directory.

Flags: none. Output: The process output is printed to stdout and stderr, and the process exits with the delegate process exit code.

Standard Operations

The following operations should be supported by all runtimes. A container runtime supports an operation by invoking ‘[binary name] [operation name]’.

The following examples use ‘funC’ as the runtime, an alternate runtime can be used by substituting its name where funC appears.

Standard Flags

All operations should support the following flags:

@julz
julz / main.go
Created June 6, 2020 08:43
Pick two distinct random numbers efficiently
package main
import (
"fmt"
"math/rand"
)
// (repeatedly) picks 2 distinct random numbers from a range, avoids looping in case of clashes
func main() {
l := 10
func BenchmarkUnixVsTcpProbe(b *testing.B) {
handler := http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
w.WriteHeader(200)
})
tcpServer := httptest.NewServer(handler)
b.Cleanup(tcpServer.Close)
tmpDir := b.TempDir()
@julz
julz / main.go
Created November 20, 2015 12:39
containersched minicontainer
package main
import (
"fmt"
"os"
"os/exec"
"syscall"
)
func main() {