-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #99 from com-pas/develop
New release
- Loading branch information
Showing
14 changed files
with
767 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,18 @@ | ||
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.8.1/apache-maven-3.8.1-bin.zip | ||
wrapperUrl=https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar | ||
# Licensed to the Apache Software Foundation (ASF) under one | ||
# or more contributor license agreements. See the NOTICE file | ||
# distributed with this work for additional information | ||
# regarding copyright ownership. The ASF licenses this file | ||
# to you under the Apache License, Version 2.0 (the | ||
# "License"); you may not use this file except in compliance | ||
# with the License. You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, | ||
# software distributed under the License is distributed on an | ||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
# KIND, either express or implied. See the License for the | ||
# specific language governing permissions and limitations | ||
# under the License. | ||
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.8.4/apache-maven-3.8.4-bin.zip | ||
wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.1.0/maven-wrapper-3.1.0.jar |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,29 @@ SPDX-FileCopyrightText: 2022 Alliander N.V. | |
SPDX-License-Identifier: Apache-2.0 | ||
--> | ||
|
||
# Development | ||
# Development for CoMPAS SCL Validator | ||
|
||
|
||
--- | ||
**Note** | ||
Mac M1 chip users, see [below](#mac-m1) | ||
|
||
--- | ||
|
||
|
||
Since version 1.2.x the JAR Files of RiseClipse are distributed through Maven Central Repository. The JAR Files can be | ||
retrieved from there and don't need to be build locally anymore. Only the OCL Files for the SCL validation still need to | ||
be downloaded from RiseClipse GIT Repository. This is still done using Git Submodules. | ||
|
||
To clone the project or update the project this means that the Git commands are sometimes a little different. To clone | ||
the project use the following command `git clone --recurse-submodules [email protected]:com-pas/compas-scl-validator.git`. | ||
This will also clone the submodules. | ||
|
||
Tip: The URL to the submodules are configured in the file `.gitmodules`, but these are using the SSH URL. There is a way | ||
described [here](https://git-scm.com/book/en/v2/Git-Tools-Submodules) to overwrite the URL locally with an HTTPS URL of | ||
the GIT Repository. | ||
|
||
Check the [Development](DEVELOPMENT.md) page for more detail information how to develop in this GIT repository. | ||
|
||
## Git | ||
|
||
|
@@ -56,6 +78,22 @@ maven module is created here, see [README.md](riseclipse/riseclipse-p2-to-m2/REA | |
Example about how to use Eclipse OCL was found | ||
[here](https://help.eclipse.org/latest/index.jsp?topic=%2Forg.eclipse.ocl.doc%2Fhelp%2FPivotStandalone.html). | ||
|
||
## Building the application | ||
|
||
You can use Maven to build the application and see if all tests are working using: | ||
|
||
```shell script | ||
./mvnw clean verify | ||
``` | ||
|
||
This should normally be enough to also run the application, but there were cases that we need to build using: | ||
|
||
```shell script | ||
./mvnw clean install | ||
``` | ||
|
||
This to make the local modules available for the app module to run the application. | ||
|
||
## Running the application in dev mode | ||
|
||
You can run your application in dev mode that enables live coding using: | ||
|
@@ -66,22 +104,77 @@ You can run your application in dev mode that enables live coding using: | |
|
||
> **_NOTE:_** Quarkus now ships with a Dev UI, which is available in dev mode only at http://localhost:8080/q/dev/. | ||
## Packaging and running the application | ||
### Application depends on a running KeyCloak instance for dev mode | ||
|
||
The application can be packaged using: | ||
There is a KeyCloak instance need to be running on port 8089 by default in dev mode. | ||
See [Security](README.md#security) for default values, if custom keycloak is used. | ||
|
||
```shell script | ||
./mvnw package | ||
There is a preconfigured keycloak instance available in | ||
the [CoMPAS Deployment Repository](https://github.com/com-pas/compas-deployment). This repository can be cloned and | ||
when going to this directory the following command can be executed to create a local Docker Image with configuration. | ||
|
||
```shell | ||
cd <CoMPAS Deployment Repository Directory>/compas/keycloak | ||
docker build -t compas_keycloak . | ||
``` | ||
|
||
It produces the `quarkus-run.jar` file in the `app/target/quarkus-app/` directory. Be aware that it’s not an _über-jar_ | ||
as the dependencies are copied into the `app/target/quarkus-app/lib/` directory. | ||
There is now a Docker Image `compas_keycloak` created that can be started using the following command | ||
|
||
```shell | ||
docker run --rm --name compas_keycloak \ | ||
-p 8089:8080 | ||
-d compas_keycloak:latest | ||
``` | ||
|
||
## Testing the application | ||
|
||
The application is tested with unit and integration tests, but you can also manually test the application using for | ||
instance Postman. And there is also a way to test this service with the CoMPAS OpenSCD Frontend application. | ||
|
||
### Postman | ||
|
||
To manually test the application there is a Postman collection in the directory `postman` that can be imported | ||
and used to execute REST XML Calls. | ||
|
||
To make the call work we also need to import an environment and authorisation collection. These files can be found | ||
in [CoMPAS Deployment Repository](https://github.com/com-pas/compas-deployment) in the directory `postman` | ||
(`auth.collection.json` and `local.environment.json`). | ||
|
||
In the authorisation collection there are called for the 3 users known within the Demo KeyCloak instance. | ||
If one of these calls are executed there is a variable `bearer` filled. | ||
|
||
Now one of the SCL Auto Alignment calls can be executed, the variable `bearer` is added to the header of the request. | ||
After the call is executed the result should be shown in Postman. | ||
|
||
If you want to build an _über-jar_, execute the following command: | ||
### CoMPAS OpenSCD Frontend application | ||
|
||
To test the SCL Validator with the CoMPAS OpenSCD application just run the application in dev mode, including the | ||
KeyCloak instance. For further instruction how to start the CoMPAS OpenSCD application and use this locally see | ||
the file `DEVELOPMENT.md` in [CoMPAS OpenSCD application](https://github.com/com-pas/compas-open-scd). | ||
|
||
## Docker Images | ||
|
||
### Creating a Docker image with native executable | ||
|
||
The CoMPAS SCL Validator currently isn't build as Native executable, GraalVM has a lot of problems to strip the | ||
Eclipse libraries and make them work as Native executable. | ||
|
||
### Creating a Docker image with JVM executable | ||
|
||
The release action is creating a Docker Image which runs the application using a JVM. You can create a Docker Image | ||
with JVM executable using: | ||
|
||
```shell script | ||
./mvnw package -Dquarkus.package.type=uber-jar | ||
./mvnw package -Pjvm-image | ||
``` | ||
|
||
The application is now runnable using `java -jar app/target/quarkus-app/quarkus-run.jar`. | ||
## Mac M1 | ||
|
||
The Mac M1 chip is ARM based. In order to make this project work, you need to install the x86 version of your IDE. | ||
You also need Rosetta2 to virtualize your os. In the x86 version of your IDE, you also need to install the x86 Java version. | ||
You can use SDK-Man to easily switch between java versions. | ||
|
||
While calling maven scripts, you need to add the os.arch flag. | ||
```shell script | ||
./mvnw clean compile -Dos.arch=x86_64 | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,7 +10,7 @@ SPDX-License-Identifier: Apache-2.0 | |
[![CII Best Practices](https://bestpractices.coreinfrastructure.org/projects/5925/badge)](https://bestpractices.coreinfrastructure.org/projects/5925) | ||
[![Slack](https://raw.githubusercontent.com/com-pas/compas-architecture/master/public/LFEnergy-slack.svg)](http://lfenergy.slack.com/) | ||
|
||
# compas-scl-validator | ||
# CoMPAS SCL Validator | ||
|
||
Service to validate SCL Files. | ||
|
||
|
@@ -28,19 +28,7 @@ automatically determine the URL to be used. | |
|
||
## Development | ||
|
||
Since version 1.2.x the JAR Files of RiseClipse are distributed through Maven Central Repository. The JAR Files can be | ||
retrieved from there and don't need to be build locally anymore. Only the OCL Files for the SCL validation still need to | ||
be downloaded from RiseClipse GIT Repository. This is still done using Git Submodules. | ||
|
||
To clone the project or update the project this means that the Git commands are sometimes a little different. To clone | ||
the project use the following command `git clone --recurse-submodules [email protected]:com-pas/compas-scl-validator.git`. | ||
This will also clone the submodules. | ||
|
||
Tip: The URL to the submodules are configured in the file `.gitmodules`, but these are using the SSH URL. There is a way | ||
described [here](https://git-scm.com/book/en/v2/Git-Tools-Submodules) to overwrite the URL locally with an HTTPS URL of | ||
the GIT Repository. | ||
|
||
Check the [Development](DEVELOPMENT.md) page for more detail information how to develop in this GIT repository. | ||
Information about how to run and develop for this project check [Development](DEVELOPMENT.md). | ||
|
||
## Custom OCL Files | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.