Fedora/GraalVM: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
|||
(58 intermediate revisions by the same user not shown) | |||
Line 5: | Line 5: | ||
| valign="top" | | | valign="top" | | ||
'''System Update:''' | '''System Update:''' | ||
<source lang="bash | <source lang="bash"> | ||
sudo su | sudo su | ||
cat << EOF >> /etc/dnf/dnf.conf | cat << EOF >> /etc/dnf/dnf.conf | ||
fastestmirror=True | fastestmirror=True | ||
max_parallel_downloads=10 | max_parallel_downloads=10 | ||
Line 17: | Line 16: | ||
| valign="top" | | | valign="top" | | ||
''' | '''Network Config:''' | ||
<source lang="bash | <source lang="bash"> | ||
sudo | sudo nmcli dev wifi con 'ChorkeOrg_2.4GHz' password 'sadaqah!' | ||
sudo nmcli dev wifi con 'ChorkeInc' password 'sadaqah!' | |||
sudo nmcli dev wifi con 'ChorkeOrg' password 'sadaqah!' | |||
sudo nmcli dev wifi rescan | |||
sudo nmcli dev wifi | |||
sudo nmcli con | |||
sudo nmcli dev | |||
</source> | </source> | ||
Line 48: | Line 46: | ||
-release-$(rpm -E %fedora).noarch.rpm | -release-$(rpm -E %fedora).noarch.rpm | ||
</source> | </source> | ||
|- | |||
| colspan="2" | | |||
---- | |||
|- | |||
| valign="middle" | | |||
'''Timezone:''' | |||
sudo timedatectl set-timezone 'Asia/Kuala_Lumpur' | |||
sudo timedatectl set-time '2010-10-10 10:10:10' | |||
sudo hostnamectl set-hostname fedora | |||
sudo timedatectl set-ntp true | |||
| valign="middle" | | |||
'''Cockpit:''' | |||
https://10.19.83.111:9090/ | |||
https://10.19.83.211:9090/ | |||
http://10.19.83.111/ | |||
http://10.19.83.211/ | |||
|} | |||
==Install== | |||
{| | |||
| valign="top" | | |||
<source lang="bash"> | |||
sudo dnf install java-latest-openjdk | |||
sudo dnf install java-1.8.0-openjdk | |||
sudo dnf install java-11-openjdk | |||
</source> | |||
| valign="top" | | |||
<source lang="bash"> | |||
sudo dnf install java-latest-openjdk-devel | |||
sudo dnf install java-1.8.0-openjdk-devel | |||
sudo dnf install java-11-openjdk-devel | |||
</source> | |||
|- | |||
| colspan="2" | | |||
---- | |||
|- | |||
| valign="top" colspan="2" | | |||
<source lang="bash"> | |||
sudo dnf install gcc glibc-devel zlib-devel libstdc++-static | |||
sudo dnf install git | |||
sudo su | |||
export ACADEMIA_HOME="$HOME/.chorke/academia" | |||
mkdir -p $ACADEMIA_HOME/var/download | |||
cd $ACADEMIA_HOME/var/download | |||
sudo mkdir -p /opt/cli | |||
</source> | |||
|- | |||
| colspan="2" | | |||
---- | |||
|- | |||
| valign="top" | | |||
<source lang="bash"> | |||
mkdir -p $ACADEMIA_HOME/etc/env/ | |||
cat << \EOF >> $ACADEMIA_HOME/etc/env/system.sh | |||
# chorke academia env | |||
export ACADEMIA_HOME="$HOME/.chorke/academia" | |||
export ACADEMIA_DEV="$ACADEMIA_HOME/dev" | |||
EOF | |||
</source> | |||
| valign="top" | | |||
<source lang="bash"> | |||
cat << \EOF >> $HOME/.bashrc | |||
# chorke academia env | |||
if [ -f "$HOME/.chorke/academia/etc/env/system.sh" ]; then | |||
source $HOME/.chorke/academia/etc/env/system.sh | |||
fi | |||
EOF | |||
</source> | |||
|- | |||
| colspan="2" | | |||
---- | |||
|- | |||
| valign="top" colspan="2" | | |||
<source lang="bash"> | |||
sudo wget -c https://github.com/graalvm/graalvm-ce-builds/releases/download/vm-22.0.0.2/\ | |||
graalvm-ce-java11-linux-aarch64-22.0.0.2.tar.gz -P /opt/cli/ | |||
sudo wget -c https://github.com/graalvm/graalvm-ce-builds/releases/download/vm-22.0.0.2/\ | |||
graalvm-ce-java17-linux-aarch64-22.0.0.2.tar.gz -P /opt/cli/ | |||
</source> | |||
|- | |||
| colspan="2" | | |||
---- | |||
|- | |||
| valign="top"| | |||
<source lang="bash"> | |||
sudo tar -xvzf /opt/cli/\ | |||
graalvm-ce-java11-linux-aarch64-22.0.0.2.tar.gz\ | |||
-C /opt/cli/ | |||
cat << \EOF >> $ACADEMIA_HOME/etc/env/system.sh | |||
# chorke academia sys | |||
export GRAALVM_HOME='/opt/cli/graalvm-ce-java11-22.0.0.2' | |||
EOF | |||
sudo rm -rf /opt/cli/\ | |||
graalvm-ce-java11-linux-aarch64-22.0.0.2.tar.gz | |||
sudo ln -s $GRAALVM_HOME\ | |||
/usr/lib/jvm/graalvm-ce-java11-22.0.0.2 | |||
sudo alternatives --install /usr/bin/java java\ | |||
$GRAALVM_HOME/bin/java 1 | |||
sudo alternatives --install /usr/bin/javac javac\ | |||
$GRAALVM_HOME/bin/javac 1 | |||
sudo alternatives --install /usr/local/bin/gu gu\ | |||
$GRAALVM_HOME/bin/gu 1 | |||
sudo gu install native-image | |||
sudo alternatives --install /usr/bin/native-image native-image\ | |||
$GRAALVM_HOME/bin/native-image 1 | |||
</source> | |||
| valign="top" | | |||
<source lang="bash"> | |||
sudo tar -xvzf /opt/cli/\ | |||
graalvm-ce-java17-linux-aarch64-22.0.0.2.tar.gz\ | |||
-C /opt/cli/ | |||
cat << \EOF >> $ACADEMIA_HOME/etc/env/system.sh | |||
# chorke academia sys | |||
export GRAALVM_HOME='/opt/cli/graalvm-ce-java17-22.0.0.2' | |||
EOF | |||
sudo rm -rf /opt/cli/\ | |||
graalvm-ce-java17-linux-aarch64-22.0.0.2.tar.gz | |||
sudo ln -s $GRAALVM_HOME\ | |||
/usr/lib/jvm/graalvm-ce-java17-22.0.0.2 | |||
sudo alternatives --install /usr/bin/java java\ | |||
$GRAALVM_HOME/bin/java 2 | |||
sudo alternatives --install /usr/bin/javac javac\ | |||
$GRAALVM_HOME/bin/javac 2 | |||
sudo alternatives --install /usr/local/bin/gu gu\ | |||
$GRAALVM_HOME/bin/gu 2 | |||
gu install native-image | |||
alternatives --install /usr/bin/native-image native-image\ | |||
$GRAALVM_HOME/bin/native-image 2 | |||
</source> | |||
|- | |||
| colspan="2" | | |||
---- | |||
|- | |||
| valign="top" colspan="2" | | |||
<source lang="bash"> | |||
sudo alternatives --config native-image | |||
sudo alternatives --config javac | |||
sudo alternatives --config java | |||
sudo alternatives --config gu | |||
ls -lah /usr/lib/jvm | |||
</source> | |||
|} | |||
==Maven== | |||
{| | |||
| valign="top"| | |||
<source lang="bash"> | |||
sudo dnf install maven-openjdk17 | |||
sudo dnf install maven-openjdk11 | |||
sudo dnf install maven-openjdk8 | |||
</source> | |||
| valign="top" | | |||
<source lang="bash"> | |||
sudo dnf remove maven-openjdk17 | |||
sudo dnf remove maven-openjdk11 | |||
sudo dnf remove maven-openjdk8 | |||
</source> | |||
| valign="top" | | |||
<source lang="bash"> | |||
sudo dnf install docker | |||
sudo dnf install ant | |||
sudo dnf install ivy | |||
</source> | |||
|- | |||
|colspan='3'| | |||
---- | |||
|- | |||
|colspan='3'| | |||
<source lang="xml"> | |||
<profile> | |||
<id>native-image-fargate</id> | |||
<build> | |||
<plugins> | |||
<plugin> | |||
<groupId>com.oracle.substratevm</groupId> | |||
<artifactId>native-image-maven-plugin</artifactId> | |||
<version>${graal.version}</version> | |||
<executions> | |||
<execution> | |||
<goals> | |||
<goal>native-image</goal> | |||
</goals> | |||
<phase>package</phase> | |||
</execution> | |||
</executions> | |||
<configuration> | |||
<mainClass>${vertx.verticle}</mainClass> | |||
<imageName>${project.artifactId}</imageName> | |||
<buildArgs>--enable-all-security-services -H:+ReportUnsupportedElementsAtRuntime --allow-incomplete-classpath</buildArgs> | |||
</configuration> | |||
</plugin> | |||
</plugins> | |||
</build> | |||
</profile> | |||
</source> | |||
|} | |||
==Knowledge== | |||
{| | |||
|valign="top"| | |||
sudo dnf repoquery --unsatisfied | |||
sudo dnf repoquery --duplicates | |||
sudo dnf install rpmconf | |||
sudo rpmconf -a | |||
|valign="top"| | |||
sudo dnf list extras | |||
sudo dnf autoremove | |||
sudo dnf update | |||
|valign="top"| | |||
sudo dnf system-upgrade download --releasever=35 | |||
sudo dnf install dnf-plugin-system-upgrade | |||
sudo dnf upgrade --refresh | |||
|- | |||
|valign="top" colspan="3"| | |||
---- | |||
|- | |||
|valign="top"| | |||
sudo dnf install snapd | |||
sudo systemctl status snapd | |||
sudo systemctl enable snapd | |||
|valign="top"| | |||
sudo snap install lxd | |||
sudo systemctl status snapd | |||
sudo systemctl restart snapd | |||
|valign="top"| | |||
lxc image list images: archlinux arm64 | |||
lxc image list images: ubuntu arm64 | |||
lxc image list images: alpine arm64 | |||
|- | |||
| valign="top" colspan="3" | | |||
---- | |||
|- | |||
|valigan="top"| | |||
lxc launch images:opensuse/15.3 agronomy | |||
lxc launch images:apertis/v2021 robotics | |||
lxc launch images:alpine/3.15 academia | |||
|valign="top"| | |||
lxc exec academia sh | |||
lxc exec agronomy sh | |||
lxc exec robotics sh | |||
|valign="top"| | |||
sudo dnf list docker-ce --showduplicates|sort -r | |||
podman build -f src/main/docker/Dockerfile.native\ | |||
-t quarkus-quickstart/getting-started . | |||
|- | |||
|valign="top" colspan="3"| | |||
---- | |||
|- | |||
| valign="top" | | |||
lxc network show lxdbr0 | |||
lxc network list | |||
lxc image list | |||
|valigan="top"| | |||
podman network ls | |||
podman image ls | |||
podman ps -a | |||
|valign="top"| | |||
export GRAALVM_HOME=/opt/cli/graalvm-ce-java11-21.3.0 | |||
mvn compile quarkus:dev | |||
mvn package -Pnative | |||
|- | |||
|valign="top" colspan="3"| | |||
---- | |||
|- | |||
|valign="top"| | |||
$GRAALVM_HOME/bin/gu install native-image | |||
sudo dnf install icedtea-web java-openjdk | |||
sudo alternatives --config java | |||
|valign="top"| | |||
sudo dnf install java-latest-openjdk | |||
sudo dnf install java-1.8.0-openjdk | |||
sudo dnf install java-11-openjdk | |||
|valign="top"| | |||
sudo dnf install java-latest-openjdk-devel | |||
sudo dnf install java-1.8.0-openjdk-devel | |||
sudo dnf install java-11-openjdk-devel | |||
|- | |||
|valign="top" colspan="3"| | |||
---- | |||
|- | |||
|valign="top" colspan="2"| | |||
<source lang="bash"> | |||
upx -7 -k target/java-native-apps-1.0.0.GA | |||
:' | |||
Ultimate Packer for eXecutables | |||
Copyright (C) 1996 - 2020 | |||
UPX 3.96 Markus Oberhumer, Laszlo Molnar & John Reiser Jan 23rd 2020 | |||
File size Ratio Format Name | |||
-------------------- ------ ----------- ----------- | |||
41083584 -> 12630492 30.74% linux/arm64 java-native-apps-1.0.0.GA | |||
' | |||
</source> | |||
|valign="bottom"| | |||
dnf search upx | |||
sudo dnf install upx | |||
|} | |||
==References== | |||
{| | |||
| valign="top" | | |||
* [https://www.graalvm.org/docs/getting-started/linux-aarch64/ GraalVM Installation on Linux ARM64 systems] | |||
* [https://quarkus.io/blog/quarkus-native-on-a-raspberry-pi/ Quarkus native running on a Raspberry Pi] | |||
* [https://docs.fedoraproject.org/en-US/quick-docs/getting-started-with-apache-http-server/ Getting started with Apache HTTP Server] | |||
* [https://docs.oracle.com/en/graalvm/enterprise/21/docs/getting-started Oracle GraalVM EE 21 Getting Started] | |||
* [https://github.com/graalvm/graalvm-ce-builds/releases/tag/vm-21.3.0 GraalVM Community Edition 21.3.0] | |||
* [https://github.com/graalvm/graalvm-ce-builds/tags GraalVM Community Edition Tags] | |||
* [[Linux Containers]] | |||
* [[Quarkus]] | |||
* [[Podman]] | |||
* [[Docker]] | |||
| valign="top" | | |||
* [https://stackoverflow.com/questions/3466166/ Detect the OS Name from a Bash Script] | |||
* [https://stackoverflow.com/questions/394230/ Detect the OS Type from a Bash Script] | |||
* [https://gist.github.com/ricardozanini/fa65e485251913e1467837b1c5a8ed28 Gist Install GraalVM CE on Linux] | |||
* [https://medium.com/@john_freeman/native-javac-with-graalvm-ddcc18a53edb Native javac built with GraalVM] | |||
* [[Convention for Workspaces]] | |||
* [[Convention for Projects]] | |||
* [[Fedora/Raspberry Pi]] | |||
* [[Ubuntu/Raspberry Pi]] | |||
* [[Ubuntu/GraalVM]] | |||
* [[Debian/GraalVM]] | |||
| valign="top" | | |||
* [https://stackoverflow.com/questions/37818831/ Setting up <code>glibc</code> on Docker Alpine Linux Base Image] | |||
* [https://www.graalvm.org/examples/java-kotlin-aot/ Build a Native Image of a Java & Kotlin Application] | |||
* [https://www.graalvm.org/docs/getting-started/container-images/ Getting Started GraalVM Community Images] | |||
* [https://aws.amazon.com/blogs/opensource/using-graalvm-build-minimal-docker-images-java-applications/ GraalVM to Build Minimal Docker Images] | |||
* [https://www.graalvm.org/release-notes/version-roadmap/ GraalVM Community Version Roadmap] | |||
* [https://stackoverflow.com/questions/63246836/ Updating package in Alpine Docker file] | |||
* [https://git-scm.com/download/linux Git Download for Linux and Unix] | |||
* [https://wiki.musl-libc.org/functional-differences-from-glibc.html <code>musl libc vs. glibc</code>] | |||
* [https://stackoverflow.com/questions/31851611/ ARM64 vs. AArch64] | |||
* [[Fedora]] | |||
|- | |||
|colspan='3'| | |||
---- | |||
|- | |||
| valign="top" | | |||
* [https://pkgs.alpinelinux.org/package/v3.15/main/aarch64/libc6-compat <code>glibc</code> compatibility libraries for Alpine <code>AArch64</code>] | |||
* [https://pkgs.alpinelinux.org/package/v3.15/main/x86_64/libc6-compat <code>glibc</code> compatibility libraries for Alpine <code>x86_64</code>] | |||
* [https://github.com/graalvm/mandrel/releases Mandrel: Download] | |||
* [[MacOS/GraalVM]] | |||
* [[Raspberry Pi]] | |||
* [[GraalVM]] | |||
| valign="top" | | |||
| valign="top" | | |||
|} | |} |
Latest revision as of 17:17, 3 April 2022
| |
System Update: sudo su
cat << EOF >> /etc/dnf/dnf.conf
fastestmirror=True
max_parallel_downloads=10
defaultyes=True
EOF
dnf update
|
Network Config: sudo nmcli dev wifi con 'ChorkeOrg_2.4GHz' password 'sadaqah!'
sudo nmcli dev wifi con 'ChorkeInc' password 'sadaqah!'
sudo nmcli dev wifi con 'ChorkeOrg' password 'sadaqah!'
sudo nmcli dev wifi rescan
sudo nmcli dev wifi
sudo nmcli con
sudo nmcli dev
|
| |
Free/Community: sudo dnf install\
https://download1.rpmfusion.org/free/fedora/rpmfusion-free-release\
-$(rpm -E %fedora).noarch.rpm
|
Non-Free/Commercial: sudo dnf install\
https://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree\
-release-$(rpm -E %fedora).noarch.rpm
|
| |
Timezone: sudo timedatectl set-timezone 'Asia/Kuala_Lumpur' sudo timedatectl set-time '2010-10-10 10:10:10' sudo hostnamectl set-hostname fedora sudo timedatectl set-ntp true |
Cockpit: https://10.19.83.111:9090/ https://10.19.83.211:9090/ http://10.19.83.111/ http://10.19.83.211/ |
Install
sudo dnf install java-latest-openjdk
sudo dnf install java-1.8.0-openjdk
sudo dnf install java-11-openjdk
|
sudo dnf install java-latest-openjdk-devel
sudo dnf install java-1.8.0-openjdk-devel
sudo dnf install java-11-openjdk-devel
|
| |
sudo dnf install gcc glibc-devel zlib-devel libstdc++-static
sudo dnf install git
sudo su
export ACADEMIA_HOME="$HOME/.chorke/academia"
mkdir -p $ACADEMIA_HOME/var/download
cd $ACADEMIA_HOME/var/download
sudo mkdir -p /opt/cli
| |
| |
mkdir -p $ACADEMIA_HOME/etc/env/
cat << \EOF >> $ACADEMIA_HOME/etc/env/system.sh
# chorke academia env
export ACADEMIA_HOME="$HOME/.chorke/academia"
export ACADEMIA_DEV="$ACADEMIA_HOME/dev"
EOF
|
cat << \EOF >> $HOME/.bashrc
# chorke academia env
if [ -f "$HOME/.chorke/academia/etc/env/system.sh" ]; then
source $HOME/.chorke/academia/etc/env/system.sh
fi
EOF
|
| |
sudo wget -c https://github.com/graalvm/graalvm-ce-builds/releases/download/vm-22.0.0.2/\
graalvm-ce-java11-linux-aarch64-22.0.0.2.tar.gz -P /opt/cli/
sudo wget -c https://github.com/graalvm/graalvm-ce-builds/releases/download/vm-22.0.0.2/\
graalvm-ce-java17-linux-aarch64-22.0.0.2.tar.gz -P /opt/cli/
| |
| |
sudo tar -xvzf /opt/cli/\
graalvm-ce-java11-linux-aarch64-22.0.0.2.tar.gz\
-C /opt/cli/
cat << \EOF >> $ACADEMIA_HOME/etc/env/system.sh
# chorke academia sys
export GRAALVM_HOME='/opt/cli/graalvm-ce-java11-22.0.0.2'
EOF
sudo rm -rf /opt/cli/\
graalvm-ce-java11-linux-aarch64-22.0.0.2.tar.gz
sudo ln -s $GRAALVM_HOME\
/usr/lib/jvm/graalvm-ce-java11-22.0.0.2
sudo alternatives --install /usr/bin/java java\
$GRAALVM_HOME/bin/java 1
sudo alternatives --install /usr/bin/javac javac\
$GRAALVM_HOME/bin/javac 1
sudo alternatives --install /usr/local/bin/gu gu\
$GRAALVM_HOME/bin/gu 1
sudo gu install native-image
sudo alternatives --install /usr/bin/native-image native-image\
$GRAALVM_HOME/bin/native-image 1
|
sudo tar -xvzf /opt/cli/\
graalvm-ce-java17-linux-aarch64-22.0.0.2.tar.gz\
-C /opt/cli/
cat << \EOF >> $ACADEMIA_HOME/etc/env/system.sh
# chorke academia sys
export GRAALVM_HOME='/opt/cli/graalvm-ce-java17-22.0.0.2'
EOF
sudo rm -rf /opt/cli/\
graalvm-ce-java17-linux-aarch64-22.0.0.2.tar.gz
sudo ln -s $GRAALVM_HOME\
/usr/lib/jvm/graalvm-ce-java17-22.0.0.2
sudo alternatives --install /usr/bin/java java\
$GRAALVM_HOME/bin/java 2
sudo alternatives --install /usr/bin/javac javac\
$GRAALVM_HOME/bin/javac 2
sudo alternatives --install /usr/local/bin/gu gu\
$GRAALVM_HOME/bin/gu 2
gu install native-image
alternatives --install /usr/bin/native-image native-image\
$GRAALVM_HOME/bin/native-image 2
|
| |
sudo alternatives --config native-image
sudo alternatives --config javac
sudo alternatives --config java
sudo alternatives --config gu
ls -lah /usr/lib/jvm
|
Maven
sudo dnf install maven-openjdk17
sudo dnf install maven-openjdk11
sudo dnf install maven-openjdk8
|
sudo dnf remove maven-openjdk17
sudo dnf remove maven-openjdk11
sudo dnf remove maven-openjdk8
|
sudo dnf install docker
sudo dnf install ant
sudo dnf install ivy
|
| ||
<profile>
<id>native-image-fargate</id>
<build>
<plugins>
<plugin>
<groupId>com.oracle.substratevm</groupId>
<artifactId>native-image-maven-plugin</artifactId>
<version>${graal.version}</version>
<executions>
<execution>
<goals>
<goal>native-image</goal>
</goals>
<phase>package</phase>
</execution>
</executions>
<configuration>
<mainClass>${vertx.verticle}</mainClass>
<imageName>${project.artifactId}</imageName>
<buildArgs>--enable-all-security-services -H:+ReportUnsupportedElementsAtRuntime --allow-incomplete-classpath</buildArgs>
</configuration>
</plugin>
</plugins>
</build>
</profile>
|
Knowledge
sudo dnf repoquery --unsatisfied sudo dnf repoquery --duplicates sudo dnf install rpmconf sudo rpmconf -a |
sudo dnf list extras sudo dnf autoremove sudo dnf update |
sudo dnf system-upgrade download --releasever=35 sudo dnf install dnf-plugin-system-upgrade sudo dnf upgrade --refresh |
| ||
sudo dnf install snapd sudo systemctl status snapd sudo systemctl enable snapd |
sudo snap install lxd sudo systemctl status snapd sudo systemctl restart snapd |
lxc image list images: archlinux arm64 lxc image list images: ubuntu arm64 lxc image list images: alpine arm64 |
| ||
lxc launch images:opensuse/15.3 agronomy lxc launch images:apertis/v2021 robotics lxc launch images:alpine/3.15 academia |
lxc exec academia sh lxc exec agronomy sh lxc exec robotics sh |
sudo dnf list docker-ce --showduplicates|sort -r podman build -f src/main/docker/Dockerfile.native\ -t quarkus-quickstart/getting-started . |
| ||
lxc network show lxdbr0 lxc network list lxc image list |
podman network ls podman image ls podman ps -a |
export GRAALVM_HOME=/opt/cli/graalvm-ce-java11-21.3.0 mvn compile quarkus:dev mvn package -Pnative |
| ||
$GRAALVM_HOME/bin/gu install native-image sudo dnf install icedtea-web java-openjdk sudo alternatives --config java |
sudo dnf install java-latest-openjdk sudo dnf install java-1.8.0-openjdk sudo dnf install java-11-openjdk |
sudo dnf install java-latest-openjdk-devel sudo dnf install java-1.8.0-openjdk-devel sudo dnf install java-11-openjdk-devel |
| ||
upx -7 -k target/java-native-apps-1.0.0.GA
:'
Ultimate Packer for eXecutables
Copyright (C) 1996 - 2020
UPX 3.96 Markus Oberhumer, Laszlo Molnar & John Reiser Jan 23rd 2020
File size Ratio Format Name
-------------------- ------ ----------- -----------
41083584 -> 12630492 30.74% linux/arm64 java-native-apps-1.0.0.GA
'
|
dnf search upx sudo dnf install upx |