Skip to content

Commit

Permalink
Pushing forward with docker and tuto docs
Browse files Browse the repository at this point in the history
  • Loading branch information
Rojods committed Jul 25, 2024
1 parent 7101281 commit 21a5d70
Show file tree
Hide file tree
Showing 3 changed files with 61 additions and 9 deletions.
19 changes: 11 additions & 8 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
FROM ubuntu:22.04

# syntax=docker/dockerfile:labs
FROM debian:bookworm-slim
# Set environment variables
ARG GRADLE_HOME=/opt/gradle
ARG GRADLE_VERSION=8.1-rc-1
Expand All @@ -11,7 +11,7 @@ RUN apt-get update && \
apt-get install -y build-essential wget curl apt-transport-https gnupg unzip zip git openjdk-${OPENJDK_VERSION}-jdk && \
apt-get clean
# For Java
ENV PATH="/usr/bin:${PATH}"
# ENV PATH="/usr/bin:${PATH}"

# Install Cargo, build tool for the Rust parts of IDeSyDe
#! set version!!!
Expand Down Expand Up @@ -44,17 +44,20 @@ RUN wget -c https://github.com/MiniZinc/MiniZincIDE/releases/download/${MINIZINC
ENV PATH="${PATH}:/MiniZincIDE-${MINIZINC_VERSION}-bundle-linux-x86_64/bin"

# Set the working directory
ENV ROOT_DIR /app
COPY . /app
ENV ROOT_DIR=/app
ADD https://github.com/forsyde/IDeSyDe.git#develop /IDeSyDe

WORKDIR /app/IDeSyDe
WORKDIR /IDeSyDe

RUN cargo build --release
RUN cp ./target/release/idesyde-orchestration idesyde
RUN sbt publishModules
RUN ./gradlew publishModules
RUN gradle publishModules

RUN apt-get purge -y wget curl apt-transport-https gnupg unzip zip && \
apt-get autoremove -y

# ENTRYPOINT [ "./idesyde" ]
ENTRYPOINT [ "./idesyde" ]



Expand Down
49 changes: 49 additions & 0 deletions docs/extensions.md
Original file line number Diff line number Diff line change
Expand Up @@ -201,5 +201,54 @@ public record AmaltheaDesignModel(
where the `category` is an identifier so that other languages might be able to consume this design model (if necessary) from its "opaque" form.
The opaqueness in this case is the DSI term for serialized in a standard format.
Similarly, `format` describes the file format on disk for this design model, which is `amxmi` for XMI files exchanged in App4mc (AMALTHEA) applications.
There is an important information missing in this design model: the elements identifiers that can be identified out of this model.
Thus, we override another method of this interface: `elements`,

```
...
@Override
public Set<String> elements() {
HashSet<String> elems = new HashSet<>();
amaltheaModel.getSwModel().getTasks().forEach(task -> elems.add(task.getName()));
return elems;
}
...
```

In this case, we are saying that the only elements that may be identified (from IDeSyDe's perspective) are the tasks in the AMALTHEA model.
Naturally, this should be much bigger outside the scope of this tutorial; an AMALTHEA model has platform information, timing information, constraints information etc.
Anything that could be identfied out of an AMALTHEA model should appear in the `elements` set generated by this design model.
In the small and pedagogical scope of this tutorial, this is enough.

### Decision model

For this tutorial, let us aim to have a decision model that captures indenpendent periodic task models without the instrumentation data, i.e. without worst-case execution times (WCET).
This means that every single one of our tasks can be described as a triple `(Period, Relative deadline, Offset)`.
So let's go ahead and make a decision model that captures exactly this information:

```
package tutorial;
import idesyde.core.DecisionModel;
import java.util.Set;
public record IndependentPeriodicTasks(
List<String> tasks,
List<Double> periods,
List<Double> realtiveDeadlines,
List<Double> offsets
) implements DecisionModel {
@Override
public String category() {
return "IndependentPeriodicTasks";
}
}
```

## Rust embedded module

TBD
2 changes: 1 addition & 1 deletion java-bridge-forsyde-io/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ plugins {
id 'idesyde.java-standalone-module'
}

def forsydeioVersion = "master-SNAPSHOT"
def forsydeioVersion = "develop-SNAPSHOT"

dependencies {
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.8.1'
Expand Down

0 comments on commit 21a5d70

Please sign in to comment.