Skip to content

Bump otelgrpc to fix CVE issue - #6100

Merged
sipsma merged 7 commits into
dagger:mainfrom
wingyplus:otelgrpc-cve
Nov 14, 2023
Merged

sipsma merged 7 commits into
dagger:mainfrom
wingyplus:otelgrpc-cve

Conversation

@wingyplus

Copy link
Copy Markdown
Contributor

Found in the Trivy scan in #6099. Bump otelgrpc library to 0.46.0 and cleanup dependencies with go mod tidy.

@jedevc
jedevc requested a review from sipsma November 13, 2023 15:11
@wingyplus

wingyplus commented Nov 13, 2023 •

Copy link
Copy Markdown
Contributor Author

Not a good way to fix. Seems bump it cause some compilation error. :(

@wingyplus wingyplus closed this Nov 13, 2023
@wingyplus
wingyplus deleted the otelgrpc-cve branch November 13, 2023 15:12
@wingyplus
wingyplus restored the otelgrpc-cve branch November 13, 2023 15:12
@wingyplus wingyplus reopened this Nov 13, 2023
@wingyplus

Copy link
Copy Markdown
Contributor Author

Compared to https://github.com/dagger/dagger/actions/runs/6851646021/job/18628377264?pr=6099#step:7:310, we have only 1 otelgrpc issue related to buildkit binary. The pending issue is lint, it fails because of the function deprecation in otelgrpc.

I'm not sure about other issues in Trivy but it seems we need to update dependencies in the Alpine during build.

@sipsma

sipsma commented Nov 13, 2023

Copy link
Copy Markdown
Contributor

Thanks for looking into this @wingyplus! Your changes look good so far.

One of the remaining issues is the buildctl binary that we have to include in the engine image. We ran into similar issues w/ it and needing to upgrade vulnerable deps recently... I'm thinking it may be time to just squash this by removing the dependency on buildctl entirely.

I will give that a quick shot and push to this PR if successful.

This fix one of issues, founded in trivy scan job [1].

Signed-off-by: Thanabodee Charoenpiriyakij <[email protected]>
Signed-off-by: Thanabodee Charoenpiriyakij <[email protected]>
Since bump otelgrpc, it's required to bump otel/sdk to 1.20.

Signed-off-by: Thanabodee Charoenpiriyakij <[email protected]>
The buildctl binary is currently required in the engine image since it
facilitates connhelpers connecting to the engine inside (by proxying the
stdio of an exec'd buildctl process to the unix socket). This is
inherited from buildkit and how Dagger has worked for a while.

The problem is we keep running into vulnerabilities in this binary that
take a while for upstream to fix (i.e. related to otel/grpc), which
leaves us to resort to various hacks to get a binary w/out
vulnerabilities in the engine image.

This change moves us off of upstream's buildctl binary and instead
replaces it with the absolute minimal features we need in
`./cmd/dialstdio`. There's none of the buildctl subcommands except
dial-stdio. This allows us to easily build it from our own go.mod (which
makes dependency upgrades easier) and also results in most problematic
sources of dependencies no longer being present.

The source code for the dial-stdio functionality is mostly a fork of
upstream, except all the other adjacent code we don't need has been
stripped out. I also switched to use cobra to be consistent w/ our other
binaries and avoid a separate dependency on urfave/cli.

Attribution on the original source code is given w/ a NOTICE and
BUILDKIT_AUTHORS file, same as we did w/ `./cmd/engine`.

Signed-off-by: Erik Sipsma <[email protected]>
@sipsma
sipsma force-pushed the otelgrpc-cve branch 2 times, most recently from be3f977 to fea6204 Compare November 14, 2023 01:27
We currently are in a situation where the engine image is being built
and installing apk packages that are vulnerable. Alpine released newer
versions of the packages a few days ago, but we are still hitting cache
for the "apk add" execs from before then and thus aren't picking them
up.

The real fix to this is to switch CI to use Zenith and use one of the
various apk/apko/wolfi modules that have been written which avoid this
problem, e.g.
https://daggerverse.dev/mod/github.com/sipsma/daggerverse/apk@d709dd631e176025ea042dc03fdc90197f4b12ba

However, in the meantime this change just wraps the apk add w/ an env
var that changes once per day (current unix time / 1 day in seconds),
which will hold us over until then.

Signed-off-by: Erik Sipsma <[email protected]>
It's not immediately clear how to replace the interceptors with the
suggested "NewServerHandler" while still working w/ grpc_middleware.

It's possible that's already do-able and I just haven't seen exactly how
yet; I didn't invest a ton of time into this since we aren't really
using otel yet. Upstream buildkit will also need to deal with this once
they upgrade so we can see what they end up doing too.

Signed-off-by: Erik Sipsma <[email protected]>
@sipsma

sipsma commented Nov 14, 2023

Copy link
Copy Markdown
Contributor

Fixed the buildctl issue here: b67fe73

Basically, we just don't use buildctl anymore. The only reason it was in our engine image was for the dial-stdio subcommand, so I just extracted the relevant parts of that out (it's a very small chunk of code) and put it in our repo.


The other issue was due to caching of our apk add command resulting in us getting versions of alpine libs that were fixed a few days ago; fixed that here: 44def4e


cc @jedevc @vito this now has meaningful changes outside go.mod, PTAL

@sipsma
sipsma requested review from jedevc and vito November 14, 2023 03:37
Comment thread internal/mage/util/engine.go Resolved
Co-authored-by: Alex Suraci <[email protected]>
Signed-off-by: Erik Sipsma <[email protected]>
@sipsma
sipsma merged commit 7586044 into dagger:main Nov 14, 2023
@wingyplus
wingyplus deleted the otelgrpc-cve branch November 15, 2023 01:00
schlapzz pushed a commit to schlapzz/dagger that referenced this pull request Nov 24, 2023
* Bump otelgrpc to v0.46.0

This fix one of issues, founded in trivy scan job [1].

Signed-off-by: Thanabodee Charoenpiriyakij <[email protected]>

* Run go mod tidy to clean up dependencies

Signed-off-by: Thanabodee Charoenpiriyakij <[email protected]>

* Bump go.opentelemetry.io/otel/sdk to 1.20.0

Since bump otelgrpc, it's required to bump otel/sdk to 1.20.

Signed-off-by: Thanabodee Charoenpiriyakij <[email protected]>

* engine: use our own dial-stdio binary rather than buildctl

The buildctl binary is currently required in the engine image since it
facilitates connhelpers connecting to the engine inside (by proxying the
stdio of an exec'd buildctl process to the unix socket). This is
inherited from buildkit and how Dagger has worked for a while.

The problem is we keep running into vulnerabilities in this binary that
take a while for upstream to fix (i.e. related to otel/grpc), which
leaves us to resort to various hacks to get a binary w/out
vulnerabilities in the engine image.

This change moves us off of upstream's buildctl binary and instead
replaces it with the absolute minimal features we need in
`./cmd/dialstdio`. There's none of the buildctl subcommands except
dial-stdio. This allows us to easily build it from our own go.mod (which
makes dependency upgrades easier) and also results in most problematic
sources of dependencies no longer being present.

The source code for the dial-stdio functionality is mostly a fork of
upstream, except all the other adjacent code we don't need has been
stripped out. I also switched to use cobra to be consistent w/ our other
binaries and avoid a separate dependency on urfave/cli.

Attribution on the original source code is given w/ a NOTICE and
BUILDKIT_AUTHORS file, same as we did w/ `./cmd/engine`.

Signed-off-by: Erik Sipsma <[email protected]>

* ci: invalidate apk install of engine image once per day.

We currently are in a situation where the engine image is being built
and installing apk packages that are vulnerable. Alpine released newer
versions of the packages a few days ago, but we are still hitting cache
for the "apk add" execs from before then and thus aren't picking them
up.

The real fix to this is to switch CI to use Zenith and use one of the
various apk/apko/wolfi modules that have been written which avoid this
problem, e.g.
https://daggerverse.dev/mod/github.com/sipsma/daggerverse/apk@d709dd631e176025ea042dc03fdc90197f4b12ba

However, in the meantime this change just wraps the apk add w/ an env
var that changes once per day (current unix time / 1 day in seconds),
which will hold us over until then.

Signed-off-by: Erik Sipsma <[email protected]>

* engine: ignore deprecation lints about otelgrpc interceptors.

It's not immediately clear how to replace the interceptors with the
suggested "NewServerHandler" while still working w/ grpc_middleware.

It's possible that's already do-able and I just haven't seen exactly how
yet; I didn't invest a ton of time into this since we aren't really
using otel yet. Upstream buildkit will also need to deal with this once
they upgrade so we can see what they end up doing too.

Signed-off-by: Erik Sipsma <[email protected]>

* Use time.Truncate to simplify apk cache expiry

Co-authored-by: Alex Suraci <[email protected]>
Signed-off-by: Erik Sipsma <[email protected]>

---------

Signed-off-by: Thanabodee Charoenpiriyakij <[email protected]>
Signed-off-by: Erik Sipsma <[email protected]>
Signed-off-by: Erik Sipsma <[email protected]>
Co-authored-by: Erik Sipsma <[email protected]>
Co-authored-by: Erik Sipsma <[email protected]>
Co-authored-by: Alex Suraci <[email protected]>
Signed-off-by: Christian Schlatter <[email protected]>
schlapzz pushed a commit to schlapzz/dagger that referenced this pull request Nov 24, 2023
* Bump otelgrpc to v0.46.0

This fix one of issues, founded in trivy scan job [1].

Signed-off-by: Thanabodee Charoenpiriyakij <[email protected]>

* Run go mod tidy to clean up dependencies

Signed-off-by: Thanabodee Charoenpiriyakij <[email protected]>

* Bump go.opentelemetry.io/otel/sdk to 1.20.0

Since bump otelgrpc, it's required to bump otel/sdk to 1.20.

Signed-off-by: Thanabodee Charoenpiriyakij <[email protected]>

* engine: use our own dial-stdio binary rather than buildctl

The buildctl binary is currently required in the engine image since it
facilitates connhelpers connecting to the engine inside (by proxying the
stdio of an exec'd buildctl process to the unix socket). This is
inherited from buildkit and how Dagger has worked for a while.

The problem is we keep running into vulnerabilities in this binary that
take a while for upstream to fix (i.e. related to otel/grpc), which
leaves us to resort to various hacks to get a binary w/out
vulnerabilities in the engine image.

This change moves us off of upstream's buildctl binary and instead
replaces it with the absolute minimal features we need in
`./cmd/dialstdio`. There's none of the buildctl subcommands except
dial-stdio. This allows us to easily build it from our own go.mod (which
makes dependency upgrades easier) and also results in most problematic
sources of dependencies no longer being present.

The source code for the dial-stdio functionality is mostly a fork of
upstream, except all the other adjacent code we don't need has been
stripped out. I also switched to use cobra to be consistent w/ our other
binaries and avoid a separate dependency on urfave/cli.

Attribution on the original source code is given w/ a NOTICE and
BUILDKIT_AUTHORS file, same as we did w/ `./cmd/engine`.

Signed-off-by: Erik Sipsma <[email protected]>

* ci: invalidate apk install of engine image once per day.

We currently are in a situation where the engine image is being built
and installing apk packages that are vulnerable. Alpine released newer
versions of the packages a few days ago, but we are still hitting cache
for the "apk add" execs from before then and thus aren't picking them
up.

The real fix to this is to switch CI to use Zenith and use one of the
various apk/apko/wolfi modules that have been written which avoid this
problem, e.g.
https://daggerverse.dev/mod/github.com/sipsma/daggerverse/apk@d709dd631e176025ea042dc03fdc90197f4b12ba

However, in the meantime this change just wraps the apk add w/ an env
var that changes once per day (current unix time / 1 day in seconds),
which will hold us over until then.

Signed-off-by: Erik Sipsma <[email protected]>

* engine: ignore deprecation lints about otelgrpc interceptors.

It's not immediately clear how to replace the interceptors with the
suggested "NewServerHandler" while still working w/ grpc_middleware.

It's possible that's already do-able and I just haven't seen exactly how
yet; I didn't invest a ton of time into this since we aren't really
using otel yet. Upstream buildkit will also need to deal with this once
they upgrade so we can see what they end up doing too.

Signed-off-by: Erik Sipsma <[email protected]>

* Use time.Truncate to simplify apk cache expiry

Co-authored-by: Alex Suraci <[email protected]>
Signed-off-by: Erik Sipsma <[email protected]>

---------

Signed-off-by: Thanabodee Charoenpiriyakij <[email protected]>
Signed-off-by: Erik Sipsma <[email protected]>
Signed-off-by: Erik Sipsma <[email protected]>
Co-authored-by: Erik Sipsma <[email protected]>
Co-authored-by: Erik Sipsma <[email protected]>
Co-authored-by: Alex Suraci <[email protected]>
schlapzz pushed a commit to schlapzz/dagger that referenced this pull request Nov 24, 2023
* Bump otelgrpc to v0.46.0

This fix one of issues, founded in trivy scan job [1].

Signed-off-by: Thanabodee Charoenpiriyakij <[email protected]>

* Run go mod tidy to clean up dependencies

Signed-off-by: Thanabodee Charoenpiriyakij <[email protected]>

* Bump go.opentelemetry.io/otel/sdk to 1.20.0

Since bump otelgrpc, it's required to bump otel/sdk to 1.20.

Signed-off-by: Thanabodee Charoenpiriyakij <[email protected]>

* engine: use our own dial-stdio binary rather than buildctl

The buildctl binary is currently required in the engine image since it
facilitates connhelpers connecting to the engine inside (by proxying the
stdio of an exec'd buildctl process to the unix socket). This is
inherited from buildkit and how Dagger has worked for a while.

The problem is we keep running into vulnerabilities in this binary that
take a while for upstream to fix (i.e. related to otel/grpc), which
leaves us to resort to various hacks to get a binary w/out
vulnerabilities in the engine image.

This change moves us off of upstream's buildctl binary and instead
replaces it with the absolute minimal features we need in
`./cmd/dialstdio`. There's none of the buildctl subcommands except
dial-stdio. This allows us to easily build it from our own go.mod (which
makes dependency upgrades easier) and also results in most problematic
sources of dependencies no longer being present.

The source code for the dial-stdio functionality is mostly a fork of
upstream, except all the other adjacent code we don't need has been
stripped out. I also switched to use cobra to be consistent w/ our other
binaries and avoid a separate dependency on urfave/cli.

Attribution on the original source code is given w/ a NOTICE and
BUILDKIT_AUTHORS file, same as we did w/ `./cmd/engine`.

Signed-off-by: Erik Sipsma <[email protected]>

* ci: invalidate apk install of engine image once per day.

We currently are in a situation where the engine image is being built
and installing apk packages that are vulnerable. Alpine released newer
versions of the packages a few days ago, but we are still hitting cache
for the "apk add" execs from before then and thus aren't picking them
up.

The real fix to this is to switch CI to use Zenith and use one of the
various apk/apko/wolfi modules that have been written which avoid this
problem, e.g.
https://daggerverse.dev/mod/github.com/sipsma/daggerverse/apk@d709dd631e176025ea042dc03fdc90197f4b12ba

However, in the meantime this change just wraps the apk add w/ an env
var that changes once per day (current unix time / 1 day in seconds),
which will hold us over until then.

Signed-off-by: Erik Sipsma <[email protected]>

* engine: ignore deprecation lints about otelgrpc interceptors.

It's not immediately clear how to replace the interceptors with the
suggested "NewServerHandler" while still working w/ grpc_middleware.

It's possible that's already do-able and I just haven't seen exactly how
yet; I didn't invest a ton of time into this since we aren't really
using otel yet. Upstream buildkit will also need to deal with this once
they upgrade so we can see what they end up doing too.

Signed-off-by: Erik Sipsma <[email protected]>

* Use time.Truncate to simplify apk cache expiry

Co-authored-by: Alex Suraci <[email protected]>
Signed-off-by: Erik Sipsma <[email protected]>

---------

Signed-off-by: Thanabodee Charoenpiriyakij <[email protected]>
Signed-off-by: Erik Sipsma <[email protected]>
Signed-off-by: Erik Sipsma <[email protected]>
Co-authored-by: Erik Sipsma <[email protected]>
Co-authored-by: Erik Sipsma <[email protected]>
Co-authored-by: Alex Suraci <[email protected]>
schlapzz pushed a commit to schlapzz/dagger that referenced this pull request Nov 24, 2023
* Bump otelgrpc to v0.46.0

This fix one of issues, founded in trivy scan job [1].

Signed-off-by: Thanabodee Charoenpiriyakij <[email protected]>

* Run go mod tidy to clean up dependencies

Signed-off-by: Thanabodee Charoenpiriyakij <[email protected]>

* Bump go.opentelemetry.io/otel/sdk to 1.20.0

Since bump otelgrpc, it's required to bump otel/sdk to 1.20.

Signed-off-by: Thanabodee Charoenpiriyakij <[email protected]>

* engine: use our own dial-stdio binary rather than buildctl

The buildctl binary is currently required in the engine image since it
facilitates connhelpers connecting to the engine inside (by proxying the
stdio of an exec'd buildctl process to the unix socket). This is
inherited from buildkit and how Dagger has worked for a while.

The problem is we keep running into vulnerabilities in this binary that
take a while for upstream to fix (i.e. related to otel/grpc), which
leaves us to resort to various hacks to get a binary w/out
vulnerabilities in the engine image.

This change moves us off of upstream's buildctl binary and instead
replaces it with the absolute minimal features we need in
`./cmd/dialstdio`. There's none of the buildctl subcommands except
dial-stdio. This allows us to easily build it from our own go.mod (which
makes dependency upgrades easier) and also results in most problematic
sources of dependencies no longer being present.

The source code for the dial-stdio functionality is mostly a fork of
upstream, except all the other adjacent code we don't need has been
stripped out. I also switched to use cobra to be consistent w/ our other
binaries and avoid a separate dependency on urfave/cli.

Attribution on the original source code is given w/ a NOTICE and
BUILDKIT_AUTHORS file, same as we did w/ `./cmd/engine`.

Signed-off-by: Erik Sipsma <[email protected]>

* ci: invalidate apk install of engine image once per day.

We currently are in a situation where the engine image is being built
and installing apk packages that are vulnerable. Alpine released newer
versions of the packages a few days ago, but we are still hitting cache
for the "apk add" execs from before then and thus aren't picking them
up.

The real fix to this is to switch CI to use Zenith and use one of the
various apk/apko/wolfi modules that have been written which avoid this
problem, e.g.
https://daggerverse.dev/mod/github.com/sipsma/daggerverse/apk@d709dd631e176025ea042dc03fdc90197f4b12ba

However, in the meantime this change just wraps the apk add w/ an env
var that changes once per day (current unix time / 1 day in seconds),
which will hold us over until then.

Signed-off-by: Erik Sipsma <[email protected]>

* engine: ignore deprecation lints about otelgrpc interceptors.

It's not immediately clear how to replace the interceptors with the
suggested "NewServerHandler" while still working w/ grpc_middleware.

It's possible that's already do-able and I just haven't seen exactly how
yet; I didn't invest a ton of time into this since we aren't really
using otel yet. Upstream buildkit will also need to deal with this once
they upgrade so we can see what they end up doing too.

Signed-off-by: Erik Sipsma <[email protected]>

* Use time.Truncate to simplify apk cache expiry

Co-authored-by: Alex Suraci <[email protected]>
Signed-off-by: Erik Sipsma <[email protected]>

---------

Signed-off-by: Thanabodee Charoenpiriyakij <[email protected]>
Signed-off-by: Erik Sipsma <[email protected]>
Signed-off-by: Erik Sipsma <[email protected]>
Co-authored-by: Erik Sipsma <[email protected]>
Co-authored-by: Erik Sipsma <[email protected]>
Co-authored-by: Alex Suraci <[email protected]>
schlapzz pushed a commit to schlapzz/dagger that referenced this pull request Nov 24, 2023
* Bump otelgrpc to v0.46.0

This fix one of issues, founded in trivy scan job [1].

Signed-off-by: Thanabodee Charoenpiriyakij <[email protected]>

* Run go mod tidy to clean up dependencies

Signed-off-by: Thanabodee Charoenpiriyakij <[email protected]>

* Bump go.opentelemetry.io/otel/sdk to 1.20.0

Since bump otelgrpc, it's required to bump otel/sdk to 1.20.

Signed-off-by: Thanabodee Charoenpiriyakij <[email protected]>

* engine: use our own dial-stdio binary rather than buildctl

The buildctl binary is currently required in the engine image since it
facilitates connhelpers connecting to the engine inside (by proxying the
stdio of an exec'd buildctl process to the unix socket). This is
inherited from buildkit and how Dagger has worked for a while.

The problem is we keep running into vulnerabilities in this binary that
take a while for upstream to fix (i.e. related to otel/grpc), which
leaves us to resort to various hacks to get a binary w/out
vulnerabilities in the engine image.

This change moves us off of upstream's buildctl binary and instead
replaces it with the absolute minimal features we need in
`./cmd/dialstdio`. There's none of the buildctl subcommands except
dial-stdio. This allows us to easily build it from our own go.mod (which
makes dependency upgrades easier) and also results in most problematic
sources of dependencies no longer being present.

The source code for the dial-stdio functionality is mostly a fork of
upstream, except all the other adjacent code we don't need has been
stripped out. I also switched to use cobra to be consistent w/ our other
binaries and avoid a separate dependency on urfave/cli.

Attribution on the original source code is given w/ a NOTICE and
BUILDKIT_AUTHORS file, same as we did w/ `./cmd/engine`.

Signed-off-by: Erik Sipsma <[email protected]>

* ci: invalidate apk install of engine image once per day.

We currently are in a situation where the engine image is being built
and installing apk packages that are vulnerable. Alpine released newer
versions of the packages a few days ago, but we are still hitting cache
for the "apk add" execs from before then and thus aren't picking them
up.

The real fix to this is to switch CI to use Zenith and use one of the
various apk/apko/wolfi modules that have been written which avoid this
problem, e.g.
https://daggerverse.dev/mod/github.com/sipsma/daggerverse/apk@d709dd631e176025ea042dc03fdc90197f4b12ba

However, in the meantime this change just wraps the apk add w/ an env
var that changes once per day (current unix time / 1 day in seconds),
which will hold us over until then.

Signed-off-by: Erik Sipsma <[email protected]>

* engine: ignore deprecation lints about otelgrpc interceptors.

It's not immediately clear how to replace the interceptors with the
suggested "NewServerHandler" while still working w/ grpc_middleware.

It's possible that's already do-able and I just haven't seen exactly how
yet; I didn't invest a ton of time into this since we aren't really
using otel yet. Upstream buildkit will also need to deal with this once
they upgrade so we can see what they end up doing too.

Signed-off-by: Erik Sipsma <[email protected]>

* Use time.Truncate to simplify apk cache expiry

Co-authored-by: Alex Suraci <[email protected]>
Signed-off-by: Erik Sipsma <[email protected]>

---------

Signed-off-by: Thanabodee Charoenpiriyakij <[email protected]>
Signed-off-by: Erik Sipsma <[email protected]>
Signed-off-by: Erik Sipsma <[email protected]>
Co-authored-by: Erik Sipsma <[email protected]>
Co-authored-by: Erik Sipsma <[email protected]>
Co-authored-by: Alex Suraci <[email protected]>
schlapzz pushed a commit to schlapzz/dagger that referenced this pull request Nov 24, 2023
* Bump otelgrpc to v0.46.0

This fix one of issues, founded in trivy scan job [1].

Signed-off-by: Thanabodee Charoenpiriyakij <[email protected]>

* Run go mod tidy to clean up dependencies

Signed-off-by: Thanabodee Charoenpiriyakij <[email protected]>

* Bump go.opentelemetry.io/otel/sdk to 1.20.0

Since bump otelgrpc, it's required to bump otel/sdk to 1.20.

Signed-off-by: Thanabodee Charoenpiriyakij <[email protected]>

* engine: use our own dial-stdio binary rather than buildctl

The buildctl binary is currently required in the engine image since it
facilitates connhelpers connecting to the engine inside (by proxying the
stdio of an exec'd buildctl process to the unix socket). This is
inherited from buildkit and how Dagger has worked for a while.

The problem is we keep running into vulnerabilities in this binary that
take a while for upstream to fix (i.e. related to otel/grpc), which
leaves us to resort to various hacks to get a binary w/out
vulnerabilities in the engine image.

This change moves us off of upstream's buildctl binary and instead
replaces it with the absolute minimal features we need in
`./cmd/dialstdio`. There's none of the buildctl subcommands except
dial-stdio. This allows us to easily build it from our own go.mod (which
makes dependency upgrades easier) and also results in most problematic
sources of dependencies no longer being present.

The source code for the dial-stdio functionality is mostly a fork of
upstream, except all the other adjacent code we don't need has been
stripped out. I also switched to use cobra to be consistent w/ our other
binaries and avoid a separate dependency on urfave/cli.

Attribution on the original source code is given w/ a NOTICE and
BUILDKIT_AUTHORS file, same as we did w/ `./cmd/engine`.

Signed-off-by: Erik Sipsma <[email protected]>

* ci: invalidate apk install of engine image once per day.

We currently are in a situation where the engine image is being built
and installing apk packages that are vulnerable. Alpine released newer
versions of the packages a few days ago, but we are still hitting cache
for the "apk add" execs from before then and thus aren't picking them
up.

The real fix to this is to switch CI to use Zenith and use one of the
various apk/apko/wolfi modules that have been written which avoid this
problem, e.g.
https://daggerverse.dev/mod/github.com/sipsma/daggerverse/apk@d709dd631e176025ea042dc03fdc90197f4b12ba

However, in the meantime this change just wraps the apk add w/ an env
var that changes once per day (current unix time / 1 day in seconds),
which will hold us over until then.

Signed-off-by: Erik Sipsma <[email protected]>

* engine: ignore deprecation lints about otelgrpc interceptors.

It's not immediately clear how to replace the interceptors with the
suggested "NewServerHandler" while still working w/ grpc_middleware.

It's possible that's already do-able and I just haven't seen exactly how
yet; I didn't invest a ton of time into this since we aren't really
using otel yet. Upstream buildkit will also need to deal with this once
they upgrade so we can see what they end up doing too.

Signed-off-by: Erik Sipsma <[email protected]>

* Use time.Truncate to simplify apk cache expiry

Co-authored-by: Alex Suraci <[email protected]>
Signed-off-by: Erik Sipsma <[email protected]>

---------

Signed-off-by: Thanabodee Charoenpiriyakij <[email protected]>
Signed-off-by: Erik Sipsma <[email protected]>
Signed-off-by: Erik Sipsma <[email protected]>
Co-authored-by: Erik Sipsma <[email protected]>
Co-authored-by: Erik Sipsma <[email protected]>
Co-authored-by: Alex Suraci <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants