diff options
Diffstat (limited to 'agl-documentation/host-configuration')
25 files changed, 1024 insertions, 0 deletions
diff --git a/agl-documentation/host-configuration/book.json b/agl-documentation/host-configuration/book.json new file mode 100644 index 0000000..fadcb68 --- /dev/null +++ b/agl-documentation/host-configuration/book.json @@ -0,0 +1,11 @@ +{ + "title": "AGL Host Configuration", + "subtitle": "Developer Documentation", + "description": "Install AGL tools from OBS repo", + "keywords": "AGL, OBS, Install, repo, host", + "author": "IoT.Bzh Team", + "website": "http://iot.bzh", + "published": "May 2018", + "version": "0.1", + "pdf_filename": "AGL-Host-Configuration" +} diff --git a/agl-documentation/host-configuration/docs/0-Doc-Revisions.md b/agl-documentation/host-configuration/docs/0-Doc-Revisions.md new file mode 100644 index 0000000..3485a4e --- /dev/null +++ b/agl-documentation/host-configuration/docs/0-Doc-Revisions.md @@ -0,0 +1,6 @@ +Document revisions +================== + +| Date | Version | Designation | Author | +|-------------|---------|--------------------------------------|-------------------------| +| 17 May 1018 | 0.1 | Initial release | C.Benier [ Iot.bzh ] | diff --git a/agl-documentation/host-configuration/docs/0-build-microservice-overview.md b/agl-documentation/host-configuration/docs/0-build-microservice-overview.md new file mode 100755 index 0000000..57d7981 --- /dev/null +++ b/agl-documentation/host-configuration/docs/0-build-microservice-overview.md @@ -0,0 +1,55 @@ +# Overview + +You can develop Microservices on your native Linux machine quickly +by following the workflow in this section. +This workflow takes advantage of RPM or Debian packages,which are available +through the +[OpenSUSE Build Service (OBS)](https://build.opensuse.org/). +You can install these +[packages](https://build.opensuse.org/project/subprojects/isv:LinuxAutomotive) +and bypass the +[Yocto Project](https://yoctoproject.org) build cycles described in the +"[Developing an AGL Image](../../getting_started/reference/getting-started/image-workflow-intro.html)" section. + +Using this workflow, you can start to code, execute, and debug Microservice +bindings directly on your host. This flow works for many cases for which +no specific hardware is required, or when you can plug hardware directly +into your native Linux host's USB port such as a Controller Area Network +([CAN](https://en.wikipedia.org/wiki/CAN_bus)) bus Adapter or a Media +Oriented Systems Transport +([MOST](https://en.wikipedia.org/wiki/MOST_Bus)) Controller. + +The following figure and list overview the Microservice Native Development +process. +You can learn about the steps in the process by reading through the +remaining sections. + +<center><img src="pictures/microservice-workflow-native.png"></center> + +1. **Verify Your Build Host:** + Make sure you have a native Linux host. + For the example used in this section (i.e. `helloworld-service`), be sure your + Linux distribution is a recent version of Debian, Ubuntu, OpenSUSE, or Fedora. + +2. **Download and Install AGL Packages:** + Download and install the + [near-zero](https://en.wikipedia.org/wiki/Zero_Install) packages + from the OBS. + +3. **Install the Binder Daemon:** + Install the Binder Daemon, which is a part of the + [AGL Application Framework (AFM)](../../apis_services/reference/af-main/0-introduction.html). + The daemon allows you to connect applications to required services. + +4. **Get Your Source Files:** + For this section, you clone the `helloworld-service` binding repository. + You also need to make sure you have some other required packages to build + that specific binding. + +5. **Build and Run Your Service Natively (Optional Tool Use):** + Build your binding on your Linux host using native tools. + Once the binding is built, you can run it to make sure it functions + as expected. + + Optionally use extra tools once your binding is building and running + smoothly in the native environment. diff --git a/agl-documentation/host-configuration/docs/0_Abstract.md b/agl-documentation/host-configuration/docs/0_Abstract.md new file mode 100644 index 0000000..0bb7aca --- /dev/null +++ b/agl-documentation/host-configuration/docs/0_Abstract.md @@ -0,0 +1,11 @@ +# Host Configuration + +## Abstract + +The purpose of this section is to help developers to natively develop and debug +AGL microservices.\ +Thanks to OBS, packages for debian/ubuntu, openSUSE and +fedora distributions are available and can be installed on developer host. + +At first hand, the idea is to easily handle native development of AGL services +and at second hand to run the same services on targets/boards. diff --git a/agl-documentation/host-configuration/docs/1-verify-build-host.md b/agl-documentation/host-configuration/docs/1-verify-build-host.md new file mode 100755 index 0000000..bc7b158 --- /dev/null +++ b/agl-documentation/host-configuration/docs/1-verify-build-host.md @@ -0,0 +1,24 @@ +# Verify Your Build Host + +In order to build a Microservice binding natively, you need to be using a +supported Linux distribution. +In general, a recent version of Debian, Ubuntu, OpenSUSE, and Fedora works. +Following is a specific list of supported distributions: + +* [Debian](https://www.debian.org/releases/) 9.0 +* [Ubuntu](https://wiki.ubuntu.com/Releases) 16.04, 16.10, 17.10, and 18.04 +* [OpenSUSE](https://en.opensuse.org/openSUSE:Roadmap) Leap 15.0 and Tumbleweed +* [Fedora](https://fedoraproject.org/wiki/Releases) 27, 28, 29, and Rawhide. + +Exporting the `DISTRO` environment variable defines the distribution. +Following are examples: + +```bash +export DISTRO="Debian_9.0" +export DISTRO="xUbuntu_16.04" +export DISTRO="xUbuntu_16.10" +export DISTRO="xUbuntu_17.10" +export DISTRO="xUbuntu_18.04" +``` + +Set the `DISTRO` environment appropriately. diff --git a/agl-documentation/host-configuration/docs/1_Prerequisites.md b/agl-documentation/host-configuration/docs/1_Prerequisites.md new file mode 100644 index 0000000..14eacec --- /dev/null +++ b/agl-documentation/host-configuration/docs/1_Prerequisites.md @@ -0,0 +1,175 @@ +# Prerequisites for package installation + +There are different repos for AGL packages depending on the version, it is +possible to install all of them and switching between them. + +To install latest (master) version you must set REVISION variable as follow : + +```bash +export REVISION=Master +``` + +You can find all available repos [here](https://build.opensuse.org/project/subprojects/isv:LinuxAutomotive#). + +For more details about OBS, please visit [LinuxAutomotive page on OBS](https://build.opensuse.org/project/show/isv:LinuxAutomotive). + +## Add repo for debian distro + +Avalable distro values are + +```bash +export DISTRO="Debian_9.0" +export DISTRO="xUbuntu_16.04" +export DISTRO="xUbuntu_16.10" +export DISTRO="xUbuntu_17.10" +export DISTRO="xUbuntu_18.04" +``` + +Install the repository: + +```bash +export REVISION=Master +export DISTRO="xUbuntu_18.04" +wget -O - http://download.opensuse.org/repositories/isv:/LinuxAutomotive:/AGL_${REVISION}/${DISTRO}/Release.key | sudo apt-key add - +sudo bash -c "cat >> /etc/apt/sources.list.d/AGL.list <<EOF +#AGL +deb http://download.opensuse.org/repositories/isv:/LinuxAutomotive:/AGL_${REVISION}/${DISTRO}/ ./ +EOF" +sudo apt-get update +``` + +## Add repo for openSuse distro + +```bash +#available distro values are openSUSE_Leap_42.3 openSUSE_Tumbleweed +export REVISION=Master +source /etc/os-release; export DISTRO=$(echo $PRETTY_NAME | sed "s/ /_/g") +sudo zypper ar http://download.opensuse.org/repositories/isv:/LinuxAutomotive:/AGL_${REVISION}/${DISTRO}/isv:LinuxAutomotive:AGL_${REVISION}.repo +sudo zypper --gpg-auto-import-keys ref +``` + +## Add repo for fedora distro + +```bash +#available distro values are Fedora_27 Fedora_28 Fedora_Rawhide +export REVISION=Master +source /etc/os-release ; export DISTRO="${NAME}_${VERSION_ID}" +sudo wget -O /etc/yum.repos.d/isv:LinuxAutomotive:AGL_${REVISION}.repo http://download.opensuse.org/repositories/isv:/LinuxAutomotive:/AGL_${REVISION}/${DISTRO}/isv:LinuxAutomotive:AGL_${REVISION}.repo +``` + +## Switch between repos + +First, let's check our installed AGL repos. + +### Debian distro + +```bash +cat /etc/apt/sources.list.d/AGL.list +``` + +### openSuse distro + +```bash +zypper repos | grep AGL +``` + +### Fedora distro + +```bash +dnf repolist --all | grep AGL +``` + +Make sure that you have what you need installed. +With the commands above you should see which repos are enabled/disabled. +To switch between two repos you just have to disable your current AGL repo and +enable the wanted repo. +It's a little bit different for Debian distros, see the example right down +below. + +### Example for Debian distro + +I'm on Master and I want an ElectricEel revision. + +```bash +export OLDR=Master +export NEWR=ElectricEel +sudo sed -i "s/${OLDR}/${NEWR}/g" /etc/apt/sources.list.d/AGL.list +sudo apt-get update +``` + +### Example for openSuse distro + +```bash +# | Alias | Name | Enabled | GPG Check | Refresh +---+-------------------------------------+-------------------------------------------------------------------------------------------+---------+-----------+-------- + 1 | Atom | Atom Editor | Yes | (r ) Yes | No + 2 | code | Visual Studio Code | Yes | (r ) Yes | No + 3 | http-ftp.uni-erlangen.de-e3cebb6d | Packman Repository | Yes | (r ) Yes | Yes + 4 | isv_LinuxAutomotive_AGL_ElectricEel | isv:LinuxAutomotive:AGL_ElectricEel (openSUSE_Leap_15.0) | Yes | (r ) Yes | No + 5 | isv_LinuxAutomotive_AGL_Master | Automotive Grade Linux Application Development tools - master branch (openSUSE_Leap_15.0) | No | ---- | ---- + 6 | openSUSE-Leap-15.0-1 | openSUSE-Leap-15.0-1 | No | ---- | ---- + 7 | repo-debug | openSUSE-Leap-15.0-Debug | No | ---- | ---- + 8 | repo-debug-non-oss | openSUSE-Leap-15.0-Debug-Non-Oss | No | ---- | ---- + 9 | repo-debug-update | openSUSE-Leap-15.0-Update-Debug | No | ---- | ---- +10 | repo-debug-update-non-oss | openSUSE-Leap-15.0-Update-Debug-Non-Oss | No | ---- | ---- +11 | repo-non-oss | openSUSE-Leap-15.0-Non-Oss | Yes | (r ) Yes | Yes +12 | repo-oss | openSUSE-Leap-15.0-Oss | Yes | (r ) Yes | Yes +13 | repo-source | openSUSE-Leap-15.0-Source | No | ---- | ---- +14 | repo-source-non-oss | openSUSE-Leap-15.0-Source-Non-Oss | No | ---- | ---- +15 | repo-update | openSUSE-Leap-15.0-Update | Yes | (r ) Yes | Yes +16 | repo-update-non-oss | openSUSE-Leap-15.0-Update-Non-Oss | Yes | (r ) Yes | Yes +``` + +I want my master repo enabled. Here ElectricEel repo is at the 4th line and Master at 5th line, so we have to enter: + +```bash +$ sudo zypper mr -d 4 && sudo zypper mr -e 5 +Repository 'isv_LinuxAutomotive_AGL_ElectricEel' has been successfully disabled. +Repository 'isv_LinuxAutomotive_AGL_Master' has been successfully enabled. +sudo zypper refresh +``` + +In this command "-d" stands for disable and "-e" enable + +```bash +# | Alias | Name | Enabled | GPG Check | Refresh +---+-------------------------------------+-------------------------------------------------------------------------------------------+---------+-----------+-------- + 1 | Atom | Atom Editor | Yes | (r ) Yes | No + 2 | code | Visual Studio Code | Yes | (r ) Yes | No + 3 | http-ftp.uni-erlangen.de-e3cebb6d | Packman Repository | Yes | (r ) Yes | Yes + 4 | isv_LinuxAutomotive_AGL_ElectricEel | isv:LinuxAutomotive:AGL_ElectricEel (openSUSE_Leap_15.0) | No | ---- | ---- + 5 | isv_LinuxAutomotive_AGL_Master | Automotive Grade Linux Application Development tools - master branch (openSUSE_Leap_15.0) | Yes | (r ) Yes | No + 6 | openSUSE-Leap-15.0-1 | openSUSE-Leap-15.0-1 | No | ---- | ---- + 7 | repo-debug | openSUSE-Leap-15.0-Debug | No | ---- | ---- + 8 | repo-debug-non-oss | openSUSE-Leap-15.0-Debug-Non-Oss | No | ---- | ---- + 9 | repo-debug-update | openSUSE-Leap-15.0-Update-Debug | No | ---- | ---- +10 | repo-debug-update-non-oss | openSUSE-Leap-15.0-Update-Debug-Non-Oss | No | ---- | ---- +11 | repo-non-oss | openSUSE-Leap-15.0-Non-Oss | Yes | (r ) Yes | Yes +12 | repo-oss | openSUSE-Leap-15.0-Oss | Yes | (r ) Yes | Yes +13 | repo-source | openSUSE-Leap-15.0-Source | No | ---- | ---- +14 | repo-source-non-oss | openSUSE-Leap-15.0-Source-Non-Oss | No | ---- | ---- +15 | repo-update | openSUSE-Leap-15.0-Update | Yes | (r ) Yes | Yes +16 | repo-update-non-oss | openSUSE-Leap-15.0-Update-Non-Oss | Yes | (r ) Yes | Yes +``` + +### Example for Fedora distro + +```bash +isv_LinuxAutomotive_AGL_FunkyFlounder isv:LinuxAutomotive:AGL disabled +isv_LinuxAutomotive_AGL_Master Automotive Grade Linux enabled +``` + +I want my ElectricEel repo enabled. + +```bash +dnf config-manager --set-disabled isv_LinuxAutomotive_AGL_Master +dnf config-manager --set-enabled isv_LinuxAutomotive_AGL_FunkyFlounder +``` + +```bash +$ dnf repolist --all | grep AGL +isv_LinuxAutomotive_AGL_FunkyFlounder isv:LinuxAutomotive:AGL enabled +isv_LinuxAutomotive_AGL_Master Automotive Grade Linux disabled +``` + +Now you have to [install the app-framework-binder](http://docs.automotivelinux.org/master/docs/devguides/en/dev/reference/host-configuration/docs/2_AGL_Application_Framework.html) diff --git a/agl-documentation/host-configuration/docs/2-download-packages.md b/agl-documentation/host-configuration/docs/2-download-packages.md new file mode 100755 index 0000000..dea2347 --- /dev/null +++ b/agl-documentation/host-configuration/docs/2-download-packages.md @@ -0,0 +1,230 @@ +# Download Packages + +Different repositories exist for different AGL releases.\ +You need to download and install the packages based on your version +of AGL. + +## Set the `REVISION` Environment Variable + +All the packages reside in repositories managed by the +[OpenSUSE Build Service (OBS)](https://build.opensuse.org/).\ +You can see the packages +[here](https://build.opensuse.org/project/subprojects/isv:LinuxAutomotive#). + +Currently, support exists for the following AGL releases: + +* ElectricEel +* FunkyFlounder +* GrumpyGuppy +* HappyHalibut +* Master + +You need to set the `REVISION` environment variable to the AGL release you +are using.\ +For this example, set and export `REVISION` as "Master". + +```bash +export REVISION=Master +``` + +For additional details about OBS, see +[LinuxAutomotive page on OBS](https://build.opensuse.org/project/show/isv:LinuxAutomotive). + +## Make Sure Your `DISTRO` Environment Variable is Set + +The `DISTRO` environment variable needs to be correctly set for your +Linux distribution.\ +See the +"[Verify Your Build Host](./1-verify-build-host.html)" +section for information on how to set this variable. + +## Install the Repository + +```bash +Hit:1 https://deb.nodesource.com/node_10.x xenial InRelease +Hit:2 https://download.docker.com/linux/ubuntu xenial InRelease +Hit:3 http://security.ubuntu.com/ubuntu xenial-security InRelease +Hit:4 http://us.archive.ubuntu.com/ubuntu xenial InRelease +Ign:5 http://download.opensuse.org/repositories/isv:/LinuxAutomotive:/AGL_FunkyFlounder/xUbuntu_16.04 ./ InRelease +Hit:6 http://us.archive.ubuntu.com/ubuntu xenial-updates InRelease +Hit:7 http://download.opensuse.org/repositories/isv:/LinuxAutomotive:/AGL_FunkyFlounder/xUbuntu_16.04 ./ Release +Hit:8 http://us.archive.ubuntu.com/ubuntu xenial-backports InRelease +Reading package lists... Done +``` + +Not sure why you get the `Ign` on line 5.\ +I guess InRelease does not exist. + +If you don't have a `/etc/apt/sources.list.d/AGL.list` file to even start with, +and you run through the whole thing, you get the following output: + +```bash +$ sudo apt-get update +Hit:1 https://deb.nodesource.com/node_10.x xenial InRelease +Hit:2 https://download.docker.com/linux/ubuntu xenial InRelease +Hit:3 http://us.archive.ubuntu.com/ubuntu xenial InRelease +Get:4 http://us.archive.ubuntu.com/ubuntu xenial-updates InRelease [109 kB] +Get:5 http://security.ubuntu.com/ubuntu xenial-security InRelease [107 kB] +Ign:6 http://download.opensuse.org/repositories/isv:/LinuxAutomotive:/AGL_FunkyFlounder/xUbuntu_16.04 ./ InRelease +Hit:7 http://download.opensuse.org/repositories/isv:/LinuxAutomotive:/AGL_FunkyFlounder/xUbuntu_16.04 ./ Release +Get:9 http://us.archive.ubuntu.com/ubuntu xenial-backports InRelease [107 kB] +Get:10 http://us.archive.ubuntu.com/ubuntu xenial-updates/main amd64 Packages [902 kB] +Fetched 1,225 kB in 1s (803 kB/s) +Reading package lists... Done +``` + +Following are example commands that show how to install the package repository +based on various values of `DISTRO` and `REVISION`: + +### Ubuntu and "Master" + +```bash +export REVISION=Master +export DISTRO="xUbuntu_18.04" +wget -O - http://download.opensuse.org/repositories/isv:/LinuxAutomotive:/AGL_${REVISION}/${DISTRO}/Release.key | sudo apt-key add - +sudo bash -c "cat >> /etc/apt/sources.list.d/AGL.list <<EOF +#AGL +deb http://download.opensuse.org/repositories/isv:/LinuxAutomotive:/AGL_${REVISION}/${DISTRO}/ ./ +EOF" +sudo apt-get update +``` + +You can see the installed repository using the following command: + +```bash +cat /etc/apt/sources.list.d/AGL.list +``` + +### OpenSUSE and "Master" + +```bash +export DISTRO="openSUSE_Leap_15.0" +export REVISION=Master +source /etc/os-release; export DISTRO=$(echo $PRETTY_NAME | sed "s/ /_/g") +sudo zypper ar http://download.opensuse.org/repositories/isv:/LinuxAutomotive:/AGL_${REVISION}/${DISTRO}/isv:LinuxAutomotive:AGL_${REVISION}.repo +sudo zypper --gpg-auto-import-keys ref +``` + +You can see the installed repository using the following command: + +```bash +zypper repos | grep AGL +``` + +### Fedora and "Master" + +```bash +export DISTRO="Fedora_28" +export REVISION=Master +source /etc/os-release ; export DISTRO="${NAME}_${VERSION_ID}" +sudo wget -O /etc/yum.repos.d/isv:LinuxAutomotive:AGL_${REVISION}.repo http://download.opensuse.org/repositories/isv:/LinuxAutomotive:/AGL_${REVISION}/${DISTRO}/isv:LinuxAutomotive:AGL_${REVISION}.repo +``` + +You can see the installed repository using the following command: + +```bash +dnf repolist --all | grep AGL +``` + +## Switching Between Repositories + +The commands in the previous section showed you how to install the packages +from a specific repository and how to verify whether or not the packages +are enabled or disabled. +You can switch between different repositories. +You must disable your current AGL repository and then enable the repository +designated for the switch. + +Following is an example for Debian distributions: + +### Example for Debian distro + +Suppose you are on "master" and you want the "ElectricEel" AGL revision. + +```bash +export OLDR=Master +export NEWR=ElectricEel +sudo sed -i "s/${OLDR}/${NEWR}/g" /etc/apt/sources.list.d/AGL.list +sudo apt-get update +``` + +### Example for openSuse distro + +```bash +# | Alias | Name | Enabled | GPG Check | Refresh +---+-------------------------------------+-------------------------------------------------------------------------------------------+---------+-----------+-------- + 1 | Atom | Atom Editor | Yes | (r ) Yes | No + 2 | code | Visual Studio Code | Yes | (r ) Yes | No + 3 | http-ftp.uni-erlangen.de-e3cebb6d | Packman Repository | Yes | (r ) Yes | Yes + 4 | isv_LinuxAutomotive_AGL_ElectricEel | isv:LinuxAutomotive:AGL_ElectricEel (openSUSE_Leap_15.0) | Yes | (r ) Yes | No + 5 | isv_LinuxAutomotive_AGL_Master | Automotive Grade Linux Application Development tools - master branch (openSUSE_Leap_15.0) | No | ---- | ---- + 6 | openSUSE-Leap-15.0-1 | openSUSE-Leap-15.0-1 | No | ---- | ---- + 7 | repo-debug | openSUSE-Leap-15.0-Debug | No | ---- | ---- + 8 | repo-debug-non-oss | openSUSE-Leap-15.0-Debug-Non-Oss | No | ---- | ---- + 9 | repo-debug-update | openSUSE-Leap-15.0-Update-Debug | No | ---- | ---- +10 | repo-debug-update-non-oss | openSUSE-Leap-15.0-Update-Debug-Non-Oss | No | ---- | ---- +11 | repo-non-oss | openSUSE-Leap-15.0-Non-Oss | Yes | (r ) Yes | Yes +12 | repo-oss | openSUSE-Leap-15.0-Oss | Yes | (r ) Yes | Yes +13 | repo-source | openSUSE-Leap-15.0-Source | No | ---- | ---- +14 | repo-source-non-oss | openSUSE-Leap-15.0-Source-Non-Oss | No | ---- | ---- +15 | repo-update | openSUSE-Leap-15.0-Update | Yes | (r ) Yes | Yes +16 | repo-update-non-oss | openSUSE-Leap-15.0-Update-Non-Oss | Yes | (r ) Yes | Yes +``` + +Now, you want your "master" repository enabled. +In the above output, the "ElectricEel" repository is at the fourth line +and the "master" repository is at the fifth line. +Thus, enter the following: + +```bash +$ sudo zypper mr -d 4 && sudo zypper mr -e 5 +Repository 'isv_LinuxAutomotive_AGL_ElectricEel' has been successfully disabled. +Repository 'isv_LinuxAutomotive_AGL_Master' has been successfully enabled. +sudo zypper refresh +``` + +**NOTE:** In the previous command, the "-d" option is used for "disable" and the +"-e" option is used for "enable". + +Following are the results: + +```bash +# | Alias | Name | Enabled | GPG Check | Refresh +---+-------------------------------------+-------------------------------------------------------------------------------------------+---------+-----------+-------- + 1 | Atom | Atom Editor | Yes | (r ) Yes | No + 2 | code | Visual Studio Code | Yes | (r ) Yes | No + 3 | http-ftp.uni-erlangen.de-e3cebb6d | Packman Repository | Yes | (r ) Yes | Yes + 4 | isv_LinuxAutomotive_AGL_ElectricEel | isv:LinuxAutomotive:AGL_ElectricEel (openSUSE_Leap_15.0) | No | ---- | ---- + 5 | isv_LinuxAutomotive_AGL_Master | Automotive Grade Linux Application Development tools - master branch (openSUSE_Leap_15.0) | Yes | (r ) Yes | No + 6 | openSUSE-Leap-15.0-1 | openSUSE-Leap-15.0-1 | No | ---- | ---- + 7 | repo-debug | openSUSE-Leap-15.0-Debug | No | ---- | ---- + 8 | repo-debug-non-oss | openSUSE-Leap-15.0-Debug-Non-Oss | No | ---- | ---- + 9 | repo-debug-update | openSUSE-Leap-15.0-Update-Debug | No | ---- | ---- +10 | repo-debug-update-non-oss | openSUSE-Leap-15.0-Update-Debug-Non-Oss | No | ---- | ---- +11 | repo-non-oss | openSUSE-Leap-15.0-Non-Oss | Yes | (r ) Yes | Yes +12 | repo-oss | openSUSE-Leap-15.0-Oss | Yes | (r ) Yes | Yes +13 | repo-source | openSUSE-Leap-15.0-Source | No | ---- | ---- +14 | repo-source-non-oss | openSUSE-Leap-15.0-Source-Non-Oss | No | ---- | ---- +15 | repo-update | openSUSE-Leap-15.0-Update | Yes | (r ) Yes | Yes +16 | repo-update-non-oss | openSUSE-Leap-15.0-Update-Non-Oss | Yes | (r ) Yes | Yes +``` + +### Example for Fedora distro + +```bash +isv_LinuxAutomotive_AGL_FunkyFlounder isv:LinuxAutomotive:AGL disabled +isv_LinuxAutomotive_AGL_Master Automotive Grade Linux enabled +``` + +The following commands enable the "ElectricEel" repository: + +```bash +dnf config-manager --set-disabled isv_LinuxAutomotive_AGL_Master +dnf config-manager --set-enabled isv_LinuxAutomotive_AGL_FunkyFlounder +``` + +```bash +$ dnf repolist --all | grep AGL +isv_LinuxAutomotive_AGL_FunkyFlounder isv:LinuxAutomotive:AGL enabled +isv_LinuxAutomotive_AGL_Master Automotive Grade Linux disabled +``` diff --git a/agl-documentation/host-configuration/docs/2_AGL_Application_Framework.md b/agl-documentation/host-configuration/docs/2_AGL_Application_Framework.md new file mode 100644 index 0000000..31a6104 --- /dev/null +++ b/agl-documentation/host-configuration/docs/2_AGL_Application_Framework.md @@ -0,0 +1,43 @@ +# AGL Application Framework + +The binder provides a way to connect applications to the services that it +needs. + +It provides a fast way to securely offer APIs to applications written in any +language and running almost anywhere. + +## Install the AGL application framework + +Use the right command line according to your distro + +### **Debian** + +```bash +sudo apt-get install agl-app-framework-binder-dev +``` + +### **openSUSE** + +```bash +sudo zypper install agl-app-framework-binder-devel +``` + +### **Fedora** + +```bash +sudo dnf install agl-app-framework-binder-devel +``` + +To have environment variables set correctly to be able to use app-framework-binder just after the installation, you need to either logout/login or you can just manually source this file : + +```bash +source /etc/profile.d/agl-app-framework-binder.sh +``` + +Note that this file will be source automatically for every new session. + +## AGL application framework documentation + +You can find the AGL application framework documentation + [here](http://docs.automotivelinux.org/master/docs/apis_services/en/dev/reference/af-main/0-introduction.html +). diff --git a/agl-documentation/host-configuration/docs/3-installing-binder-daemon.md b/agl-documentation/host-configuration/docs/3-installing-binder-daemon.md new file mode 100755 index 0000000..19158eb --- /dev/null +++ b/agl-documentation/host-configuration/docs/3-installing-binder-daemon.md @@ -0,0 +1,80 @@ +# Installing the Binder Daemon + +The Application Framework Binder Daemon (`afb-daemon`), which is a part of +the AGL Application Framework, provides a way to connect applications to +required services.\ +It provides a fast way to securely offer APIs to applications that are +written in any language and that can run almost anywhere. + +You can learn more about the AGL Application Framework in the +"[AGL Framework Overview](../../apis_services/reference/af-main/0-introduction.html)" +section.\ +You can learn more about the `aft-daemon` in the +"[Binder Overview](../../apis_services/reference/af-binder/afb-overview.html)" +section. + +## Installing on Debian + +Use the following commands if your native Linux machine uses the Debian +distribution: + +```bash +sudo apt-get install agl-app-framework-binder-dev +``` + +## Installing on OpenSUSE + +Use the following commands if your native Linux machine uses the OpenSUSE +distribution: + +```bash +sudo zypper install agl-app-framework-binder-devel +``` + +## Installing on Fedora + +Use the following commands if your native Linux machine uses the Fedora +distribution: + +```bash +sudo dnf install agl-app-framework-binder-devel +``` + +## Setting Your Environment Variables + +Regardless of your system's distribution, you need to set certain environment +variables correctly in order to use the daemon (i.e. `app-framework-binder`). + +Commands that define and export these environment variables exist in the +`agl-app-framework-binder.sh` file, which is created when +you install the daemon: + +```bash +#---------- AGL %{name} options Start ---------" +# Object: AGL cmake option for binder/bindings +export LD_LIBRARY_PATH=/opt/AGL/lib64:${LD_LIBRARY_PATH} +export LIBRARY_PATH=/opt/AGL/lib64:${LIBRARY_PATH} +export PKG_CONFIG_PATH=/opt/AGL/lib64/pkgconfig:${PKG_CONFIG_PATH} +export PATH=/opt/AGL/bin:$PATH +#---------- AGL options End --------- +``` + +You can make sure these environment variables are correctly set by doing +one of the following: + +* **Logout and Log Back In:** + + Logging out and then logging back in correctly sets the environment + variables. + +* **Manually Source the `agl-app-framework-binder.sh` File:** + + Source the following command: + + ```bash + source /etc/profile.d/agl-app-framework-binder.sh + ``` + + **NOTE:** + Creating a new session automatically sources the `agl-app-framework-binder.sh` + file. diff --git a/agl-documentation/host-configuration/docs/3_Binding_Build_Example.md b/agl-documentation/host-configuration/docs/3_Binding_Build_Example.md new file mode 100644 index 0000000..6ac6d90 --- /dev/null +++ b/agl-documentation/host-configuration/docs/3_Binding_Build_Example.md @@ -0,0 +1,85 @@ +# Binding Build Example + +Now that you have installed the AGL Application Framework, you will be guided through the installation of the [helloworld-service](https://github.com/iotbzh/helloworld-service) binding. + +## Install git, cmake, gcc, g++ and json-c + +### Debian + +```bash +sudo apt-get install git cmake gcc g++ libjson-c-dev +``` + +### openSuse + +```bash +sudo zypper install git cmake gcc gcc-c++ libjson-c-devel +``` + +### Fedora + +```bash +sudo dnf install git cmake gcc gcc-c++ json-c-devel.x86_64 +``` + +## Clone the helloworld-service repository + +Sources of the [helloworld-service](https://github.com/iotbzh/helloworld-service) binding are available at IoT.BZH's GitHub. + +```bash +git clone "https://gerrit.automotivelinux.org/gerrit/apps/agl-service-helloworld" +cd agl-service-helloworld +``` + +## Built it + +```bash +./autobuild/linux/autobuild package +``` + +or manually + +```bash +mkdir build +cd build +cmake .. +make +``` + +## Run it + +Refer to the "Running" section of [this](http://docs.automotivelinux.org/master/docs/apis_services/en/dev/reference/af-binder/afb-binding-writing.html#sample-binding-tuto-1) page + +## Troubleshooting + +### systemd and/or libmicrohttpd + +If you encounter an error message like this one : + +```shell +-- Checking for module 'libmicrohttpd>=0.9.55' +-- No package 'libmicrohttpd' found +CMake Error at /usr/share/cmake/Modules/FindPkgConfig.cmake:415 (message): + A required package was not found +Call Stack (most recent call first): + /usr/share/cmake/Modules/FindPkgConfig.cmake:593 (_pkg_check_modules_internal) + conf.d/app-templates/cmake/cmake.d/01-build_options.cmake:92 (PKG_CHECK_MODULES) + conf.d/app-templates/cmake/common.cmake:77 (include) + conf.d/cmake/config.cmake:184 (include) + CMakeLists.txt:3 (include) +``` + +Open the config.cmake file located in helloworld-service/conf.d/cmake/ +and add a # to the beginning of the "libsystemd>=222" and "libmicrohttpd>=0.9.55". +The end result should look something like this + +```CMake + set (PKG_REQUIRED_LIST + json-c + #libsystemd>=222 + afb-daemon + #libmicrohttpd>=0.9.55 + ) +``` + +Once this is done return to the "Build it!" section of this page. diff --git a/agl-documentation/host-configuration/docs/4-getting-source-files.md b/agl-documentation/host-configuration/docs/4-getting-source-files.md new file mode 100755 index 0000000..5a7563c --- /dev/null +++ b/agl-documentation/host-configuration/docs/4-getting-source-files.md @@ -0,0 +1,65 @@ +# Getting Your Source Files + +Now that you have your host ready, packages installed, and the binder +daemon ready, you can get your source files together. +This example uses the `helloworld-service` binding, which is +a project hosted on GitHub, is written in the C programming language, +depends on the `libjson-c` library, and uses `cmake` for building. + +## Install Programs and Libraries You Need for this Example + +For this example, you need to have the following installed on your host: + +```bash +git +cmake +pkg-config +gcc +g++ +json-c +``` + +**NOTE:** If you are building a different binding, you need to make sure +you have all the programs and libraries needed to build that particular +binding. + +### Installing on Debian + +Use the following commands if your native Linux machine uses the Debian +distribution: + +```bash +sudo apt-get install git cmake pkg-config gcc g++ libjson-c-dev +``` + +### Installing on OpenSUSE + +Use the following commands if your native Linux machine uses the OpenSUSE +distribution: + +```bash +sudo zypper install git cmake pkg-config gcc gcc-c++ libjson-c-devel +``` + +### Installing on Fedora + +Use the following commands if your native Linux machine uses the Fedora +distribution: + +```bash +sudo dnf install git cmake pkg-config gcc gcc-c++ json-c-devel.x86_64 +``` + +## Cloning the helloworld-service repository + +Use Git to create a local repository of the +[helloworld-service](https://github.com/iotbzh/helloworld-service) binding from +[IoT.BZH](https://iot.bzh/en/). +The following command creates a repository named `helloworld-service` in the +current directory. +The "--recurse-submodules" option ensures that all submodules (i.e. repositories +within `helloworld-service`) are initialized and cloned as well. + +```bash +git clone https://github.com/iotbzh/helloworld-service.git --recurse-submodules +``` diff --git a/agl-documentation/host-configuration/docs/4_AGL_XDS.md b/agl-documentation/host-configuration/docs/4_AGL_XDS.md new file mode 100644 index 0000000..5f06c19 --- /dev/null +++ b/agl-documentation/host-configuration/docs/4_AGL_XDS.md @@ -0,0 +1,31 @@ +# AGL XDS + +AGL X(cross) Development System (XDS) provides a multi-platform cross +development tool with near-zero installation. + +* xds-agent: a client/agent that should run on your local / user development machine when you use XDS. +* xds-cli: a command line tool used to control / interface X(cross) Development System, it can be used in addition to XDS DASHBOARD. +* xds-gdb: a wrapper on gdb debugger for X(cross) Development System. + +## AGL XDS for debian + +```bash +sudo apt-get install agl-xds-agent agl-xds-cli agl-xds-gdb +``` + +## AGL XDS for openSUSE + +```bash +sudo zypper install agl-xds-agent agl-xds-cli agl-xds-gdb +``` + +## AGL XDS for fedora + +```bash +sudo dnf install agl-xds-agent agl-xds-cli agl-xds-gdb +``` + +## AGL XDS Documentation + +You can find the XDS documentation + [here](http://docs.automotivelinux.org/master/docs/devguides/en/dev/reference/xds/part-1/0_Abstract.html). diff --git a/agl-documentation/host-configuration/docs/5-building-and-running-service-natively.md b/agl-documentation/host-configuration/docs/5-building-and-running-service-natively.md new file mode 100755 index 0000000..3bde906 --- /dev/null +++ b/agl-documentation/host-configuration/docs/5-building-and-running-service-natively.md @@ -0,0 +1,110 @@ +# Building and Running Your Service Natively + +The next step in the binder development process is to build your +binder and run it using your native Linux system. + +**NOTE:** This section assumes using the `helloworld-service` example +and completion of the previous steps in this +"[Building Microservices Natively](./0-build-microservice-overview.html)" +section. + +## Building the Service + +Move to the cloned `helloworld-service` repository and build the service +using either of the following methods: + +* ```bash + cd helloworld-service + ./conf.d/autobuild/linux/autobuild package + ``` + +* ```bash + cd helloworld-service + mkdir build + cd build + cmake .. + make + ``` + +## Running the Service + +You use the Application Framework Binder Daemon (`afb-daemon`) to +bind one instance of an application or service to the rest of the system. +In this example, you are binding an instance of `helloworld-service` +to the rest of the system: + +```bash +afb-daemon --binding helloworld.so --port 3333 --token '' +``` + +The previous command starts `afb-daemon` and loads the `helloworld.so` +binding. +The daemon is now listening on port 3333 of the `localhost`. + +## Testing the Service + +Refer to the +[AGL Test Framework](../../apis_services/#agl-test-framework) topic in the +"APIs & Services" topic. +You can test your `helloworld-service` binding using the `afm-test` tool. + +Examine the generic example describing how to launch the tests suite +[here](../../apis_services/reference/afb-test/3_Launch_the_tests.html). +This example can help you understand how to test your helloworld binding +instance. + +## Using Optional Tools + +Once you have built and run your micro-service successfully using your +native Linux system, you should consider using some additional +development tools: X(Cross) Development System (XDS) and +the Controller Area Network (CAN) Development Studio (CANdevStudio). + +* **XDS:** Cross-compiles and ports your AGL image to your target hardware. +For information on XDS, see the +"[X(cross) Development System: User's Guide](../reference/xds/part-1/xds-overview.html)" +section. + +* **CANdevStudio:** Simulates CAN signals such as ignition status, +doors status, or reverse gear by every automotive developer. +For information on CANdevStudio, see the +"[CANdevStudio Quickstart](../../apis_services/reference/candevstudio/1_Usage.html)" +section. + +## Troubleshooting + +### systemd and/or libmicrohttpd + +If you encounter an error message similar to the following, +you need to make some changes to your `cmake` file: + +```shell +-- Checking for module 'libmicrohttpd>=0.9.60' +-- No package 'libmicrohttpd' found +CMake Error at /usr/share/cmake/Modules/FindPkgConfig.cmake:415 (message): + A required package was not found +Call Stack (most recent call first): + /usr/share/cmake/Modules/FindPkgConfig.cmake:593 (_pkg_check_modules_internal) + conf.d/app-templates/cmake/cmake.d/01-build_options.cmake:92 (PKG_CHECK_MODULES) + conf.d/app-templates/cmake/common.cmake:77 (include) + conf.d/cmake/config.cmake:184 (include) + CMakeLists.txt:3 (include) +``` + +Open the `config.cmake` file located in `helloworld-service/conf.d/cmake/` directory +and add a hash character (i.e. #) to the beginning of the "libsystemd>=222" +and "libmicrohttpd>=0.9.60" strings. +Following is an example of the edits: + +```CMake + set (PKG_REQUIRED_LIST + json-c + #libsystemd>=222 + afb-daemon + #libmicrohttpd>=0.9.60 + ) +``` + +After making these changes, rebuild the service again as described in the +"[Building the Service](./4-getting-source-files.html#building-the-service)" +section previously on this page. diff --git a/agl-documentation/host-configuration/docs/5_Candevstudio.md b/agl-documentation/host-configuration/docs/5_Candevstudio.md new file mode 100644 index 0000000..6118315 --- /dev/null +++ b/agl-documentation/host-configuration/docs/5_Candevstudio.md @@ -0,0 +1,35 @@ +# CANdevStudio + +CANdevStudio is a CAN bus simulation software.\ +It can work with variety of CAN hardware interfaces (e.g.): + +* Microchip +* Vector +* PEAK-Systems +* even without it (vcan and cannelloni) + +CANdevStudio enables to simulate CAN signals such as +ignition status, doors status or reverse gear by every automotive developer. + +## CANdevStudio for debian + +```bash +sudo apt-get install CANdevStudio +``` + +## CANdevStudio for openSUSE + +```bash +sudo zypper install CANdevStudio +``` + +## CANdevStudio for fedora + +```bash +sudo dnf install CANdevStudio +``` + +## CANdevStudio Quickstart + +The CANdevStudio Quickstart can be found +[here](http://docs.automotivelinux.org/master/docs/apis_services/en/dev/reference/candevstudio/docs/1_Usage.html). diff --git a/agl-documentation/host-configuration/docs/README.md b/agl-documentation/host-configuration/docs/README.md new file mode 100644 index 0000000..b1c50df --- /dev/null +++ b/agl-documentation/host-configuration/docs/README.md @@ -0,0 +1,20 @@ +# Introduction + +AGL Automotive Grade Linux Automotive Grade Linux is a collaborative open +source project that is bringing together automakers, suppliers and technology +companies to accelerate the development and adoption of a fully open software +stack for the connected car. + +![Automotive grade linux screenshot](pictures/Automotive_grade_linux.png) + +| *Meta* | *Data* | +| -- | -- | +| **Title** | {{ config.title }} | +| **Author** | {{ config.author }} | +| **Description** | {{ config.description }} | +| **Keywords** | {{ config.keywords }} | +| **Language** | English | +| **Published** | Published {{ config.published }} as an electronic book | +| **Updated** | {{ gitbook.time }} | +| **Collection** | Open-source | +| **Website** | [{{ config.website }}]({{ config.website }}) | diff --git a/agl-documentation/host-configuration/docs/SUMMARY.md b/agl-documentation/host-configuration/docs/SUMMARY.md new file mode 100644 index 0000000..1d164c0 --- /dev/null +++ b/agl-documentation/host-configuration/docs/SUMMARY.md @@ -0,0 +1,10 @@ +# Summary + +* [Document revisions](0-Doc-Revisions.md) + +* [Abstract](0_Abstract.md) +* [Prerequisites](1_Prerequisites.md) +* [AGL Application Framework Installation](2_AGL_Application_Framework.md) +* [Binding Build Example](3_Binding_Build_Example.md) +* [AGL XDS Installation.md](4_AGL_XDS.md) +* [CanDevStudio Installation](5_Candevstudio.md) diff --git a/agl-documentation/host-configuration/docs/devguides-book.yml b/agl-documentation/host-configuration/docs/devguides-book.yml new file mode 100644 index 0000000..3eacca6 --- /dev/null +++ b/agl-documentation/host-configuration/docs/devguides-book.yml @@ -0,0 +1,22 @@ +type: books +books: +- + id: host-configuration + title: Building Microservices Natively + description: Host Configuration documentation + keywords: + author: "IotBzh" + version: master + chapters: + - url: 0-build-microservice-overview.md + name: Overview + - url: 1-verify-build-host.md + name: Verify Your Build Host + - url: 2-download-packages.md + name: Download Packages + - url: 3-installing-binder-daemon.md + name: Installing the Binder Daemon + - url: 4-getting-source-files.md + name: Getting Your Source Files + - url: 5-building-and-running-service-natively.md + name: Building and Running Your Service Natively diff --git a/agl-documentation/host-configuration/docs/pictures/Automotive_grade_linux.png b/agl-documentation/host-configuration/docs/pictures/Automotive_grade_linux.png Binary files differnew file mode 100644 index 0000000..46291dd --- /dev/null +++ b/agl-documentation/host-configuration/docs/pictures/Automotive_grade_linux.png diff --git a/agl-documentation/host-configuration/docs/pictures/CANdevStudio.png b/agl-documentation/host-configuration/docs/pictures/CANdevStudio.png Binary files differnew file mode 100644 index 0000000..c944e02 --- /dev/null +++ b/agl-documentation/host-configuration/docs/pictures/CANdevStudio.png diff --git a/agl-documentation/host-configuration/docs/pictures/HVAC.jpg b/agl-documentation/host-configuration/docs/pictures/HVAC.jpg Binary files differnew file mode 100644 index 0000000..79175fb --- /dev/null +++ b/agl-documentation/host-configuration/docs/pictures/HVAC.jpg diff --git a/agl-documentation/host-configuration/docs/pictures/Xds-screenshots.jpg b/agl-documentation/host-configuration/docs/pictures/Xds-screenshots.jpg Binary files differnew file mode 100644 index 0000000..1901f4c --- /dev/null +++ b/agl-documentation/host-configuration/docs/pictures/Xds-screenshots.jpg diff --git a/agl-documentation/host-configuration/docs/pictures/microservice-workflow-native.png b/agl-documentation/host-configuration/docs/pictures/microservice-workflow-native.png Binary files differnew file mode 100755 index 0000000..1c38d2a --- /dev/null +++ b/agl-documentation/host-configuration/docs/pictures/microservice-workflow-native.png diff --git a/agl-documentation/host-configuration/docs/resources/iotbzh_logo.png b/agl-documentation/host-configuration/docs/resources/iotbzh_logo.png Binary files differnew file mode 100644 index 0000000..ae6bc48 --- /dev/null +++ b/agl-documentation/host-configuration/docs/resources/iotbzh_logo.png diff --git a/agl-documentation/host-configuration/docs/resources/iotbzh_logo_small.png b/agl-documentation/host-configuration/docs/resources/iotbzh_logo_small.png Binary files differnew file mode 100644 index 0000000..6a98c60 --- /dev/null +++ b/agl-documentation/host-configuration/docs/resources/iotbzh_logo_small.png diff --git a/agl-documentation/host-configuration/mkdocs.yml b/agl-documentation/host-configuration/mkdocs.yml new file mode 100644 index 0000000..ca03607 --- /dev/null +++ b/agl-documentation/host-configuration/mkdocs.yml @@ -0,0 +1,11 @@ +site_name: AGL Application Framework Binder +theme: readthedocs +docs_dir: docs +pages: +- 'Document revisions' : '0-Doc-Revisions.md' +- '0. Abstract': '0_Abstract.md' +- '1. Prequisites': '1_Prerequisites.md' +- '2. AGL Application Framework Installation': '2_AGL_Application_Framework.md' +- '3. Binding Build Example': '3_Binding_Build_Example.md' +- '4. AGL XDS Installation.md': '4_AGL_XDS.md' +- '5. CanDevStudio Installation': '5_Candevstudio.md' |