Skip to content

Commit

Permalink
Merge branch 'master' into python-version-property
Browse files Browse the repository at this point in the history
  • Loading branch information
lhstrh authored Aug 4, 2024
2 parents 03c2fb9 + 56ba716 commit 59618b7
Show file tree
Hide file tree
Showing 64 changed files with 1,199 additions and 205 deletions.
49 changes: 49 additions & 0 deletions .github/actions/push-rti-docker/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Push RTI to Docker Hub
description: Build and push the RTI image to Docker Hub
inputs:
tag:
description: 'The tag of the RTI image to build and push'
required: true
default: 'latest'
DOCKERHUB_USERNAME:
description: 'The username to log in to Docker Hub'
required: true
DOCKERHUB_TOKEN:
description: 'The token to log in to Docker Hub'
required: true
latest:
description: 'Also push as latest tag if true'
default: 'false'
runs:
using: "composite"
steps:
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ inputs.DOCKERHUB_USERNAME }}
password: ${{ inputs.DOCKERHUB_TOKEN }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Check out lingua-franca repository
uses: actions/checkout@v3
with:
submodules: recursive
fetch-depth: 0
- name: Build and push
uses: docker/build-push-action@v6
with:
file: ./core/src/main/resources/lib/c/reactor-c/core/federated/RTI/rti.Dockerfile
context: ./core/src/main/resources/lib/c/reactor-c
platforms: linux/amd64, linux/arm64, linux/arm/v7, linux/riscv64
push: true
tags: lflang/rti:${{ inputs.tag }}
if: ${{ inputs.latest == 'false' }}
- name: Build and push as latest
uses: docker/build-push-action@v6
with:
file: ./core/src/main/resources/lib/c/reactor-c/core/federated/RTI/rti.Dockerfile
context: ./core/src/main/resources/lib/c/reactor-c
platforms: linux/amd64, linux/arm64, linux/arm/v7, linux/riscv64
push: true
tags: lflang/rti:${{ inputs.tag }}, lflang/rti:latest
if: ${{ inputs.latest == 'true' }}
52 changes: 26 additions & 26 deletions .github/workflows/c-zephyr-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,27 +39,27 @@ jobs:
path: core/src/main/resources/lib/c/reactor-c
ref: ${{ inputs.runtime-ref }}
if: ${{ inputs.runtime-ref }}
- name: Run Zephyr smoke tests
run: |
./gradlew core:integrationTest \
--tests org.lflang.tests.runtime.CZephyrTest.buildZephyrUnthreaded* \
--tests org.lflang.tests.runtime.CZephyrTest.buildZephyrThreaded* core:integrationTestCodeCoverageReport
./.github/scripts/run-zephyr-tests.sh test/C/src-gen
rm -rf test/C/src-gen
- name: Run basic tests
run: |
./gradlew core:integrationTest --tests org.lflang.tests.runtime.CZephyrTest.buildBasic* core:integrationTestCodeCoverageReport
./.github/scripts/run-zephyr-tests.sh test/C/src-gen
rm -rf test/C/src-gen
- name: Run concurrent tests
run: |
./gradlew core:integrationTest --tests org.lflang.tests.runtime.CZephyrTest.buildConcurrent* core:integrationTestCodeCoverageReport
./.github/scripts/run-zephyr-tests.sh test/C/src-gen
rm -rf test/C/src-gen
- name: Run Zephyr board tests
run: |
./gradlew core:integrationTest --tests org.lflang.tests.runtime.CZephyrTest.buildZephyrBoards* core:integrationTestCodeCoverageReport
rm -rf test/C/src-gen
# - name: Run Zephyr smoke tests
# run: |
# ./gradlew core:integrationTest \
# --tests org.lflang.tests.runtime.CZephyrTest.buildZephyrUnthreaded* \
# --tests org.lflang.tests.runtime.CZephyrTest.buildZephyrThreaded* core:integrationTestCodeCoverageReport
# ./.github/scripts/run-zephyr-tests.sh test/C/src-gen
# rm -rf test/C/src-gen
# - name: Run basic tests
# run: |
# ./gradlew core:integrationTest --tests org.lflang.tests.runtime.CZephyrTest.buildBasic* core:integrationTestCodeCoverageReport
# ./.github/scripts/run-zephyr-tests.sh test/C/src-gen
# rm -rf test/C/src-gen
# - name: Run concurrent tests
# run: |
# ./gradlew core:integrationTest --tests org.lflang.tests.runtime.CZephyrTest.buildConcurrent* core:integrationTestCodeCoverageReport
# ./.github/scripts/run-zephyr-tests.sh test/C/src-gen
# rm -rf test/C/src-gen
# - name: Run Zephyr board tests
# run: |
# ./gradlew core:integrationTest --tests org.lflang.tests.runtime.CZephyrTest.buildZephyrBoards* core:integrationTestCodeCoverageReport
# rm -rf test/C/src-gen
- name: Smoke test of lf-west-template
run: |
export LFC=$(pwd)/bin/lfc-dev
Expand All @@ -68,8 +68,8 @@ jobs:
west lfc apps/NrfBlinky/src/NrfBlinky.lf --lfc $LFC --build "-p always"
west lfc apps/NrfBlinky/src/NrfToggleGPIO.lf --lfc $LFC --build "-p always"
west build -b qemu_cortex_m3 -p always apps/HelloZephyr
- name: Report to CodeCov
uses: ./.github/actions/report-code-coverage
with:
files: core/build/reports/jacoco/integrationTestCodeCoverageReport/integrationTestCodeCoverageReport.xml
if: ${{ github.repository == 'lf-lang/lingua-franca' }}
# - name: Report to CodeCov
# uses: ./.github/actions/report-code-coverage
# with:
# files: core/build/reports/jacoco/integrationTestCodeCoverageReport/integrationTestCodeCoverageReport.xml
# if: ${{ github.repository == 'lf-lang/lingua-franca' }}
42 changes: 42 additions & 0 deletions .github/workflows/rti-docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Push RTI Image to Docker Hub

on:
push:
branches:
- master
workflow_dispatch:
workflow_call:

jobs:
build-and-push:
runs-on: ubuntu-latest
name: Build and push RTI to Docker Hub
steps:
- name: Check out lingua-franca repository
uses: actions/checkout@v3
with:
repository: lf-lang/lingua-franca
submodules: recursive
fetch-depth: 0
- name: Look up the current version and export as environment variable
run: |
export LF_VERSION=$(cat core/src/main/resources/org/lflang/StringsBundle.properties | sed -n 's/.*VERSION = \(.*\)/\1/p' | tr '[:upper:]' '[:lower:]')
echo "lf_version=$LF_VERSION"
echo "lf_version=$LF_VERSION" >> $GITHUB_ENV
- name: Build and push RTI to Docker Hub
uses: ./.github/actions/push-rti-docker
with:
tag: ${{ env.lf_version }}
latest: false
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}
if: ${{ endsWith(env.lf_version, '-snapshot') }}

