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

[Feature:Autograding] Add Salsa image #49

Merged
merged 6 commits into from
Oct 11, 2024
Merged
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
34 changes: 34 additions & 0 deletions dockerfiles/salsa/1.1.6/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
FROM ubuntu:22.04

# DO NOT EXPOSE ANY PORTS IN THIS FILE

# Install necessary packages (Java and curl)
RUN apt-get update \
&& apt-get install -y openjdk-17-jdk curl --no-install-recommends \
ION606 marked this conversation as resolved.
Show resolved Hide resolved
&& rm -rf /var/lib/apt/lists/*

WORKDIR /usr/src/app

RUN mkdir -p /usr/local/lib/salsa
ENV SALSA_JAR_SHA256=821fe5ec2922ff32f09fa55280afd023aa9852c7cc074f90cd086a4691e327af

# Download the Salsa compiler jar file
RUN curl -SL -o /usr/local/lib/salsa/salsa1.1.6.jar http://wcl.cs.rpi.edu/salsa/releases/salsa1.1.6.jar \
&& echo "$SALSA_JAR_SHA256 /usr/local/lib/salsa/salsa1.1.6.jar" | sha256sum -c -

RUN apt-get remove curl -y && apt autoremove -y && apt clean -y

# Set environment variable for the Salsa compiler jar location
ENV SALSA_COMPILER_JAR=/usr/local/lib/salsa/salsa1.1.6.jar
ENV SALSAOPTS=""

# Write aliases to a separate file
RUN echo "alias salsac='java -cp $SALSA_COMPILER_JAR:. salsac.SalsaCompiler *.salsa; javac -classpath $SALSA_COMPILER_JAR:. *.java'" >> /usr/src/app/salsa_aliases.sh && \
echo "alias salsa='java -cp $SALSA_COMPILER_JAR:. $SALSAOPTS'" >> /usr/src/app/salsa_aliases.sh && \
echo "alias wwcns='java -cp $SALSA_COMPILER_JAR:. wwc.naming.WWCNamingServer'" >> /usr/src/app/salsa_aliases.sh && \
echo "alias wwctheater='java -cp $SALSA_COMPILER_JAR:. $SALSAOPTS wwc.messaging.Theater'" >> /usr/src/app/salsa_aliases.sh

# make sure the aliases script gets sourced on container start
RUN echo "source /usr/src/app/salsa_aliases.sh" >> /etc/bash.bashrc

CMD ["bash"]
3 changes: 3 additions & 0 deletions dockerfiles/salsa/metadata.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"pushLatest": false
}
Loading