diff --git a/deployment/ansible/playbooks/codeGrader_install_backend.yml b/deployment/ansible/playbooks/codeGrader_install_backend.yml index 0f02ba9..9c1145b 100644 --- a/deployment/ansible/playbooks/codeGrader_install_backend.yml +++ b/deployment/ansible/playbooks/codeGrader_install_backend.yml @@ -35,13 +35,16 @@ - libpq-dev - pip - git + - python3.11-venv state: present - - - name: Recursively remove directory for python venvs + + - name: Recursively remove directory /opt/CodeGrader_venv ansible.builtin.file: - path: /usr/lib/python3.11/EXTERNALLY-MANAGED + path: /opt/CodeGrader_venv state: absent - force: true + + - name: Create python venv for CodeGrader + shell: python3 -m venv /opt/CodeGrader_venv - name: Recursively remove directory /opt/CodeGrader ansible.builtin.file: @@ -57,6 +60,7 @@ - name: Install CodeGrader Backend requirements ansible.builtin.pip: requirements: /opt/CodeGrader/codeGrader/backend/requirements.txt + virtualenv: /opt/CodeGrader_venv/ - name: Rename the setup Script shell: mv setup_backend.py setup.py @@ -64,6 +68,6 @@ chdir: /opt/CodeGrader - name: Install the CodeGrader Application Backend - shell: pip install . + shell: /opt/CodeGrader_venv/bin/python3.11 -m pip install . args: chdir: /opt/CodeGrader diff --git a/deployment/ansible/playbooks/codeGrader_install_frontend.yml b/deployment/ansible/playbooks/codeGrader_install_frontend.yml index f601a41..f10ce84 100644 --- a/deployment/ansible/playbooks/codeGrader_install_frontend.yml +++ b/deployment/ansible/playbooks/codeGrader_install_frontend.yml @@ -40,13 +40,16 @@ - libpq-dev - pip - git + - python3.11-venv state: present - - - name: Recursively remove directory for python venvs + + - name: Recursively remove directory /opt/CodeGrader_venv ansible.builtin.file: - path: /usr/lib/python3.11/EXTERNALLY-MANAGED + path: /opt/CodeGrader_venv state: absent - force: true + + - name: Create python venv for CodeGrader + shell: python3 -m venv /opt/CodeGrader_venv - name: Recursively remove directory /opt/CodeGrader ansible.builtin.file: @@ -62,6 +65,7 @@ - name: Install CodeGrader Frontend requirements ansible.builtin.pip: requirements: /opt/CodeGrader/codeGrader/frontend/requirements.txt + virtualenv: /opt/CodeGrader_venv/ - name: Rename the setup Script shell: mv setup_frontend.py setup.py @@ -69,6 +73,6 @@ chdir: /opt/CodeGrader - name: Install the CodeGrader Application Frontend - shell: pip install . + shell: /opt/CodeGrader_venv/bin/python3.11 -m pip install . args: chdir: /opt/CodeGrader diff --git a/deployment/ansible/playbooks/codeGrader_install_full.yml b/deployment/ansible/playbooks/codeGrader_install_full.yml index f7e424b..111faf5 100644 --- a/deployment/ansible/playbooks/codeGrader_install_full.yml +++ b/deployment/ansible/playbooks/codeGrader_install_full.yml @@ -36,12 +36,14 @@ - pip - git state: present - - - name: Recursively remove directory for python venvs + + - name: Recursively remove directory /opt/CodeGrader_venv ansible.builtin.file: - path: /usr/lib/python3.11/EXTERNALLY-MANAGED + path: /opt/CodeGrader_venv state: absent - force: true + + - name: Create python venv for CodeGrader + shell: python3 -m venv /opt/CodeGrader_venv - name: Recursively remove directory /opt/CodeGrader ansible.builtin.file: @@ -57,10 +59,12 @@ - name: Install CodeGrader Backend requirements ansible.builtin.pip: requirements: /opt/CodeGrader/codeGrader/backend/requirements.txt + virtualenv: /opt/CodeGrader_venv/ - name: Install CodeGrader Frontend requirements ansible.builtin.pip: requirements: /opt/CodeGrader/codeGrader/frontend/requirements.txt + virtualenv: /opt/CodeGrader_venv/ - name: Rename the setup Script shell: mv setup_full.py setup.py @@ -68,6 +72,6 @@ chdir: /opt/CodeGrader - name: Install the CodeGrader Application Frontend and Backend - shell: pip install . + shell: /opt/CodeGrader_venv/bin/python3.11 -m pip install . args: chdir: /opt/CodeGrader