Yohann Roussel | 1b45741 | 2015-10-22 10:57:00 +0200 | [diff] [blame] | 1 | ########### |
| 2 | Jack server |
| 3 | ########### |
| 4 | |
| 5 | The Jack server's goal is to handle a pool of Jack compiler instances in order to limit memory usage |
| 6 | and benefit from already warm instances. |
| 7 | |
| 8 | |
| 9 | |
Yohann Roussel | 9710d33 | 2016-01-06 16:12:40 +0100 | [diff] [blame^] | 10 | Setup for Mac OS |
| 11 | ---------------- |
| 12 | |
| 13 | Jack server is automatically installed and started by android build but requires initial setup on |
| 14 | Mac 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 Roussel | 1b45741 | 2015-10-22 10:57:00 +0200 | [diff] [blame] | 27 | Starting the server |
| 28 | ------------------- |
| 29 | |
| 30 | You may need to start the Jack server manually. |
| 31 | Use "jack-admin start-server". |
| 32 | |
| 33 | |
| 34 | |
| 35 | Client info |
| 36 | ----------- |
| 37 | |
| 38 | The client is a bash script simply named "jack". |
Yohann Roussel | 5a6b2ab | 2015-12-11 15:34:55 +0100 | [diff] [blame] | 39 | It can be configured in "$HOME/.jack-settings" |
Yohann Roussel | 1b45741 | 2015-10-22 10:57:00 +0200 | [diff] [blame] | 40 | |
| 41 | |
| 42 | |
| 43 | ".jack-settings" file |
| 44 | --------------------- |
| 45 | |
| 46 | This file contains script shell variables: |
| 47 | "SERVER_HOST": IP address of the server |
| 48 | by 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 Roussel | 5a6b2ab | 2015-12-11 15:34:55 +0100 | [diff] [blame] | 51 | defined in "$HOME/.jack-server/config.properties" on the server host (See "Server info" below) |
Yohann Roussel | 1b45741 | 2015-10-22 10:57:00 +0200 | [diff] [blame] | 52 | by 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 Roussel | 5a6b2ab | 2015-12-11 15:34:55 +0100 | [diff] [blame] | 55 | "$HOME/.jack-server/config.properties" on the server host (See "Server info" below) |
Yohann Roussel | 1b45741 | 2015-10-22 10:57:00 +0200 | [diff] [blame] | 56 | by default: "SERVER_PORT_ADMIN=8077". |
| 57 | |
| 58 | "SETTING_VERSION": Internal, do not modify. |
| 59 | |
| 60 | |
| 61 | |
| 62 | Server info |
| 63 | ----------- |
| 64 | |
| 65 | The server is composed of 2 jars named "jack-server.jar" and "jack-launcher.jar". |
| 66 | |
| 67 | Check "Admin" section to know how to install and administrate the Jack server. |
| 68 | |
| 69 | The server can also be configured in "$HOME/.jack-server/config.properties". |
| 70 | |
| 71 | |
| 72 | |
| 73 | "config.properties" file |
| 74 | ------------------------ |
| 75 | |
| 76 | It contains Jack server configuration properties. |
| 77 | Description with default values follows: |
| 78 | |
| 79 | jack.server.max-service=<number> |
| 80 | Maximum number of simultaneous Jack tasks. Default is 4. |
| 81 | |
| 82 | jack.server.max-jars-size=<size-in-bytes> |
| 83 | Maximum size for Jars, in bytes. "-1" means no limit. Default is 100 MiB. |
| 84 | |
| 85 | jack.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 | |
| 89 | jack.server.service.port=<port-number> |
| 90 | Server service TCP port number. Default is 8076. Needs to match the service port defined in |
Yohann Roussel | 5a6b2ab | 2015-12-11 15:34:55 +0100 | [diff] [blame] | 91 | "$HOME/.jack-settings" on the client host (See Client section). |
Yohann Roussel | 1b45741 | 2015-10-22 10:57:00 +0200 | [diff] [blame] | 92 | |
| 93 | jack.server.admin.port=<port-number> |
| 94 | Server admin TCP port number. Default is 8077. Needs to match the service port defined in |
Yohann Roussel | 5a6b2ab | 2015-12-11 15:34:55 +0100 | [diff] [blame] | 95 | "$HOME/.jack-settings" on the client host (See Client section). |
Yohann Roussel | 1b45741 | 2015-10-22 10:57:00 +0200 | [diff] [blame] | 96 | |
| 97 | jack.server.config.version=<version> |
| 98 | Internal, do not modify. |
| 99 | |
| 100 | |
| 101 | |
| 102 | Server logs |
| 103 | ----------- |
| 104 | |
| 105 | Server logs can be found by running "jack-admin server-log". Default location is |
| 106 | "$HOME/.jack-server/logs/". |
| 107 | |
| 108 | |
| 109 | |
| 110 | Admin |
| 111 | ----- |
| 112 | |
| 113 | The "jack-admin" bash script allows to install and administrate the Jack server. |
| 114 | Here are some commands: |
| 115 | |
| 116 | $ jack-admin help |
| 117 | Print help. |
| 118 | |
| 119 | $ jack-admin install-server jack-launcher.jar jack-server.jar |
| 120 | Install the Jack server. |
| 121 | |
| 122 | $ jack-admin uninstall-server |
| 123 | Uninstall the Jack server and all components. |
| 124 | |
| 125 | $ jack-admin list jack |
| 126 | List installed versions for Jack. |
| 127 | |
| 128 | $ jack-admin update jack jack.jar |
| 129 | Install or update a Jack jar. |
| 130 | |
| 131 | $ jack-admin start-server |
| 132 | Start the server. |
| 133 | |
| 134 | $ jack-admin stop-server |
| 135 | Stop the server after the last compilation is complete. |
| 136 | |
| 137 | $ jack-admin kill-server |
| 138 | Kill the server process immediately, interrupting abruptly ongoing compilations. |
| 139 | |
| 140 | $ jack-admin list-server |
| 141 | List Jack server processes. |
| 142 | |
| 143 | $ jack-admin server-stat |
| 144 | Print various info about the server and the host. |
| 145 | |
| 146 | $ jack-admin server-log |
| 147 | Print log pattern. |
| 148 | |
| 149 | |
| 150 | |
| 151 | Troubleshooting |
| 152 | --------------- |
| 153 | |
| 154 | If compilation fails on "No Jack server running": |
| 155 | |
| 156 | See "Starting the server" above. |
| 157 | |
| 158 | |
| 159 | If your computer becomes unresponsive during compilation or if you experience Jack compilations |
| 160 | failing on "Out of memory error.": |
| 161 | |
| 162 | You can improve the situation by reducing the number of jack simultaneous compilations by editing |
Yohann Roussel | 5a6b2ab | 2015-12-11 15:34:55 +0100 | [diff] [blame] | 163 | your "$HOME/.jack-server/config.properties" and changing jack.server.max-service to a lower value. |
Yohann Roussel | 1b45741 | 2015-10-22 10:57:00 +0200 | [diff] [blame] | 164 | |
| 165 | |
| 166 | If you have trouble starting the server: |
| 167 | |
| 168 | This may mean that TCP ports are already in use on your computer. You can try modifying the ports |
| 169 | both in your client and server configurations. See the "Server info" and "Client info" sections. |
Yohann Roussel | 5a6b2ab | 2015-12-11 15:34:55 +0100 | [diff] [blame] | 170 | If 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 | |
| 177 | If your commands fails on |
| 178 | "Failed to contact Jack server: Problem reading <your home>/.jack-server/client.pem": |
| 179 | |
| 180 | This may mean that your server never managed to start, see |
| 181 | "If you have trouble starting the server" above. |
Yohann Roussel | 1b45741 | 2015-10-22 10:57:00 +0200 | [diff] [blame] | 182 | |
| 183 | |
| 184 | If your compilation gets stuck without any progress: |
| 185 | |
| 186 | Please report and give us additional information by: |
Yohann Roussel | 5a6b2ab | 2015-12-11 15:34:55 +0100 | [diff] [blame] | 187 | - 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. |