Skip to content

Commit 9235945

Browse files
committed
Merge remote-tracking branch 'upstream/develop' into upstream-main
2 parents 6785f0a + f018b97 commit 9235945

File tree

109 files changed

+1748
-4180
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

109 files changed

+1748
-4180
lines changed

.github/workflows/build.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Build
2+
on:
3+
push:
4+
branches: [ "develop" ]
5+
pull_request:
6+
branches: [ "develop" ]
7+
jobs:
8+
Build:
9+
runs-on: ubuntu-latest
10+
permissions:
11+
contents: read
12+
pull-requests: write
13+
steps:
14+
- uses: actions/checkout@v4
15+
- uses: graalvm/setup-graalvm@v1
16+
with:
17+
java-version: '21'
18+
distribution: 'graalvm'
19+
github-token: ${{ secrets.GITHUB_TOKEN }}
20+
- uses: wagoid/commitlint-github-action@v6
21+
- name: Install Protoc
22+
uses: arduino/setup-protoc@v3
23+
- name: Build using Gradle
24+
run: ./gradlew build
25+
- name: Upload Test Reports
26+
uses: actions/upload-artifact@v3
27+
if: always()
28+
with:
29+
name: test-reports
30+
path: |
31+
build/test-results/test/TEST-*.xml
32+
build/reports/jacoco/**/jacocoTestReport.xml
33+
retention-days: 1

.github/workflows/docker.yml

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
name: Docker
2+
3+
on:
4+
schedule:
5+
- cron: "0 10 * * *"
6+
push:
7+
branches:
8+
- "**"
9+
tags:
10+
- "v*.*.*"
11+
pull_request:
12+
13+
jobs:
14+
docker:
15+
runs-on: ubuntu-latest
16+
steps:
17+
- name: Docker meta
18+
id: meta
19+
uses: docker/metadata-action@v5
20+
with:
21+
# list of Docker images to use as base name for tags
22+
images: |
23+
ghcr.io/UIBK-DPS-DC/Cirrina
24+
# generate Docker tags based on the following events/attributes
25+
tags: |
26+
type=schedule
27+
type=ref,event=branch
28+
type=ref,event=pr
29+
type=semver,pattern={{version}}
30+
type=semver,pattern={{major}}.{{minor}}
31+
type=semver,pattern={{major}}
32+
type=sha
33+
34+
- name: Set up QEMU
35+
uses: docker/setup-qemu-action@v3
36+
37+
- name: Set up Docker Buildx
38+
uses: docker/setup-buildx-action@v3
39+
40+
- name: Login to GHCR
41+
if: github.event_name != 'pull_request'
42+
uses: docker/login-action@v3
43+
with:
44+
registry: ghcr.io
45+
username: ${{ github.repository_owner }}
46+
password: ${{ secrets.GITHUB_TOKEN }}
47+
48+
- name: Build and push
49+
uses: docker/build-push-action@v6
50+
with:
51+
push: ${{ github.event_name != 'pull_request' }}
52+
tags: ${{ steps.meta.outputs.tags }}
53+
labels: ${{ steps.meta.outputs.labels }}

.github/workflows/report.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Test
2+
on:
3+
workflow_run:
4+
workflows: [ "build" ]
5+
types: [ "completed" ]
6+
permissions:
7+
checks: write
8+
pull-requests: write
9+
jobs:
10+
report:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Download Test Reports
14+
uses: dawidd6/action-download-artifact@v2
15+
with:
16+
name: test-reports
17+
workflow: ${{ github.event.workflow.id }}
18+
run_id: ${{ github.event.workflow_run.id }}
19+
- name: Publish Test Report
20+
uses: mikepenz/action-junit-report@v3
21+
with:
22+
commit: ${{github.event.workflow_run.head_sha}}
23+
report_paths: 'test-results/test/TEST-*.xml'
24+
fail_on_failure: true
25+
require_tests: true
26+
include_passed: true
27+
detailed_summary: true
28+
#- name: JaCoCo Code Coverage Report
29+
# uses: PavanMudigonda/[email protected]
30+
# with:
31+
# coverage_results_path: reports/jacoco/test/jacocoTestReport.xml
32+
# coverage_report_name: Coverage
33+
# coverage_report_title: JaCoCo
34+
# github_token: ${{ secrets.GITHUB_TOKEN }}
35+
# skip_check_run: false
36+
# minimum_coverage: 80
37+
# fail_below_threshold: false
38+
# publish_only_summary: false

.gitlab-ci.yml

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,25 @@ build:
2222
expire_in: 1 week
2323

