Skip to content

Commit a0ab06a

Browse files
Denys Smirnovdennwc
authored andcommitted
Update Go and dependencies, fix image pull.
1 parent fce3479 commit a0ab06a

14 files changed

Lines changed: 403 additions & 895 deletions

File tree

.github/workflows/check.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
- name: Set up Go
1717
uses: actions/setup-go@v2
1818
with:
19-
go-version: 1.19
19+
go-version: 1.25
2020

2121
- name: Test
2222
run: go test -v -coverprofile=coverage.txt -covermode=atomic ./...

Dockerfile

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,47 @@
11
# Base builder image with all libraries installed, including the source of the project
2-
FROM golang:1.12 as builder
2+
FROM golang:1.25-bookworm AS builder
33

44
RUN apt-get update && \
55
apt-get install -y --no-install-recommends \
66
libostree-dev \
77
libglib2.0-dev \
8-
btrfs-tools \
8+
btrfs-progs \
99
&& apt-get clean
1010

11-
ENV GOPATH=/go
12-
ENV GO111MODULE=on
13-
WORKDIR /go/src/github.com/bblfsh/bblfshd
11+
WORKDIR /bblfsh
12+
13+
ADD go.mod ./
14+
ADD go.sum ./
15+
16+
RUN go mod download
1417

1518
ADD . .
1619

1720

1821
# Actual build image that compiles bblfshd and bblfshctl
19-
FROM builder as binbuild
22+
FROM builder AS binbuild
2023

2124
RUN mkdir /build
2225

2326
ARG BBLFSHD_VERSION=dev
24-
ARG BBLFSHD_BUILD=unknown
27+
ARG BBLFSHD_BUILD=undefined
2528

2629
ENV GO_LDFLAGS="-X 'main.version=${BBLFSHD_VERSION}' -X 'main.build=${BBLFSHD_BUILD}'"
2730

28-
RUN go build -tags ostree --ldflags "${GO_LDFLAGS}" -o /build/bblfshd ./cmd/bblfshd/
31+
RUN go build -tags ostree,containers_image_ostree --ldflags "${GO_LDFLAGS}" -o /build/bblfshd ./cmd/bblfshd/
2932
RUN go build --ldflags "${GO_LDFLAGS}" -o /build/bblfshctl ./cmd/bblfshctl/
3033

3134

3235
# Final image for bblfshd
33-
FROM debian:stretch-slim
36+
FROM debian:bookworm-slim
3437

3538
RUN apt-get update && \
3639
apt-get install -y --no-install-recommends --no-install-suggests \
3740
ca-certificates \
3841
libostree-1-1 \
3942
&& apt-get clean
4043

41-
ENV TINI_VERSION v0.18.0
44+
ENV TINI_VERSION=v0.18.0
4245
ADD https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini /tini
4346
RUN chmod +x /tini
4447

