Skip to content

Commit be77488

Browse files
authored
[Feature:Autograding] Add Salsa image (#49)
### Please check if the PR fulfills these requirements: * [x] Tests for the changes have been added/updated (if possible) * [x] Documentation has been updated/added if relevant ### What is the current behavior? <!-- List issue if it fixes/closes/implements one using the "Fixes #<number>" or "Closes #<number>" syntax --> none ### What is the new behavior? we can now run salsa files ### Other information? <!-- Is this a breaking change? --> <!-- How did you test --> this is not a breaking change and I tested it using some simple files (I included an example below): ```salsa module demo; /* Actors with this behavior simply create a migrate actor with the specified UAN and first UAL and then migrate to the second UAL. */ behavior Migrate { void print() { standardOutput<-println( "Migrate actor just migrated here." ); } void act( String[] args ) { if (args.length != 3) { standardOutput<-println( "Usage: java migration.Migrate <UAN> <srcUAL> <destUAL> " ); return; } UAN uan = new UAN(args[0]); UAL ual = new UAL(args[1]); Migrate migrateActor = new Migrate() at (uan, ual); migrateActor<-print() @ migrateActor<-migrate( args[2] ) @ migrateActor<-print(); } } ```
1 parent b22a0ef commit be77488

File tree

2 files changed

+37
-0
lines changed

2 files changed

+37
-0
lines changed

dockerfiles/salsa/1.1.6/Dockerfile

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
FROM ubuntu:22.04
2+
3+
# DO NOT EXPOSE ANY PORTS IN THIS FILE
4+
5+
# Install necessary packages (Java and curl)
6+
RUN apt-get update \
7+
&& apt-get install -y openjdk-17-jdk curl --no-install-recommends \
8+
&& rm -rf /var/lib/apt/lists/*
9+
10+
WORKDIR /usr/src/app
11+
12+
RUN mkdir -p /usr/local/lib/salsa
13+
ENV SALSA_JAR_SHA256=821fe5ec2922ff32f09fa55280afd023aa9852c7cc074f90cd086a4691e327af
14+
15+
# Download the Salsa compiler jar file
16+
RUN curl -SL -o /usr/local/lib/salsa/salsa1.1.6.jar http://wcl.cs.rpi.edu/salsa/releases/salsa1.1.6.jar \
17+
&& echo "$SALSA_JAR_SHA256 /usr/local/lib/salsa/salsa1.1.6.jar" | sha256sum -c -
18+
19+
RUN apt-get remove curl -y && apt autoremove -y && apt clean -y
20+
21+
# Set environment variable for the Salsa compiler jar location
22+
ENV SALSA_COMPILER_JAR=/usr/local/lib/salsa/salsa1.1.6.jar
23+
ENV SALSAOPTS=""
24+
25+
# Write aliases to a separate file
26+
RUN echo "alias salsac='java -cp $SALSA_COMPILER_JAR:. salsac.SalsaCompiler *.salsa; javac -classpath $SALSA_COMPILER_JAR:. *.java'" >> /usr/src/app/salsa_aliases.sh && \
27+
echo "alias salsa='java -cp $SALSA_COMPILER_JAR:. $SALSAOPTS'" >> /usr/src/app/salsa_aliases.sh && \
28+
echo "alias wwcns='java -cp $SALSA_COMPILER_JAR:. wwc.naming.WWCNamingServer'" >> /usr/src/app/salsa_aliases.sh && \
29+
echo "alias wwctheater='java -cp $SALSA_COMPILER_JAR:. $SALSAOPTS wwc.messaging.Theater'" >> /usr/src/app/salsa_aliases.sh
30+
31+
# make sure the aliases script gets sourced on container start
32+
RUN echo "source /usr/src/app/salsa_aliases.sh" >> /etc/bash.bashrc
33+
34+
CMD ["bash"]

dockerfiles/salsa/metadata.json

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"pushLatest": false
3+
}

0 commit comments

Comments
 (0)