Skip to content

Instantly share code, notes, and snippets.

@sipsma
sipsma / main.go
Created April 26, 2024 03:46
buildkit scheduler debug log parser
package main
import (
"bufio"
"bytes"
"fmt"
"os"
"slices"
"strconv"
"strings"
@sipsma
sipsma / main.go
Created April 9, 2023 23:13
example of running kind inside dagger
package main
import (
"context"
"fmt"
"net"
"os"
"dagger.io/dagger"
k8smeta "k8s.io/apimachinery/pkg/apis/meta/v1"
3:12AM INF actions.test.integration._dag."10"._exec | #26 100.5 not ok 19 plan/client/env optional unset
3:12AM INF actions.test.integration._dag."10"._exec | #26 100.5 # (in test file ./plan.bats, line 207)
3:12AM INF actions.test.integration._dag."10"._exec | #26 100.5 # `"$DAGGER" "do" -p ./plan/client/env/optional.cue test unset' failed with status 66
3:12AM INF actions.test.integration._dag."10"._exec | #26 100.5 # 3:11AM DBG system | loading plan args=[
3:12AM INF actions.test.integration._dag."10"._exec | #26 100.5 # "./plan/client/env/optional.cue"
3:12AM INF actions.test.integration._dag."10"._exec | #26 100.5 # ]
3:12AM INF actions.test.integration._dag."10"._exec | #26 100.5 # 3:11AM DBG system | viper flags map[string]interface {}{"cache-from":[]string{}, "cache-to":[]string{}, "check":false, "dry-run":false, "experimental":false, "format":"txt", "help":false, "log-format":"plain", "log-level":"debug", "name":"", "no-cache":false, "output":"", "output-format":"plain", "plan":"./plan/clien
=== CONT TestClientGatewayIntegration/TestClientSlowCacheRootfsRef/worker=containerd-snapshotter-stargz
build_test.go:1023:
Error Trace: build_test.go:1023
client.go:187
build.go:56
solve.go:224
errgroup.go:57
asm_amd64.s:1581
Error: Received unexpected error:
failed to load cache key: failed to copy: failed to send write: EOF: unknown
=== CONT TestIntegration/TestBasicRegistryCacheImportExport/worker=oci-rootless
client_test.go:3540:
Error Trace: client_test.go:3540
client_test.go:2665
client_test.go:2704
run.go:176
Error: Should be true
Test: TestIntegration/TestBasicRegistryCacheImportExport/worker=oci-rootless
sandbox.go:228: stdout: /usr/bin/sudo
sandbox.go:228: stderr: /usr/bin/sudo
root@host:~/ovl# ls
root@host:~/ovl# mkdir layerA layerB layerC work mnt
root@host:~/ovl# touch layerA/a layerB/b layerC/c
root@host:~/ovl# mount ovl -t overlay -o lowerdir=layerA,upperdir=layerB,workdir=work mnt
root@host:~/ovl# ls -la mnt
total 8
drwxr-xr-x 1 root root 4096 Jun 16 17:32 .
drwxr-xr-x 7 root root 4096 Jun 16 17:32 ..
-rw-r--r-- 1 root root 0 Jun 16 17:32 a
-rw-r--r-- 1 root root 0 Jun 16 17:32 b
@sipsma
sipsma / gist:906b9843817f3a9f5b397845323b139f
Created August 23, 2020 19:43
opaque doesn't count if root of lowerdir
root@bincastle-dev:/home/sipsma/tmp/test-opq# ls
1 2 merged
root@bincastle-dev:/home/sipsma/tmp/test-opq# ls *
1:
foo
2:
foo
merged:
@sipsma
sipsma / gist:3399d4a30f2709019cd1d53309765878
Created August 4, 2020 22:52
example of trusted.overlay.origin
root@bincastle-dev:/home/sipsma/tmp/wh-issue2# ls
root@bincastle-dev:/home/sipsma/tmp/wh-issue2# mkdir -p lower/foo upper work merged
root@bincastle-dev:/home/sipsma/tmp/wh-issue2# touch lower/foo/bar
root@bincastle-dev:/home/sipsma/tmp/wh-issue2# mount overlay -t overlay -o lowerdir=lower,upperdir=upper,workdir=work,xino=off merged/
root@bincastle-dev:/home/sipsma/tmp/wh-issue2# rm merged/foo/bar
root@bincastle-dev:/home/sipsma/tmp/wh-issue2# umount merged/
root@bincastle-dev:/home/sipsma/tmp/wh-issue2# ls -la upper/foo/
total 8
drwxr-xr-x 2 root root 4096 Aug 4 15:50 .
drwxr-xr-x 3 root root 4096 Aug 4 15:49 ..
@sipsma
sipsma / gist:f113c578f3a8a86a93cd047f26bfa273
Created August 4, 2020 19:25
example of whiteouts being weird w/ overlay
root@bincastle-dev:/home/sipsma/tmp/wh-issue# ls
root@bincastle-dev:/home/sipsma/tmp/wh-issue# mkdir -p lower1/foo lower2/foo upper work merged
root@bincastle-dev:/home/sipsma/tmp/wh-issue# mknod lower1/foo/wh c 0 0
root@bincastle-dev:/home/sipsma/tmp/wh-issue# mknod lower1/foo/other-device c 0 1
root@bincastle-dev:/home/sipsma/tmp/wh-issue# mount overlay -t overlay -o lowerdir=lower1,upperdir=upper,workdir=work merged/
root@bincastle-dev:/home/sipsma/tmp/wh-issue# ls -la merged/foo/
ls: cannot access 'merged/foo/wh': No such file or directory
total 8
drwxr-xr-x 2 root root 4096 Aug 4 12:22 .
drwxr-xr-x 1 root root 4096 Aug 4 12:21 ..
#3 /bin/ls -la /
#3 sha256:ffc7afe35c556f8d7fcb457f635f05236cf7c3b7d5a24c9c5abab779c886444b
#3 ...
#2 docker-image://docker.io/eriksipsma/golang-singleuser:foo
#2 sha256:1bdfe7dbad1ed1b7eae8b7922d848bca3de1c8b1710538fb2ded34f85906a99b
#2 resolve docker.io/eriksipsma/golang-singleuser:foo 2.6s done
#2 DONE 2.7s
#2 docker-image://docker.io/eriksipsma/golang-singleuser:foo