Skip to content

buildkite: debug internal pipeline failures #11585

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .buildkite/hooks/post-command
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
set -x

ps axf
ss -an
uname -a
docker info
docker ps

source .buildkite/hooks/libhook

# Clear any downloaded credentials.
Expand Down
9 changes: 7 additions & 2 deletions .buildkite/hooks/pre-command
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ source .buildkite/hooks/libhook

clear_docker_containers

uname -a
ps axf
ss -an
sysctl -w net.ipv4.tcp_tw_reuse=1

# Use a per-day bazel remote cache. As the cache object's TTL expires, they are
# deleted on an ongoing basis. Such partial deletion can break the cache state.
# Using per day cache will ensure that builds triggered on a certain day have
Expand Down Expand Up @@ -104,12 +109,12 @@ if [[ "${BUILDKITE_PIPELINE_INSTALL_RUNTIME:-}" == "true" ]]; then
make sudo TARGETS=//runsc:runsc \
ARGS="install --experimental=true --runtime=${RUNTIME} -- ${RUNTIME_ARGS:-}"
fi
if [[ "$HAD_EXPERIMENTAL" != true ]]; then
if true; then
# WARNING: We may be running in a container when this command executes.
# This only makes sense if Docker's `live-restore` feature is enabled.
echo 'Restarting Docker daemon with this new configuration:' >&2
cat /etc/docker/daemon.json >&2
sudo systemctl restart docker
sudo chroot /proc/1/root systemctl restart docker
else
# If experimental-ness was already enabled, we don't need to restart, as the
# only thing we modified is the list of runtimes, which can be reloaded with
Expand Down
8 changes: 8 additions & 0 deletions runsc/cmd/do.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ type Do struct {
ip string
quiet bool
overlay bool
netns string
uidMap idMapSlice
gidMap idMapSlice
}
Expand Down Expand Up @@ -128,6 +129,7 @@ func (c *Do) SetFlags(f *flag.FlagSet) {
f.BoolVar(&c.overlay, "force-overlay", true, "use an overlay. WARNING: disabling gives the command write access to the host")
f.Var(&c.uidMap, "uid-map", "Add a user id mapping [ContainerID, HostID, Size]")
f.Var(&c.gidMap, "gid-map", "Add a group id mapping [ContainerID, HostID, Size]")
f.StringVar(&c.netns, "netns", "", "path to the pre-created network namespace")
}

// Execute implements subcommands.Command.Execute.
Expand Down Expand Up @@ -198,6 +200,12 @@ func (c *Do) Execute(_ context.Context, f *flag.FlagSet, args ...any) subcommand
conf.Network = config.NetworkHost
}

} else if c.netns != "" {
netns := specs.LinuxNamespace{
Type: specs.NetworkNamespace,
Path: c.netns,
}
addNamespace(spec, netns)
} else {
switch clean, err := c.setupNet(cid, spec); err {
case errNoDefaultInterface:
Expand Down
5 changes: 5 additions & 0 deletions runsc/cmd/install.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ type Install struct {
ConfigFile string
Runtime string
Experimental bool
UserlandProxy bool
Clobber bool
CgroupDriver string
executablePath string
Expand All @@ -60,6 +61,7 @@ func (i *Install) SetFlags(fs *flag.FlagSet) {
fs.StringVar(&i.ConfigFile, "config_file", "/etc/docker/daemon.json", "path to Docker daemon config file")
fs.StringVar(&i.Runtime, "runtime", "runsc", "runtime name")
fs.BoolVar(&i.Experimental, "experimental", false, "enable/disable experimental features")
fs.BoolVar(&i.UserlandProxy, "userland-proxy", false, "enable/disable userland-proxy features")
fs.BoolVar(&i.Clobber, "clobber", true, "clobber existing runtime configuration")
fs.StringVar(&i.CgroupDriver, "cgroupdriver", "", "docker cgroup driver")
}
Expand Down Expand Up @@ -158,6 +160,9 @@ func doInstallConfig(i *Install, rw configReaderWriter) error {
if i.Experimental {
c["experimental"] = true
}
if !i.UserlandProxy {
c["userland-proxy"] = false
}

re := regexp.MustCompile(`^native.cgroupdriver=`)
// Set the cgroupdriver if required.
Expand Down
21 changes: 13 additions & 8 deletions runsc/cmd/install_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,8 @@ var defaultInput = map[string]any{
runtimeArgs: []string{"super", "cool", "args"},
},
},
"exec-opts": []string{"some-cgroup-driver=something", "native.cgroupdriver=init_driver"},
"exec-opts": []string{"some-cgroup-driver=something", "native.cgroupdriver=init_driver"},
"userland-proxy": false,
}

func TestInstall(t *testing.T) {
Expand Down Expand Up @@ -102,8 +103,9 @@ func TestInstall(t *testing.T) {
runtimeArgs: []string{"new", "cool", "args"},
},
},
"exec-opts": []string{"some-cgroup-driver=something", "native.cgroupdriver=my_driver"},
"experimental": true,
"exec-opts": []string{"some-cgroup-driver=something", "native.cgroupdriver=my_driver"},
"experimental": true,
"userland-proxy": false,
},
},
{
Expand Down Expand Up @@ -132,8 +134,9 @@ func TestInstall(t *testing.T) {
runtimeArgs: []string{"super", "cool", "args"},
},
},
"exec-opts": []string{"some-cgroup-driver=something", "native.cgroupdriver=init_driver", "native.cgroupdriver=my_driver"},
"experimental": true,
"exec-opts": []string{"some-cgroup-driver=something", "native.cgroupdriver=init_driver", "native.cgroupdriver=my_driver"},
"experimental": true,
"userland-proxy": false,
},
},
{
Expand Down Expand Up @@ -164,8 +167,9 @@ func TestInstall(t *testing.T) {
runtimeArgs: []string{"super", "cool", "args"},
},
},
"exec-opts": []string{"some-cgroup-driver=something", "native.cgroupdriver=init_driver"},
"experimental": true,
"exec-opts": []string{"some-cgroup-driver=something", "native.cgroupdriver=init_driver"},
"experimental": true,
"userland-proxy": false,
},
},
} {
Expand Down Expand Up @@ -231,7 +235,8 @@ func TestUninstall(t *testing.T) {
runtimeArgs: []string{"super", "cool", "args"},
},
},
"exec-opts": []string{"some-cgroup-driver=something", "native.cgroupdriver=init_driver"},
"userland-proxy": false,
"exec-opts": []string{"some-cgroup-driver=something", "native.cgroupdriver=init_driver"},
},
},
{
Expand Down