3 Depending on your situation, you must either install the
4 XDS server part or you can skip installation:
6 - If you are a developer and plan to connect to and use an existing `xds-server`
7 that is running on your local network (On-Premise) or is available from
8 the Cloud (SaaS), you do not need to install the server part.
9 - If you are configured for Standalone or you are an administrator
10 that wants to install an On-Premise solution, you must install
13 This section describes three types of server part installations:
15 | Install type | Supported OS | Section to refer |
16 |--------------|--------------|------------------|
17 | Container | Linux or MacOS | [Docker Container](#docker-container) |
18 | Virtual Machine | Linux, MacOS or Windows | [VirtualBox Appliance](#virtualbox-appliance) |
19 | Native | Linux | [Native](#native) |
23 This section describes how to install the server part (`xds-server`)
25 [Docker Container](https://www.docker.com/resources/what-container)
26 on a Linux-based system or a MacOS system.
30 The system on which you are installing the server part
31 must meet both the following prerequisites:
33 - You must have Docker installed on the host machine.
34 For information on installing Docker, see the
35 [Docker documentation](https://docs.docker.com/engine/installation/).
37 - Aside from having Docker installed, users must be part of a
39 [group](https://www.linux.com/learn/intro-to-linux/2017/12/how-manage-users-groups-linux).
40 Enter the following command to display the system's groups and
41 then search for and list the Docker groups:
47 If the users that plan on using the container are not part of the
48 Docker group or the group does not exist, you must take steps.
49 See the [docker post install instructions](https://docs.docker.com/install/linux/linux-postinstall/)
50 for details on creating a Docker group and adding users.
52 Following is a summary of the key commands:
56 sudo usermod -aG docker $USER
57 # Log out and re-login so the system can re-evaluate the group membership
58 # You might also need to start docker service manually
60 sudo service docker start
62 sudo systemctl start docker
67 Use the following command to load the pre-built AGL
68 SDK Docker image, which includes `xds-server`:
71 wget -O - http://iot.bzh/download/public/XDS/docker/docker_agl_worker-xds-latest.tar.xz | docker load
74 The following command lists and displays information about the image:
77 docker images "docker.automotivelinux.org/agl/worker-xds*"
79 REPOSITORY TAG IMAGE ID CREATED SIZE
80 docker.automotivelinux.org/agl/worker-xds 5.0 877979e534ff 3 hours ago 106MB
83 ### Create and Start a New Container
85 Running the following script creates a new Docker image and starts a new container:
89 wget -O xds-docker-create-container.sh 'https://gerrit.automotivelinux.org/gerrit/gitweb?p=src/xds/xds-server.git;a=blob_plain;f=scripts/xds-docker-create-container.sh;hb=master'
91 # Create new XDS worker container (change the -id option value if you get a port conflict error)
92 bash ./xds-docker-create-container.sh -id 0
94 # Be sure the new container is running
95 docker ps | grep worker-xds
96 f67079db4339 docker.automotivelinux.org/agl/worker-xds:5.0 "/usr/bin/wait_for..." About a minute ago Up 34 seconds 0.0.0.0:8000->8000/tcp,0.0.0.0:10809->10809/tcp, 0.0.0.0:2222->22/tcp agl-xds-HOSTNAME-0-USERNAME
99 In the previous example, the container exposes following ports:
101 | Port number | Description |
102 |-------------|---------------------------------------------|
103 | 8000 | `xds-server`: serve XDS webapp and REST API |
106 This container also creates the following volumes, which are shared folders between
107 inside and outside Docker:
109 | Directory on host | Directory inside docker | Comment |
110 |-------------------|-------------------------|---------|
111 | $HOME/xds-workspace | /home/devel/xds-workspace | XDS projects workspace location|
112 | $HOME/xds-workspace/.xdt_0 | /xdt | location to store SDKs |
113 | $USER_VOLUME | $USER_VOLUME | user path, see `--volume` option of `xds-docker-create-container.sh` script |
115 #### Optional Settings
117 When you create the container, you can use optional settings.
118 This section shows minimal settings to configure the container.
119 For more detailed `xds-server` configuration information including settings, see the
120 "[xds-server configuration](../part-2/1_xds-server/2_config.html)" section.
124 Adds a new shared directory using the `--volume` option (e.g.
125 used with Path-Mapping folder types):
128 # Create new XDS worker container and share extra '$HOME/my-workspace' directory
129 bash ./xds-docker-create-container.sh --volume /my-workspace:$HOME/my-workspace
134 Changes the port used by Docker:
137 # Create new XDS worker container with a different port number
139 bash ./xds-docker-create-container.sh -id ${ID}
141 # Check that new container is running (in example below id has been set to 3)
142 docker ps | grep worker-xds
143 f67079db4339 docker.automotivelinux.org/agl/worker-xds:5.0 "/usr/bin/wait_for..." About a minute ago Up 34 seconds 0.0.0.0:2225->22/tcp, 0.0.0.0:8003->8000/tcp, 0.0.0.0:10892->10809/tcp agl-xds-3
146 <!-- section-note -->
148 Changing the container id impacts the port number used to connect to `xds-server`.
149 Consequently, you might need to adjust the `xds-agent` configuration in order
150 to match the correct port number.
152 In the previous example where the container id is set to "3", the export
153 port number is `8003`.
154 In this case, you must define "url" in the `xds-server` configuration as follows:
161 "url": "http://localhost:8003"
168 For more information, see the
169 [xds-agent configuration](../part-2/2_xds-agent/2_config.html) section.
170 <!-- end-section-note -->
172 #### Manually Setup the Docker User ID
174 If you are using path-mapping sharing type for your projects, you need to
175 have the same user ID and group ID inside and outside Docker.
177 By default, user, password and group names inside Docker are `devel`, `devel` and `1664`, respectively.
179 <!-- section-note -->
182 If you used the `xds-docker-create-container.sh` script to create the XDS
183 Docker container, the user uid/gid inside Docker has already been changed.
184 <!-- end-section-note -->
186 Use following commands to replace ID `1664` with your user and group ID:
189 # Set the Docker container name (e.g. agl-xds-xxx where xxx is USERNAME@MACHINENAME-IDX-NAME).
190 export CONTAINER_NAME=agl-xds-seb@laptop-0-seb
191 docker ps | grep -q ${CONTAINER_NAME} || echo "ERROR: No container name \"${CONTAINER_NAME}\" please set a valid CONTAINER_NAME before you continue"
193 # Kill all processes of with the user ID `devel`. This includes the running xds-server.
194 docker exec ${CONTAINER_NAME} bash -c "/bin/loginctl kill-user devel"
196 # Change user and group IDs inside Docker to match your user and group IDs.
197 docker exec ${CONTAINER_NAME} bash -c "usermod -u $(id -u) devel"
198 docker exec ${CONTAINER_NAME} bash -c "groupmod -g $(id -g) devel"
200 # Update file ownerships.
201 docker exec ${CONTAINER_NAME} bash -c "chown -R devel:devel /home/devel /tmp/xds*"
203 # Restart the devel autologin service.
204 docker exec ${CONTAINER_NAME} bash -c "systemctl restart autologin"
206 # Restart xds-server as a service. The ssh port 2222 might depend on your container ID.
207 ssh -p 2222 devel@localhost -- "systemctl --user restart xds-server"
209 ### Manually setup the Docker Password
211 If you forget the password set for the container , you wont be able to ssh into the container and check on the files created.
212 For such a time , you need to set up a new password for the container. Use the following commands to do just that:
215 # This will let you access the bash shell inside the container as root
216 docker exec -it ${CONTAINER_NAME} /bin/bash
218 # Change the password of the user (root or devel)
221 ### Check if xds-server is Running (open XDS webapp)
223 When the container starts up, `xds-server` automatically starts as a
226 If the container is running on your localhost, you can access a basic web
227 application to check on `xds-server`:
230 xdg-open http://localhost:8000
233 From a shell prompt, you can check status, stop, and start `xds-server`
234 using the following commands:
238 ssh -p 2222 devel@localhost systemctl --user status xds-server.service
241 ssh -p 2222 devel@localhost systemctl --user stop xds-server.service
244 ssh -p 2222 devel@localhost systemctl --user start xds-server.service
246 # Get XDS server logs
247 ssh -p 2222 devel@localhost journalctl --user --unit=xds-server.service --output=cat
250 `xds-server` should be up and running.
251 You can now install AGL SDKs.
253 "[AGL SDKs](install-sdk.html)" section for more information.
255 ## VirtualBox Appliance
257 This section describes how to install the server part (`xds-server`)
258 into a guest Virtual Machine (VM) supported by
259 [VirtualBox](https://en.wikipedia.org/wiki/VirtualBox).
260 VirtualBox allows the creation and management of guest virtual
261 machines that run versions and derivations on many types of systems
262 (e.g. Linux, Window, MacOS, and so forth).
266 The system on which you are installing the server part must have
267 VirtualBox installed.
268 For information on how to install VirtualBox, see the
269 [VirtualBox documentation](https://www.virtualbox.org/wiki/Downloads).
271 ### Get the Appliance
273 Use the following command to load the pre-built AGL SDK
274 appliance image, which includes `xds-server`:
277 wget http://iot.bzh/download/public/XDS/appliance/xds-vm-debian9_latest.ova
280 ### Clean the Old Appliance
282 Only one appliance can exist on the machine.
283 Consequently, you must remove any existing XDS appliance.
284 Use the following commands:
287 # Get the virtual machine name
288 VDS_VMNAME=$(VBoxManage list vms | grep xds-vm-debian | cut -d "\"" -f2)
291 # Remove the old XDS appliance
292 [ -n ${VDS_VMNAME} ] && VBoxManage controlvm ${VDS_VMNAME} poweroff
293 [ -n ${VDS_VMNAME} ] && VBoxManage unregistervm ${VDS_VMNAME} --delete
296 ### Create and Start a New Appliance
298 You can create a new appliance by using a provided script or by
299 using the VirtualBox GUI:
302 # Import image into VirtualBox
303 VBoxManage import ./xds-vm-debian9_latest.ova
305 # Check import result
306 VDS_VMNAME=$(VBoxManage list vms | grep xds-vm-debian | cut -d "\"" -f2)
310 Add a share folder to the appliance.
311 You must use "path-mapping sharing type for projects":
314 # Create local share folder
315 mkdir -p $HOME/xds-workspace
317 #Add share folder to appliance
318 VBoxManage sharedfolder add ${VDS_VMNAME} --name XDS-workspace --hostpath $HOME/xds-workspace
321 Use the following command to start the appliance:
324 # Start XDS appliance
325 [ -n ${VDS_VMNAME} ] && VBoxManage startvm ${VDS_VMNAME}
328 ### Appliance Settings
330 The image exposes the following network ports, which are NAT mode:
332 - 8000 : `xds-server` to serve XDS basic web page
335 ### Check if xds-server is Running
337 When the container in the virtual machine starts up, the `xds-server` automatically starts.
339 To check if `xds-server` is correctly installed and running, you can access the
340 XDS basic web page and refer to the instructions:
343 # If the container/appliance is running on your local host
344 # (else replace localhost with the name or the ip of the machine running the container)
345 xdg-open http://localhost:8000
348 `xds-server` should be up and running.
349 You can now install AGL SDKs.
351 "[AGL SDKs](install-sdk.html)" section for more information.
356 This section describes how to install the server part (`xds-server`) 'natively'
357 on a Linux-based system.
359 <!-- section-note -->
361 Hosts running a Linux distribution are the only hosts that support native
362 installation of the server part.
363 <!-- end-section-note -->
367 The system on which you are installing the server part must have
368 `python3` installed, which allows `xds-server` to manage AGL SDKs.
370 #### Installing Packages for Debian
372 Use the following commands to install packages for
373 `xds-server` on Debian-based systems:
376 # Set 'DISTRO' (e.g. xUbuntu_16.04, xUbuntu_16.10, xUbuntu_17.04, Debian_8.0, Debian_9.0)
377 export DISTRO="xUbuntu_16.04"
379 # Set AGL_RELEASE (e.g. AGL_ElectricEel, AGL_FunkyFlounder, AGL_Master)
380 export AGL_RELEASE="AGL_Master"
382 wget -O - http://download.opensuse.org/repositories/isv:/LinuxAutomotive:/${AGL_RELEASE}/${DISTRO}/Release.key | sudo apt-key add -
383 sudo bash -c "cat >> /etc/apt/sources.list.d/AGL.list <<EOF
384 deb http://download.opensuse.org/repositories/isv:/LinuxAutomotive:/${AGL_RELEASE}/${DISTRO}/ ./
388 sudo apt-get install agl-xds-server
391 sudo apt-get install python3
394 #### Install Packages for OpenSUSE
396 Use the following commands to install packages for
397 `xds-server` on OpenSUSE-based systems:
400 # Set DISTRO (openSUSE_Leap_42.3, openSUSE_Leap_15.0, openSUSE_Tumbleweed)
401 export DISTRO="openSUSE_Leap_15.0"
403 # Set AGL_RELEASE (AGL_ElectricEel, AGL_FunkyFlounder, AGL_Master)
404 export AGL_RELEASE="AGL_Master"
406 sudo zypper ar http://download.opensuse.org/repositories/isv:/LinuxAutomotive:/${AGL_RELEASE}/${DISTRO}/isv:LinuxAutomotive:${AGL_RELEASE}.repo
409 sudo zypper install agl-xds-server
412 sudo zypper install python3
415 #### Configure the xds-server
417 Configuring the `xds-server` occurs through a JSON configuration file
418 named `server-config.json`.
419 All fields in the JSON configuration file are optional.
420 Consequently, you can skip this configuration step if you want to use
421 the default settings in the JSON file.
423 If you want to customize or alter the default configuration, see the
424 "[Configuration chapter of xds-server](../part-2/1_xds-server/2_config.html)"
425 section for details on the JSON configuration file.
427 #### Start and Stop xds-server
429 You can manage `xds-server` as a
430 [systemd](https://en.wikipedia.org/wiki/Systemd) service by using
431 the following commands:
435 systemctl --user status xds-server.service
438 systemctl --user stop xds-server.service
441 systemctl --user start xds-server.service
443 # Get XDS server logs
444 systemctl --user --unit=xds-server.service --output=cat
447 To check if `xds-server` is correctly installed and running, you can access
448 the XDS web interface through your browser:
451 xdg-open http://localhost:8000
454 Alternatively, you can use the following `curl` command:
457 curl http://localhost:8000/api/v1/version