Skip to content
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

add Dagger runtime #259

Merged
merged 25 commits into from
Nov 27, 2022
Merged
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
32 changes: 28 additions & 4 deletions bass/bass.bass
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,25 @@
(defn latest-commit [src paths]
(git-out src ($ git log -n1 "--pretty=format:%H" -- & $paths))))

(provide [git-submodules]
; TODO: remove once this ships and bass-loop is upgraded
;
; reads all values from the source into a list
;
; => (take-all (list->source [1 2 3]))
(defn take-all [source]
(let [val (next source _)]
(if (ignore? val)
[]
(cons val (take-all source)))))

(defn git-submodules [src]
(map (fn [[_ path]] (string->dir path))
(-> ($ git config --file src/.gitmodules --get-regexp path)
(with-image (linux/alpine/git))
(read :unix-table)
take-all))))

(provide [deps deps+go]
; monolithic image containing dependencies for building and testing
(defn deps [src]
Expand All @@ -45,9 +64,12 @@

; deps with Go dependencies pre-fetched
(defn deps+go [src]
(from (deps src)
($ cp src/go.mod src/go.sum ./)
($ go mod download))))
(let [submodule-paths (map src/ (git-submodules src))
submodule-cp-args (conj submodule-paths ./)]
(from (deps src)
($ cp src/go.mod src/go.sum ./)
($ cp -a & $submodule-cp-args)
($ go mod download)))))

(provide [build smoke-test tests docs coverage]
(use (*dir*/buildkit.bass))
Expand All @@ -69,7 +91,8 @@
(archive src (dist src version os arch) os arch))

