Skip to content

Multiple #dagger: compute calls does not seem to work? #10

Closed

Description

@dubo-dubon-duponey

Is it allowed to have multiple #dagger: compute snippets in a single cue?

This:

package acme

import (
	"dagger.cloud/alpine"
	"dagger.cloud/dagger"
)

let base=alpine & {
	package: {
		bash: ">3.0"
		rsync: true
	}
}

www: {

	dosomething: {
		#dagger: compute: [
			dagger.#Load & { from: base },
		]
	}
}

bar: {
	dosomethingelse: {
		#dagger: compute: [
			dagger.#Load & { from: base },
		]
	}
}

Will output:

[info] Running
buildkit solve:  task failed: #Script.0: field `do` not allowed:
    /config/cue.mod/pkg/dagger.cloud/dagger/dagger.cue:74:2
    /config/simple.cue:29:4
    /config/simple.cue:29:19
    input.cue:1:1

Activity

  1. shykes commented on Jan 12, 2021

    @shykes
    Contributor

    Yes it is allowed. I don’t see anything wrong with this snippet.

    What happens if you remove one of the two? The error message does not seem directly related. I would like to double-check that it isn’t caused by something else.

  2. dubo-dubon-duponey commented on Jan 12, 2021

    @dubo-dubon-duponey
    ContributorAuthor

    If I remove one of the two, it works fine.

  3. aluzzardi commented on Jan 12, 2021

    @aluzzardi
    Contributor

    Verified. Can't get it to work, neither with the dagger.#Load nor {op: "load"} syntax

  4. shykes commented on Jan 12, 2021

    @shykes
    Contributor

    Here’s a simplified repro case, for reference. Note that the error is unrelated to a specific operation or package.
    Here fetch-container and fetch-git could be replaced by any operation, and the result would be the same.

    foo: {
          dosomething: {
                #dagger: compute: [
                            { do: "fetch-container", ref: "index.docker.io/redis"}
                    ]
            }
    }
    
    bar: {
            dosomethingelse: {
                    #dagger: compute: [
                            { do: "fetch-git", ref: "https://github.com/blocklayerhq/dagger" }
                    ]
            }
    }
    
    
  5. shykes commented on Jan 12, 2021

    @shykes
    Contributor

    I think there is race condition. With the following config, I get the error roughly half of the time, at random.

    package acme
    
    www: {
    
            dosomething: {
                    #dagger: compute: [
                            { do: "fetch-container", ref: "index.docker.io/redis"}
                    ]
            }
    }
    
    bar: {
            dosomethingelse: {
                    #dagger: compute: [
                            {
                                    do: "fetch-git"
                                    remote: "https://github.com/shykes/tests"
                                    ref: "stdlib"
                            }
                    ]
            }
    }
    
  6. shykes commented on Jan 12, 2021

    @shykes
    Contributor
  7. reopened this on Jan 19, 2021
  8. linked a pull request that will close this issueFix locking around Fill and Lookup #54on Jan 20, 2021
  9. aluzzardi commented on Jan 22, 2021

    @aluzzardi
    Contributor

    I think this one got fixed by #54

  10. added a commit that references this issue on Sep 16, 2022
  11. added a commit that references this issue on Aug 24, 2023
  12. added a commit that references this issue on Jul 31, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions