Skip to main content

Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

Difference between revisions of "BaSyx / Download / Components Setup"

m (Adds reference to releases & makes postgres installation more clear)
 
(12 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 +
=How to install BaSyx Components=
  
= How to run the BaSyx Components=
+
<span style="color:red">!! Building BaSyx Java is only necessary if you would like to access the currently being developed features. All releases are available on [https://search.maven.org/search?q=org.eclipse.basyx Maven Central] or [https://hub.docker.com/search?q=eclipsebasyx DockerHub] and thus don't need to be build locally !!</span>
The Components package requires an SQL backend to be able to run the DirectorySQLProvider. This backend can for example be provided by [https://www.postgresql.org/ postgreSQL].
+
 
 +
 
 +
The complete installation process of the SDK and components is documented in a 15 minutes video: [https://www.youtube.com/results?search_query=basyx YouTube]
 +
The code of the components can be found on [https://github.com/eclipse-basyx/basyx-java-components GitHub].
 +
 
 +
 
 +
The components package depends on [[BaSyx_/_Download_/_Java_Setup#Starting_development | basyx.sdk]] and is a hierarchical maven project that consists of multiple infrastructure components. Each of them is separated in its own maven project. Therefore each component can be built independently and can have its own dependencies.
 +
 
 +
In order to install all components to the local maven repository, '''mvn install''' can be used like with installing the [[BaSyx_/_Download_/_Java_Setup#Project_installation | basyx.sdk]]. As maven executes all tests before installing the build artifacts into the local repository, you need to make sure all the component's requirements are met beforehand. See the next subsections for the SQL and MongoDB backends. Alternatively, it is possible to directly build the artifacts without these requirements by skipping the maven test phase with '''mvn install -DskipTests'''.
 +
 
 +
Additionally, all of the off-the-shelf components can be used in a Docker environment. All maven projects can also build their correspondent [[BaSyx_/_Documentation_/_Components_/_Docker#Predefined_Docker_Images | docker images]].
 +
 
 +
==SQL components==
 +
All SQL components additionally require an SQL backend. This backend can for example be provided by [https://www.postgresql.org/ postgreSQL].
  
 
During installation of the SQL backend, choose the following credentials:
 
During installation of the SQL backend, choose the following credentials:
Line 8: Line 22:
  
 
'''password''': admin
 
'''password''': admin
 +
 +
Note: In order to change these default connection settings for the postgreSQL database, the connection data has to be updated in the properties files for the SQL tests
 +
in the components project.
  
 
To setup the database for the test cases, open up a console and use the following commands:
 
To setup the database for the test cases, open up a console and use the following commands:
Line 17: Line 34:
 
Create configuration directory:
 
Create configuration directory:
  
initdb -D "<installation-path>" -U <username>
+
initdb -D "<db-path>" -U <username>
  
Where <installation-path> is a path to a directory you have the right to write to, and <username> would be "postgres". Now you start the database with
+
Where <db-path> is a path to a directory you have the right to write to, and <username> would be "postgres". Now you start the database with
  
pg_ctl -D "<installation-path>" start
+
pg_ctl -D "<db-path>" start
 
+
and connect your command line interface to the running instance with
+
 
+
psql -U <username>
+
  
 
|-
 
|-
 
|}
 
|}
  
With the following SQL commands you can now create and fill the database as follows:
+
Save the following commands to an arbitrary text file (named <your-file> in the following). Next, import the database through psql -U postgres -f "<your-file>".
  
 
{| class="wikitable" style="text-align: left;"
 
{| class="wikitable" style="text-align: left;"
Line 36: Line 49:
 
|
 
|
 
CREATE DATABASE "basyx-map";
 
CREATE DATABASE "basyx-map";
 
\c basyx-map
 
 
CREATE SCHEMA elements;
 
  
 
CREATE DATABASE "basyx-directory";
 
CREATE DATABASE "basyx-directory";
  
\c basyx-directory
+
|-
 +
|}
  
CREATE SCHEMA directory;
+
Finally, you can install the basyx.components project using maven. See the instructions for the [[BaSyx_/_Download_/_Java_Setup#Starting_development | Java SDK]] on how to do that.
  
CREATE TABLE directory.directory ( "ElementRef" varchar(999999), "ElementID" varchar(999999) primary key );
 
  
INSERT INTO directory.directory ( "ElementID", "ElementRef" ) VALUES (
+
==MongoDB components==
'urn:de.FHG:es.iese:aas:0.98:5:lab/microscope#A-19', 'content.aas1' );
+
Similarly, the components based on MongoDB need the MongoDB when executed locally. This can for example be provided by the Community version of the MongoDB [https://www.mongodb.com/try/download/community MongoDB].
 
+
INSERT INTO directory.directory ( "ElementID", "ElementRef" ) VALUES (
+
'urn:de.FHG:es.iese:aas:0.98:5:lab/microscope#A-18', 'content.aas2' );
+
 
+
INSERT INTO directory.directory ( "ElementID", "ElementRef" ) VALUES ( 'urn:de.FHG:es.iese:aas:0.98:5:lab/microscope#A-17', 'content.aas3' );
+
 
+
INSERT INTO directory.directory ( "ElementID", "ElementRef" ) VALUES ( 'urn:de.FHG:es.iese:aas:0.98:5:lab/microscope#A-16', 'content.aas4' );
+
 
+
INSERT INTO directory.directory ( "ElementID", "ElementRef" ) VALUES ( 'urn:de.FHG:es.iese:aas:0.98:5:lab/microscope#A-15', 'content.aas5' );
+
 
+
|-
+
|}
+

Latest revision as of 06:56, 17 January 2023

How to install BaSyx Components

!! Building BaSyx Java is only necessary if you would like to access the currently being developed features. All releases are available on Maven Central or DockerHub and thus don't need to be build locally !!


The complete installation process of the SDK and components is documented in a 15 minutes video: YouTube The code of the components can be found on GitHub.


The components package depends on basyx.sdk and is a hierarchical maven project that consists of multiple infrastructure components. Each of them is separated in its own maven project. Therefore each component can be built independently and can have its own dependencies.

In order to install all components to the local maven repository, mvn install can be used like with installing the basyx.sdk. As maven executes all tests before installing the build artifacts into the local repository, you need to make sure all the component's requirements are met beforehand. See the next subsections for the SQL and MongoDB backends. Alternatively, it is possible to directly build the artifacts without these requirements by skipping the maven test phase with mvn install -DskipTests.

Additionally, all of the off-the-shelf components can be used in a Docker environment. All maven projects can also build their correspondent docker images.

SQL components

All SQL components additionally require an SQL backend. This backend can for example be provided by postgreSQL.

During installation of the SQL backend, choose the following credentials:

user: postgres

password: admin

Note: In order to change these default connection settings for the postgreSQL database, the connection data has to be updated in the properties files for the SQL tests in the components project.

To setup the database for the test cases, open up a console and use the following commands:

Create configuration directory:

initdb -D "<db-path>" -U <username>

Where <db-path> is a path to a directory you have the right to write to, and <username> would be "postgres". Now you start the database with

pg_ctl -D "<db-path>" start

Save the following commands to an arbitrary text file (named <your-file> in the following). Next, import the database through psql -U postgres -f "<your-file>".

CREATE DATABASE "basyx-map";

CREATE DATABASE "basyx-directory";

Finally, you can install the basyx.components project using maven. See the instructions for the Java SDK on how to do that.


MongoDB components

Similarly, the components based on MongoDB need the MongoDB when executed locally. This can for example be provided by the Community version of the MongoDB MongoDB.

Back to the top