pip install kedro-docker
kedro docker init
kedro docker build
$ cat Dockerfile
ARG BASE_IMAGE=python:3.6-buster
FROM $BASE_IMAGE
# install project requirements
COPY src/requirements.txt /tmp/requirements.txt
RUN pip install -r /tmp/requirements.txt && rm -f /tmp/requirements.txt
##install some custom python packages py_tools and methods
RUN pip install --extra-index-url https://developer:XXXXXXXXXX/simple py_tools
RUN pip install --extra-index-url https://developer:XXXXXXXXXX/pypi-all/simple methods
# add kedro user
ARG KEDRO_UID=999
ARG KEDRO_GID=0
RUN groupadd -f -g ${KEDRO_GID} kedro_group && \
useradd -d /home/kedro -s /bin/bash -g ${KEDRO_GID} -u ${KEDRO_UID} kedro
# copy the whole project except what is in .dockerignore
WORKDIR /home/kedro
COPY . .
RUN chown -R kedro:${KEDRO_GID} /home/kedro
USER kedro
RUN chmod -R a+w /home/kedro
EXPOSE 8888
CMD ["kedro", "run"]
$ kedro docker run
docker run -v /Users/sl/project/conf/local:/home/kedro/conf/local -v /Users/sl/project/data:/home/kedro/data -v /Users/sl/project/logs:/home/kedro/logs -v /Users/sl/project/notebooks:/home/kedro/notebooks -v /Users/sl/project/references:/home/kedro/references -v /Users/sl/project/results:/home/kedro/results --rm --name project-run project kedro run
2022-06-21 11:17:15,371 - kedro.framework.cli.hooks.manager - INFO - Registered CLI hooks from 1 installed plugin(s): kedro-telemetry-0.2.1
As an open-source project, we collect usage analytics.
We cannot see nor store information contained in a Kedro project.
You can find out more by reading our privacy notice:
https://github.com/kedro-org/kedro-plugins/tree/main/kedro-telemetry#privacy-notice
Do you opt into usage analytics? [y/N]: 2022-06-21 11:17:15,399 - kedro_telemetry.plugin - WARNING - Failed to confirm consent. No data was sent to Heap. Exception:
2022-06-21 11:17:15,402 - kedro.framework.session.store - INFO - `read()` not implemented for `BaseSessionStore`. Assuming empty store.
Model version 20220621-111715
2022-06-21 11:17:15,472 - kedro.framework.session.session - INFO - ** Kedro project kedro
2022-06-21 11:17:15,972 - kedro.framework.session.store - INFO - `save()` not implemented for `BaseSessionStore`. Skipping the step.
Traceback (most recent call last):
File "/usr/local/bin/kedro", line 8, in <module>
sys.exit(main())
File "/usr/local/lib/python3.10/site-packages/kedro/framework/cli/cli.py", line 217, in main
cli_collection()
File "/usr/local/lib/python3.10/site-packages/click/core.py", line 1130, in __call__
return self.main(*args, **kwargs)
File "/usr/local/lib/python3.10/site-packages/kedro/framework/cli/cli.py", line 145, in main
super().main(
File "/usr/local/lib/python3.10/site-packages/click/core.py", line 1055, in main
rv = self.invoke(ctx)
File "/usr/local/lib/python3.10/site-packages/click/core.py", line 1657, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/usr/local/lib/python3.10/site-packages/click/core.py", line 1404, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/usr/local/lib/python3.10/site-packages/click/core.py", line 760, in invoke
return __callback(*args, **kwargs)
File "/usr/local/lib/python3.10/site-packages/kedro/framework/cli/project.py", line 352, in run
session.run(
File "/usr/local/lib/python3.10/site-packages/kedro/framework/session/session.py", line 344, in run
pipeline = pipelines[name]
File "/usr/local/lib/python3.10/site-packages/kedro/framework/project/__init__.py", line 121, in inner
self._load_data()
File "/usr/local/lib/python3.10/site-packages/kedro/framework/project/__init__.py", line 153, in _load_data
register_pipelines = self._get_pipelines_registry_callable(
File "/usr/local/lib/python3.10/site-packages/kedro/framework/project/__init__.py", line 141, in _get_pipelines_registry_callable
module_obj = importlib.import_module(pipelines_module)
File "/usr/local/lib/python3.10/importlib/__init__.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 883, in exec_module
File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
File "/home/kedro/src/project/pipeline_registry.py", line 7, in <module>
from project.pipelines.data_science import pipeline as ds
File "/home/kedro/src/project/pipelines/ds/pipeline.py", line 2, in <module>
from project.pipelines.ds.model import train_model
File "/home/kedro/src/epc_fi/pipelines/ds/model.py", line 2, in <module>
from py_tools.ds.FKU.model import Model
ModuleNotFoundError: No module named 'py_tools.ds.FKU'
* kedro, version 0.18.1
*$ pip show kedro-docker
Name: kedro-docker
Version: 0.3.0
Summary: Kedro-Docker makes it easy to package Kedro projects with Docker.
Home-page: https://github.com/kedro-org/kedro-plugins/tree/main/kedro-docker
Author: Kedro
Author-email:
License: Apache Software License (Apache 2.0)
Location: /Users/sl/.conda/envs/test-new/lib/python3.10/site-packages
Requires: semver, anyconfig, kedro
Required-by:
* Python 3.10.4
* Mac OS, Monterey, M1
Could anyone throw some light to fix this. Anything else need to be defined in the Docker file like python path or etc..?