2424
docker-build:
25-
image: docker:latest
2625
stage: build
2726
variables:
28-
GIT_SUBMODULE_STRATEGY: recursive
29-
before_script:
30-
- docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
27+
http_proxy: http://proxy.uibk.ac.at:3128
28+
https_proxy: http://proxy.uibk.ac.at:3128
29+
no_proxy: "localhost,.uibk.ac.at,docker"
30+
image:
31+
name: gcr.io/kaniko-project/executor:v1.14.0-debug
32+
entrypoint: [ "" ]
3133
script:
32-
- docker build -t ${CI_REGISTRY_IMAGE}:${CI_COMMIT_TAG} ${CI_PROJECT_DIR}
33-
- docker push ${CI_REGISTRY_IMAGE}:${CI_COMMIT_TAG}
34+
- /kaniko/executor
35+
--context "${CI_PROJECT_DIR}"
36+
--build-arg "http_proxy=${http_proxy}"
37+
--build-arg "HTTP_PROXY=${http_proxy}"
38+
--build-arg "https_proxy=${https_proxy}"
39+
--build-arg "HTTPS_PROXY=${https_proxy}"
40+
--build-arg "no_proxy=${no_proxy}"
41+
--build-arg "NO_PROXY=${no_proxy}"
42+
--dockerfile "${CI_PROJECT_DIR}/Dockerfile"
43+
--destination "${CI_REGISTRY_IMAGE}:${CI_COMMIT_TAG}"
3444
rules:
3545
- if: '$CI_COMMIT_TAG'
3646

.idea/jarRepositories.xml

