aboutsummaryrefslogtreecommitdiffstats
path: root/docs/part-1/2_install-xds-server.md
diff options
context:
space:
mode:
Diffstat (limited to 'docs/part-1/2_install-xds-server.md')
-rw-r--r--docs/part-1/2_install-xds-server.md160
1 files changed, 112 insertions, 48 deletions
diff --git a/docs/part-1/2_install-xds-server.md b/docs/part-1/2_install-xds-server.md
index 3609bd7..cbbca44 100644
--- a/docs/part-1/2_install-xds-server.md
+++ b/docs/part-1/2_install-xds-server.md
@@ -9,7 +9,7 @@ running on your local network (On-Premise config) or in the Cloud (SaaS config),
For others (standalone config or administrators that want to install an
On-Premise solution) xds-server must be installed.
-Several installation types are supported :
+Several installation types are supported:
| Install type | Supported OS | Section to refer |
|--------------|--------------|------------------|
@@ -19,7 +19,7 @@ Several installation types are supported :
## Installation based on Docker container
-### Prerequisites
+### Docker container prerequisites
Docker is installed on the host machine, please refer to [Docker documentation](https://docs.docker.com/engine/installation/) for more details.
@@ -37,27 +37,47 @@ You should get `docker.automotivelinux.org/agl/worker-xds:X.Y` image
# List image that we just load
docker images "docker.automotivelinux.org/agl/worker-xds*"
-docker.automotivelinux.org/agl/worker-xds 4.0 786d65b2792c 6 days ago 654MB
+REPOSITORY TAG IMAGE ID CREATED SIZE
+docker.automotivelinux.org/agl/worker-xds 5.0 877979e534ff 3 hours ago 106MB
```
### Create and start a new container
-Use provided script to create a new docker container and start it:
+Use provided script to create a new docker image and start a new container:
```bash
# Get script
-wget https://raw.githubusercontent.com/iotbzh/xds-server/master/scripts/xds-docker-create-container.sh
+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'
# Create new XDS worker container
bash ./xds-docker-create-container.sh
# Check that new container is running
docker ps | grep worker-xds
-
-b985d81af40c docker.automotivelinux.org/agl/worker-xds:3.99.1 "/usr/bin/wait_for..." 6 days ago Up 4 hours 0.0.0.0:8000->8000/tcp, 0.0.0.0:69->69/udp, 0.0.0.0:10809->10809/tcp, 0.0.0.0:2222->22/tcp agl-xds-seb@laptop-0-seb
+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:69->69/udp, 0.0.0.0:10809->10809/tcp, 0.0.0.0:2222->22/tcp agl-xds-HOSTNAME-0-USERNAME
```
-Note that you can also add a new shared directory using `--volume` option in order
+This container exposes following ports:
+
+| Port number | Description |
+|-------------|---------------------------------------------|
+| 8000 | `xds-server`: serve XDS webapp and REST API |
+| 69 | TFTP |
+| 2222 | ssh |
+
+This container also creates the following volumes (shared folders between
+inside and outside docker):
+
+| Directory on host | Directory inside docker | Comment |
+|-------------------|-------------------------|---------|
+| $HOME/xds-workspace | /home/devel/xds-workspace | XDS projects workspace location|
+| $HOME/xds-workspace/.xdt_0 | /xdt | location to store SDKs |
+| $USER_VOLUME | $USER_VOLUME | user path, see `--volume` option of `xds-docker-create-container.sh` script |
+
+<!-- note -->
+**Note:**
+
+You can add a new shared directory using `--volume` option in order
to use for example with Path-Mapping folder type.
```bash
@@ -65,47 +85,95 @@ to use for example with Path-Mapping folder type.
bash ./xds-docker-create-container.sh --volume /my-workspace:$HOME/my-workspace
```
-### Check if xds-server is running
+You can change docker used port with `-id` option
-`xds-server` is automatically started as a service on container startup.
+```bash
+# Create new XDS worker container with a different port number
+bash ./xds-docker-create-container.sh -id ${ID}
-To check if xds-server is correctly install and running, you can access the basic
-web page that gives you some instructions:
+# Check that new container is running
+docker ps | grep worker-xds
+f67079db4339 docker.automotivelinux.org/agl/worker-xds:5.0 "/usr/bin/wait_for..." About a minute ago Up 34 seconds 0.0.0.0:(2222+ID)->22/tcp, 0.0.0.0:(69+ID)->69/udp, 0.0.0.0:(8000+ID)->8000/tcp, 0.0.0.0:(10809+ID)->10809/tcp agl-xds-HOSTNAME-ID-USERNAME
+```
+
+<!-- endnote -->
+
+#### Manually setup docker user id
+
+<!-- note -->
+**Note:**
+
+If you used `xds-docker-create-container.sh` script to create XDS
+docker container, user uid/gid inside docker has already been changed by this script.
+<!-- endnote -->
+
+If you plan to use **path-mapping sharing type for your projects**, you need to
+have the same user id and group id inside and outside docker.
+
+By default user and group name inside docker is set `devel` (id `1664`).
+
+Use following commands to replace id `1664` with your user/group id:
+
+```bash
+# Set docker container name to use (usually agl-xds-xxx where xxx is USERNAME@MACHINENAME-IDX-NAME)
+export CONTAINER_NAME=agl-xds-seb@laptop-0-seb
+docker ps | grep -q ${CONTAINER_NAME} || echo "ERROR: No container name \"${CONTAINER_NAME}\" please set a valid CONTAINER_NAME before you continue"
+
+# First kill all processes of devel user (including running xds-server)
+docker exec ${CONTAINER_NAME} bash -c "/bin/loginctl kill-user devel"
+
+# Change user and group id inside docker to match your ids
+docker exec ${CONTAINER_NAME} bash -c "usermod -u $(id -u) devel"
+docker exec ${CONTAINER_NAME} bash -c "groupmod -g $(id -g) devel"
+
+# Update some files ownership
+docker exec ${CONTAINER_NAME} bash -c "chown -R devel:devel /home/devel /tmp/xds*"
+
+# Restart devel autologin service
+docker exec ${CONTAINER_NAME} bash -c "systemctl restart autologin"
+
+# Restart xds-server as a service (ssh port 2222 may depend on your container ID)
+ssh -p 2222 devel@localhost -- "systemctl --user restart xds-server"
+```
+
+### Check if xds-server is running (open XDS webapp)
+
+**`xds-server` is automatically started** as a service on container startup.
+
+If the container is running on your localhost, you can access to a basic web
+application:
```bash
-# if container is running on your local host
-# (else replace localhost by the name or the ip of the machine running the container)
xdg-open http://localhost:8000
```
-`xds-server` is now up and running, you can now install AGL SDKs, please refer
-to next chapter named [Installing AGL SDKs](3_install-sdks.md#installing-agl-sdks)
+If needed you can status / stop / start it manually using following commands:
-### Container settings
+```bash
+# Status XDS server:
+ssh -p 2222 devel@localhost systemctl --user status xds-server.service
-This container (ID=0) exposes following ports:
+# Stop XDS server
+ssh -p 2222 devel@localhost systemctl --user stop xds-server.service
-- 8000 : `xds-server` to serve XDS basic web page
-- 69 : TFTP
-- 2222 : ssh
+# Start XDS server
+ssh -p 2222 devel@localhost systemctl --user start xds-server.service
-This container also creates the following volumes (sharing directories between
-inside and outside docker):
+# Get XDS server logs
+ssh -p 2222 devel@localhost journalctl --user --unit=xds-server.service --output=cat
+```
-| Directory on host | Directory inside docker | Comment |
-|-------------------|-------------------------|---------|
-| $HOME/xds-workspace | /home/devel/xds-workspace | XDS projects workspace location|
-| $HOME/xds-workspace/.xdt_0 | /xdt | location to store SDKs |
-| $USER_VOLUME | $USER_VOLUME | user path, see `--volume` option of `xds-docker-create-container.sh` script |
+`xds-server` is now up and running, you can now install AGL SDKs, please refer
+to next chapter named [Installing AGL SDKs](3_install-sdks.html#installing-agl-sdks)
<!-- note -->
-Please refer to [part 2 - xds-server](../part-2/1_xds-server.md#sdk-cross-toolchain-management) documentation
+Please refer to [part 2 - xds-server](../part-2/1_xds-server.html#sdk-cross-toolchain-management) documentation
for additional info.
<!-- endnote -->
## Installation based on Virtual Machine appliance
-### Prerequisites
+### Virtual Machine appliance prerequisites
> VirtualBox is installed on the host machine
@@ -131,6 +199,7 @@ VDS_VMNAME=$(VBoxManage list vms | grep xds-vm-debian | cut -d "\"" -f2)
echo ${VDS_VMNAME}
# Remove old XDS appliance
+[ -n ${VDS_VMNAME} ] && VBoxManage controlvm ${VDS_VMNAME} poweroff
[ -n ${VDS_VMNAME} ] && VBoxManage unregistervm ${VDS_VMNAME} --delete
```
@@ -150,6 +219,18 @@ echo ${VDS_VMNAME}
[ -n ${VDS_VMNAME} ] && VBoxManage startvm ${VDS_VMNAME}
```
+**Mandatory**:
+
+Add share folder to appliance, to allow files sharing using pathmap method:
+
+```bash
+# Create local share folder
+mkdir -p $HOME/xds-workspace
+
+#Add share folder to appliance
+vboxmanage sharedfolder add ${VDS_VMNAME} --name XDS-workspace --hostpath $HOME/xds-workspace
+```
+
### Appliance settings
This image exposes following network ports (NAT mode):
@@ -171,7 +252,7 @@ xdg-open http://localhost:8000
```
`xds-server` is now up and running, you can now install AGL SDKs, please refer
-to next chapter named [Installing AGL SDKs](3_install-sdks.md#installing-agl-sdks)
+to next chapter named [Installing AGL SDKs](3_install-sdks.html#installing-agl-sdks)
## Native installation
@@ -212,23 +293,6 @@ sudo zypper install agl-xds-server
**Optional step**: skip this chapter if you plan to use default settings
<!-- endnote -->
-When `xds-server` is started as a systemd service, default environment variables
-are set into `/etc/default/xds-server` file.
-
-`xds-server` configuration is also driven by a JSON config file (`server-config.json`),
-and default JSON config is `/etc/xds/server/server-config.json`.
-
-<!-- note -->
-**Note:**
-
-- You can use your own JSON config by settings `APP_CONFIG` variable of
-`/etc/default/xds-server` file to your file, for example `/home/MYUSER/.xds/server/server-config.json`
-
-- `CloudSync` (AKA syncthing) synchronzation type can also be disabled when
-`"syncthing"` key is not defined in JSON configuration file.
-
-<!-- endnote -->
-
Please refer to [Configuration chapter of xds-server](../part-2/1_xds-server.html#configuration)
documentation for more details about JSON configuration file.