When I try to run a pipeline I get the following e...
# deployment-kubernetes
m
When I try to run a pipeline I get the following error:
Copy code
AttributeError: 'K8sRunLauncher' object has no attribute '_instance'
  File "/usr/local/lib/python3.9/site-packages/dagster_graphql/implementation/utils.py", line 14, in _fn
    return fn(*args, **kwargs)
  File "/usr/local/lib/python3.9/site-packages/dagster_graphql/implementation/execution/launch_execution.py", line 16, in launch_pipeline_execution
    return _launch_pipeline_execution(graphene_info, execution_params)
  File "/usr/local/lib/python3.9/site-packages/dagster_graphql/implementation/execution/launch_execution.py", line 49, in _launch_pipeline_execution
    run = do_launch(graphene_info, execution_params, is_reexecuted)
  File "/usr/local/lib/python3.9/site-packages/dagster_graphql/implementation/execution/launch_execution.py", line 36, in do_launch
    return graphene_info.context.instance.submit_run(
  File "/usr/local/lib/python3.9/site-packages/dagster/core/instance/__init__.py", line 1202, in submit_run
    submitted_run = self._run_coordinator.submit_run(
  File "/usr/local/lib/python3.9/site-packages/dagster/core/run_coordinator/default_run_coordinator.py", line 44, in submit_run
    return self._instance.launch_run(pipeline_run.run_id, external_pipeline)
  File "/usr/local/lib/python3.9/site-packages/dagster/core/instance/__init__.py", line 1260, in launch_run
    self._run_launcher.launch_run(self, run, external_pipeline=external_pipeline)
  File "/opt/dagster/app/dagster-k8s/dagster_k8s/launcher.py", line 250, in launch_run
    self._instance.report_engine_event(
I'm using the same custom docker image for the k8s scheduler, dagit, daemon and one user deployment. The image contains the libraries dagit, dagster-postgres, dagster-cron, dagster-celery-k8s and dagster-k8s. Does anyone know what I'm missing?
1
d
Hi Michiel - this error is consistent with dagster-k8s being stuck on an older release of dagster than the rest of your libraries. Maybe try doing a full reinstall of the image and see if the problem persists?
m
I'm trying to test an edit that I made to the dagster-k8s lib. So in my Docker file I pip install everything from the official repo except for dagster-k8s, that one I pip install from my local directory. I will update my local version and see if it works. 🙂
d
Ah, yeah, that would also explain this. You should have better luck if you build all the dagster libraries locally
(or none of them locally)
m
I'm trying to do that but I have a feeling that I'm doing something wrong with my COPY and pip install statements in my Dockerfile. Is this the way to go?
Copy code
FROM python:3.9-slim

# Cron is required to use scheduling in Dagster
RUN apt-get update && apt-get install -yqq cron apt-transport-https ca-certificates curl gnupg-agent software-properties-common
RUN curl -fsSL <https://download.docker.com/linux/debian/gpg> | apt-key add -
RUN add-apt-repository "deb [arch=amd64] <https://download.docker.com/linux/debian> $(lsb_release -cs) stable"
RUN apt-get update && apt-get install -yqq docker-ce docker-ce-cli <http://containerd.io|containerd.io>

RUN mkdir -p /opt/dagster/dagster_home /opt/dagster/app

WORKDIR /opt/dagster/app

# Install third party libraries
COPY project/image/requirements.txt .
RUN pip install -r requirements.txt

# Install local libraries as pip packages or else they cannot be found by the Dagster system
COPY project/setup.py .
COPY project/custom_lib_1/ ./custom_lib_1
COPY project/custom_lib_2/ ./custom_lib_2

# Local Dagster libraries
COPY project/dagster/python_modules/dagit/ ./dagit
COPY project/dagster/python_modules/libraries/dagster-k8s/ ./dagster-k8s
COPY project/dagster/python_modules/libraries/dagster-postgres/ ./dagster-postgres

RUN pip install -e ./dagit
RUN pip install -e ./dagster-postgres
RUN pip install -e ./dagster-k8s
RUN pip install -e .


# Copy your pipeline code and entrypoint.sh to /opt/dagster/app
COPY project/pipelines.py project/image/workspace.yaml ./

CMD ["dagit", "-h", "0.0.0.0", "-p", "3000"]
d
That looks right, but you also want to include python_modules/dagster at the top of the list of modules to copy/locally install (dagster and dagit are different modules)
👍 1