Commit 6fe54644 by Eric Fischer

Update README dev instructions

Also removes the Vagrantfile that had been present in this repo.
parent 751c4fa0
......@@ -4,141 +4,10 @@ Open Response Assessment |build-status| |coverage-status|
`User docs <http://edx.readthedocs.org/projects/edx-partner-course-staff/en/latest/exercises_tools/open_response_assessments/index.html>`_
Installation
============
The intent of this project is to be installed as Django apps that will be included in `edx-platform <https://github.com/edx/edx-platform>`_.
But development is done in the Workbench which is part of the `xblock-sdk <https://github.com/edx/xblock-sdk>`_. Currently Ubuntu 12.04 is assumed. You can setup everything in a Vagrant instance.
To do so install the latest VirtualBox >= 4.3.12 and the latest Vagrant >= 1.6.5.
Clone the repo:
.. code:: bash
mkdir orastack
cd orastack
git clone git@github.com:edx/edx-ora2.git
Create the Vagrant instance:
.. code:: bash
ln -s ./edx-ora2/Vagrantfile ./
vagrant plugin install vagrant-vbguest
vagrant up
The first vagrant up will fail when setting up shared folders (because the user ora2 does not exist) so do:
.. code:: bash
vagrant provision
vagrant reload
Now you can ssh into the vagrant machine:
.. code:: bash
vagrant ssh
sudo su ora2
To install all dependencies:
.. code:: bash
make install-sys-requirements
make install
make install-dev
Running the Development Server
==============================
.. code:: bash
./scripts/workbench.sh
Additional arguments are passed to ``runserver``. For example,
to start the server on port 9000:
.. code:: bash
./scripts/workbench.sh 0.0.0.0:9000
Combining and Minifying JavaScript and Sass
============================================
To reduce page size, the OpenAssessment XBlock serves combined/minified
versions of JavaScript and CSS. This combined/minified files are checked
into the git repository.
If you modify JavaScript or Sass, you MUST regenerate the combined/minified
files:
.. code:: bash
# Combine/minify JavaScript
make javascript
# Combine/minify CSS (from Sass)
make sass
Make sure you commit the combined/minified files to the git repository!
Running Tests
=============
To run all unit tests:
.. code:: bash
make test
To limit Python tests to a particular module:
.. code:: bash
./scripts/test-python.sh openassessment/xblock/test/test_openassessment.py
To run just the JavaScript tests:
.. code:: bash
make test-js
To run the JavaScript tests in Chrome so you can use the debugger:
.. code:: bash
make test-js-debug
There are also acceptance and accessibility tests that run can be run against a sandbox. For more information, about how to run these from your machine, check out `test/acceptance/README.rst <https://github.com/edx/edx-ora2/blob/master/test/acceptance/README.rst/>`__.
i18n
====
You will need to:
1. Install `i18n-tools <https://github.com/edx/i18n-tools>`_.
2. Configure Transifex, as described in the `docs <http://docs.transifex.com/developer/client/setup>`_.
3. Install `gettext <http://www.gnu.org/software/gettext/>`_.
To extract strings and push to Transifex
.. code:: bash
./scripts/i18n-push.sh
To pull strings from Transifex
.. code:: bash
./scripts/i18n-pull.sh
Installation, Tests, and other Developer Tasks
==============================================
EdX engineers follow the `guides on our wiki <https://openedx.atlassian.net/wiki/display/TNL/ORA+FAQ>`_.
License
=======
......@@ -158,12 +27,13 @@ Reporting Security Issues
Please do not report security issues in public. Please email security@edx.org
Mailing List and IRC Channel
============================
Mailing List and Slack
======================
You can get help with this code on our `mailing lists`_ or in real-time conversations on `Slack`_.
You can discuss this code on the
`edx-code Google Group <https://groups.google.com/forum/#!forum/edx-code>`_ or
in the `edx-code` IRC channel on Freenode.
.. _mailing lists: https://open.edx.org/getting-help
.. _Slack: https://open.edx.org/getting-help
.. |build-status| image:: https://travis-ci.org/edx/edx-ora2.png?branch=master
:target: https://travis-ci.org/edx/edx-ora2
......
Vagrant.require_version ">= 1.5.3"
unless Vagrant.has_plugin?("vagrant-vbguest")
raise "Please install the vagrant-vbguest plugin by running `vagrant plugin install vagrant-vbguest`"
end
VAGRANTFILE_API_VERSION = "2"
MEMORY = 1048
CPU_COUNT = 2
$bashrc = <<SCRIPT
source "/edx/app/ora2/venvs/ora2/bin/activate"
# If X11 forwarding is enabled, then use the DISPLAY value
# already set and use the X11 session cookie
if [ -n "$DISPLAY" ]; then
export XAUTHORITY="/home/vagrant/.Xauthority"
# Otherwise, configure the display to use the virtual frame buffer
else
export DISPLAY=":1"
fi
cd "/edx/app/ora2/edx-ora2"
SCRIPT
$script = <<SCRIPT
export PYTHONUNBUFFERED=1
if id -u ora2 >/dev/null 2>&1; then
echo "User ora2 exists."
else
echo "Creating user ora2."
mkdir -p /edx/app/ora2
sudo useradd -d /edx/app/ora2 -s /bin/bash ora2
sudo adduser --quiet ora2 admin
chown -R ora2:ora2 /edx/app/ora2
sudo -u ora2 echo "#{$bashrc}" >> /edx/app/ora2/.bashrc
fi
sudo apt-get install -y python-pip python-virtualenv
if [ -d "/edx/app/ora2/venvs/ora2" ]; then
echo "Virtualenv exists in /edx/app/ora2/venvs/ora2. Skipping creating one."
else
echo "Creating virtualenv in /edx/app/ora2/venvs/ora2."
sudo -u ora2 virtualenv --clear -q /edx/app/ora2/venvs/ora2
fi
SCRIPT
ora_mount_dir = "edx-ora2"
if ENV['VAGRANT_MOUNT_BASE']
ora_mount_dir = ENV['VAGRANT_MOUNT_BASE'] + "/" + ora_mount_dir
end
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
# Creates an edX devstack VM from an official release
config.vm.box = "precise64"
config.vm.box_url = "http://files.vagrantup.com/precise64.box"
config.vm.network :private_network, ip: "192.168.33.11"
config.vm.network :forwarded_port, guest: 9000, host: 9000
config.vm.network :forwarded_port, guest: 9001, host: 9001
config.ssh.insert_key = true
# Enable X11 forwarding so we can interact with GUI applications
if ENV['VAGRANT_X11']
config.ssh.forward_x11 = true
end
config.vm.synced_folder "#{ora_mount_dir}", "/edx/app/ora2/edx-ora2",
create: true, owner: "ora2", group: "ora2"
config.vm.provider :virtualbox do |vb|
vb.customize ["modifyvm", :id, "--memory", MEMORY.to_s]
vb.customize ["modifyvm", :id, "--cpus", CPU_COUNT.to_s]
# Allow DNS to work for Ubuntu 12.10 host
# http://askubuntu.com/questions/238040/how-do-i-fix-name-service-for-vagrant-client
vb.customize ["modifyvm", :id, "--natdnshostresolver1", "on"]
end
# Use vagrant-vbguest plugin to make sure Guest Additions are in sync
config.vbguest.auto_reboot = true
config.vbguest.auto_update = true
config.vm.provision "shell", inline: $script
end
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