https://dagster.io/ logo
Title
t

Timo Klockow

12/28/2022, 1:14 PM
Hey, is there a way to rename the repository that is created by a
Definition
object? Like with using the
@repository
decorator? In the source code I can see it gets a default value of
name=SINGLETON_REPOSITORY_NAME
Can we override it somehow or is this only possible using the decorator?
p

Peter Davidson

12/28/2022, 1:19 PM
just write my_name=Definitions(...) then my_name shows up
t

Timo Klockow

12/28/2022, 1:20 PM
hmm I put it in my
repo.py
file and in dagit it is shown as
repo.py
no matter how I name the variable
p

Peter Davidson

12/28/2022, 1:39 PM
hmm your right
t

Timo Klockow

12/28/2022, 2:39 PM
E.g. lets say I have multiple gRPC servers running (different Teams) and contributing to one Dagit instance. How will the naming of each created repository be decided?
d

daniel

12/28/2022, 3:19 PM
Hi Timo - the
repo.py
you're describing is actually the name of the code location, not the repository. That name is configurable - what are you using to tell dagit which code locations to load? If it's a workspace.yaml file then there's a location_name key that you can use
t

Timo Klockow

12/28/2022, 3:20 PM
oh ok, the location_name key I wasn’t aware of… Thanks, I’ll try that….
d

daniel

12/28/2022, 3:20 PM
no problem - You can see an example with location_name set here: https://docs.dagster.io/concepts/code-locations/workspace-files#initializing-the-server
# workspace.yaml

load_from:
  - grpc_server:
      host: localhost
      port: 4266
      location_name: "my_grpc_server"
:thankyou: 2
:rainbow-daggy: 2
t

Timo Klockow

12/29/2022, 9:09 AM
although this takes away the flexibility to use python for dynamic namings. For e.g. we append the current version of our build
@repository(
    name=f'data_platform_repo_v{get_current_version()}_{STACK}',
same for Description. Is it possible for you guys to add this to your roadmap to include name and description arguments to Definition?
@daniel
d

daniel

12/29/2022, 6:12 PM
Is this something you could file a feature request for? I don't think we actually display the description for repositories in dagit either currently
I know there are plans to offer additional organizational tools for jobs using Definitions
t

Timo Klockow

12/29/2022, 6:13 PM
Sure where do I do that? 🙂
github?
d

daniel

12/29/2022, 6:13 PM
Yeah feature requests are tracked here: https://github.com/dagster-io/dagster/issues
👍 1
t

Timo Klockow

12/29/2022, 6:17 PM
s

schrockn

12/29/2022, 6:26 PM
@Timo Klockow keep in mind that you can keep on using
@repository
for this purpose. Additionally in the next dot release there is a function in
dagster._core.definitions.definitions_class
called
create_repository_using_definitions_args
that will allow you create a named repository using the definitions arguments
t

Timo Klockow

12/29/2022, 6:29 PM
Alright, thank you Nick 😊
s

schrockn

12/29/2022, 6:33 PM
However I do think it is worth stepping back and figuring out how to best support your use case. It definitely feels like you are hacking around a feature we lack (e.g. tags or metadata on code locations).
Dynamically naming in the fashion would make programmatically invoking things very difficult, for example.
t

Timo Klockow

12/29/2022, 6:40 PM
Plus I believe
description
is nowhere shown in Dagit