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

Replace Ammonite with Scala-CLI #1165

Closed
wants to merge 3 commits into from
Closed
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
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ For more detailed changes see:
- New [ROBOT Version 1.9.6](https://github.com/ontodev/robot/releases/tag/v1.9.6). This came with a great number of updates and upgrades, see release notes.
- J2cli, a command-line tool to process Jinja2 templates, has been replaced by [Jinjanator](https://github.com/kpfleming/jinjanator). If your custom workflows invoke the `j2` tool, you will need to update them to use `jinjanate` instead.
- New program `dicer-cli` to manage the ID range file.
- Ammonite, the Scala interpreter, is no longer provided in the ODKLite image. If you need Ammonite, you must now use the ODKFull image.
- Ammonite, the Scala interpreter, has been replaced by Scala-CLI. The new interpreter is only available in the ODKFull image.

## New configuration options

Expand Down
13 changes: 7 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ ENV ODK_VERSION=$ODK_VERSION
ENV JENA_VERSION=4.9.0
ENV KGCL_JAVA_VERSION=0.5.1
ENV SSSOM_JAVA_VERSION=1.1.1
ENV AMMONITE_VERSION=2.5.9
ENV SCALA_CLI_VERSION=1.5.4

# Avoid repeated downloads of script dependencies by mounting the local coursier cache:
# docker run -v $HOME/.coursier/cache/v1:/tools/.coursier-cache ...
Expand Down Expand Up @@ -86,11 +86,12 @@ RUN test "x$TARGETARCH" = xamd64 && ( \
RUN wget -nv http://archive.apache.org/dist/jena/binaries/apache-jena-$JENA_VERSION.tar.gz -O- | tar xzC /tools && \
mv /tools/apache-jena-$JENA_VERSION /tools/apache-jena

# Install Ammonite
RUN wget -nv https://github.com/lihaoyi/Ammonite/releases/download/$AMMONITE_VERSION/2.13-$AMMONITE_VERSION \
-O /tools/amm && \
chmod 755 /tools/amm && \
java -cp /tools/amm ammonite.AmmoniteMain /dev/null
# Install Scala-CLI
RUN wget -nv https://github.com/VirtusLab/scala-cli/releases/download/v$SCALA_CLI_VERSION/scala-cli.jar \
-O /tools/scala-cli.jar && \
echo "#!/bin/bash" > /tools/scala-cli && \
echo "java -jar /tools/scala-cli.jar \"\$@\"" >> /tools/scala-cli && \
chmod 0755 /tools/scala-cli

# Install SPARQLProg.
RUN swipl -g "pack_install(sparqlprog, [interactive(false),global(true)])" -g halt
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ test_odkfull_programs: test_odklite_programs
@./tests/test-program.sh KONCLUDE Konclude -h
@./tests/test-program.sh SOUFFLE souffle --version
@./tests/test-program.sh JENA jena
@./tests/test-program.sh AMMONITE sh amm --help
@./tests/test-program.sh SCALA-CLI scala-cli --version
@./tests/test-program.sh SPARQL sparql --version
@./tests/test-program.sh SPARQLPROG pl2sparql -g halt
@./tests/test-program.sh OBO-DASHBOARD obodash --help
Expand Down
4 changes: 4 additions & 0 deletions scripts/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ mkdir -p /home/odkuser
chown odkuser:odkuser /home/odkuser
[ -d /home/odkuser/.data ] && chown odkuser:odkuser /home/odkuser/.data
[ -d /home/odkuser/.data/oaklib ] && chown odkuser:odkuser /home/odkuser/.data/oaklib
if [ ! -d /tools/.coursier-cache ] ; then
mkdir /tools/.coursier-cache
chown odkuser:odkuser /tools/.coursier-cache
fi
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You removed Ammonite, but build logic to handle coursier cache? Is /tools/.coursier-cache used for anything other than ammonite?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Scala-CLI uses it as well. :)

PATH=$PATH:/home/odkuser/.local/bin
[ -S /run/host-services/ssh-auth.sock ] && chown odkuser /run/host-services/ssh-auth.sock

Expand Down
Loading