Skip to content

Commit f15abbb

Browse files
author
Dennis Labordus
authored
Merge pull request #99 from com-pas/develop
New release
2 parents 0251a9c + c972808 commit f15abbb

File tree

14 files changed

+767
-48
lines changed

14 files changed

+767
-48
lines changed

.github/workflows/build-project.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
build:
1818
name: Build
1919
runs-on: ubuntu-latest
20-
timeout-minutes: 15
20+
timeout-minutes: 30
2121

2222
steps:
2323
- name: Checkout
@@ -39,11 +39,11 @@ jobs:
3939
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
4040
restore-keys: ${{ runner.os }}-m2
4141

42-
- name: Set up JDK 1.11
42+
- name: Set up JDK 17
4343
uses: actions/setup-java@v3
4444
with:
4545
distribution: 'zulu'
46-
java-version: '11'
46+
java-version: '17'
4747

4848
- name: Create custom Maven Settings.xml
4949
uses: whelk-io/maven-settings-xml-action@v20

.github/workflows/release-project.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ jobs:
1212
push_to_registry:
1313
name: Build and publish
1414
runs-on: ubuntu-latest
15+
timeout-minutes: 30
1516

1617
steps:
1718
- name: Checkout
@@ -43,11 +44,11 @@ jobs:
4344
shell: bash
4445
# Extra the tagname form the git reference, value of GITHUB_REF will be something like refs/tags/<tag_name>.
4546
run: echo "##[set-output name=tagname;]$(echo ${GITHUB_REF##*/})"
46-
- name: Set up JDK 1.11
47+
- name: Set up JDK 17
4748
uses: actions/setup-java@v3
4849
with:
4950
distribution: 'zulu'
50-
java-version: '11'
51+
java-version: '17'
5152

5253
- name: Create custom Maven Settings.xml
5354
uses: whelk-io/maven-settings-xml-action@v20

.github/workflows/sonarcloud-analysis.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
build:
2222
name: SonarCloud
2323
runs-on: ubuntu-latest
24-
timeout-minutes: 15
24+
timeout-minutes: 30
2525

2626
if: ${{ (github.event_name != 'pull_request_target' && github.actor != 'dependabot[bot]') || (github.actor == 'dependabot[bot]' && github.event_name == 'pull_request_target') }}
2727
steps:
@@ -31,11 +31,11 @@ jobs:
3131
fetch-depth: 0
3232
submodules: 'true'
3333

34-
- name: Set up JDK 1.11
34+
- name: Set up JDK 17
3535
uses: actions/setup-java@v3
3636
with:
3737
distribution: 'zulu'
38-
java-version: '11'
38+
java-version: '17'
3939
- name: Cache SonarCloud packages
4040
uses: actions/cache@v3
4141
with:
Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,18 @@
1-
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.8.1/apache-maven-3.8.1-bin.zip
2-
wrapperUrl=https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar
1+
# Licensed to the Apache Software Foundation (ASF) under one
2+
# or more contributor license agreements. See the NOTICE file
3+
# distributed with this work for additional information
4+
# regarding copyright ownership. The ASF licenses this file
5+
# to you under the Apache License, Version 2.0 (the
6+
# "License"); you may not use this file except in compliance
7+
# with the License. You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing,
12+
# software distributed under the License is distributed on an
13+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
# KIND, either express or implied. See the License for the
15+
# specific language governing permissions and limitations
16+
# under the License.
17+
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.8.4/apache-maven-3.8.4-bin.zip
18+
wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.1.0/maven-wrapper-3.1.0.jar

DEVELOPMENT.md

Lines changed: 103 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,29 @@ SPDX-FileCopyrightText: 2022 Alliander N.V.
44
SPDX-License-Identifier: Apache-2.0
55
-->
66

