@@ -20,87 +20,33 @@ evaluation request is a subject to this limit. There are also other limits
20
20
related to memory consumption, output size, etc. (see Google App Engine
21
21
documentation for details).
22
22
23
- Installation
24
- ------------
25
-
26
- Download 1.9.xx version of the original Google App Engine SDK for Python from
27
- https://cloud.google.com/appengine/docs/python/download/ - it may be neccessary
28
- to click ``Or, you can download the original App Engine SDK for Python. `` link
29
- first to expand proper download section. Than move in the command line to the
30
- location where you downloaded SDK and unpack the downloaded package.
31
-
32
- $ unzip google_appengine_1.9.xx.zip
33
-
34
- On the Mac, it is a disk image with an application, which you should
35
- drag to your Applications folder. Open the program and install the
36
- symlinks (it should ask you the first time you open the application, but
37
- if it doesn't, choose "Make Symlinks..." from the
38
- GoogleAppEngineLauncher menu). Note that you will have to do this again
39
- each time you update the AppEngine program.
40
-
41
- Then clone sympy-live repository::
42
-
43
- $ git clone git://github.com/sympy/sympy-live.git
44
- $ cd sympy-live
45
-
46
- We use submodules to include external libraries in sympy-live::
47
-
48
- $ git submodule init
49
- $ git submodule update
50
-
51
- This is sufficient to clone appropriate repositories in correct versions
52
- into sympy-live (see git documentation on submodules for information).
53
-
54
- You will need to install Datastore Emulator as well, which comes from gcloud's SDK,
55
- install the Google Cloud SDK for your OS from here: https://cloud.google.com/sdk/install
56
- Then run the following commands to install and run the datastore emulator in the background::
57
-
58
- $ gcloud components install cloud-datastore-emulator --quiet
59
- $ gcloud beta emulators datastore start &
60
-
61
- Install Dependencies
62
- --------------------
63
-
64
- The project depends on some third-party libraries that are not on the list
65
- of built-in libraries (in app.yaml) bundled with the runtime, to install them
66
- run the following command.::
67
-
68
- $ pip install -r requirements/requirements.txt -t lib/
69
-
70
- Some libraries although available on app engine runtime, but needs to be
71
- installed locally for development.
72
-
73
- Ref: https://cloud.google.com/appengine/docs/standard/python/tools/using-libraries-python-27#local_development ::
74
-
75
- $ pip install -r requirements/local_requirements.txt
76
-
77
- Development server
23
+ Development Server
78
24
------------------
79
25
80
- Now you are ready to run development web server::
26
+ To setup the development environment and run the app locally, you
27
+ need ``docker `` and ``docker-compose ``:
81
28
82
- $ ../google_appengine/dev_appserver.py .
29
+ * https://docs.docker.com/get-docker/
30
+ * https://docs.docker.com/compose/install/
83
31
84
- On the Mac, just run::
85
-
86
- $ dev_appserver .
32
+ Now you are ready to run development web server::
87
33
88
- (make sure you installed the symlinks as described above).
34
+ $ docker-compose up
89
35
90
- I couldn't figure out how to make it work in the GUI (it won't find the
91
- sympy git submodule). If you figure out how to do it, please update
92
- this file and send a patch describing how to do it.
36
+ This will build and run the image for app and datastore emulator.
93
37
94
- This is a local server that runs on port 8080 (use `` --port `` option to
95
- change this). Open a web browser and go to http://localhost:8080. You
96
- should see GUI of SymPy Online Shell.
38
+ This will spin up a local server that runs on port `` 8080 ``.
39
+ Open a web browser and go to http://localhost:8080.
40
+ You should see GUI of SymPy Online Shell.
97
41
98
- Deploying to GAE
99
- ----------------
42
+ Deploying to Google App Engine
43
+ ------------------------------
100
44
101
45
Travis-CI is used to deploy automatically to the official server
102
- via Github Releases. Go to https://github.com/sympy/sympy-live/releases
103
- and click on create a release and name the release as `version-NN `
46
+ via Github Releases.
47
+
48
+ * Go to https://github.com/sympy/sympy-live/releases
49
+ * Click on create a release and name the release as `version-NN `
104
50
where `NN ` is the release version. After this travis will automatically
105
51
release version `NN `.
106
52
@@ -118,6 +64,11 @@ the google cloud console for the project::
118
64
119
65
$ gcloud init
120
66
67
+ You need to to create ``lib `` (libraries) before deploying, make sure the development
68
+ server is up and running via ``docker-compose ``, as mentioned above and create
69
+ libraries folder to package with the following command::
70
+
71
+ $ docker cp app:/usr/src/app/lib lib
121
72
122
73
Assuming that sympy-live works properly (also across different mainstream web
123
74
browsers), you can upload your changes to Google App Engine, replacing the
@@ -160,14 +111,22 @@ Testing on the App Engine
160
111
-------------------------
161
112
162
113
It's usually a good idea to test big changes on the App Engine itself before
163
- deploying, as ``dev_appserver.py `` can only simulate the App Engine. There is
164
- a semi-official testing server at sympy-live-tests.appspot.com. If you want
114
+ deploying, as ``dev_appserver.py `` can only simulate the App Engine.
115
+
116
+ There is a semi-official testing server at sympy-live-tests.appspot.com. If you want
165
117
write access to it, just ask Aaron Meurer. The convention there is to push
166
118
to the version corresponding to the pull request (so if you have a branch that
167
119
is pull request #55, you would push to version 55, and access it by
168
120
55-dot-sympy-live-tests.appspot.com). Alternately, you can set up your own
169
121
testing server (it's free, though it requires a cell phone to set up).
170
122
123
+ You need to to create ``lib `` (libraries) before deploying, make sure the development
124
+ server is up and running via ``docker-compose ``, as mentioned above and create
125
+ libraries folder to package with the following command::
126
+
127
+ $ docker cp app:/usr/src/app/lib lib
128
+
129
+
171
130
Either way, to test, you will need to edit the Project ID in the deploy command
172
131
mentioned above with your Project ID and the version you want to deploy to::
173
132
@@ -194,51 +153,13 @@ includes Chrome, Firefox, Safari and Internet Explorer. Be extra cautious
194
153
about trailing commas in JavaScript object and arrays. IE doesn't allow
195
154
them, so you have to remove them, if any were introduced.
196
155
197
- GAE development server allows to use any Python interpreter, but Google
198
- App Engine uses Python 2.5, so if the default Python isn't 2.5, then make
199
- sure to test your changes to the server part, if it runs properly on 2.5.
200
- Also don't use any modules that aren't supported by GAE.
201
-
202
156
Running Tests
203
157
-------------
204
158
205
- To run the tests you need to have ``pytest `` and ``selenium `` installed. These are
206
- already present in the ``local_requirements.txt ``. If you you have installed
207
- them you may skip this step. Otherwise to install testing requirements::
208
-
209
- $ pip install selenium pytest
210
-
211
- You would also need latest version of one of the supported browsers:
212
-
213
- * Chrome: https://www.google.com/chrome/
214
- * Firefox: https://www.mozilla.org/firefox/new/
215
-
216
- You need to download the driver for your browser as well:
217
-
218
- For chrome, get the driver for your system from here:
219
- https://chromedriver.chromium.org/downloads
220
-
221
- Here is an example for Linux::
222
-
223
- $ wget https://chromedriver.storage.googleapis.com/81.0.4044.69/chromedriver_linux64.zip
224
- $ unzip -q chromedriver_linux64.zip
225
-
226
- For Firefox, get the driver for your system from here:
227
- https://github.com/mozilla/geckodriver/releases
228
-
229
- After extracting the browser driver from the zip or tar file, for Unix based systems,
230
- copy the driver to following directory::
231
-
232
- $ mv /path/to/ChromeDriver /usr/local/bin
233
- $ mv /path/to/geckodriver /usr/local/bin
234
-
235
- For other systems like Windows, you need to put it in PATH.
236
-
237
- Now run the application in the background, (See ``dev_appserver `` instructions above to start the app).
238
-
239
- Run selenium tests via the following command::
159
+ To run tests you need to spinup the container as mentioned above
160
+ via ``docker-compose `` and run the following command::
240
161
241
- $ pytest tests -v
162
+ $ docker-compose exec app pytest tests/ -v
242
163
243
164
Pulling changes
244
165
---------------
0 commit comments