Skip to content

Commit 4331bc5

Browse files
committed
Tutor v3 complete rewrite
Replace all make commands by a single "tutor" binary. Environment and data are all moved to ~/.tutor/local/share/tutor. We take the opportunity to add a web UI and revamp the documentation. This is a complete rewrite. Close #121. Close #147.
1 parent 2c955ea commit 4331bc5

131 files changed

Lines changed: 2585 additions & 1457 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/ISSUE_TEMPLATE.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ Include the exact command that you are running and that is causing an error. In
66

77
## Unexpected behavior
88

9-
Include the full, exact output from the command that is causing your issue. Also include relevant error logs; for instance, to debug the LMS take a look at the files in `data/lms/logs`.
9+
Include the full, exact output from the command that is causing your issue. Also include relevant error logs; for instance, to debug the LMS provide the output of `tutor local logs lms --tail=100`
1010

1111
## Additional info (IMPORTANT)
1212

13-
Include the output of the `make info` command.
13+
Provide the output of `tutor --version`.

.gitignore

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
.*.swp
22
!.gitignore
3-
/config.json
4-
/data*/
53
TODO
4+
5+
/build/tutor
6+
/dist/
7+
/tutor_openedx.egg-info/

.travis.yml

Lines changed: 70 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,72 @@
1-
language: minimal
2-
services:
3-
- docker
1+
language: python
2+
matrix:
3+
include:
4+
- os: linux
5+
# We need an older version of python in order to have compatibility with
6+
# older versions of libc
7+
dist: trusty
8+
python: 3.6
9+
services:
10+
- docker
11+
env:
12+
BUILD_BINARY: "true"
13+
- os: linux
14+
dist: xenial
15+
python: 3.6
16+
services:
17+
- docker
18+
env:
19+
BUILD_DOCKER: "true"
20+
- os: linux
21+
dist: xenial
22+
python: 3.6
23+
services:
24+
- docker
25+
env:
26+
BUILD_PYPI: "true"
27+
- os: osx
28+
language: generic
29+
env:
30+
BUILD_BINARY: "true"
431
script:
5-
- make travis
32+
- python3 --version
33+
- pip3 --version
34+
- pip3 install -U setuptools
35+
- pip3 install -r requirements/dev.txt
36+
- make bundle
37+
- ./dist/tutor config noninteractive
38+
- ./dist/tutor images env
39+
- ./dist/tutor local env
40+
41+
before_deploy:
42+
- cp ./dist/tutor ./dist/tutor-$TRAVIS_OS_NAME
43+
644
deploy:
7-
provider: script
8-
script: cd build/ && docker login -u "$DOCKER_USERNAME" -p "$DOCKER_PASSWORD" && make push
9-
on:
10-
all_branches: true
11-
condition: $TRAVIS_BRANCH =~ ^master|release\/.*$
45+
# Push tutor binary to github releases
46+
- provider: releases
47+
api_key:
48+
secure: ffrhGvgxHf3WVnKsKiJZTUoEf3+ZBtIydPHQoTDmHiYMyPnaO6RJWxq5PnoDRr47b1vnvbCE0lhNsGr3sgnruQSN3xHYfT4wz1F6Lz7Y5Jt7Uq1W0/UfSRlB3BwYcFpkUb5fSXLSku+QrV8OTk/yItlY9tppnvXA9h4CZjQqgJYHYc1DRKWQVYnVs/dCttUpiPV3eyIFeQoPKFsHwZXKcm9cVzom5r+lkjwpw3AIuAutPd71jyj/Va/By6B/43yAIqw3sA/thBeL76vqd8C4cMeWE00of1EWnH+sx6pKz32Fqe/o6dVop5PZPCiI+TVIDxR8oLevHtPTCfIwRDg60y23DdH3bMGSw1bAyjeWTnhRGcdYQJi1NKq3hJ0ldy0lOFlUiMkKPdQBtU7i0xIpoXTIhnro0YUUtjbh/QEtyRn8nbMVeenId42Bymah5P8srhE8S2z0x0mirIqNlM/tgLKEOJXdSL4sPKCMwRLcTUIc0fCiwLeHJnHIrMNEfnWsqO1odzv/PS5nLsdiGHBmC63d+xLNllzincIV1djyi5SEzMZxcqmjX1n/G3nKYVXhaIQE0wWQSHqNwLlKluY0kPXCNtU1TPr5SJHGnomQKizVaEsDrdAjylBL+rPwVCAv9z8FCtyOg7uMx2WdD0pvky2Iy4rbl2RBLUHmUZoAjPY=
49+
file: dist/tutor-$TRAVIS_OS_NAME
50+
skip_cleanup: true
51+
on:
52+
tags: true
53+
condition: $BUILD_BINARY = true
54+
55+
# Push docker images to docker hub
56+
- provider: script
57+
script: ./dist/tutor images build all && \
58+
./dist/tutor local databases && \
59+
docker login -u "$DOCKER_USERNAME" -p "$DOCKER_PASSWORD" && \
60+
./dist/tutor images push all
61+
skip_cleanup: true
62+
on:
63+
tags: true
64+
condition: $BUILD_DOCKER = true
65+
66+
# Push to pypi
67+
- provider: script
68+
script: pip install twine && python setup.py sdist && twine upload dist/*.tar.gz
69+
skip_cleanup: true
70+
on:
71+
tags: true
72+
condition: $BUILD_PYPI = true

CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
# Changelog
22

3+
## 3.0.0 (2019-06-09)
4+
5+
- [Improvement] Complete rewrite of Tutor: switch from a make-based project to a single binary which runs all commands.
6+
- [Feature] An web user interface can be created with `tutor webui start`
7+
- [Bugfix] Add missing elasticsearch to Kubernetes deployment (#147)
8+
- [Improvement] Upload `tutor-openedx` to pypi
9+
10+
## Older changes
11+
312
- 2019-01-27 [Bugfix] Fix video transcript/srt upload and download of user-uploaded files. Thanks @dannielariola!
413
- 2019-01-20 [Improvement] Make it easy to load custom settings for the local production install
514
- 2019-01-16 [Improvement] Switch license from MIT to AGPL

Makefile

Lines changed: 10 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -1,66 +1,17 @@
1-
.PHONY: android build
21
.DEFAULT_GOAL := help
32

4-
PWD = $$(pwd)
5-
USERID ?= $$(id -u)
3+
compile-requirements: ## Compile requirements files
4+
pip-compile -o requirements/base.txt requirements/base.in
5+
pip-compile -o requirements/dev.txt requirements/dev.in
66

7-
build: ## Build all docker images
8-
cd build/ && make build
7+
bundle: ## Bundle the tutor package in a single "dist/tutor" executable
8+
pyinstaller --onefile --name=tutor --add-data=./tutor/templates:./tutor/templates ./bin/main
99

10-
config.json: ## Generate config.json configuration file interactively
11-
@$(MAKE) -s upgrade-to-tutor
12-
@$(MAKE) -s -C build/ build-configurator 1> /dev/null
13-
@docker run --rm -it \
14-
--volume="$(PWD):/openedx/config/" \
15-
-e USERID=$(USERID) -e SILENT=$(SILENT) \
16-
regis/openedx-configurator:hawthorn \
17-
configurator interactive
18-
19-
substitute: config.json
20-
@docker run --rm -it \
21-
--volume="$(PWD)/config.json:/openedx/config/config.json" \
22-
--volume="$(TEMPLATES):/openedx/templates" \
23-
--volume="$(OUTPUT):/openedx/output" \
24-
-e USERID=$(USERID) -e SILENT=$(SILENT) $(CONFIGURE_OPTS) \
25-
regis/openedx-configurator:hawthorn \
26-
configurator substitute /openedx/templates/ /openedx/output/
27-
28-
local: ## Configure and run a ready-to-go Open edX platform
29-
$(MAKE) -C deploy/local all
30-
31-
stop: ## Stop all single server services
32-
$(MAKE) -C deploy/local stop
33-
34-
android: ## Configure and build a development Android app
35-
cd android/ && make all
36-
37-
travis:
38-
cd build && make build
39-
cd deploy/local \
40-
&& make configure SILENT=1 CONFIGURE_OPTS="-e SETTING_ACTIVATE_NOTES=1 -e SETTING_ACTIVATE_XQUEUE=1" \
41-
&& make databases
42-
43-
upgrade-to-tutor: ## Upgrade from earlier versions of tutor
44-
@(stat config/config.json > /dev/null 2>&1 && (\
45-
echo "You are running an older version of Tutor. Now migrating to the latest version" \
46-
&& echo "Moving config/config.json to ./config.json" && mv config/config.json config.json \
47-
&& echo "Moving config/ to deploy/env/" && mv config/ deploy/env/ \
48-
&& ((ls openedx/themes/* > /dev/null 2>&1 && echo "Moving openedx/themes/* to build/openedx/themes/" && mv openedx/themes/* build/openedx/themes/) || true) \
49-
&& (mv .env deploy/local/ > /dev/null 2>&1 || true)\
50-
&& echo "Done migrating to tutor. This command will not be run again."\
51-
)) || true
52-
53-
info: ## Print some information about the current install, for debugging
54-
uname -a
55-
@echo "-------------------------"
56-
git rev-parse HEAD
57-
@echo "-------------------------"
58-
docker version
59-
@echo "-------------------------"
60-
docker-compose --version
61-
@echo "-------------------------"
62-
echo $$EDX_PLATFORM_PATH
63-
echo $$EDX_PLATFORM_SETTINGS
10+
travis: bundle ## Run tests on travis-ci
11+
./dist/tutor config noninteractive
12+
./dist/tutor images env
13+
./dist/tutor images build all
14+
./dist/tutor local databases
6415

6516
ESCAPE = 
6617
help: ## Print this help

README.rst

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@ Tutor 🎓 Open edX 1-click install for everyone
1313
:alt: GitHub closed issues
1414
:target: https://github.com/regisb/tutor/issues?q=is%3Aclosed
1515

16+
.. image:: https://img.shields.io/github/license/regisb/tutor.svg
17+
:alt: AGPL License
18+
:target: https://www.gnu.org/licenses/agpl-3.0.en.html
19+
1620
**Tutor** is a one-click install of `Open edX <https://openedx.org>`_, both for production and local development, inside docker containers. Tutor is easy to run, fast, full of cool features, and it is already used by dozens of Open edX platforms in the world.
1721

1822
.. image:: https://asciinema.org/a/octNfEnvIA6jNohCBmODBKizE.png
@@ -22,18 +26,16 @@ Tutor 🎓 Open edX 1-click install for everyone
2226
Quickstart
2327
----------
2428

25-
::
26-
27-
git clone https://github.com/regisb/tutor
28-
cd tutor/deploy/local
29-
make all
29+
1. `Download <https://github.com/regisb/tutor/releases>`_ the latest stable release of Tutor, uncompress the file and place the ``tutor`` executable in your path.
30+
2. Run ``tutor local quickstart``
31+
3. You're done!
3032

3133
Documentation
3234
-------------
3335

3436
Extensive documentation is available online: http://docs.tutor.overhang.io/
3537

36-
How to contribute
37-
-----------------
38+
Contributing
39+
------------
3840

39-
We go to great lengths to make it as easy as possible for people to run Open edX inside Docker containers. If you have an improvement idea, feel free to `open an issue on Github <https://github.com/regisb/tutor/issues/new>`_ so that we can discuss it. `Pull requests <https://github.com/regisb/tutor/pulls>`_ will be happily examined, too! However, we should be careful to keep the project lean and simple: both to use and to modify. Optional features should not make the user experience more complex. Instead, documentation on how to add the feature is preferred.
41+
We go to great lengths to make it as easy as possible for people to run Open edX inside Docker containers. If you have an improvement idea, feel free to `open an issue on Github <https://github.com/regisb/tutor/issues/new>`_ so that we can discuss it. `Pull requests <https://github.com/regisb/tutor/pulls>`_ will be happily examined, too!

android/.gitignore

Lines changed: 0 additions & 2 deletions
This file was deleted.

android/Makefile

Lines changed: 0 additions & 32 deletions
This file was deleted.

bin/main

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/usr/bin/env python3
2+
3+
from tutor.cli import main
4+
main()

build/.gitignore

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)