cmd/bblfshd/main.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,13 @@ import (
66
"fmt"
77
"net"
88
"net/http"
9+
_ "net/http/pprof"
910
"os"
1011
"os/signal"
1112
"sync"
1213
"syscall"
1314
"time"
1415

15-
_ "net/http/pprof"
16-
1716
"gopkg.in/src-d/go-log.v1"
1817

1918
"github.com/bblfsh/bblfshd/daemon"
@@ -22,8 +21,9 @@ import (
2221
cmdutil "github.com/bblfsh/sdk/v3/cmd"
2322
"github.com/bblfsh/sdk/v3/driver/manifest/discovery"
2423
"github.com/prometheus/client_golang/prometheus"
24+
pversion2 "github.com/prometheus/client_golang/prometheus/collectors/version"
2525
"github.com/prometheus/client_golang/prometheus/promhttp"
26-
pversion "github.com/prometheus/common/version"
26+
pversion1 "github.com/prometheus/common/version"
2727
jaegercfg "github.com/uber/jaeger-client-go/config"
2828
)
2929

@@ -67,9 +67,9 @@ var (
6767
)
6868

6969
func init() {
70-
pversion.Version = version
71-
pversion.BuildDate = build
72-
prometheus.MustRegister(pversion.NewCollector("bblfshd"))
70+
pversion1.Version = version
71+
pversion1.BuildDate = build
72+
prometheus.MustRegister(pversion2.NewCollector("bblfshd"))
7373

7474
cmd = flag.NewFlagSet("bblfshd", flag.ExitOnError)
7575
network = cmd.String("network", "tcp", "network type: tcp, tcp4, tcp6, unix or unixpacket.")

daemon/daemon.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
//go:build linux && cgo
12
// +build linux,cgo
23

34
package daemon

daemon/daemon_test.go

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,16 @@ package daemon
22

33
import (
44
"context"
5+
"errors"
56
"fmt"
67
"io/ioutil"
78
"net"
89
"os"
9-
"reflect"
1010
"sync"
1111
"testing"
1212
"time"
1313

14+
"github.com/docker/distribution/registry/api/errcode"
1415
"github.com/stretchr/testify/require"
1516
"google.golang.org/grpc"
1617
"gopkg.in/bblfsh/sdk.v1/protocol"
@@ -53,7 +54,9 @@ func TestDaemon_InstallNonexistentDriver(t *testing.T) {
5354

5455
err := s.InstallDriver("", "docker://list", false)
5556
require.Error(err, "An error was expected")
56-
require.Equal("errcode.Errors", reflect.TypeOf(err).String())
57+
var e errcode.Errors
58+
ok := errors.As(err, &e)
59+
require.True(ok)
5760
}
5861

5962
func TestDaemonParse_MockedDriverParallelClients(t *testing.T) {

daemon/driver.go

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
//go:build linux && cgo
12
// +build linux,cgo
23

34
package daemon
@@ -15,7 +16,6 @@ import (
1516

1617
"github.com/bblfsh/bblfshd/daemon/protocol"
1718
"github.com/bblfsh/bblfshd/runtime"
18-
1919
protocol2 "github.com/bblfsh/sdk/v3/protocol"
2020
"github.com/opencontainers/runc/libcontainer/configs"
2121
"google.golang.org/grpc"
@@ -86,11 +86,15 @@ func NewDriverInstance(r *runtime.Runtime, lang string, i runtime.DriverImage, o
8686
Destination: "/tmp/",
8787
Device: "bind",
8888
Flags: syscall.MS_BIND | syscall.MS_REC | syscall.MS_NOSUID,
89-
PremountCmds: []configs.Command{
90-
{Path: "mkdir", Args: []string{"-p", tmp}},
91-
},
9289
})
93-
90+
if cfg.Hooks == nil {
91+
cfg.Hooks = make(configs.Hooks)
92+
}
93+
const hook = configs.CreateRuntime // TODO: is it the right one?
94+
cfg.Hooks[hook] = append(cfg.Hooks[hook], configs.NewCommandHook(&configs.Command{
95+
Path: "mkdir",
96+
Args: []string{"-p", tmp},
97+
}))
9498
return cfg
9599
}
96100

go.mod

Lines changed: 101 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,121 @@
11
module github.com/bblfsh/bblfshd
22

3-
go 1.12
3+
go 1.25.0
44

55
require (
6-
github.com/14rcole/gopopulate v0.0.0-20180821133914-b175b219e774 // indirect
76
github.com/bblfsh/go-client/v4 v4.0.1
87
github.com/bblfsh/sdk/v3 v3.3.1
98
github.com/briandowns/spinner v0.0.0-20170614154858-48dbb65d7bd5
109
github.com/cenkalti/backoff v2.1.1+incompatible
11-
github.com/containers/image v3.0.0+incompatible
12-
github.com/containers/storage v1.28.1 // indirect
13-
github.com/docker/distribution v2.8.2+incompatible
14-
github.com/docker/docker v20.10.24+incompatible // indirect
15-
github.com/docker/docker-credential-helpers v0.6.0 // indirect
16-
github.com/docker/go-units v0.4.0
17-
github.com/docker/libtrust v0.0.0-20160708172513-aabc10ec26b7 // indirect
10+
github.com/containers/image v3.0.3-0.20190807230338-8645d022d4f3+incompatible
11+
github.com/docker/distribution v2.8.3+incompatible
12+
github.com/docker/go-units v0.5.0
1813
github.com/gogo/protobuf v1.3.2
19-
github.com/golang/protobuf v1.5.0
20-
github.com/google/go-github v17.0.0+incompatible // indirect
14+
github.com/golang/protobuf v1.5.4
2115
github.com/jessevdk/go-flags v1.4.0
22-
github.com/klauspost/compress v1.16.0 // indirect
23-
github.com/morikuni/aec v1.0.0 // indirect
2416
github.com/oklog/ulid v1.3.1
2517
github.com/olekukonko/tablewriter v0.0.0-20170925234030-a7a4c189eb47
26-
github.com/opencontainers/image-spec v1.0.2
27-
github.com/opencontainers/runc v1.1.5
18+
github.com/opencontainers/image-spec v1.1.0
19+
github.com/opencontainers/runc v1.4.0
2820
github.com/opentracing/opentracing-go v1.1.0
29-
github.com/ostreedev/ostree-go v0.0.0-20170727130318-80ab7dbb8986 // indirect
3021
github.com/pkg/errors v0.9.1
31-
github.com/prometheus/client_golang v1.11.1
32-
github.com/prometheus/common v0.26.0
22+
github.com/prometheus/client_golang v1.20.5
23+
github.com/prometheus/common v0.55.0
3324
github.com/src-d/enry/v2 v2.0.0
34-
github.com/stretchr/testify v1.7.0
25+
github.com/stretchr/testify v1.11.1
3526
github.com/uber/jaeger-client-go v2.16.0+incompatible
36-
github.com/uber/jaeger-lib v2.0.0+incompatible // indirect
37-
github.com/ulikunitz/xz v0.5.11 // indirect
38-
github.com/vbatts/tar-split v0.11.2 // indirect
39-
golang.org/x/net v0.7.0
40-
google.golang.org/grpc v1.30.0
27+
golang.org/x/net v0.50.0
28+
google.golang.org/grpc v1.79.1
4129
gopkg.in/bblfsh/sdk.v1 v1.17.0
4230
gopkg.in/src-d/go-errors.v1 v1.0.0
4331
gopkg.in/src-d/go-log.v1 v1.0.2
4432
)
33+
34+
require (
35+
cyphar.com/go-pathrs v0.2.3 // indirect
36+
github.com/14rcole/gopopulate v0.0.0-20180821133914-b175b219e774 // indirect
37+
github.com/BurntSushi/toml v1.6.0 // indirect
38+
github.com/Microsoft/go-winio v0.6.2 // indirect
39+
github.com/beorn7/perks v1.0.1 // indirect
40+
github.com/blang/semver v3.5.1+incompatible // indirect
41+
github.com/cespare/xxhash/v2 v2.3.0 // indirect
42+
github.com/checkpoint-restore/go-criu/v7 v7.2.0 // indirect
43+
github.com/containerd/console v1.0.5 // indirect
44+
github.com/containerd/log v0.1.0 // indirect
45+
github.com/containers/storage v1.59.1 // indirect
46+
github.com/coreos/go-systemd/v22 v22.7.0 // indirect
47+
github.com/cyphar/filepath-securejoin v0.6.1 // indirect
48+
github.com/davecgh/go-spew v1.1.1 // indirect
49+
github.com/distribution/reference v0.6.0 // indirect
50+
github.com/docker/docker v27.3.1+incompatible // indirect
51+
github.com/docker/docker-credential-helpers v0.7.0 // indirect
52+
github.com/docker/go-connections v0.4.0 // indirect
53+
github.com/docker/go-metrics v0.0.1 // indirect
54+
github.com/docker/libtrust v0.0.0-20160708172513-aabc10ec26b7 // indirect
55+
github.com/fatih/color v1.15.0 // indirect
56+
github.com/felixge/httpsnoop v1.0.4 // indirect
57+
github.com/ghodss/yaml v1.0.0 // indirect
58+
github.com/go-logr/logr v1.4.3 // indirect
59+
github.com/go-logr/stdr v1.2.2 // indirect
60+
github.com/godbus/dbus/v5 v5.2.2 // indirect
61+
github.com/google/go-github v17.0.0+incompatible // indirect
62+
github.com/google/go-querystring v1.0.0 // indirect
63+
github.com/gorilla/mux v1.8.1 // indirect
64+
github.com/grpc-ecosystem/grpc-opentracing v0.0.0-20180507213350-8e809c8a8645 // indirect
65+
github.com/klauspost/compress v1.18.4 // indirect
66+
github.com/klauspost/pgzip v1.2.6 // indirect
67+
github.com/mattn/go-colorable v0.1.13 // indirect
68+
github.com/mattn/go-isatty v0.0.17 // indirect
69+
github.com/mattn/go-runewidth v0.0.2 // indirect
70+
github.com/mcuadros/go-lookup v0.0.0-20171110082742-5650f26be767 // indirect
71+
github.com/mgutz/ansi v0.0.0-20170206155736-9520e82c474b // indirect
72+
github.com/moby/docker-image-spec v1.3.1 // indirect
73+
github.com/moby/sys/capability v0.4.0 // indirect
74+
github.com/moby/sys/mountinfo v0.7.2 // indirect
75+
github.com/moby/sys/user v0.4.0 // indirect
76+
github.com/moby/sys/userns v0.1.0 // indirect
77+
github.com/moby/term v0.5.2 // indirect
78+
github.com/morikuni/aec v1.0.0 // indirect
79+
github.com/mrunalp/fileutils v0.5.1 // indirect
80+
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
81+
github.com/opencontainers/cgroups v0.0.6 // indirect
82+
github.com/opencontainers/go-digest v1.0.0 // indirect
83+
github.com/opencontainers/runtime-spec v1.3.0 // indirect
84+
github.com/opencontainers/selinux v1.13.1 // indirect
85+
github.com/ostreedev/ostree-go v0.0.0-20170727130318-80ab7dbb8986 // indirect
86+
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
87+
github.com/prometheus/client_model v0.6.1 // indirect
88+
github.com/prometheus/procfs v0.15.1 // indirect
89+
github.com/rogpeppe/go-internal v1.14.1 // indirect
90+
github.com/seccomp/libseccomp-golang v0.11.1 // indirect
91+
github.com/sirupsen/logrus v1.9.4 // indirect
92+
github.com/src-d/envconfig v1.0.0 // indirect
93+
github.com/src-d/go-oniguruma v1.1.0 // indirect
94+
github.com/stretchr/objx v0.5.2 // indirect
95+
github.com/toqueteos/trie v1.0.0 // indirect
96+
github.com/uber/jaeger-lib v2.0.0+incompatible // indirect
97+
github.com/ulikunitz/xz v0.5.15 // indirect
98+
github.com/vbatts/tar-split v0.12.2 // indirect
99+
github.com/vishvananda/netlink v1.3.1 // indirect
100+
github.com/vishvananda/netns v0.0.5 // indirect
101+
github.com/x-cray/logrus-prefixed-formatter v0.5.2 // indirect
102+
go.opentelemetry.io/auto/sdk v1.2.1 // indirect
103+
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.65.0 // indirect
104+
go.opentelemetry.io/otel v1.40.0 // indirect
105+
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.40.0 // indirect
106+
go.opentelemetry.io/otel/metric v1.40.0 // indirect
107+
go.opentelemetry.io/otel/trace v1.40.0 // indirect
108+
golang.org/x/crypto v0.48.0 // indirect
109+
golang.org/x/mod v0.32.0 // indirect
110+
golang.org/x/oauth2 v0.34.0 // indirect
111+
golang.org/x/sys v0.41.0 // indirect
112+
golang.org/x/term v0.40.0 // indirect
113+
golang.org/x/text v0.34.0 // indirect
114+
golang.org/x/time v0.14.0 // indirect
115+
google.golang.org/genproto/googleapis/api v0.0.0-20260128011058-8636f8732409 // indirect
116+
google.golang.org/genproto/googleapis/rpc v0.0.0-20260217215200-42d3e9bedb6d // indirect
117+
google.golang.org/protobuf v1.36.11 // indirect
118+
gopkg.in/toqueteos/substring.v1 v1.0.2 // indirect
119+
gopkg.in/yaml.v2 v2.4.0 // indirect
120+
gopkg.in/yaml.v3 v3.0.1 // indirect
121+
)

0 commit comments

Comments
 (0)