Added 'GraalVM' as overlay bundle.
This commit is contained in:
parent
3cff7fe815
commit
c06a36fae1
@ -135,6 +135,7 @@ OVERLAY_TYPE=folder
|
||||
# dropbear - SSH server and client.
|
||||
# felix - Apache Felix OSGi framework.
|
||||
# fio - I/O load generator.
|
||||
# graalvm - VM for Java, JavaScript, Python, Ruby, R, LLVM.
|
||||
# java - Oracle JRE or JDK. Manual preparations are required.
|
||||
# kbd - keyboard utilities.
|
||||
# kernel_modules - default MLL kernel modules and 'mdev' hotplug manager.
|
||||
|
@ -63,6 +63,11 @@ Currently available overlay bundles:
|
||||
workloads on RAM or disks. 'fio' is essential for
|
||||
troubleshooting data I/O bottlenecks.
|
||||
|
||||
GraalVM - Universal virtual machine for running applications written
|
||||
in JavaScript, Python, Ruby, R, JVM-based languages like
|
||||
Java, Scala, Clojure, Kotlin, and LLVM-based languages such
|
||||
as C and C++.
|
||||
|
||||
JRE / JDK - Oracle JRE/JDK. This overlay bundle requires some manual
|
||||
preparation steps. Refer to the 'JAVA_ARCHIVE' property in
|
||||
the '.config' file for more information. This overlay bundle
|
||||
|
17
src/minimal_overlay/bundles/graalvm/.config
Normal file
17
src/minimal_overlay/bundles/graalvm/.config
Normal file
@ -0,0 +1,17 @@
|
||||
# You can find the latest GraalVM archives here:
|
||||
#
|
||||
# http://github.com/oracle/graal
|
||||
#
|
||||
GRAALVM_URL=http://github.com/oracle/graal/releases/download/vm-1.0.0-rc1/graalvm-ce-1.0.0-rc1-linux-amd64.tar.gz
|
||||
|
||||
# List of additional languages to install. The full catalog can be found here:
|
||||
#
|
||||
# https://www.graalvm.org/1.0.0-rc1/component-catalog/graal-updater-component-catalog.properties
|
||||
#
|
||||
# The corresponding languages and their executables:
|
||||
#
|
||||
# org.graalvm.ruby the main executable is 'ruby' or 'truffleruby'
|
||||
# org.graalvm.pythn the main executable is 'graalpython'
|
||||
# org.graalvm.r the main executable is 'R' or 'Rscript'
|
||||
#
|
||||
GRAALVM_LANGUAGES=python,ruby,r
|
38
src/minimal_overlay/bundles/graalvm/01_get.sh
Executable file
38
src/minimal_overlay/bundles/graalvm/01_get.sh
Executable file
@ -0,0 +1,38 @@
|
||||
#!/bin/sh
|
||||
|
||||
set -e
|
||||
|
||||
. ../../common.sh
|
||||
|
||||
# Read the common configuration properties.
|
||||
DOWNLOAD_URL=`read_property GRAALVM_URL`
|
||||
USE_LOCAL_SOURCE=`read_property USE_LOCAL_SOURCE`
|
||||
|
||||
# Grab everything after the last '/' character.
|
||||
ARCHIVE_FILE=${DOWNLOAD_URL##*/}
|
||||
|
||||
if [ "$USE_LOCAL_SOURCE" = "true" -a ! -f $MAIN_SRC_DIR/source/overlay/$ARCHIVE_FILE ] ; then
|
||||
echo "Bundle $MAIN_SRC_DIR/source/overlay/$ARCHIVE_FILE is missing and will be downloaded."
|
||||
USE_LOCAL_SOURCE="false"
|
||||
fi
|
||||
|
||||
cd $MAIN_SRC_DIR/source/overlay
|
||||
|
||||
if [ ! "$USE_LOCAL_SOURCE" = "true" ] ; then
|
||||
# Downloading GraalVM bundle file. The '-c' option allows the download to resume.
|
||||
echo "Downloading GraalVM bundle from $DOWNLOAD_URL"
|
||||
wget -c $DOWNLOAD_URL
|
||||
else
|
||||
echo "Using local GraalVM bundle $MAIN_SRC_DIR/source/overlay/$ARCHIVE_FILE"
|
||||
fi
|
||||
|
||||
# Delete folder with previously extracted Felix.
|
||||
echo "Removing GraalVM work area. This may take a while."
|
||||
rm -rf $WORK_DIR/overlay/$BUNDLE_NAME
|
||||
mkdir $WORK_DIR/overlay/$BUNDLE_NAME
|
||||
|
||||
# Extract GraalVM to folder 'work/overlay/graalvm'.
|
||||
# Full path will be something like 'work/overlay/graalvm/graalvm-1.0.0-rc1'.
|
||||
tar -xvf $ARCHIVE_FILE -C $WORK_DIR/overlay/$BUNDLE_NAME
|
||||
|
||||
cd $SRC_DIR
|
42
src/minimal_overlay/bundles/graalvm/02_install.sh
Executable file
42
src/minimal_overlay/bundles/graalvm/02_install.sh
Executable file
@ -0,0 +1,42 @@
|
||||
#!/bin/sh
|
||||
|
||||
set -e
|
||||
|
||||
. ../../common.sh
|
||||
|
||||
cd $WORK_DIR/overlay/$BUNDLE_NAME
|
||||
mv `ls -d *` $BUNDLE_NAME
|
||||
|
||||
mkdir opt
|
||||
mv graalvm opt
|
||||
|
||||
# Remove the unnecessary Java sources which just take valuable space.
|
||||
rm -f opt/graalvm/src.zip
|
||||
|
||||
mkdir $WORK_DIR/overlay/$BUNDLE_NAME/bin
|
||||
cd $WORK_DIR/overlay/$BUNDLE_NAME/bin
|
||||
|
||||
# Read the additional languages to install.
|
||||
GRAALVM_LANGUAGES=`read_property GRAALVM_LANGUAGES`
|
||||
|
||||
LANGUAGES_LIST="$(echo $GRAALVM_LANGUAGES | tr ',' ' ')"
|
||||
|
||||
# Install the additional languages
|
||||
for LANGUAGE in $LANGUAGES_LIST
|
||||
do
|
||||
./../opt/$BUNDLE_NAME/bin/gu -c install org.graalvm.$LANGUAGE
|
||||
done
|
||||
|
||||
for FILE in $(ls ../opt/$BUNDLE_NAME/bin)
|
||||
do
|
||||
ln -s ../opt/$BUNDLE_NAME/bin/$FILE $FILE
|
||||
done
|
||||
|
||||
# With '--remove-destination' all possibly existing soft links in
|
||||
# '$OVERLAY_ROOTFS' will be overwritten correctly.
|
||||
cp -r --remove-destination $WORK_DIR/overlay/$BUNDLE_NAME/* \
|
||||
$OVERLAY_ROOTFS
|
||||
|
||||
echo "GraalVM has been installed."
|
||||
|
||||
cd $SRC_DIR
|
10
src/minimal_overlay/bundles/graalvm/bundle.sh
Executable file
10
src/minimal_overlay/bundles/graalvm/bundle.sh
Executable file
@ -0,0 +1,10 @@
|
||||
#!/bin/sh
|
||||
|
||||
set -e
|
||||
|
||||
. ../../common.sh
|
||||
|
||||
./01_get.sh
|
||||
./02_install.sh
|
||||
|
||||
cd $SRC_DIR
|
2
src/minimal_overlay/bundles/graalvm/bundle_deps
Normal file
2
src/minimal_overlay/bundles/graalvm/bundle_deps
Normal file
@ -0,0 +1,2 @@
|
||||
glibc_full
|
||||
zlib
|
Loading…
x
Reference in New Issue
Block a user