Hello everyone ! Would you know if it's possible t...
# ask-community
j
Hello everyone ! Would you know if it's possible to run a gRPC server by not using a given .py file but, like for the cmd
dagster dev
being able to use the
workspace.yaml
? So having a commanding like that:
Copy code
dagster api grpc --workspace myproject/workspace.yaml
My need would be to use the same process with
dagster dev
&
dagster api grpc
(but perhaps I misunderstood something in this page) Thanks !
d
Hey Justin - this isn't currently possible because a gRPC server maps to one code location / Python environment, and a workspace.yaml can contain multiple code locations. It should be possible to map each line in the workspace.yaml to a single
dagster api grpc
call though. I don't totally understand your use case, can you elaborate?
j
Thank you for your answer Daniel ! So I could do sthg like
Copy code
dagster api grpc --python-file docker/file1.py, docker/file2.py, docker/file3.py
My use case is to use always the same source of truth, and so to have everything in
workspace.yaml
so if I want to do the same in my gRPC server I don't "forget" anything as I would have been running this file, and not added manually in my query all files it should run
d
If you're running your own grpc server I would expect your workspace.yaml to look something more like this: https://docs.dagster.io/concepts/code-locations/workspace-files#initializing-the-server
Copy code
load_from:
  - grpc_server:
      host: localhost
      port: 4266
      location_name: "my_grpc_server"
dagster api grpc
can only take one --python-file argument - since it only corresponds to a single code location
(similar to how each entry in the list of code locations in the workspace.yaml file can only take in one python_file argument)
j
Oh ok I understand better what you meant ! In fact my
workspace.yaml
is more like this for now:
Copy code
load_from:
  - python_file: testPipeline/assets.py
d
If that's the case i'm curious why you want to run your own grpc server - with a workspace.yaml like that, dagit will do it for you
j
I already have a dagit running and want to have the possibility to add new pipelines running in different dockers (because of python versions and to avoid dependencies), but it's not impossible that I misunderstood something haha
But I'm not the one who did it I'll ask my friend what he exactly has in mind ! Perhaps I misunderstood what he did and what I'm saying is complete gibberish
d
you can point dagit at a grpc server that you're running separately, but if you do, the entry in workspace.yaml would need to say
grpc_server
not
python_file
j
Just so you know what we did is the k8s deployement (I know just this)
d
(or it won't know how to find the grpc server that you're runnign separately)
j
Oooooh !
Ok that's clear
Thx for your help !
condagster 1
m
@daniel Hello ! We are trying to deploy dagster (dagit + grpc server) using your provided Helm Charts, and as we have multiple dagit deployments to manage, we wanted to use the
user-deployments
option (is there any other way?) That’s why we need to understand how to run grpc server. The project’s structure is quite common I think :
Copy code
.
├── README.md
├── batchAPIs.py
├── batchPipeline
│   ├── Dockerfile.prod
│   ├── README.md
│   ├── batchPipeline
│   │   ├── __init__.py
│   │   ├── __pycache__
│   │   ├── assets.py
│   │   ├── resources.py
│   │   ├── run_pipeline.py
│   │   └── testDynamicAssets.py
│   ├── batchPipeline_tests
│   │   ├── __init__.py
│   │   └── test_assets.py
│   ├── pyproject.toml
│   ├── schedules
│   │   └── schedules.db
│   ├── setup.cfg
│   ├── setup.py
│   └── workspace.yaml
├── ...
└── requirements.txt
And to launch a user deployment using your helm, as I understood, we need to launch
dagster grpc api <parameters>
do you have an idea on the parameters I need to specify to launch the server ?
d
Max can you make a new post for this question? Our support oncall will be able to help you out
m
Ok thank you very much ! (I thought it was easier to understand regarding if I posted in this thread to have the context)