Skip to content

Template repo for a data science project using Docker and Prefect with Python.

Notifications You must be signed in to change notification settings

cyniphile/docker-prefect-datasci

Repository files navigation

Install

  • Install docker and start the daemon.

  • docker-compose up will start the container and print URLs to connect to the jupyter web UI.

    • If you're using VSCode, install the Remote Development Extensions Pack to easily run code and otherwise work within the docker container.
    • Attach to the {repo_name}-notebook-1 container.
    • Be sure to install the VSCode python extension in the remote container as well.
  • The Prefect UI is available at http://localhost:4200/ to view jobs.

  • Jupyter notebooks are available at http://localhost:8888/.

    • Ensure that notebooks are "trusted" in the top right corner to display interactive plots.
  • Download data: docker compose exec -i notebook python download_data.py

Non-Docker Usage

You can use poetry to setup an environment without Docker to reduce overhead.

  • Install poetry.
  • Configure to create virtual environments in project: poetry config settings.virtualenvs.in-project true
  • poetry install and point your notebooks to the new venv.
  • To add/remove packages:
    • poetry {add|remove} {package}
    • poetry export -f requirements.txt --output requirements.txt --without-hashes.
    • To update docker containers, run docker-compose up --build to rebuild the image with new packages, or, for faster turnaround, docker-compose exec notebook pip install -r /usr/src/app/requirements.txt
  • Prefect orion server, etc need to be started manually using the commands in docker-compose.yml

About

Template repo for a data science project using Docker and Prefect with Python.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published