Is there a way to access the repository name from ...
# announcements
j
Is there a way to access the repository name from a run context/solid handle?
a
I don’t believe so - we allow executing pipelines that did not come from a repository. What is your use case?
j
The use case is for writing to files that will move around the org outside of dagster. I’d like to be able to store the origin/organize the origin of these files in a case where there will be many repositories running at once. something like
Copy code
key_path = f"{mode}/{prefix}/{contex.repository_name}/{model_name}/logs/{run_date}/{git_hash}:{context.run_id}.json"
where
contex.repository_name
would be the runtime repository
a
is pipeline name a usable replacement? or do you want multiple pipelines going to the same place?
using
tags
might be a workaround
@pipeline(tags={'the_name': 'foo'})
context.pipeline_def.tags['the_name']
j
yeah i think tags could work, though it’ll force my users to maintain that where as having the writing resource reflect the current repo wouldn’t. The reason this comes up is because we will have many different repositories each representing a different execution environment, each containing many pipelines
j
oh perfect