<commit_before>{% set data_path = '/tmp/edx_config' -%}
{% set venv_path = '/tmp/edx_config/venv' -%}
{% set repo_path = '/tmp/edx_config/configuration' -%}
{% set conf_file = '/tmp/edx_config/edx-xqwatcher.conf' -%}
{% set playbooks = salt.pillar.get('xqueue:playbooks', ['edx-east/xqwatcher.yml']) %}

include:
  - .run_ansible

configure_git_ppa_for_edx:
  pkgrepo.managed:
    - ppa: git-core/ppa
    - require_in:
        - pkg: install_os_packages_for_xqwatcher

install_os_packages_for_xqwatcher:
  pkg.installed:
    - pkgs:
        - git
        - python
        - python-dev
        - python3
        - python3-dev
        - python-pip
        - python3-pip
        - python-virtualenv
        - python3-virtualenv
        - libmysqlclient-dev
        - libssl-dev
    - refresh: True
    - refresh_modules: True
    - require_in:
        - virtualenv: create_ansible_virtualenv
        - git: clone_edx_configuration
        - cmd: run_ansible

link_venv_binary_to_expected_location:
  file.symlink:
    - name: /usr/local/bin/virtualenv
    - target: /usr/bin/virtualenv
    - require:
        - pkg: install_os_packages_for_xqwatcher

activate_xqwatcher_supervisor_config:
  file.symlink:
    - name: /edx/app/supervisor/conf.d/xqwatcher.conf
    - target: /edx/app/supervisor/conf.available.d/xqwatcher.conf
    - user: supervisor
    - group: www-data
  cmd.wait:
    - name: /edx/bin/supervisorctl reread && /edx/bin/supervisorctl update
    - watch:
        - file: activate_xqwatcher_supervisor_config

configure_logging_for_xqwatcher:
  file.managed:
    - name: /edx/app/xqwatcher/logging.json
    - contents: |
        {{ salt.pillar.get('edx:xqwatcher:logconfig', {})|json }}<commit_msg>Fixed requisites for xqwatcher deployment<commit_after>{% set data_path = '/tmp/edx_config' -%}
{% set venv_path = '/tmp/edx_config/venv' -%}
{% set repo_path = '/tmp/edx_config/configuration' -%}
{% set conf_file = '/tmp/edx_config/edx-xqwatcher.conf' -%}
{% set playbooks = salt.pillar.get('xqueue:playbooks', ['edx-east/xqwatcher.yml']) %}

include:
  - .run_ansible

configure_git_ppa_for_edx:
  pkgrepo.managed:
    - ppa: git-core/ppa
    - require_in:
        - pkg: install_os_packages_for_xqwatcher

install_os_packages_for_xqwatcher:
  pkg.installed:
    - pkgs:
        - git
        - python
        - python-dev
        - python3
        - python3-dev
        - python-pip
        - python3-pip
        - python-virtualenv
        - python3-virtualenv
        - libmysqlclient-dev
        - libssl-dev
    - refresh: True
    - refresh_modules: True
    - require_in:
        - virtualenv: create_ansible_virtualenv
        - git: clone_edx_configuration
        - cmd: run_ansible

link_venv_binary_to_expected_location:
  file.symlink:
    - name: /usr/local/bin/virtualenv
    - target: /usr/bin/virtualenv
    - require:
        - pkg: install_os_packages_for_xqwatcher
    - require_in:
        - cmd: run_ansible

activate_xqwatcher_supervisor_config:
  file.symlink:
    - name: /edx/app/supervisor/conf.d/xqwatcher.conf
    - target: /edx/app/supervisor/conf.available.d/xqwatcher.conf
    - user: supervisor
    - group: www-data
    - require:
        - cmd: run_ansible
  cmd.wait:
    - name: /edx/bin/supervisorctl reread && /edx/bin/supervisorctl update
    - watch:
        - file: activate_xqwatcher_supervisor_config

configure_logging_for_xqwatcher:
  file.managed:
    - name: /edx/app/xqwatcher/logging.json
    - contents: |
        {{ salt.pillar.get('edx:xqwatcher:logconfig', {})|json }}
{'fraction_non_alphanumeric': 0.12001132182281347, 'fraction_numerical': 0.0022643645626945937, 'mean_word_length': 2.523429710867398, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2321908', 'n_tokens_mistral': 1326, 'n_tokens_neox': 1286, 'n_words': 182}