blob: bdf7f93f46f528051df0691cd42a1acb16665104 [file] [log] [blame]
Yohann Roussel1b457412015-10-22 10:57:00 +02001###########
2Jack server
3###########
4
5The Jack server's goal is to handle a pool of Jack compiler instances in order to limit memory usage
6and benefit from already warm instances.
7
8
9
Yohann Roussel9710d332016-01-06 16:12:40 +010010Setup for Mac OS
11----------------
12
13Jack server is automatically installed and started by android build but requires initial setup on
14Mac OS:
15
16 - Install MacPorts from http://www.macports.org/install.php
17 Make sure that /opt/local/bin appears in your path before /usr/bin. If not, please add the
18 following to your ~/.bash_profile file (If you do not have a .bash_profile file in your home
19 directory, create one):
20 export PATH=/opt/local/bin:$PATH
21
22 - Get curl package from MacPorts:
23 $ POSIXLY_CORRECT=1 sudo port install curl +ssl
24
25
26
Yohann Roussel1b457412015-10-22 10:57:00 +020027Starting the server
28-------------------
29
30You may need to start the Jack server manually.
31Use "jack-admin start-server".
32
33
34
35Client info
36-----------
37
38The client is a bash script simply named "jack".
Yohann Roussel5a6b2ab2015-12-11 15:34:55 +010039It can be configured in "$HOME/.jack-settings"
Yohann Roussel1b457412015-10-22 10:57:00 +020040
41
42
43".jack-settings" file
44---------------------
45
46This file contains script shell variables:
47"SERVER_HOST": IP address of the server
48by default: "SERVER_HOST=127.0.0.1".
49
50"SERVER_PORT_SERVICE": Server service TCP port number. Needs to match the service port number
Yohann Roussel5a6b2ab2015-12-11 15:34:55 +010051defined in "$HOME/.jack-server/config.properties" on the server host (See "Server info" below)
Yohann Roussel1b457412015-10-22 10:57:00 +020052by default: "SERVER_PORT_SERVICE=8076".
53
54"SERVER_PORT_ADMIN": Server admin TCP port number. Needs to match the admin port number defined in
Yohann Roussel5a6b2ab2015-12-11 15:34:55 +010055"$HOME/.jack-server/config.properties" on the server host (See "Server info" below)
Yohann Roussel1b457412015-10-22 10:57:00 +020056by default: "SERVER_PORT_ADMIN=8077".
57
58"SETTING_VERSION": Internal, do not modify.
59
60
61
62Server info
63-----------
64
65The server is composed of 2 jars named "jack-server.jar" and "jack-launcher.jar".
66
67Check "Admin" section to know how to install and administrate the Jack server.
68
69The server can also be configured in "$HOME/.jack-server/config.properties".
70
71
72
73"config.properties" file
74------------------------
75
76It contains Jack server configuration properties.
77Description with default values follows:
78
79jack.server.max-service=<number>
80 Maximum number of simultaneous Jack tasks. Default is 4.
81
82jack.server.max-jars-size=<size-in-bytes>
83 Maximum size for Jars, in bytes. "-1" means no limit. Default is 100 MiB.
84
85jack.server.time-out=<time-in-seconds>
86 Time out delay before Jack gets to sleep. When Jack sleeps, its memory usage is reduced, but it is
87 slower to wake up. "-1" means "do not sleep". Default is 2 weeks.
88
89jack.server.service.port=<port-number>
90 Server service TCP port number. Default is 8076. Needs to match the service port defined in
Yohann Roussel5a6b2ab2015-12-11 15:34:55 +010091 "$HOME/.jack-settings" on the client host (See Client section).
Yohann Roussel1b457412015-10-22 10:57:00 +020092
93jack.server.admin.port=<port-number>
94 Server admin TCP port number. Default is 8077. Needs to match the service port defined in
Yohann Roussel5a6b2ab2015-12-11 15:34:55 +010095 "$HOME/.jack-settings" on the client host (See Client section).
Yohann Roussel1b457412015-10-22 10:57:00 +020096
97jack.server.config.version=<version>
98 Internal, do not modify.
99
100
101
102Server logs
103-----------
104
105Server logs can be found by running "jack-admin server-log". Default location is
106"$HOME/.jack-server/logs/".
107
108
109
110Admin
111-----
112
113The "jack-admin" bash script allows to install and administrate the Jack server.
114Here are some commands:
115
116$ jack-admin help
117Print help.
118
119$ jack-admin install-server jack-launcher.jar jack-server.jar
120Install the Jack server.
121
122$ jack-admin uninstall-server
123Uninstall the Jack server and all components.
124
125$ jack-admin list jack
126List installed versions for Jack.
127
128$ jack-admin update jack jack.jar
129Install or update a Jack jar.
130
131$ jack-admin start-server
132Start the server.
133
134$ jack-admin stop-server
135Stop the server after the last compilation is complete.
136
137$ jack-admin kill-server
138Kill the server process immediately, interrupting abruptly ongoing compilations.
139
140$ jack-admin list-server
141List Jack server processes.
142
143$ jack-admin server-stat
144Print various info about the server and the host.
145
146$ jack-admin server-log
147Print log pattern.
148
149
150
151Troubleshooting
152---------------
153
154If compilation fails on "No Jack server running":
155
156See "Starting the server" above.
157
158
159If your computer becomes unresponsive during compilation or if you experience Jack compilations
160failing on "Out of memory error.":
161
162You can improve the situation by reducing the number of jack simultaneous compilations by editing
Yohann Roussel5a6b2ab2015-12-11 15:34:55 +0100163your "$HOME/.jack-server/config.properties" and changing jack.server.max-service to a lower value.
Yohann Roussel1b457412015-10-22 10:57:00 +0200164
165
166If you have trouble starting the server:
167
168This may mean that TCP ports are already in use on your computer. You can try modifying the ports
169both in your client and server configurations. See the "Server info" and "Client info" sections.
Yohann Roussel5a6b2ab2015-12-11 15:34:55 +0100170If it doesn't solve the problem, please report and give us additional information by:
171 - Attaching your compilation log.
172 - Attaching a zip of "$HOME/.jack-server/".
173 - Attaching "$HOME/.jack-settings".
174 - Executing "lsof -i TCP:8076", "lsof -i TCP:8077" and attaching the outputs.
175
176
177If your commands fails on
178"Failed to contact Jack server: Problem reading <your home>/.jack-server/client.pem":
179
180This may mean that your server never managed to start, see
181"If you have trouble starting the server" above.
Yohann Roussel1b457412015-10-22 10:57:00 +0200182
183
184If your compilation gets stuck without any progress:
185
186Please report and give us additional information by:
Yohann Roussel5a6b2ab2015-12-11 15:34:55 +0100187 - Running "jack-admin list-server | awk '{print $2}' | xargs kill -3".
188 - Attaching the server log to the bug (see the "Server logs" section).
189 - Executing a "jack-admin server-stat" and attaching the output.
190 - Attaching "$HOME/.jack-server/logs/outputs.txt".
191 - Executing "lsof -i TCP:8076", "lsof -i TCP:8077" and attaching the outputs.