- name: Update latest (released versions only)
uses: ./.github/actions/push-rti-docker
with:
tag: ${{ env.lf_version }}
latest: true
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}
if: ${{ !endsWith(env.lf_version, '-snapshot') }}
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,11 @@ local.properties
# PyDev specific (Python IDE for Eclipse)
*.pydevproject

## Python specific
*.pyc
**.egg-info
__pycache__

# CDT-specific (C/C++ Development Tooling)
.cproject

Expand Down
98 changes: 98 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,103 @@
# Changelog

## [v0.8.2](https://github.com/lf-lang/lingua-franca/tree/v0.8.2) (2024-08-02)

**Highlights**

This patch release includes minor bugfixes and several enhancements of our Docker support. It also adds custom serialization for the Python target and support for the use of target code expressions to specify time values in C++.

**🚀 New Features**

- Docker compose override [\#2371](https://github.com/lf-lang/lingua-franca/pull/2371) (@Depetrol)

**✨ Enhancements**

- Ability to use of target code expressions for time values in C++ [\#2369](https://github.com/lf-lang/lingua-franca/pull/2369) (@cmnrd)
- Do not require libexecinfo in C++ docker images [\#2372](https://github.com/lf-lang/lingua-franca/pull/2372) (@cmnrd)
- Immediate start of federates with STP offset under decentralized coordination & fix target code STP_offset [\#2368](https://github.com/lf-lang/lingua-franca/pull/2368) (@Depetrol)
- Custom Serialization in Python Target [\#2375](https://github.com/lf-lang/lingua-franca/pull/2375) (@Depetrol)
- RTI Docker Hub Continuous Deployment with Multiplatform Support [\#2384](https://github.com/lf-lang/lingua-franca/pull/2384) (@Depetrol)

**🔧 Fixes**

- Immediate start of federates with STP offset under decentralized coordination & fix target code STP_offset [\#2368](https://github.com/lf-lang/lingua-franca/pull/2368) (@Depetrol)
- Fixed docker support for the Python target [\#2377](https://github.com/lf-lang/lingua-franca/pull/2377) (@cmnrd)
- Fix to get get all preambles in Python + updated tests [\#2381](https://github.com/lf-lang/lingua-franca/pull/2381) (@edwardalee)
- C++ raw strings allowed in target code blocks [\#2385](https://github.com/lf-lang/lingua-franca/pull/2385) (@lhstrh)

**🚧 Maintenance and Refactoring**

- Renaming `Latest Tag Completed` to `Latest Tag Confirmed` [\#2346](https://github.com/lf-lang/lingua-franca/pull/2346) (@byeonggiljun)


### Submodule [lf-lang/reactor-c](http://github.com/lf-lang/reactor-c)

**🚀 New Features**

- Support for Patmos platform [\#383](https://github.com/lf-lang/reactor-c/pull/383) (@EhsanKhodadad)

**✨ Enhancements**

- Immediate start of federates with STA offset under decentralized coordination [\#469](https://github.com/lf-lang/reactor-c/pull/469) (@Depetrol)
- Custom Serialization in Python Target [\#471](https://github.com/lf-lang/reactor-c/pull/471) (@Depetrol)
- Optimization of LTC signals [\#445](https://github.com/lf-lang/reactor-c/pull/445) (@byeonggiljun)
- RTI dockerfile support for multi-architecture builds [\#464](https://github.com/lf-lang/reactor-c/pull/464) (@elgeeko1)


### Submodule [lf-lang/reactor-cpp](http://github.com/lf-lang/reactor-cpp)

**✨ Enhancements**

- Portable backtrace mechanism [\#59](https://github.com/lf-lang/reactor-cpp/pull/59) (@cmnrd)


### Submodule [lf-lang/reactor-rs](http://github.com/lf-lang/reactor-rs)

- No Changes



## [v0.8.1](https://github.com/lf-lang/lingua-franca/tree/v0.8.1) (2024-07-14)

**Highlights**

This patch release includes several minor bugfixes and enhancements, improving Docker support for the C++ target and providing a more complete implementation of watchdogs.

**✨ Enhancements**

- API to look up source and package directory in Python [\#2331](https://github.com/lf-lang/lingua-franca/pull/2331) (@edwardalee)
- Define self variable so it can be used in instantiations [\#2353](https://github.com/lf-lang/lingua-franca/pull/2353) (@edwardalee)
- Fixed build script support in C++ docker generation [\#2357](https://github.com/lf-lang/lingua-franca/pull/2357) (@cmnrd)
- Diagram support for watchdogs [\#2356](https://github.com/lf-lang/lingua-franca/pull/2356) (@edwardalee)
- Fixed C++ docker generation for when cmake is not installed [\#2358](https://github.com/lf-lang/lingua-franca/pull/2358) (@cmnrd)
- Effects made accessible in watchdog handlers [\#2359](https://github.com/lf-lang/lingua-franca/pull/2359) (@lhstrh)

**🚧 Maintenance and Refactoring**

- Platform name changed from `Nrf52` to `nRF52` [\#2350](https://github.com/lf-lang/lingua-franca/pull/2350) (@edwardalee)


### Submodule [lf-lang/reactor-c](http://github.com/lf-lang/reactor-c)

**🚀 New Features**

- New Python functions `lf.package_directory()` and `lf.source_directory()` [\#455](https://github.com/lf-lang/reactor-c/pull/455) (@edwardalee)

**🔧 Fixes**

- Better error messages when HMAC authentication is attempted by federates when RTI does not support it [\#461](https://github.com/lf-lang/reactor-c/pull/461) (@Jakio815)


### Submodule [lf-lang/reactor-cpp](http://github.com/lf-lang/reactor-cpp)

- No Changes


### Submodule [lf-lang/reactor-rs](http://github.com/lf-lang/reactor-rs)

- Remove creusot sources and merge back vecmap into main runtime crate [\#47](https://github.com/lf-lang/reactor-rs/pull/47) (@oowekyala)


## [v0.8.0](https://github.com/lf-lang/lingua-franca/tree/v0.8.0) (2024-07-02)

**Highlights**
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[Website](https://lf-lang.org/) |
[Documentation](https://www.lf-lang.org/docs/handbook/) |
[Download](https://www.lf-lang.org/download/) |
[Documentation](https://www.lf-lang.org/docs/) |
[Download](https://www.lf-lang.org/docs/installation) |
[Contributing](CONTRIBUTING.md) |
[Changelog](CHANGELOG.md)

Expand All @@ -18,4 +18,4 @@ Lingua Franca (LF) is a polyglot coordination language for concurrent and possib

See [lf-lang.org](https://lf-lang.org) for installation instructions and documentation. See also the [wiki](https://github.com/icyphy/lingua-franca/wiki) for further information on ongoing projects.

See our [Publications and Presentations](https://www.lf-lang.org/publications-and-presentations).
See our [Publications and Presentations](https://www.lf-lang.org/research/).
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ protected boolean supportsSingleThreadedExecution() {

@Override
protected boolean supportsDockerOption() {
return false; // FIXME: https://issues.lf-lang.org/1564
return true;
}

@Test
Expand Down
14 changes: 3 additions & 11 deletions core/src/main/java/org/lflang/AttributeUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -36,17 +36,7 @@
import org.eclipse.xtext.nodemodel.util.NodeModelUtils;
import org.eclipse.xtext.resource.XtextResource;
import org.lflang.ast.ASTUtils;
import org.lflang.lf.Action;
import org.lflang.lf.AttrParm;
import org.lflang.lf.Attribute;
import org.lflang.lf.Input;
import org.lflang.lf.Instantiation;
import org.lflang.lf.Output;
import org.lflang.lf.Parameter;
import org.lflang.lf.Reaction;
import org.lflang.lf.Reactor;
import org.lflang.lf.StateVar;
import org.lflang.lf.Timer;
import org.lflang.lf.*;
import org.lflang.util.StringUtil;

/**
Expand Down Expand Up @@ -83,6 +73,8 @@ public static List<Attribute> getAttributes(EObject node) {
return ((Output) node).getAttributes();
} else if (node instanceof Instantiation) {
return ((Instantiation) node).getAttributes();
} else if (node instanceof Watchdog) {
return ((Watchdog) node).getAttributes();
}
throw new IllegalArgumentException("Not annotatable: " + node);
}
Expand Down
5 changes: 4 additions & 1 deletion core/src/main/java/org/lflang/LinguaFranca.xtext
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,7 @@ Deadline:
'deadline' '(' delay=Expression ')' code=Code;

Watchdog:
(attributes+=Attribute)*
'watchdog' name=ID '(' timeout=Expression ')'
('->' effects+=VarRefOrModeTransition (',' effects+=VarRefOrModeTransition)*)?
code=Code;
Expand Down Expand Up @@ -424,6 +425,8 @@ terminal ML_COMMENT: ('/*' -> '*/') | ("'''" -> "'''");

terminal LT_ANNOT: "'" ID?;

terminal CPP_RAW_STR: 'R"' -> '"';

terminal STRING: '"' ( '\\' . | !('\\' | '"' | '\t' | '\r' | '\n') )* '"'
| '"""' -> '"""'
;
Expand Down Expand Up @@ -511,7 +514,7 @@ Body:
// the end of a target-code segment.
Token:
// Non-constant terminals
ID | INT | FLOAT_EXP_SUFFIX | LT_ANNOT | STRING | CHAR_LIT | ML_COMMENT | SL_COMMENT | WS | ANY_OTHER |
ID | INT | FLOAT_EXP_SUFFIX | LT_ANNOT | CPP_RAW_STR | STRING | CHAR_LIT | ML_COMMENT | SL_COMMENT | WS | ANY_OTHER |
// Keywords
'target' | 'import' | 'main' | 'realtime' | 'reactor' | 'state' | 'time' |
'mutable' | 'input' | 'output' | 'timer' | 'action' | 'reaction' |
Expand Down
Loading

0 comments on commit 59618b7

Please sign in to comment.