Skip to content

[BUG] bash.#Run mounts failed with: mount "xxx" is not concrete #1823

Closed

Description

@hongchaodeng
Here is my full CUE code
package main

import (
	"dagger.io/dagger"
	"universe.dagger.io/bash"
	"universe.dagger.io/docker"
	"universe.dagger.io/alpine"
)

#Kubectl: {
	version: string | *"v1.23.5"
	image:   docker.#Build & {
		steps: [
			alpine.#Build & {
				packages: {
					bash: {}
					curl: {}
				}
			},
			bash.#Run & {
				workdir: "/src"
				script: contents: #"""
					curl -LO https://dl.k8s.io/release/\#(version)/bin/linux/amd64/kubectl
					chmod +x kubectl
					mv kubectl /usr/local/bin/
					"""#
			},
		]
	}
}

dagger.#Plan & {
	let kcpath = client.env.KUBECONFIG
	let kubeconfig = client.filesystem[kcpath].read.contents

	client: {
		filesystem: "\(kcpath)": read: contents: dagger.#FS
		filesystem: out: write: contents:        kubeconfig

		env: KUBECONFIG: string
	}

	actions: {
		kubectl: #Kubectl & {version: "v1.23.5"}
		test:    bash.#Run & {
			input:   kubectl.image.output
			workdir: "/src"
			mounts: "KubeConfig Data": {
				dest:     "/kubeconfig"
				contents: kubeconfig
			}
			script: contents: #"""
				cat /kubeconfig
				"""#
		}
	}
}

It failed:

12:38AM ERR actions.test._exec | failed: mount "\"KubeConfig Data\"" is not concrete
12:38AM FTL system | failed to execute plan: task failed: actions.test._exec: mount "\"KubeConfig Data\"" is not concrete

Activity

  1. shykes commented on Mar 21, 2022

    @shykes
    Contributor

    To isolate the problem, what happens if you do: let kcpath = "/hardcoded/path/for/testing" ?

  2. jlongtine commented on Mar 21, 2022

    @jlongtine
    Contributor

    @shykes The problem is that the tasks here:

    		filesystem: "\(kcpath)": read: contents: dagger.#FS
    		filesystem: out: write: contents:        kubeconfig
    
    		env: KUBECONFIG: string
    	}
    

    are not being run before the actions tasks. It's definitely related to the dagger do task code, but I'm not sure what the solution should be yet. Digging into that with @aluzzardi in a bit!

  3. shykes commented on Mar 21, 2022

    @shykes
    Contributor

    @shykes The problem is that the tasks here:

    		filesystem: "\(kcpath)": read: contents: dagger.#FS
    		filesystem: out: write: contents:        kubeconfig
    
    		env: KUBECONFIG: string
    	}
    

    are not being run before the actions tasks.

    I am trying to determine if that is caused by one client action depending on another. Hardcoding kcpath will help us determine that.

  4. shykes commented on Mar 24, 2022

    @shykes
    Contributor

    @hongchaodeng are you still stuck on this?

  5. shykes commented on Mar 24, 2022

    @shykes
    Contributor

    @jlongtine assigning to you since it seems related to your investigation of dependency detection issues.

  6. hongchaodeng commented on Mar 24, 2022

    @hongchaodeng
    ContributorAuthor

    Hi @shykes.

    are you still stuck on this?

    Not stuck. I have found a way to work around it:

    	client: {
    		commands: kubeconfig: {
    			name: "cat"
    			args: ["\(env.KUBECONFIG)"]
    			stdout: dagger.#Secret
    		}
    
  7. shykes commented on Mar 27, 2022

    @shykes
    Contributor

    Do you consider this an unresolved bug @aluzzardi @jlongtine ? If not, OK to close?

  8. helderco commented on Apr 11, 2022

    @helderco
    Contributor

    I am trying to determine if that is caused by one client action depending on another. Hardcoding kcpath will help us determine that.

    Yes, hardcoding works @shykes.

    I believe the dependency is being skipped because of being incomplete. We've seen this in various places already:

  9. helderco commented on May 3, 2022

    @helderco
    Contributor

    As a follow up on my last comment, the real issue is that client: filesystem paths are a part of the client action's CUE path and so it must be known during load.

    There's more details and proposal at:

    That issue goes to the heart of the problem you encountered here, you can track progress there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions