You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is all incredibly experimental and you'll need bleeding-edge versions of everything, but it's a fun proof of concept!
In general it's better to integrate with Dockerfiles than to pretend Bass exists in a world where it has somehow replaced them. It means you can use Bass anywhere you can use a Dockerfile, and it means you can be downstream of projects that use Dockerfiles.
ignore bustas with (glob)
You can now (glob) thunk and host paths to prevent boring files from busting caches.
This is a pretty huge feature in hindsight since it gives you total control over when things should rerun.
For example, Bass bundles a shim executable that needs to be built for each platform. It's slow to build and package, but changes infrequently. I had to resort to git specific trickery to scope its build to its own changes, but now I can just use (glob)!
it'll be all (write)
Bass can now (write) to host paths:
; write a thunk's output to disk
(write (from (linux/alpine) ($ echo "Hello!"))
./hello.txt)
; write a path to disk
(use (.git (linux/alpine/git)))
(write git:github/vito/bass/ref/main/README.md
*dir*/hello.md)
After coming back to Bass I noticed I had a confusing blend of inter-dependent Bash and Bass scripts in my repo. Lots of Bass scripts expected you to pipe them to bass --export and direct that to disk, so a lot of Bass scripts had a corresponding Bash script for doing just that.
I was hesitant to allow this before, because I liked the idea of Bass being "pure" and isolated. But if it means writing less Bash, it seems worth it.
Note that you can only write to host paths that the script has access to, so Bass scripts are still somewhat "pure" in the sense that they can only write to explicit inputs. (*dir*/../ will yell at you.)
(publish) and (export) thunks
Bass can now (publish) a thunk directly to a container registry, or you can (export) a thunk to create a "virtual" OCI archive path that you can (write) to disk.
(deffoo
(from (linux/alpine)
($ touch ./foo)))
; publish to Docker Hub at vito/foo:latest
(publish foo "vito/foo:latest")
; => {:repository "docker.io/vito/foo" :tag "latest" :digest "sha256:60f786f7639880846f853388cd668d95f619749b0086b127ad030dd9fc7dd0a3"}; write an OCI tarball to disk
(write (export foo) *dir*/image.tar)
; read it, because why not?
(next (read (export foo) :tar))
; => <fs>/blobs/
Similar to before, adding these allowed me to delete a few Bash scripts and write more Bass.
ENTRYPOINT & CMD gain some respect
Bass now has (with-entrypoint) and (with-default-args) for configuring a container image's ENTRYPOINT and CMD.
Now that (publish) and (export) are directly part of the language, it seemed only right to also let you configure an ENTRYPOINT and CMD if you want to.
Bass will also automatically run the entrypoint for an image if no command is otherwise specified:
(linux/hello-world) ; now returns a thunk
(run (linux/hello-world))
Up until now, Bass has never respected a container's entrypoint or default command. You could (from) it to hop inside, but you couldn't just, you know, run it. Now it will in scenarios where running is required and no command is provided.
This change is backwards compatible. ($) still doesn't respect entrypoint, so thunks created using it work similar to Dockerfiles.
To run a command using the entrypoint, use ($$):
(run (from (linux/alpine/git) ($$ version)))
Dagger runtime: almost prime-time
The Dagger runtime is nearly feature-complete, and Bass will automatically use it if it detects one available (e.g. in dagger run).
Dagger now has Bass-style services, so now it can run service thunks.
Dagger can now run thunks loaded from OCI achives. The Buildkit runtime also has much better support for these.
Dagger can now run insecure! thunks (i.e. privileged builds).
Dagger now has a much better secrets implementation.
Thunk timestamps are now normalized to 1985, just like the Buildkit runtime.
Cache paths now support synchronization control in both the Dagger and Buildkit runtime.
The two remaining feature gaps are TLS and the niche capability to run commands from cache paths.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hi! It's been a while.
This is a pretty big release - the first since November 2022!
All the major changes are included below, in no particular order.
bass 🤝 Dockerfiles
Bass can now
(docker-build)
Dockerfiles:But also, Bass can now be used in a Dockerfile:
This is all incredibly experimental and you'll need bleeding-edge versions of everything, but it's a fun proof of concept!
In general it's better to integrate with Dockerfiles than to pretend Bass exists in a world where it has somehow replaced them. It means you can use Bass anywhere you can use a Dockerfile, and it means you can be downstream of projects that use Dockerfiles.
ignore bustas with
(glob)
You can now
(glob)
thunk and host paths to prevent boring files from busting caches.This is a pretty huge feature in hindsight since it gives you total control over when things should rerun.
For example, Bass bundles a shim executable that needs to be built for each platform. It's slow to build and package, but changes infrequently. I had to resort to
git
specific trickery to scope its build to its own changes, but now I can just use(glob)
!it'll be all
(write)
Bass can now
(write)
to host paths:After coming back to Bass I noticed I had a confusing blend of inter-dependent Bash and Bass scripts in my repo. Lots of Bass scripts expected you to pipe them to
bass --export
and direct that to disk, so a lot of Bass scripts had a corresponding Bash script for doing just that.I was hesitant to allow this before, because I liked the idea of Bass being "pure" and isolated. But if it means writing less Bash, it seems worth it.
Note that you can only write to host paths that the script has access to, so Bass scripts are still somewhat "pure" in the sense that they can only write to explicit inputs. (
*dir*/../
will yell at you.)(publish)
and(export)
thunksBass can now
(publish)
a thunk directly to a container registry, or you can(export)
a thunk to create a "virtual" OCI archive path that you can(write)
to disk.Similar to before, adding these allowed me to delete a few Bash scripts and write more Bass.
ENTRYPOINT
&CMD
gain some respectBass now has
(with-entrypoint)
and(with-default-args)
for configuring a container image's ENTRYPOINT and CMD.Now that
(publish)
and(export)
are directly part of the language, it seemed only right to also let you configure anENTRYPOINT
andCMD
if you want to.Bass will also automatically run the entrypoint for an image if no command is otherwise specified:
Up until now, Bass has never respected a container's entrypoint or default command. You could
(from)
it to hop inside, but you couldn't just, you know, run it. Now it will in scenarios where running is required and no command is provided.This change is backwards compatible.
($)
still doesn't respect entrypoint, so thunks created using it work similar to Dockerfiles.To run a command using the entrypoint, use
($$)
:Dagger runtime: almost prime-time
The Dagger runtime is nearly feature-complete, and Bass will automatically use it if it detects one available (e.g. in
dagger run
).Dagger now has Bass-style services, so now it can run service thunks.
Dagger can now run thunks loaded from OCI achives. The Buildkit runtime also has much better support for these.
Dagger can now run
insecure!
thunks (i.e. privileged builds).Dagger now has a much better secrets implementation.
Thunk timestamps are now normalized to 1985, just like the Buildkit runtime.
Cache paths now support synchronization control in both the Dagger and Buildkit runtime.
The two remaining feature gaps are TLS and the niche capability to run commands from cache paths.
What's Changed
Breaking Changes⚠️
(assert)
for better error messages by @vito in redo(assert)
for better error messages #274(glob)
,(only-globs)
, and(except-globs)
for fine-grained caching via include/exclude glob patterns by @vito in Add(glob)
,(only-globs)
, and(except-globs)
for fine-grained caching via include/exclude glob patterns #282New Features ✨
(write)
,(publish)
, and(docker-build)
by @vito in Add(write)
,(publish)
, and(docker-build)
#270(export)
: returns a virtual OCI tarball file by @vito in add(export)
: returns a virtual OCI tarball file #273ENTRYPOINT
andCMD
by @vito in Support configuringENTRYPOINT
andCMD
#271(cache-dir)
can set cache concurrency, now defaults to:shared
by @vito in(cache-dir)
can set cache concurrency, now defaults to:shared
#275(refute)
; opposite of(assert)
by @vito in add(refute)
; opposite of(assert)
#277Full Changelog: v0.11.0...v0.12.0
This discussion was created from the release v0.12.0: still bassy after all these years.
Beta Was this translation helpful? Give feedback.
All reactions