Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft: Apply pluggable security for federated execution #2466

Draft
wants to merge 22 commits into
base: networkdriver
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
import org.lflang.target.property.ClockSyncOptionsProperty;
import org.lflang.target.property.ClockSyncOptionsProperty.ClockSyncOptions;
import org.lflang.target.property.CmakeIncludeProperty;
import org.lflang.target.property.CommunicationTypeProperty;
import org.lflang.target.property.CommunicationModeProperty;
import org.lflang.target.property.CompileDefinitionsProperty;
import org.lflang.target.property.CoordinationOptionsProperty;
import org.lflang.target.property.CoordinationProperty;
Expand Down Expand Up @@ -202,9 +202,9 @@ public static void handleCompileDefinitions(
if (federate.targetConfig.get(AuthProperty.INSTANCE)) {
definitions.put("FEDERATED_AUTHENTICATED", "");
}
if (federate.targetConfig.isSet(CommunicationTypeProperty.INSTANCE)) {
if (federate.targetConfig.isSet(CommunicationModeProperty.INSTANCE)) {
definitions.put(
"COMM_TYPE", federate.targetConfig.get(CommunicationTypeProperty.INSTANCE).toString());
"COMM_TYPE", federate.targetConfig.get(CommunicationModeProperty.INSTANCE).toString());
}
definitions.put("NUMBER_OF_FEDERATES", String.valueOf(federateNames.size()));
definitions.put("EXECUTABLE_PREAMBLE", "");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,14 @@
import org.lflang.lf.VarRef;
import org.lflang.target.Target;
import org.lflang.target.TargetConfig;
import org.lflang.target.property.CommunicationModeProperty;
import org.lflang.target.property.CoordinationProperty;
import org.lflang.target.property.DockerProperty;
import org.lflang.target.property.DockerProperty.DockerOptions;
import org.lflang.target.property.KeepaliveProperty;
import org.lflang.target.property.NoCompileProperty;
import org.lflang.target.property.PlatformProperty;
import org.lflang.target.property.type.CommunicationModeType.CommunicationMode;
import org.lflang.target.property.type.CoordinationModeType.CoordinationMode;
import org.lflang.util.Averager;
import org.lflang.util.FileUtil;
Expand Down Expand Up @@ -159,6 +161,12 @@ public boolean doGenerate(Resource resource, LFGeneratorContext context) throws
// for logical connections.
replaceFederateConnectionsWithProxies(federation, main, resource);

// If communication mode is SST, generate configurations for SST.
if (context.getTargetConfig().get(CommunicationModeProperty.INSTANCE)
== CommunicationMode.SST) {
SSTGenerator.setupSST(fileConfig, federates, messageReporter, context, rtiConfig);
}

FedEmitter fedEmitter =
new FedEmitter(
fileConfig,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,26 @@ public Path getFedBinPath() {
return getFedGenPath().resolve("bin");
}

public Path getSSTPath() {
return getGenPath().resolve("sst");
}

public Path getSSTConfigPath() {
return getSSTPath().resolve("configs");
}

public Path getSSTCredentialsPath() {
return getSSTPath().resolve("credentials");
}

public Path getSSTGraphsPath() {
return getSSTPath().resolve("graphs");
}

public Path getSSTAuthPath() {
return getSSTPath().resolve("auth");
}

@Override
public void doClean() throws IOException {
super.doClean();
Expand Down
Loading