---
# roles/ml-python-packages

# This should be optimized so that only one check / install for pip3 is needed
# Still we should make sure that pip3 is actually installed before trying to use it
- name: Install dependecies
  become: true
  apt:
    name:
      - python3-pip
      - libatlas-base-dev
    state: present
    update_cache: true

- name: Copy requirements.txt to remote fs
  copy:
    src: files/requirements.txt
    dest: /tmp/ml-requirements.txt

- name: Install ml python packages
  pip:
    virtualenv_command: /usr/bin/python3 -m venv
    requirements: /tmp/ml-requirements.txt
    virtualenv: "/home/{{ target_user }}/.ml-venv"
    # name:
      # - numpy
      # - sklearn
      # - matplotlib
      # - pandas
      # - Pillow
      # - torch
      # - torchvision
      # - fastai
    # state: present
