Commit 1a75f791 by Max Rothman Committed by GitHub

Merge pull request #3444 from edx/max/edxapp-nodeenv

OPS-1850: use nodeenv for edxapp
parents 0a0af320 7ca232dc
......@@ -47,7 +47,7 @@ COMMON_ENVIRONMENT: 'default_env'
COMMON_DEPLOYMENT: 'default_deployment'
COMMON_PIP_VERBOSITY: ''
COMMON_PYPI_MIRROR_URL: 'https://pypi.python.org/simple'
COMMON_NPM_MIRROR_URL: 'http://registry.npmjs.org'
COMMON_NPM_MIRROR_URL: 'https://registry.npmjs.org'
COMMON_UBUNTU_APT_KEYSERVER: "http://keyserver.ubuntu.com/pks/lookup?op=get&fingerprint=on&search="
COMMON_EDX_PPA: "deb http://ppa.edx.org {{ ansible_distribution_release }} main"
......
......@@ -636,7 +636,9 @@ edxapp_log_dir: "{{ COMMON_LOG_DIR }}/edxapp"
edxapp_venvs_dir: "{{ edxapp_app_dir }}/venvs"
edxapp_venv_dir: "{{ edxapp_venvs_dir }}/edxapp"
edxapp_venv_bin: "{{ edxapp_venv_dir }}/bin"
edxapp_node_bin: "{{ edxapp_code_dir }}/node_modules/.bin"
edxapp_nodeenv_dir: "{{ edxapp_app_dir }}/nodeenvs/edxapp"
edxapp_node_bin: "{{ edxapp_nodeenv_dir }}/bin"
edxapp_node_version: "0.10.37"
edxapp_user: edxapp
edxapp_deploy_path: "{{ edxapp_venv_bin }}:{{ edxapp_code_dir }}/bin:{{ edxapp_node_bin }}:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
edxapp_staticfile_dir: "{{ edxapp_data_dir }}/staticfiles"
......@@ -695,7 +697,7 @@ edxapp_generic_doc_store_config: &edxapp_generic_default_docstore
socketTimeoutMS: 3000 # default is never timeout while the connection is open, this means it needs to explicitly close raising pymongo.errors.NetworkTimeout
connectTimeoutMS: 2000 # default is 20000, I believe raises pymongo.errors.ConnectionFailure
# Not setting waitQueueTimeoutMS and waitQueueMultiple since pymongo defaults to nobody being allowed to wait
EDXAPP_LMS_DRAFT_DOC_STORE_CONFIG:
<<: *edxapp_generic_default_docstore
......
......@@ -109,37 +109,6 @@
- install:code
- install:app-requirements
# Set the npm registry
# This needs to be done as root since npm is weird about
# chown - https://github.com/npm/npm/issues/3565
- name: Set the npm registry
shell:
npm config set registry '{{ COMMON_NPM_MIRROR_URL }}'
creates="{{ edxapp_app_dir }}/.npmrc"
environment: "{{ edxapp_environment }}"
tags:
- install
- install:app-requirements
# Set the npm registry permissions
- name: Set the npm registry permissions
file:
path: "{{ edxapp_app_dir }}/.npmrc"
owner: "{{ edxapp_user }}"
group: "{{ edxapp_user }}"
tags:
- install
- install:app-requirements
# Node play that need to be run after platform updates.
- name: Install edx-platform npm dependencies
shell: npm install chdir={{ edxapp_code_dir }}
become_user: "{{ edxapp_user }}"
environment: "{{ edxapp_environment }}"
tags:
- install
- install:app-requirements
- name: Create the virtualenv to install the Python requirements
command: >
virtualenv {{ edxapp_venv_dir }}
......@@ -241,6 +210,49 @@
- install
- install:app-requirements
- name: create nodeenv
shell: >
{{ edxapp_venv_dir }}/bin/nodeenv {{ edxapp_nodeenv_dir }} --node={{ edxapp_node_version }} --prebuilt
args:
creates: "{{ edxapp_nodeenv_dir }}"
tags:
- install
- install:app-requirements
# Set the npm registry
# This needs to be done as root since npm is weird about
# chown - https://github.com/npm/npm/issues/3565
- name: Set the npm registry
shell: >
npm config set registry '{{ COMMON_NPM_MIRROR_URL }}'
args:
creates: "{{ edxapp_app_dir }}/.npmrc"
environment: "{{ edxapp_environment }}"
tags:
- install
- install:app-requirements
# Set the npm registry permissions
- name: Set the npm registry permissions
file:
path: "{{ edxapp_app_dir }}/.npmrc"
owner: "{{ edxapp_user }}"
group: "{{ edxapp_user }}"
tags:
- install
- install:app-requirements
- name: install node dependencies
npm:
executable: "{{ edxapp_node_bin }}/npm"
path: "{{ edxapp_code_dir }}"
production: yes
environment: "{{ edxapp_environment }}"
become_user: "{{ edxapp_user }}"
tags:
- install
- install:app-requirements
# The next few tasks set up the python code sandbox
# need to disable this profile, otherwise the pip inside the sandbox venv has no permissions
......
Markdown is supported
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