Lines changed: 5 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ATTRIBUTIONS.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Dependencies
2+
3+
Cirrina makes use of the following dependencies:
4+
5+
| **Name** | **License** | **URL** |
6+
|------------------------------|----------------------------------------------------------------------------------------------------------------|------------------------------------------------------|
7+
| JCommander | [Apache License 2.0](https://github.com/cbeust/jcommander?tab=Apache-2.0-1-ov-file#readme) | https://github.com/cbeust/jcommander |
8+
| Jackson | [Apache License 2.0](https://github.com/FasterXML/jackson-core/wiki) | https://github.com/FasterXML/jackson |
9+
| Guava | [Apache License 2.0](https://github.com/google/guava?tab=Apache-2.0-1-ov-file#readme) | https://github.com/google/guava |
10+
| Protocol Buffers | [New BSD License](https://github.com/protocolbuffers/protobuf/blob/main/LICENSE) | https://github.com/protocolbuffers/protobuf |
11+
| NATS - Java Client | [Apache License 2.0](https://github.com/nats-io/nats.java?tab=Apache-2.0-1-ov-file#readme) | https://github.com/nats-io/nats.java |
12+
| OpenTelemetry Java | [Apache License 2.0](https://github.com/open-telemetry/opentelemetry-java?tab=Apache-2.0-1-ov-file#readme) | https://github.com/open-telemetry/opentelemetry-java |
13+
| Jakarta Annotations | [Eclipse Public License 2.0](https://github.com/jakartaee/common-annotations-api?tab=License-1-ov-file#readme) | https://github.com/jakartaee/common-annotations-api |
14+
| Apache Commons JEXL | [Apache License 2.0](https://github.com/apache/commons-jexl/blob/master/LICENSE.txt) | https://github.com/apache/commons-jexl |
15+
| Apache Curator | [Apache License 2.0](https://github.com/apache/curator?tab=Apache-2.0-1-ov-file#readme) | https://github.com/apache/curator |
16+
| Apache HttpComponents Client | [Apache License 2.0](https://github.com/apache/httpcomponents-client?tab=Apache-2.0-1-ov-file#readme) | https://github.com/apache/httpcomponents-client |
17+
| Apache Log4j | [Apache License 2.0](https://github.com/apache/logging-log4j2?tab=Apache-2.0-1-ov-file#readme) | https://github.com/apache/logging-log4j2 |
18+
| Eclipse Expressly | [Eclipse Public License 2.0](https://github.com/eclipse-ee4j/expressly?tab=License-1-ov-file#readme) | https://github.com/eclipse-ee4j/expressly |
19+
| Hibernate Validator | [Apache License 2.0](https://github.com/hibernate/hibernate-validator?tab=Apache-2.0-1-ov-file#readme) | https://github.com/hibernate/hibernate-validator |
20+
| JGraphT | [Eclipse Public License 2.0](https://github.com/jgrapht/jgrapht/blob/master/license-EPL.txt) | https://github.com/jgrapht/jgrapht |
21+
| Mockito | [MIT License](https://github.com/mockito/mockito?tab=MIT-1-ov-file#readme) | https://github.com/mockito/mockito |
22+
| JUnit | [Eclipse Public License 2.0](https://github.com/junit-team/junit5?tab=License-1-ov-file#readme) | https://github.com/junit-team/junit5 |

Dockerfile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
# Stage 1: Build Stage
22
FROM gradle:8.7.0-jdk21-alpine AS build
33

4+
ARG GRADLE_OPTS
5+
46
# Install protoc
57
RUN apk add protoc
68

@@ -17,7 +19,7 @@ RUN gradle distZip
1719
FROM openjdk:21-bookworm
1820

1921
# Define a build argument for the application version
20-
ARG CIRRINA_VERSION="cirrina-1.0-SNAPSHOT"
22+
ARG CIRRINA_VERSION="cirrina-1.0.0"
2123

2224
# Copy the application distribution ZIP from the build stage
2325
COPY --from=build /usr/src/cirrina/build/distributions/${CIRRINA_VERSION}.zip /tmp/${CIRRINA_VERSION}.zip

Pkl.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# Cirrina-Pkl
2+
3+
[Pkl](https://pkl-lang.org/) is a configuration as code language with rich validation and tooling.
4+
5+
## Setup
6+
7+
1. Download the jar file:
8+
```bash
9+
curl -o pkl-tools-0.26.2.jar https://repo1.maven.org/maven2/org/pkl-lang/pkl-tools/0.26.2/pkl-tools-0.26.2.jar
10+
```
11+
12+
2. Generate the code for the CSM descriptions:
13+
```bash
14+
java -cp pkl-tools-0.26.2.jar org.pkl.codegen.java.Main -o generated/ descriptions/CollaborativeStateMachineDescription.pkl --generate-getters --generate-javadoc
15+
java -cp pkl-tools-0.26.2.jar org.pkl.codegen.java.Main -o generated/ .\descriptions\JobDescription.pkl --generate-getters --generate-javadoc
16+
java -cp pkl-tools-0.26.2.jar org.pkl.codegen.java.Main -o generated/ .\descriptions\ServiceImplementationDescription.pkl --generate-getters --generate-javadoc
17+
java -cp pkl-tools-0.26.2.jar org.pkl.codegen.java.Main -o generated/ .\descriptions\HttpServiceImplementationDescription.pkl --generate-getters --generate-javadoc
18+
```
19+
20+
**NOTE:** The code could also be generated with the Gradle plugin, however, there are some issues that need to be fixed first.
21+
22+
## Recommended Editors
23+
24+
For editing Pkl files, we recommend the following editors:
25+
26+
- [VSCode](https://code.visualstudio.com/) for Windows
27+
- [IntelliJ IDEA](https://www.jetbrains.com/idea/) for MacOS or Linux
28+
29+
To improve the editing experience, you can install the recommended plugins for the editors.
30+

README.md

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
<img src="cirrina.svg" alt="Logo" width="400"/>
55
</div>
66

7+
[![License: GPL v3](https://img.shields.io/badge/License-GPLv3-blue.svg)](LICENSE.md) [![Build](https://github.com/UIBK-DPS-DC/Cirrina/actions/workflows/build.yml/badge.svg?event=push)](https://github.com/UIBK-DPS-DC/Cirrina/actions/workflows/build.yml?event=push) [![Test](https://github.com/UIBK-DPS-DC/Cirrina/actions/workflows/report.yml/badge.svg?event=push)](https://github.com/UIBK-DPS-DC/Cirrina/actions/workflows/report.yml?event=push)
8+
79
Cirrina, a distributed Collaborative State Machines (CSM) runtime for the Cloud-Edge-IoT continuum. Collaborative state machines is a state
810
machine-based programming model for the Cloud-Edge-IoT continuum inspired by David
911
Harel's [statecharts](https://www.sciencedirect.com/science/article/pii/0167642387900359).
@@ -14,10 +16,6 @@ visit [CSML Specifications](https://git.uibk.ac.at/informatik/dps/dps-dc-softwar
1416
Collaborative State Machines and the Cirrina runtime are created and developed by the [Distributed and Parallel Systems Group of the
1517
Universität Innsbruck](https://dps.uibk.ac.at/).
1618

17-
## Pipeline Status
18-
19-
[![pipeline status](https://git.uibk.ac.at/informatik/dps/dps-dc-software/cirrina/badges/develop/pipeline.svg)](https://git.uibk.ac.at/informatik/dps/dps-dc-software/cirrina/-/commits/develop)
20-
2119
## Running
2220

2321
To run a Cirrina runtime without compiling or building a Docker image manually, the
@@ -38,11 +36,16 @@ The following arguments are expected to be provided (otherwise it is assumed tha
3836
- `--nats-event-handler-url` The NATS server URL where the event bus resides.
3937
- `--zookeeper-connect-string` The ZooKeeper server connection string.
4038

41-
## License
39+
## Dependencies
4240

43-
GPLv3 licensed, see [LICENSE](LICENSE).
41+
The following components are used by this version of Cirrina:
42+
43+
| Name | Version |
44+
|------------------------|---------|
45+
| Cirrina-Specifications | 2.0 |
46+
| Cirrina-UseCases | 1.0.0 |
4447

4548
## Citing
4649

4750
```
48-
```
51+
```

build.gradle.kts

Lines changed: 24 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@ plugins {
44
application
55

66
jacoco
7-
id("net.razvan.jacoco-to-cobertura") version "1.2.0"
87

98
id("com.google.protobuf") version "0.9.4"
9+
id("org.pkl-lang") version "0.26.2"
1010
}
1111

1212
group = "ac.at.uibk.dps.cirrina"
13-
version = "1.0-SNAPSHOT"
13+
version = "1.0.0"
1414

1515
application {
1616
mainClass = "at.ac.uibk.dps.cirrina.main.Main"
@@ -26,6 +26,22 @@ jacoco {
2626
toolVersion = "0.8.11"
2727
}
2828

29+
pkl {
30+
javaCodeGenerators {
31+
register("pklGenJava") {
32+
allowedModules.add("https:")
33+
sourceModules.addAll(
34+
"https://raw.githubusercontent.com/UIBK-DPS-DC/Cirrina-Specifications/main/pkl/CollaborativeStateMachineDescription.pkl",
35+
"https://raw.githubusercontent.com/UIBK-DPS-DC/Cirrina-Specifications/main/pkl/HttpServiceImplementationDescription.pkl",
36+
"https://raw.githubusercontent.com/UIBK-DPS-DC/Cirrina-Specifications/main/pkl/JobDescription.pkl",
37+
"https://raw.githubusercontent.com/UIBK-DPS-DC/Cirrina-Specifications/main/pkl/ServiceImplementationDescription.pkl"
38+
)
39+
generateGetters.set(true)
40+
generateJavadoc.set(true)
41+
}
42+
}
43+
}
44+
2945
protobuf {
3046
generateProtoTasks {
3147
all().forEach { task ->
@@ -38,6 +54,9 @@ protobuf {
3854
}
3955

4056
dependencies {
57+
implementation("org.pkl-lang:pkl-config-java:0.26.2")
58+
implementation("org.pkl-lang:pkl-codegen-java:0.26.2")
59+
4160
implementation("com.beust:jcommander:1.82")
4261

4362
implementation("com.fasterxml.jackson.core:jackson-databind:2.15.1")
@@ -66,7 +85,7 @@ dependencies {
6685

6786
implementation("org.apache.curator:curator-framework:5.6.0")
6887
implementation("org.apache.curator:curator-recipes:5.6.0")
69-
88+
7089
implementation("org.apache.httpcomponents.client5:httpclient5:5.3.1")
7190

7291
implementation("org.apache.logging.log4j:log4j-core:2.23.1")
@@ -77,7 +96,6 @@ dependencies {
7796
implementation("org.hibernate:hibernate-validator-cdi:8.0.1.Final")
7897

7998
implementation("org.jgrapht:jgrapht-core:1.5.2")
80-
implementation("org.jgrapht:jgrapht-io:1.5.2")
8199

82100
testImplementation("org.mockito:mockito-core:5.11.0")
83101

@@ -87,6 +105,7 @@ dependencies {
87105

88106
repositories {
89107
mavenCentral()
108+
gradlePluginPortal()
90109
maven(url = "https://repository.cloudera.com/artifactory/cloudera-repos/")
91110
}
92111

@@ -101,12 +120,11 @@ tasks.jacocoTestReport {
101120
html.required = false
102121
csv.required = false
103122
}
104-
finalizedBy(tasks.jacocoToCobertura)
105123
}
106124

107125
tasks.withType<Jar> {
108126
manifest {
109127
attributes["Main-Class"] = "at.ac.uibk.dps.cirrina.main.Main"
110128
attributes["Implementation-Version"] = version
111129
}
112-
}
130+
}

0 commit comments

Comments
 (0)