Hi all! First time poster as I try to work out the idiomatic way to solve what is probably a very normal thing. I have a GCP Service Account JSON key that I need to make available to a function. What is the normal way to pass a secret that is a file? I am trying to pass it in via a file: directive of the dagger call for a parameter that is a dagger.Secret. But when I run my pipeline this way, the step trying to authenticate using the injected file fails silently in the way that would happen if there was no such auth key present.
I notice this suspicious ETOOBIG message in the output for the with_new_file:
.withNewFile(contents: ETOOBIG:sha256:<sha>, path: "/gcloud_jsonkey.json")
which was called like so:
async def build_env(self, source: dagger.Directory, gcloudkey: dagger.Secret) -> dagger.Container:
"""Build a ready-to-use development environment"""
gcloud_secret = await gcloudkey.plaintext()
return (
self.base_cuda_img(source)
.with_new_file("/gcloud_jsonkey.json", gcloud_secret)
.with_exec(["gcloud", "auth", "activate-service-account", "--key-file", "/gcloud_jsonkey.json"])
.with_directory("/src", source)
.with_workdir("/src")
.with_exec(["poetry", "install"])
)
There are several aspeects to this which I can imagine are not quite the idiom however ❤️