https://dagster.io/ logo
Title
s

Sundara Moorthy

02/24/2022, 10:02 AM
Hi Team, is it possible to deploy spark docker image in dagster-helm. In this example
dagster-user-deployments:
  enabled: true
  deployments:
    - name: "k8s-example-user-code-1"
      image:
        repository: "<http://docker.io/dagster/user-code-example|docker.io/dagster/user-code-example>"
        tag: latest
        pullPolicy: Always
      dagsterApiGrpcArgs:
        - "--python-file"
        - "/example_project/example_repo/repo.py"
      port: 3030
Can i use spark image in place of docker.io/dagster/user-code-example
a

alex

02/24/2022, 3:16 PM
ya the “user-code-example” is intended to be replaced by your actual code
s

Sundara Moorthy

02/24/2022, 3:18 PM
But is it possible to use spark-based-images which does spark-submit cmd ?
dagster-user-deployments:
  enabled: true
  deployments:
    - name: "k8s-example-user-code-1"
      image:
        repository: "<http://docker.io/bitnami/spark-3.1.2|docker.io/bitnami/spark-3.1.2>"
        tag: latest
        pullPolicy: Always
      dagsterApiGrpcArgs:
        - spark-submit --master <k8s://https>://<k8s-apiserver-host>:<k8s-apiserver-port> \
    --deploy-mode cluster
        - "/example_project/example_repo/repo.py"
      port: 3030
like this?
a

alex

02/24/2022, 3:20 PM
The purpose of this deployment is to run the grpc server which serves your
@repository
and the `@job`s & etc it contains. Why are you trying to
spark-submit
from there?
s

Sundara Moorthy

02/24/2022, 3:23 PM
I need to deploy spark image in k8 which spark-submit jobs in cluster mode , so i thought using feature of dagster-k8, which allows us to submit our own images
a

alex

02/24/2022, 3:25 PM
I would expect a behavior like that to happen in python in a
@resource
or
@op
what you posted above certainly wont work since you are passing the
spark-submit
command as a cli flag to
dagster api grpc
in the
dagsterApiGrpcArgs
section
s

Sundara Moorthy

02/24/2022, 3:27 PM
Okay, is there any other way to achieve this ?
In dagster
And if i have op which spark-submits a job, in this case, can i build a image and submit it in this way?
dagster-user-deployments:
  enabled: true
  deployments:
    - name: "code"
      image:
        repository: "<http://docker.io/code/code|docker.io/code/code>"
        tag: latest
        pullPolicy: Always
      dagsterApiGrpcArgs:
        - "--python-file"
        - "/main.py"
      port: 3030
a

alex

02/24/2022, 3:39 PM
ya that looks like the right path - build an image with your user code and any spark dependencies and use it here as your
user-deployment
. The same image will be used with
@job
s are run that were sourced from that deployment.
s

Sundara Moorthy

02/24/2022, 3:40 PM
Okay, which means no spark-submit is possible to pass in user-deployment. Correct me if i am wrong?
a

alex

02/24/2022, 3:45 PM
I do not believe it is possible to include a spark-submit command as part of the deployment spec for the user-deployment
s

Sundara Moorthy

02/24/2022, 3:47 PM
And is it possible to trigger the launch-run button programmatically without using dagit UI??
a

alex

02/24/2022, 3:48 PM
you can set up a
schedule
or
sensor
or use the GraphQL API to programtically trigger runs
s

Sundara Moorthy

02/24/2022, 3:48 PM
Thanks @alex