mirror of
https://github.com/MillironX/singularity-builds.git
synced 2024-11-21 17:36:04 +00:00
Update Julia to 1.6.2 and switched to Alpine base image
This commit is contained in:
parent
a0377be27a
commit
6763d3254e
1 changed files with 66 additions and 63 deletions
129
julia/julia.def
129
julia/julia.def
|
@ -1,82 +1,85 @@
|
||||||
Bootstrap: library
|
Bootstrap: library
|
||||||
From: default/debian:10
|
From: default/alpine:3.14.0
|
||||||
|
|
||||||
%post
|
%post
|
||||||
# Copied from https://github.com/docker-library/julia/blob/master/1.6/buster/Dockerfile
|
# Install dependencies
|
||||||
apt-get -y update
|
apk add --no-cache bash
|
||||||
apt-get install -y --no-install-recommends \
|
apd add --no-cache --virtual .build-deps gpg curl
|
||||||
ca-certificates \
|
|
||||||
curl \
|
|
||||||
procps
|
|
||||||
rm -rf /var/lib/apt/lists/*
|
|
||||||
|
|
||||||
export JULIA_GPG="3673DF529D9049477F76B37566E3C7DC03D6E495"
|
# Make our lives easier by declaring some constants
|
||||||
export JULIA_VERSION="1.6.1"
|
export JULIA_GPG="3673DF529D9049477F76B37566E3C7DC03D6E495"
|
||||||
export JULIA_PATH=/usr/local/julia
|
export JULIA_VERSION="1.6.2"
|
||||||
export PATH=$JULIA_PATH/bin:$PATH
|
export JULIA_PATH=/usr/local/julia
|
||||||
|
export PATH=$JULIA_PATH/bin:$PATH
|
||||||
|
export tarArch='x86_64'
|
||||||
|
export dirArch='x64'
|
||||||
|
export sha256='5ff279bc733a99a9582fd9b39eb3d18a3fa77b9d3d2733039279a250c8c5d49c'
|
||||||
|
|
||||||
savedAptMark="$(apt-mark showmanual)"
|
# Download Julia
|
||||||
|
export folder="$(echo "$JULIA_VERSION" | cut -d. -f1-2)"
|
||||||
|
curl -fL -o julia.tar.gz.asc "https://julialang-s3.julialang.org/bin/musl/${dirArch}/${folder}/julia-${JULIA_VERSION}-linux-${tarArch}.tar.gz.asc"
|
||||||
|
curl -fL -o julia.tar.gz "https://julialang-s3.julialang.org/bin/musl/${dirArch}/${folder}/julia-${JULIA_VERSION}-linux-${tarArch}.tar.gz"
|
||||||
|
|
||||||
if ! command -v gpg > /dev/null; then
|
# Security check step 1: verify via sha256
|
||||||
apt-get update
|
echo "${sha256} *julia.tar.gz" | sha256sum -c -
|
||||||
apt-get install -y --no-install-recommends \
|
|
||||||
gnupg \
|
|
||||||
dirmngr
|
|
||||||
rm -rf /var/lib/apt/lists/*
|
|
||||||
fi
|
|
||||||
|
|
||||||
export tarArch='x86_64'
|
# Security check step 2: verify via GPG
|
||||||
export dirArch='x64'
|
export GNUPGHOME="$(mktemp -d)"
|
||||||
export sha256='7c888adec3ea42afbfed2ce756ce1164a570d50fa7506c3f2e1e2cbc49d52506'
|
gpg --batch --keyserver keyserver.ubuntu.com --recv-keys "$JULIA_GPG"
|
||||||
|
gpg --batch --verify julia.tar.gz.asc julia.tar.gz
|
||||||
|
command -v gpgconf > /dev/null && gpgconf --kill all
|
||||||
|
rm -rf "$GNUPGHOME" julia.tar.gz.asc
|
||||||
|
|
||||||
export folder="$(echo "$JULIA_VERSION" | cut -d. -f1-2)"
|
# Extract Julia
|
||||||
curl -fL -o julia.tar.gz.asc "https://julialang-s3.julialang.org/bin/linux/${dirArch}/${folder}/julia-${JULIA_VERSION}-linux-${tarArch}.tar.gz.asc"
|
mkdir "$JULIA_PATH"
|
||||||
curl -fL -o julia.tar.gz "https://julialang-s3.julialang.org/bin/linux/${dirArch}/${folder}/julia-${JULIA_VERSION}-linux-${tarArch}.tar.gz"
|
tar -xzf julia.tar.gz -C "$JULIA_PATH" --strip-components 1
|
||||||
|
rm julia.tar.gz
|
||||||
|
|
||||||
echo "${sha256} *julia.tar.gz" | sha256sum -c -
|
# Cleanup build dependencies
|
||||||
|
apk del --no-cache .build-deps
|
||||||
export GNUPGHOME="$(mktemp -d)"
|
|
||||||
gpg --batch --keyserver keyserver.ubuntu.com --recv-keys "$JULIA_GPG"
|
|
||||||
gpg --batch --verify julia.tar.gz.asc julia.tar.gz
|
|
||||||
command -v gpgconf > /dev/null && gpgconf --kill all
|
|
||||||
rm -rf "$GNUPGHOME" julia.tar.gz.asc
|
|
||||||
|
|
||||||
mkdir "$JULIA_PATH"
|
|
||||||
tar -xzf julia.tar.gz -C "$JULIA_PATH" --strip-components 1
|
|
||||||
rm julia.tar.gz
|
|
||||||
|
|
||||||
apt-mark auto '.*' > /dev/null
|
|
||||||
[ -z "$savedAptMark" ] || apt-mark manual $savedAptMark
|
|
||||||
apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false
|
|
||||||
|
|
||||||
%environment
|
%environment
|
||||||
export JULIA_PATH=/usr/local/julia
|
export JULIA_PATH=/usr/local/julia
|
||||||
export PATH=$JULIA_PATH/bin:$PATH
|
export PATH=$JULIA_PATH/bin:$PATH
|
||||||
|
|
||||||
%test
|
%test
|
||||||
if [ ! "$(command -v julia)" ]; then
|
cat << "EOF" > /tmp/singularity-test.sh
|
||||||
echo "command julia not found!"
|
#!/bin/bash
|
||||||
FAILED_TESTS="TRUE"
|
CMDS=('bash' 'ps' 'julia')
|
||||||
fi
|
for CMD in "${CMDS[@]}"; do
|
||||||
|
if ! command -v "$CMD"; then
|
||||||
if [ ! "$(command -v bash)" ]; then
|
echo "command $CMD not found!"
|
||||||
echo "command bash not found!"
|
FAILED_TESTS=1
|
||||||
FAILED_TESTS="TRUE"
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ ! "$(command -v ps)" ]; then
|
|
||||||
echo "command ps not found!"
|
|
||||||
FAILED_TESTS="TRUE"
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ -n "$FAILED_TESTS" ]; then
|
|
||||||
exit 1
|
|
||||||
fi
|
fi
|
||||||
|
done
|
||||||
|
# Abort if a test failed
|
||||||
|
if [ -n "$FAILED_TESTS" ]; then
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
EOF
|
||||||
|
chmod +x /tmp/singularity-test.sh
|
||||||
|
bash /tmp/singularity-test.sh
|
||||||
|
|
||||||
|
|
||||||
%runscript
|
%runscript
|
||||||
julia "$@"
|
julia "$@"
|
||||||
|
|
||||||
%labels
|
%labels
|
||||||
Author 25492070+MillironX@users.noreply.github.com
|
Author 25492070+MillironX@users.noreply.github.com
|
||||||
Version v2.3.1
|
SoftwareVersion v1.6.2
|
||||||
|
SingularityDefinitionVersion 1
|
||||||
|
|
||||||
|
%help
|
||||||
|
Julia
|
||||||
|
=====
|
||||||
|
|
||||||
|
Julia is a high-level dynamic programming language designed to address the
|
||||||
|
needs of high-performance numerical analysis and computational science. It
|
||||||
|
provides a sophisticated compiler, distributed parallel execution, numerical
|
||||||
|
accuracy, and an extensive mathematical function library.
|
||||||
|
Source: GitHub (<https://github.com/topics/julia>)
|
||||||
|
|
||||||
|
For more help, see
|
||||||
|
- <https://julialang.org>
|
||||||
|
- <https://github.com/JuliaLang/julia>
|
||||||
|
- <https://github.com/MillironX/singularity-builds>
|
||||||
|
|
Loading…
Reference in a new issue