(defn with-deps-and-shims [thunk src]
(let [only-shim (subgit src ./pkg/runtimes/shim/ ./Makefile ./go.mod ./go.sum)
(let [submodules (git-submodules src)
only-shim (subgit src ./pkg/runtimes/shim/ ./Makefile ./go.mod ./go.sum & submodules)
built-shims (make-shims only-shim)]
(-> thunk
(with-mount src ./)
Expand Down Expand Up @@ -167,6 +190,7 @@
; returns a thunk that runs the tests
(defn tests [src testflags]
(-> ($ go test & $testflags)
(with-env {:SKIP_DAGGER_TESTS "true"})
(with-bass-and-buildkitd src)))

; returns a thunk that will run the tests and return cover.html
Expand Down
75 changes: 40 additions & 35 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,29 +3,31 @@ module github.com/vito/bass
go 1.18

require (
dagger.io/dagger v0.4.1
github.com/adrg/xdg v0.4.0
github.com/agext/levenshtein v1.2.3
github.com/ajstarks/svgo v0.0.0-20210406150507-75cfd577ce75
github.com/alecthomas/chroma v0.9.2
github.com/c-bata/go-prompt v0.2.6
github.com/cenkalti/backoff/v4 v4.1.2
github.com/containerd/containerd v1.6.6
github.com/cenkalti/backoff/v4 v4.1.3
github.com/containerd/containerd v1.6.9
github.com/docker/cli v20.10.17+incompatible
github.com/docker/distribution v2.8.1+incompatible
github.com/docker/docker v20.10.7+incompatible
github.com/docker/docker v20.10.18+incompatible
github.com/gertd/go-pluralize v0.1.7
github.com/gofrs/flock v0.8.1
github.com/google/go-cmp v0.5.7
github.com/google/go-cmp v0.5.9
github.com/hashicorp/go-multierror v1.1.1
github.com/jonboulle/clockwork v0.2.2
github.com/mattn/go-colorable v0.1.12
github.com/mattn/go-isatty v0.0.14
github.com/mattn/go-unicodeclass v0.0.1
github.com/moby/buildkit v0.10.1-0.20220826012947-46c8b9ee45d0
github.com/moby/buildkit v0.10.5
github.com/moby/sys/mountinfo v0.6.2
github.com/morikuni/aec v1.0.0
github.com/neovim/go-client v1.2.2-0.20220118223211-7c85d516f28c
github.com/opencontainers/go-digest v1.0.0
github.com/opencontainers/image-spec v1.0.3-0.20211202183452-c5a74bcca799
github.com/opencontainers/image-spec v1.0.3-0.20220303224323-02efb9a75ee1
github.com/opencontainers/umoci v0.4.7
github.com/pkg/errors v0.9.1
github.com/protocolbuffers/txtpbfmt v0.0.0-20220608084003-fc78c767cd6a
Expand All @@ -35,6 +37,7 @@ require (
github.com/spf13/pflag v1.0.5
github.com/spy16/slurp v0.2.3
github.com/square/certstrap v1.3.0
github.com/tonistiigi/fsutil v0.0.0-20220930225714-4638ad635be5
github.com/tonistiigi/units v0.0.0-20180711220420-6950e57a87ea
github.com/vito/booklit v0.12.2-0.20220630023834-33787382be72
github.com/vito/go-interact v1.0.1
Expand All @@ -44,20 +47,21 @@ require (
github.com/vito/vt100 v0.0.0-20220721174540-1f9a7c0f76a9
github.com/zeebo/xxh3 v1.0.2
github.com/zmb3/spotify/v2 v2.2.1
go.opentelemetry.io/otel v1.4.1
go.opentelemetry.io/otel v1.10.0
go.uber.org/zap v1.19.1
golang.org/x/crypto v0.0.0-20220525230936-793ad666bf5e
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c
golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a
golang.org/x/term v0.0.0-20220411215600-e5f449aeb171
google.golang.org/grpc v1.47.0
google.golang.org/protobuf v1.27.1
golang.org/x/crypto v0.0.0-20220722155217-630584e8d5aa
golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4
golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab
golang.org/x/term v0.0.0-20220722155259-a9ba230a4035
google.golang.org/grpc v1.49.0
google.golang.org/protobuf v1.28.1
)

require (
cloud.google.com/go v0.81.0 // indirect
filippo.io/edwards25519 v1.0.0-rc.1 // indirect
github.com/AdamKorcz/go-fuzz-headers v0.0.0-20210312213058-32f4d319f0d2 // indirect
github.com/Khan/genqlient v0.5.0 // indirect
github.com/Microsoft/go-winio v0.5.2 // indirect
github.com/apex/log v1.4.0 // indirect
github.com/charmbracelet/bubbles v0.13.0 // indirect
Expand All @@ -71,31 +75,32 @@ require (
github.com/cyphar/filepath-securejoin v0.2.3 // indirect
github.com/danwakefield/fnmatch v0.0.0-20160403171240-cbb64ac3d964 // indirect
github.com/dlclark/regexp2 v1.4.0 // indirect
github.com/docker/cli v20.10.17+incompatible // indirect
github.com/docker/docker-credential-helpers v0.6.4 // indirect
github.com/docker/go-units v0.5.0 // indirect
github.com/fogleman/ease v0.0.0-20170301025033-8da417bf1776 // indirect
github.com/go-bindata/go-bindata v3.1.2+incompatible // indirect
github.com/go-logr/logr v1.2.2 // indirect
github.com/go-logr/logr v1.2.3 // indirect
github.com/go-logr/stdr v1.2.2 // indirect
github.com/gogo/googleapis v1.4.1 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b // indirect
github.com/golang/glog v1.0.0 // indirect
github.com/golang/protobuf v1.5.2 // indirect
github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 // indirect
github.com/gorilla/websocket v1.4.2 // indirect
github.com/grpc-ecosystem/go-grpc-middleware v1.3.0 // indirect
github.com/grpc-ecosystem/grpc-gateway v1.16.0 // indirect
github.com/grpc-ecosystem/grpc-gateway/v2 v2.11.2 // indirect
github.com/hashicorp/errwrap v1.1.0 // indirect
github.com/iancoleman/strcase v0.2.0 // indirect
github.com/jessevdk/go-flags v1.4.0 // indirect
github.com/klauspost/compress v1.15.7 // indirect
github.com/klauspost/compress v1.15.9 // indirect
github.com/klauspost/cpuid/v2 v2.0.9 // indirect
github.com/klauspost/pgzip v1.2.4 // indirect
github.com/lucasb-eyer/go-colorful v1.2.0 // indirect
github.com/mattn/go-runewidth v0.0.13 // indirect
github.com/mattn/go-tty v0.0.3 // indirect
github.com/mitchellh/go-wordwrap v1.0.1 // indirect
github.com/mna/pigeon v1.0.1-0.20200224192238-18953b277063 // indirect
github.com/moby/sys/signal v0.6.0 // indirect
github.com/moby/patternmatcher v0.5.0 // indirect
github.com/moby/sys/signal v0.7.0 // indirect
github.com/muesli/ansi v0.0.0-20211018074035-2e021307bc4b // indirect
github.com/muesli/cancelreader v0.2.1 // indirect
github.com/muesli/reflow v0.3.0 // indirect
Expand All @@ -106,32 +111,32 @@ require (
github.com/pkg/term v1.2.0-beta.2 // indirect
github.com/rivo/uniseg v0.2.0 // indirect
github.com/rootless-containers/proto v0.1.0 // indirect
github.com/sergi/go-diff v1.1.0 // indirect
github.com/sirupsen/logrus v1.8.1 // indirect
github.com/tonistiigi/fsutil v0.0.0-20220510150904-0dbf3a8a7d58 // indirect
github.com/sirupsen/logrus v1.9.0 // indirect
github.com/tonistiigi/vt100 v0.0.0-20210615222946-8066bb97264f // indirect
github.com/vbatts/go-mtree v0.5.0 // indirect
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.29.0 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.4.1 // indirect
go.opentelemetry.io/otel/sdk v1.4.1 // indirect
go.opentelemetry.io/otel/trace v1.4.1 // indirect
go.opentelemetry.io/proto/otlp v0.12.0 // indirect
github.com/vektah/gqlparser/v2 v2.5.1 // indirect
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.34.0 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.9.0 // indirect
go.opentelemetry.io/otel/sdk v1.9.0 // indirect
go.opentelemetry.io/otel/trace v1.10.0 // indirect
go.opentelemetry.io/proto/otlp v0.18.0 // indirect
go.step.sm/crypto v0.16.2 // indirect
go.uber.org/atomic v1.7.0 // indirect
go.uber.org/goleak v1.1.12 // indirect
go.uber.org/multierr v1.6.0 // indirect
golang.org/x/mod v0.6.0-dev.0.20220106191415-9b9b3d81d5e3 // indirect
golang.org/x/net v0.0.0-20220225172249-27dd8689420f // indirect
golang.org/x/oauth2 v0.0.0-20210819190943-2bc19b11175f // indirect
golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4 // indirect
golang.org/x/net v0.0.0-20220906165146-f3363e06e74c // indirect
golang.org/x/oauth2 v0.0.0-20220722155238-128564f6959c // indirect
golang.org/x/text v0.3.7 // indirect
golang.org/x/time v0.0.0-20220210224613-90d013bbcef8 // indirect
golang.org/x/tools v0.1.10 // indirect
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 // indirect
golang.org/x/time v0.0.0-20220722155302-e5dcc9cfc0b9 // indirect
golang.org/x/tools v0.1.12 // indirect
google.golang.org/appengine v1.6.7 // indirect
google.golang.org/genproto v0.0.0-20220310185008-1973136f34c6 // indirect
google.golang.org/genproto v0.0.0-20220810155839-1856144b1d9c // indirect
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect
)

replace github.com/moby/buildkit => github.com/moby/buildkit v0.10.1-0.20220826012947-46c8b9ee45d0

// BEGIN SYNC buildkit
replace github.com/docker/docker => github.com/docker/docker v20.10.3-0.20220414164044-61404de7df1a+incompatible

Expand Down
Loading