I'm using the go sdk, with this xs/.dagger/main.go
package main
import (
"context"
"dagger/xs/internal/dagger"
)
type Xs struct{}
func (m *Xs) UploadRust(ctx context.Context, dir *dagger.Directory) (string, error) {
cleanDir := dag.Directory().
WithDirectory("src", dir.Directory("src")).
WithFile("Cargo.toml", dir.File("Cargo.toml"))
return dag.Container().
From("alpine:latest").
WithMountedDirectory("/mnt", cleanDir).
WithWorkdir("/mnt").
WithExec([]string{"find", "."}).
Stdout(ctx)
}
Rough details of the xs directory:
~/s/03d..x3n/xs $ ^du -sh .
11G .
~/s/03d..x3n/xs $ ^du -sh ./src
416K ./src
~/s/03d..x3n/xs $ ^find foo
foo
foo/Cargo.toml
foo/Cargo.boo
foo/src
foo/src/main.rx
When I pass "foo" as the directory, it runs quite quickly and I only see ./src and Cargo.toml
$ dagger develop ; dagger -c 'upload-rust "foo"'
▶ connect 2.3s
... ./src ./src/main.rx
./Cargo.toml
When use "." (ie the xs directory), I've not seen it complete. It runs for minutes on the upload step before I interupt it. My hunch is it's trying to upload all 11Gb?
dagger develop ; dagger -c 'upload-rust "."'