Commit 18febf1c authored by Ralf Berger's avatar Ralf Berger
Browse files

Refactor; install multiple version

parent d4047545
- hosts: workspace
vars:
user_name: "{{ ansible_user }}"
user_name: "{{ ansible_user }}"
conda_yaml_path: "/home/{{ user_name }}/.conda/.export"
conda_envs_path: "/home/{{ user_name }}/.conda/envs"
conda_bin_path: /opt/anaconda/condabin
conda_bin_path: "/opt/anaconda/condabin"
conda_environments:
- inference
- training
- deepspeech-inference-0.7.3
- deepspeech-training-0.7.3
- deepspeech-inference-0.7.4
- deepspeech-training-0.7.4
- deepspeech-inference-0.8.0a3
- deepspeech-training-0.8.0a3
conda_envs_path: "~/.conda/envs"
deepspeech_version: 0.7.3
deepspeech_repo_url: https://github.com/mozilla/DeepSpeech
deepspeech_repo_ref: "v{{ deepspeech_version }}"
deepspeech_repo_path: "~/deepspeech-repository"
deepspeech_asset_url: "https://github.com/mozilla/DeepSpeech/releases/download/v{{ deepspeech_version }}"
deepspeech_asset_path: "~/deepspeech-assets-{{ deepspeech_version }}"
conda_inference_test_environments:
- deepspeech-inference-0.7.3
- deepspeech-inference-0.7.4
- deepspeech-inference-0.8.0a3
deepspeech_repo_version: 0.7.4
deepspeech_repo_url: "https://github.com/mozilla/DeepSpeech"
deepspeech_repo_path: "~/deepspeech-repository"
deepspeech_asset_version: 0.7.4
deepspeech_asset_url: "https://github.com/mozilla/DeepSpeech/releases/download/v{{ deepspeech_asset_version }}"
deepspeech_asset_path: "~/deepspeech-assets"
tasks:
- include_tasks: tasks/conda.yaml
with_items: "{{ conda_environments }}"
loop: "{{ conda_environments }}"
- include_tasks: tasks/test-inference.yaml
loop: "{{ conda_inference_test_environments }}"
- include_tasks: tasks/repository.yaml
- include_tasks: tasks/artifacts.yaml
- include_tasks: tasks/test.yaml
......@@ -9,11 +9,11 @@
dest: "{{ deepspeech_asset_path }}/{{ item.dest }}"
force: no
with_items:
- { src: "deepspeech-{{ deepspeech_version }}-models.pbmm", dest: "models.pbmm" }
- { src: "deepspeech-{{ deepspeech_version }}-models.tflite", dest: "models.tflite" }
- { src: "deepspeech-{{ deepspeech_version }}-models.scorer", dest: "models.scorer" }
- { src: "deepspeech-{{ deepspeech_version }}-checkpoint.tar.gz", dest: "checkpoint.tgz" }
- { src: "audio-{{ deepspeech_version }}.tar.gz", dest: "audio.tgz" }
- { src: "deepspeech-{{ deepspeech_asset_version }}-models.pbmm", dest: "models.pbmm" }
- { src: "deepspeech-{{ deepspeech_asset_version }}-models.tflite", dest: "models.tflite" }
- { src: "deepspeech-{{ deepspeech_asset_version }}-models.scorer", dest: "models.scorer" }
- { src: "deepspeech-{{ deepspeech_asset_version }}-checkpoint.tar.gz", dest: "checkpoint.tgz" }
- { src: "audio-{{ deepspeech_asset_version }}.tar.gz", dest: "audio.tgz" }
- name: Unpack DeepSpeech release artifacts
unarchive:
......
- vars:
environment_name: "deepspeech-{{ item }}"
environment_yaml: "{{ conda_yaml_path }}/{{ item }}-environment.yaml"
environment_name: "{{ item }}"
environment_path: "{{ conda_envs_path }}/{{ environment_name }}"
conda_yaml_path: "~/.conda/.export"
block:
- name: Create YAML directory
......@@ -9,21 +9,21 @@
path: "{{ conda_yaml_path }}"
state: directory
- name: "Upload deepspeech/{{ item }}-environment.yaml"
- name: "Upload YAML"
template:
src: "templates/conda/deepspeech-{{ item }}.yaml"
dest: "{{ environment_yaml }}"
src: "templates/conda/{{ environment_name }}.yaml"
dest: "{{ conda_yaml_path }}/{{ environment_name }}.yaml"
register: requirements_yaml
- name: "Remove environment: {{ item }}"
- name: "Remove environment: {{ environment_name }}"
when: requirements_yaml.changed
command:
cmd: "{{ conda_bin_path }}/conda remove -p {{ environment_path }} --all --yes"
removes: "{{ environment_path }}"
- name: "Install environment: {{ item }}"
- name: "Install environment: {{ environment_name }}"
command:
cmd: "{{ conda_bin_path }}/conda env create -p {{ environment_path }} -f {{ environment_yaml }}"
cmd: "{{ conda_bin_path }}/conda env create -p {{ environment_path }} -f {{ conda_yaml_path }}/{{ environment_name }}.yaml"
creates: "{{ environment_path }}"
rescue:
......@@ -31,4 +31,4 @@
cmd: "{{ conda_bin_path }}/conda remove -p {{ environment_path }} --all --yes"
removes: "{{ environment_path }}"
- fail:
msg: "Failed installing: {{ item }}"
msg: "Failed installing Conda environment: {{ environment_name }}"
- name: Clone DeepSpeech repo
git:
repo: "{{ deepspeech_repo_url }}"
version: "{{ deepspeech_repo_ref }}"
dest: "{{ deepspeech_repo_path }}"
repo: "{{ deepspeech_repo_url }}"
version: "v{{ deepspeech_repo_version }}"
depth: 1
- name: Smoke-test DeepSpeech binary
shell: . /etc/profile && conda activate deepspeech-inference && deepspeech --version
shell: . /etc/profile && conda activate {{ item }} && deepspeech --version
environment:
CONDA_EXE: /opt/anaconda/bin/conda
CONDA_PYTHON_EXE: /opt/anaconda/bin/python
......
......@@ -2,22 +2,21 @@
## Inference
* Dependencies according to [DeepSpeech usage documentation](https://deepspeech.readthedocs.io/en/v0.7.3/USING.html)
```sh
$ conda env create -f deepspeech-inference.yaml
$ conda activate deepspeech-inference
$ conda env create -f deepspeech-inference-0.7.4.yaml
$ conda activate deepspeech-inference-0.7.4
$ deepspeech --version
[...] Successfully opened dynamic library libcudart.so.10.0
DeepSpeech 0.7.4
```
* [DeepSpeech 0.7.4 usage documentation](https://deepspeech.readthedocs.io/en/v0.7.4/USING.html)
## Training
* Dependencies according to [DeepSpeech training documentation](https://deepspeech.readthedocs.io/en/v0.7.3/TRAINING.html)
```sh
$ conda env create -f deepspeech-training.yaml
$ conda activate deepspeech-training
$ conda env create -f deepspeech-training-0.7.4.yaml
$ conda activate deepspeech-training-0.7.4
```
* [DeepSpeech 0.7.4 training documentation](https://deepspeech.readthedocs.io/en/v0.7.4/TRAINING.html)
name: deepspeech-inference
name: deepspeech-inference-0.7.3
channels:
- conda-forge
......@@ -13,4 +13,4 @@ dependencies:
- libstdcxx-ng
- pthread-stubs
- pip:
- deepspeech-gpu
- deepspeech-gpu==0.7.3
name: deepspeech-inference-0.7.4
channels:
- conda-forge
dependencies:
- python=3.5
- pip
- cudatoolkit=10.0
- cupti=10.0
- cudnn=7.6
- sox
- libstdcxx-ng
- pthread-stubs
- pip:
- deepspeech-gpu==0.7.4
name: deepspeech-inference-0.8.0a3
channels:
- conda-forge
dependencies:
- python=3.5
- pip
- cudatoolkit=10.0
- cupti=10.0
- cudnn=7.6
- sox
- libstdcxx-ng
- pthread-stubs
- pip:
- deepspeech-gpu==0.8.0a3
name: deepspeech-training
name: deepspeech-training-0.7.3
channels:
- conda-forge
......
name: deepspeech-training-0.7.4
channels:
- conda-forge
dependencies:
- python=3.5
- pip
- cudatoolkit=10.0
- cupti=10.0
- cudnn=7.6
- pip:
- tensorflow-gpu==1.15.2
- "--editable=git+https://github.com/mozilla/DeepSpeech.git@v0.7.4#egg=deepspeech"
name: deepspeech-training-0.8.0a3
channels:
- conda-forge
dependencies:
- python=3.5
- pip
- cudatoolkit=10.0
- cupti=10.0
- cudnn=7.6
- pip:
- tensorflow-gpu==1.15.2
- "--editable=git+https://github.com/mozilla/DeepSpeech.git@v0.8.0-alpha.3#egg=deepspeech"
- hosts: workspace
tasks:
- include_tasks: 'tasks/test.yaml'
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment