#This step is killing me. The idea here

1 messages · Page 1 of 1 (latest)

grand sorrel
#

This is also a reply to your help question where you were asking about being able to ignore files and directories.

This PR aims to improve the ergonomics around specifying which directories and files to ignore. We're hoping to get this in by the next release.

https://github.com/dagger/dagger/pull/7744

In the meantime, you can try using "views" which will be deprecated soon, but can make things a bit easier.

Here's an example: https://github.com/dagger/dagger/blob/main/dev/dagger.json#L28

For a given view called default if your function accepts a directory as an argument, you can call it like this:

This means "pass in the current directory . while ignoring anything in the default view

GitHub

API changes
This PR updates the Function and FunctionArg from our engine API to support defaultPathFromContext

Function

withArg(
"""
If the argument is a Directory or Fi...

GitHub

An engine to run your pipelines in containers. Contribute to dagger/dagger development by creating an account on GitHub.

normal latch
#

I don't think these are relevant

  1. we are not using functions or modules
  2. We do want the .git directory (minus lfs) which works as intended, but takes forever
    git := dc.Dagger.Host().Directory(".git", dagger.HostDirectoryOpts{
        Exclude: []string{"lfs/"},
    })

The issue seems to be more about the check to see if things have changed / packaging / uploading to dagger-engine

It's a 600Mb .git/objects directory

#

One thought I have had is being able to do a shallow git clone against the clone in the local filesystem

grand sorrel
# normal latch I don't think these are relevant 1. we are not using functions or modules 2. We ...

Got it, thanks for clarifying

note, this is a rebuild, in that I ran Dagger, and then ran it again immediately after it completed, so no changes

This feels odd to me, but its possible that the cache was cleared because of how large it is. The GC policy is pretty aggressive and we've been experiementing with it a bit.

How large is the disk that the container runtime has access to on the machine where you're running this?

normal latch
#

200Gb, I cleaned up a 71Gb docker volume tied to Dagger a couple days ago

#

fyi, this seems to work so far

    clone := dc.Dagger.Git(".", dagger.GitOpts{
        KeepGitDir: true,
    })

    id, err := clone.ID(dc.Ctx)

    fmt.Println("CLONE ID", id, err)

    dc.ENG = clone.Head().Tree().Directory(".")

Now to unwind my hacks to see if things improve. Does Dagger always do a shallow clone? I don't see much in the way of config for controlling that. In CI, we need multiple commits for a build (because we simulate the PR merge before running the build, to test code as if it was merged)

#

apparently it does not work...

✔ connect 0.7s
✔ git(keepGitDir: true, url: "."): GitRepository! 0.0s
✔ cacheVolume(key: "cache-go-mod-1.22.5"): CacheVolume! 0.0s
✔ host: Host! 0.0s
✔ GitRepository.head: GitRef! 0.0s
✔ Host.directory(path: "/home/tony/.ssh"): Directory! 0.0s
✘ GitRef.tree: Directory! 0.1s
  ✘ cache request: git://./ 0.1s
  ! error fetching default branch for repository https://.: git error: exit status 128
✘ Directory.directory(path: "."): Directory! 0.1s
! failed to load cache key: error fetching default branch for repository https://.: git error: exit status 128
✔ Host.file(path: "src/dagger/images/with/gitconfig"): File! 0.1s
✔ cacheVolume(key: "cache-go-build-1.22.5"): CacheVolume! 0.0s