-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' of github.com:PRL-PRG/r-compile-server
- Loading branch information
Showing
9,112 changed files
with
30,723 additions
and
2,864 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,79 +1,70 @@ | ||
# This Dockerfile uses separate build arguments instead of VARIANT | ||
ARG TARGET_JAVA_VERSION=22.0.2+9 | ||
ARG TARGET_GNUR_VERSION=4.3.2 | ||
ARG TARGET_DEBIAN_VERSION=bookworm | ||
FROM mcr.microsoft.com/devcontainers/base:$TARGET_DEBIAN_VERSION | ||
ARG JAVA_VERSION=22 | ||
ARG MAVEN_VERSION=3.9.9 | ||
ARG LLVM_VERSION=17 | ||
ARG BASE_IMAGE=ubuntu-24.04 | ||
|
||
USER root | ||
ARG TARGET_JAVA_VERSION | ||
ARG TARGET_GNUR_VERSION | ||
ENV JAVA_HOME=/usr/lib/jvm/jdk | ||
ENV PATH="$JAVA_HOME/bin:$PATH" | ||
# Default to UTF-8 file.encoding | ||
ENV LANG=en_US.UTF-8 | ||
|
||
# Install OpenJDK (Adoptium / temurin) | ||
RUN arch="$(dpkg --print-architecture)" \ | ||
&& case "$arch" in \ | ||
"amd64") \ | ||
arch1="x64"; \ | ||
;; \ | ||
"arm64") \ | ||
arch1="aarch64"; \ | ||
;; \ | ||
*) echo >&2 "error: unsupported architecture: '$arch'"; exit 1 ;; \ | ||
esac \ | ||
&& jdkUrl="https://github.com/adoptium/temurin22-binaries/releases/download/jdk-$TARGET_JAVA_VERSION/OpenJDK22U-jdk_${arch1}_linux_hotspot_$(echo $TARGET_JAVA_VERSION | tr '+' '_').tar.gz" \ | ||
&& wget --progress=dot:giga -O temurin.tar.gz "$jdkUrl" \ | ||
&& wget --progress=dot:giga -O sha256.txt "$jdkUrl.sha256.txt" | ||
|
||
RUN sha256Text=$(cat sha256.txt) \ | ||
&& sha256=$(expr substr "$sha256Text" 1 64) \ | ||
&& echo "$sha256 temurin.tar.gz" | sha256sum --strict --check - \ | ||
&& rm sha256.txt* | ||
FROM mcr.microsoft.com/devcontainers/base:$BASE_IMAGE | ||
|
||
RUN mkdir -p "$JAVA_HOME" | ||
RUN tar --extract \ | ||
--file temurin.tar.gz \ | ||
--directory "$JAVA_HOME" \ | ||
--strip-components 1 \ | ||
--no-same-owner | ||
RUN rm temurin.tar.gz* | ||
|
||
RUN ln -s $JAVA_HOME /docker-java-home | ||
RUN ln -s $JAVA_HOME /usr/local/openjdk-$(echo $TARGET_JAVA_VERSION | cut -d'-' -f1) | ||
|
||
# Install GNU-R | ||
# From https://cran.r-project.org/doc/manuals/r-release/R-admin.html#Essential-and-useful-other-programs-under-a-Unix_002dalike | ||
ARG GNUR_RUNTIME_DEPENDENCIES="build-essential gfortran" | ||
ARG GNUR_BUILD_DEPENDENCIES="libreadline-dev zlib1g-dev libbz2-dev liblzma-dev libpcre2-dev" | ||
# default to UTF-8 file.encoding | ||
ENV LANG=en_US.UTF-8 | ||
|
||
RUN gnurUrl="https://cloud.r-project.org/src/base/R-$(printf %.1s $TARGET_GNUR_VERSION)/R-$TARGET_GNUR_VERSION.tar.gz" \ | ||
&& wget --progress=dot:giga -O gnur.tar.gz "$gnurUrl" | ||
# this is weird, but without this, the default value would not be used. | ||
ARG JAVA_VERSION | ||
ARG MAVEN_VERSION | ||
ARG LLVM_VERSION | ||
|
||
RUN mkdir -p /tmp/gnur | ||
RUN tar --extract \ | ||
--file gnur.tar.gz \ | ||
--directory /tmp/gnur \ | ||
--strip-components 1 \ | ||
--no-same-owner | ||
RUN rm gnur.tar.gz* | ||
# install OpenJDK | ||
RUN curl -fsSL https://packages.adoptium.net/artifactory/api/gpg/key/public | gpg --dearmor | tee /etc/apt/trusted.gpg.d/adoptium.gpg > /dev/null \ | ||
&& echo "deb https://packages.adoptium.net/artifactory/deb $(awk -F= '/^VERSION_CODENAME/{print$2}' /etc/os-release) main" | tee /etc/apt/sources.list.d/adoptium.list \ | ||
&& apt update -y \ | ||
&& apt install -y temurin-$JAVA_VERSION-jdk \ | ||
&& ln -s "$(which java | xargs readlink -f | xargs dirname | xargs dirname)" /opt/java | ||
|
||
RUN DEBIAN_FRONTEND=noninteractive apt-get update | ||
RUN DEBIAN_FRONTEND=noninteractive apt-get -y install --no-install-recommends $GNUR_BUILD_DEPENDENCIES $GNUR_RUNTIME_DEPENDENCIES | ||
# install maven | ||
RUN mkdir -p /opt/maven \ | ||
&& curl -fsSL -o /tmp/apache-maven.tar.gz "https://dlcdn.apache.org/maven/maven-3/$MAVEN_VERSION/binaries/apache-maven-$MAVEN_VERSION-bin.tar.gz" \ | ||
&& tar -xzf /tmp/apache-maven.tar.gz -C /opt/maven --strip-components=1 \ | ||
&& rm -f /tmp/apache-maven.tar.gz | ||
|
||
RUN cd /tmp/gnur \ | ||
&& ./tools/rsync-recommended \ | ||
&& ./configure --prefix=/usr/local --with-x=no \ | ||
&& make \ | ||
&& make install | ||
RUN rm -rf /tmp/gnur | ||
ENV MAVEN_HOME=/opt/maven | ||
ENV JAVA_HOME=/opt/java | ||
ENV PATH="$PATH:$MAVEN_HOME/bin" | ||
|
||
RUN DEBIAN_FRONTEND=noninteractive apt-get -y remove --purge $GNUR_BUILD_DEPENDENCIES | ||
# Fortran is needed at | ||
RUN DEBIAN_FRONTEND=noninteractive apt-get -y install --no-install-recommends gfortran | ||
RUN DEBIAN_FRONTEND=noninteractive apt-get -y autoremove | ||
# install support for building client: | ||
# - the bundled R | ||
# - the rsh R package | ||
RUN apt update -y \ | ||
&& apt install -y \ | ||
bear \ | ||
build-essential \ | ||
ca-certificates \ | ||
gdb \ | ||
gfortran \ | ||
libbz2-dev \ | ||
libcairo2-dev \ | ||
libcurl4-openssl-dev \ | ||
libgrpc++-dev \ | ||
libgtk2.0-dev \ | ||
libicu-dev \ | ||
libjpeg-dev \ | ||
liblzma-dev \ | ||
libpango1.0-dev \ | ||
libpng-dev \ | ||
libreadline-dev \ | ||
libssl-dev \ | ||
libtiff5-dev \ | ||
libx11-dev \ | ||
libxt-dev \ | ||
libxxhash-dev \ | ||
libzmq3-dev \ | ||
protobuf-compiler \ | ||
protobuf-compiler-grpc \ | ||
rr \ | ||
software-properties-common \ | ||
xvfb \ | ||
zlib1g-dev | ||
|
||
# [Optional] Uncomment this section to install additional OS packages. | ||
# RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \ | ||
# && apt-get -y install --no-install-recommends <your-package-list-here> | ||
# install LLVM | ||
RUN curl -fsSL -o /opt/llvm.sh https://apt.llvm.org/llvm.sh \ | ||
&& chmod +x /opt/llvm.sh \ | ||
&& /opt/llvm.sh "$LLVM_VERSION" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,33 @@ | ||
{ | ||
"name": "r-compile-server", | ||
"build": { | ||
"dockerfile": "./Dockerfile", | ||
"context": "." | ||
}, | ||
features: { | ||
"ghcr.io/devcontainers/features/java:1": { | ||
"installMaven": "true" | ||
// ensure consistency between vscode and intellij | ||
// the embedded R uses absolute paths | ||
"workspaceMount": "source=${localWorkspaceFolder},target=/workspace,type=bind,consistency=cached", | ||
"workspaceFolder": "/workspace", | ||
"postCreateCommand": "make setup", | ||
"customizations": { | ||
"vscode": { | ||
"extensions": [ | ||
"vscjava.vscode-java-pack", | ||
"llvm-vs-code-extensions.vscode-clangd", | ||
"vadimcn.vscode-lldb" | ||
] | ||
} | ||
}, | ||
"containerEnv": { | ||
"JAVA_HOME": "/usr/lib/jvm/jdk" | ||
// needed for ptrace based debuggers such as gdb / rr | ||
"runArgs": [ | ||
"--cap-add=SYS_PTRACE", | ||
"--security-opt", | ||
"seccomp=unconfined" | ||
], | ||
"updateRemoteUserUID": true, | ||
"features": { | ||
"ghcr.io/devcontainers/features/common-utils:2": { | ||
"configureZshAsDefaultShell": true | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,28 @@ | ||
#!/bin/bash | ||
|
||
everything_staged=$(git diff --name-only) | ||
SERVER_DIR="server" | ||
|
||
cd "$SERVER_DIR" | ||
|
||
everything_staged=$(git diff --name-only -- "$SERVER_DIR") | ||
# `no_partial_stages` from https://github.com/evilmartians/lefthook/issues/140#issuecomment-1012967850 | ||
no_partial_stages=$(comm -12 <(git diff --name-only | sort) <(git diff --name-only --staged | sort)) | ||
format_only_staged=-DspotlessFiles="$(git diff --staged --name-only | sed 's/^/.*/' | paste -sd ',' -)" | ||
no_partial_stages=$(comm -12 <(git diff --name-only -- "$SERVER_DIR" | sort) <(git diff --name-only --staged -- "$SERVER_DIR" | sort)) | ||
format_only_staged=-DspotlessFiles="$(git diff --staged --name-only -- "$SERVER_DIR" | sed 's/^/.*/' | paste -sd ',' -)" | ||
|
||
if [ -n "$no_partial_stages" ]; then | ||
# Format only staged changes. Don't commit if we change anything, because we can't partially format a file, and it's | ||
# ambiguous what formatting changes should be staged and what shouldn't. | ||
mvn spotless:check "$format_only_staged" || { | ||
mvn spotless:apply "$format_only_staged" | ||
echo "Reformatted a partially-staged file. Re-interactively-stage and commit again." | ||
exit 1 | ||
} | ||
# Format only staged changes. Don't commit if we change anything, because we can't partially format a file, and it's | ||
# ambiguous what formatting changes should be staged and what shouldn't. | ||
mvn spotless:check "$format_only_staged" || { | ||
mvn spotless:apply "$format_only_staged" | ||
echo "Reformatted a partially-staged file. Re-interactively-stage and commit again." | ||
exit 1 | ||
} | ||
elif [ -n "$everything_staged" ]; then | ||
# Format only staged changes. We must re-add them because the formats aren't committed. | ||
mvn spotless:apply "$format_only_staged" | ||
git diff --name-only --staged | tr \\n \\0 | xargs -0 git add -f | ||
# Format only staged changes. We must re-add them because the formats aren't committed. | ||
mvn spotless:apply "$format_only_staged" | ||
git diff --name-only --staged -- "$SERVER_DIR" | tr \\n \\0 | xargs -0 git add -f | ||
else | ||
# Format everything because spotless caches. We must re-add everything because the formats aren't committed. | ||
mvn spotless:apply | ||
git add -u | ||
# Format everything because spotless caches. We must re-add everything because the formats aren't committed. | ||
mvn spotless:apply | ||
git add -u | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,47 +1,28 @@ | ||
**/src/test/snapshots/**/*.fail* | ||
!src/test/resources/**/*.log | ||
|
||
### Tempfiles ### | ||
.devcontainer/.features.temp.dockerfile | ||
|
||
### Build ### | ||
target/ | ||
!.mvn/wrapper/maven-wrapper.jar | ||
!**/src/main/**/target/ | ||
!**/src/test/**/target/ | ||
|
||
### IntelliJ IDEA ### | ||
.idea/modules.xml | ||
.idea/jarRepositories.xml | ||
.idea/compiler.xml | ||
.idea/libraries/ | ||
*.iws | ||
*.iml | ||
*.ipr | ||
|
||
### Eclipse ### | ||
.apt_generated | ||
.classpath | ||
.factorypath | ||
.project | ||
# We actually want to sync this | ||
# .settings | ||
.springBeans | ||
.sts4-cache | ||
|
||
### NetBeans ### | ||
/nbproject/private/ | ||
/nbbuild/ | ||
/dist/ | ||
/nbdist/ | ||
/.nb-gradle/ | ||
build/ | ||
!**/src/main/**/build/ | ||
!**/src/test/**/build/ | ||
|
||
### VS Code ### | ||
# We actually want to sync this | ||
# .vscode/ | ||
|
||
### Mac OS ### | ||
.DS_Store | ||
.DS_Store | ||
|
||
### R ### | ||
.RData | ||
.Rhistory | ||
external/R/doc/manual/*.html | ||
external/R/doc/NEWS.pdf | ||
..Rcheck | ||
|
||
### C ### | ||
.cache | ||
.gdb_history | ||
compile_commands.json | ||
*.so | ||
*.o | ||
|
||
### IntelliJ IDEA ### | ||
/.idea/uiDesigner.xml | ||
.idea/modules.xml | ||
.idea/workspace.iml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
[submodule "external/R"] | ||
path = external/R | ||
url = https://github.com/PRL-PRG/r-compiler-server-gnur | ||
ignore = untracked | ||
[submodule "external/R-debug"] | ||
path = external/R-debug | ||
url = https://github.com/PRL-PRG/r-compiler-server-gnur |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.