7-
# Development
7+
# Development for CoMPAS SCL Validator
8+
9+
10+
---
11+
**Note**
12+
Mac M1 chip users, see [below](#mac-m1)
13+
14+
---
15+
16+
17+
Since version 1.2.x the JAR Files of RiseClipse are distributed through Maven Central Repository. The JAR Files can be
18+
retrieved from there and don't need to be build locally anymore. Only the OCL Files for the SCL validation still need to
19+
be downloaded from RiseClipse GIT Repository. This is still done using Git Submodules.
20+
21+
To clone the project or update the project this means that the Git commands are sometimes a little different. To clone
22+
the project use the following command `git clone --recurse-submodules [email protected]:com-pas/compas-scl-validator.git`.
23+
This will also clone the submodules.
24+
25+
Tip: The URL to the submodules are configured in the file `.gitmodules`, but these are using the SSH URL. There is a way
26+
described [here](https://git-scm.com/book/en/v2/Git-Tools-Submodules) to overwrite the URL locally with an HTTPS URL of
27+
the GIT Repository.
28+
29+
Check the [Development](DEVELOPMENT.md) page for more detail information how to develop in this GIT repository.
830

931
## Git
1032

@@ -56,6 +78,22 @@ maven module is created here, see [README.md](riseclipse/riseclipse-p2-to-m2/REA
5678
Example about how to use Eclipse OCL was found
5779
[here](https://help.eclipse.org/latest/index.jsp?topic=%2Forg.eclipse.ocl.doc%2Fhelp%2FPivotStandalone.html).
5880

81+
## Building the application
82+
83+
You can use Maven to build the application and see if all tests are working using:
84+
85+
```shell script
86+
./mvnw clean verify
87+
```
88+
89+
This should normally be enough to also run the application, but there were cases that we need to build using:
90+
91+
```shell script
92+
./mvnw clean install
93+
```
94+
95+
This to make the local modules available for the app module to run the application.
96+
5997
## Running the application in dev mode
6098

6199
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:
66104

67105
> **_NOTE:_** Quarkus now ships with a Dev UI, which is available in dev mode only at http://localhost:8080/q/dev/.
68106
69-
## Packaging and running the application
107+
### Application depends on a running KeyCloak instance for dev mode
70108

71-
The application can be packaged using:
109+
There is a KeyCloak instance need to be running on port 8089 by default in dev mode.
110+
See [Security](README.md#security) for default values, if custom keycloak is used.
72111

73-
```shell script
74-
./mvnw package
112+
There is a preconfigured keycloak instance available in
113+
the [CoMPAS Deployment Repository](https://github.com/com-pas/compas-deployment). This repository can be cloned and
114+
when going to this directory the following command can be executed to create a local Docker Image with configuration.
115+
116+
```shell
117+
cd <CoMPAS Deployment Repository Directory>/compas/keycloak
118+
docker build -t compas_keycloak .
75119
```
76120

77-
It produces the `quarkus-run.jar` file in the `app/target/quarkus-app/` directory. Be aware that it’s not an _über-jar_
78-
as the dependencies are copied into the `app/target/quarkus-app/lib/` directory.
121+
There is now a Docker Image `compas_keycloak` created that can be started using the following command
122+
123+
```shell
124+
docker run --rm --name compas_keycloak \
125+
-p 8089:8080
126+
-d compas_keycloak:latest
127+
```
128+
129+
## Testing the application
130+
131+
The application is tested with unit and integration tests, but you can also manually test the application using for
132+
instance Postman. And there is also a way to test this service with the CoMPAS OpenSCD Frontend application.
133+
134+
### Postman
135+
136+
To manually test the application there is a Postman collection in the directory `postman` that can be imported
137+
and used to execute REST XML Calls.
138+
139+
To make the call work we also need to import an environment and authorisation collection. These files can be found
140+
in [CoMPAS Deployment Repository](https://github.com/com-pas/compas-deployment) in the directory `postman`
141+
(`auth.collection.json` and `local.environment.json`).
142+
143+
In the authorisation collection there are called for the 3 users known within the Demo KeyCloak instance.
144+
If one of these calls are executed there is a variable `bearer` filled.
145+
146+
Now one of the SCL Auto Alignment calls can be executed, the variable `bearer` is added to the header of the request.
147+
After the call is executed the result should be shown in Postman.
79148

80-
If you want to build an _über-jar_, execute the following command:
149+
### CoMPAS OpenSCD Frontend application
150+
151+
To test the SCL Validator with the CoMPAS OpenSCD application just run the application in dev mode, including the
152+
KeyCloak instance. For further instruction how to start the CoMPAS OpenSCD application and use this locally see
153+
the file `DEVELOPMENT.md` in [CoMPAS OpenSCD application](https://github.com/com-pas/compas-open-scd).
154+
155+
## Docker Images
156+
157+
### Creating a Docker image with native executable
158+
159+
The CoMPAS SCL Validator currently isn't build as Native executable, GraalVM has a lot of problems to strip the
160+
Eclipse libraries and make them work as Native executable.
161+
162+
### Creating a Docker image with JVM executable
163+
164+
The release action is creating a Docker Image which runs the application using a JVM. You can create a Docker Image
165+
with JVM executable using:
81166

82167
```shell script
83-
./mvnw package -Dquarkus.package.type=uber-jar
168+
./mvnw package -Pjvm-image
84169
```
85170

86-
The application is now runnable using `java -jar app/target/quarkus-app/quarkus-run.jar`.
171+
## Mac M1
172+
173+
The Mac M1 chip is ARM based. In order to make this project work, you need to install the x86 version of your IDE.
174+
You also need Rosetta2 to virtualize your os. In the x86 version of your IDE, you also need to install the x86 Java version.
175+
You can use SDK-Man to easily switch between java versions.
87176

177+
While calling maven scripts, you need to add the os.arch flag.
178+
```shell script
179+
./mvnw clean compile -Dos.arch=x86_64
180+
```

README.md

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ SPDX-License-Identifier: Apache-2.0
1010
[![CII Best Practices](https://bestpractices.coreinfrastructure.org/projects/5925/badge)](https://bestpractices.coreinfrastructure.org/projects/5925)
1111
[![Slack](https://raw.githubusercontent.com/com-pas/compas-architecture/master/public/LFEnergy-slack.svg)](http://lfenergy.slack.com/)
1212

13-
# compas-scl-validator
13+
# CoMPAS SCL Validator
1414

1515
Service to validate SCL Files.
1616

@@ -28,19 +28,7 @@ automatically determine the URL to be used.
2828

2929
## Development
3030

31-
Since version 1.2.x the JAR Files of RiseClipse are distributed through Maven Central Repository. The JAR Files can be
32-
retrieved from there and don't need to be build locally anymore. Only the OCL Files for the SCL validation still need to
33-
be downloaded from RiseClipse GIT Repository. This is still done using Git Submodules.
34-
35-
To clone the project or update the project this means that the Git commands are sometimes a little different. To clone
36-
the project use the following command `git clone --recurse-submodules [email protected]:com-pas/compas-scl-validator.git`.
37-
This will also clone the submodules.
38-
39-
Tip: The URL to the submodules are configured in the file `.gitmodules`, but these are using the SSH URL. There is a way
40-
described [here](https://git-scm.com/book/en/v2/Git-Tools-Submodules) to overwrite the URL locally with an HTTPS URL of
41-
the GIT Repository.
42-
43-
Check the [Development](DEVELOPMENT.md) page for more detail information how to develop in this GIT repository.
31+
Information about how to run and develop for this project check [Development](DEVELOPMENT.md).
4432

4533
## Custom OCL Files
4634

app/src/main/docker/Dockerfile.jvm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
###
2424
FROM registry.access.redhat.com/ubi8/ubi-minimal:8.6
2525

26-
ARG JAVA_PACKAGE=java-11-openjdk-headless
26+
ARG JAVA_PACKAGE=java-17-openjdk-headless
2727
ARG RUN_JAVA_VERSION=1.3.8
2828
ENV LANG='en_US.UTF-8' LANGUAGE='en_US:en'
2929
# Install java and the run-java script

pom.xml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,7 @@ SPDX-License-Identifier: Apache-2.0
1515

1616
<properties>
1717
<maven.compiler.parameters>true</maven.compiler.parameters>
18-
<maven.compiler.source>11</maven.compiler.source>
19-
<maven.compiler.target>11</maven.compiler.target>
18+
<maven.compiler.release>17</maven.compiler.release>
2019
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
2120
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
2221

@@ -27,7 +26,7 @@ SPDX-License-Identifier: Apache-2.0
2726
<compas.scl.xsd.version>0.0.4</compas.scl.xsd.version>
2827
<compas.core.version>0.9.1</compas.core.version>
2928

30-
<quarkus.platform.version>2.10.1.Final</quarkus.platform.version>
29+
<quarkus.platform.version>2.10.3.Final</quarkus.platform.version>
3130
<slf4j.version>1.7.36</slf4j.version>
3231
<openpojo.version>0.9.1</openpojo.version>
3332
</properties>

0 commit comments

Comments
 (0)