#can't use Annotated[Secret, Doc("AZURE_DEVOPS_TOKEN")] in constructor
1 messages · Page 1 of 1 (latest)
Hello @hearty mulch
Have you tried
dagger call --azure-devops-token=env:AZURE_DEVOPS_TOKEN format --source=services/ingest
?
omg 🙂 it works, ok so constructor args should be passed before function call?
sorry, dagger noob here 🙂 docs are confusing
exactly 🙂
right now I am also struggling with with_directory()... I passed --source=hello, and that hello dir has (dir1, dir2)... so the problem what I am trying to do is to mount them into 2 different places
dir1 should be at /src
dir2 should be at /src2
source.with_new_directory ?
or I need to use exclude / include?
I understand that I should probably take 2 dirs as args (--dir1, --dir2)
but I want to unify the pipeline
path.```
¯_(ツ)_/¯
so confusing
@ebon tulip if you have a second 🙂 would appreciate it
just loosing my mind here
testing with terminal --cmd=bash each variation
Can you show the module you are writing, so that I can get a better understanding?
def build_datasets(self, source: Directory) -> Container:
base = self._build_base()
base = self._with_poetry(base, poetry_home="/root/.poetry")
# add models
base = base.with_directory(
"/models", self.models, exclude=["**/.venv", "**/tests"]
)
return base.with_workdir("/workdir") \
.with_directory(".", source.with_new_directory("dagster/**"))```
I give source directory, that has 2 folders "dagster" and "dbt"
dagster should be linked to /workdir
dbt should be linked to /dbt
.with_directory(".", source.with_new_directory("dagster/**"))
that's what I had in my dockerfile COPY datasets/dagster . COPY datasets/dbt /dbt
I run dagger call build_datasets --source datasets
so i should play with include / exclude?
Not really used to python SDK, but this should do the trick
@function
def build_datasets(self, source: Directory) -> Container:
base = self._build_base()
base = self._with_poetry(base, poetry_home="/root/.poetry")
# add models
base = base.with_directory(
"/models", self.models, exclude=["**/.venv", "**/tests"]
)
return base.with_directory("/workdir", source.directory("/dagster")) \
.with_directory(".", source.directory("/dbt")) \
.with_workdir("/workdir")
Sorry for the delay 🙂
omg! I have no idea how I miss that .directory()...
thanks @ebon tulip
why then have that .with_directory?
They have different use cases
.directory
Mounts are included.```
.with_directory
`Retrieves this directory plus a directory written at the given path.`