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

Add GraalVM Community Edition & GraalVM Native Image (in order to build Java native images) #2197

Closed
1 of 7 tasks
haroldlbrown opened this issue Dec 4, 2020 · 12 comments
Closed
1 of 7 tasks

Comments

@haroldlbrown
Copy link

haroldlbrown commented Dec 4, 2020

Tool information

  • Tool name: GraalVM Community Edition & GraalVM Native Image
  • Tool license: GNU General Public License with the “Classpath” Exception
  • Add or update? Add
  • Desired version: 20.3.0 (it should always be the latest version)
  • Approximate size: 430 MB (GraalVM) + 12 MB (Native Image)
  • If this is an add request:
    • Brief description of tool: GraalVM is a high-performance multilingual runtime. It is designed to accelerate the execution of applications written in Java and other JVM languages while also providing runtimes for JavaScript, Ruby, Python, and a number of other popular languages.
    • URL for tool's homepage: https://www.graalvm.org/
    • Provide a basic test case to validate the tool's functionality: native-image --version

Area for Triage:

Question, Bug, or Feature?:
Feature

Virtual environments affected

  • Ubuntu 16.04
  • Ubuntu 18.04
  • Ubuntu 20.04
  • macOS 10.15
  • macOS 11.0
  • Windows Server 2016 R2
  • Windows Server 2019

Can this tool be installed during the build?

- run: curl -Lo graalvm-archive.tar.gz https://github.com/graalvm/graalvm-ce-builds/releases/download/vm-20.3.0/graalvm-ce-java11-linux-amd64-20.3.0.tar.gz
- run: tar -xzf graalvm-archive.tar.gz
- run: echo "`pwd`/graalvm-ce-java11-20.3.0/bin" >> $GITHUB_PATH
- run: java --version
- run: gu install native-image
- run: sudo apt-get install build-essential libz-dev zlib1g-dev
- run: native-image --version

I have created a repository in which GraalVM & Native Image is installed during a GitHub Actions build: https://github.com/infonova/github-graal-poc/blob/main/.github/workflows/graal-poc.yml

Tool installation time in runtime
46 seconds

Are you willing to submit a PR?
No

@maxim-lobanov
Copy link
Contributor

Hello @bernhardvollnhofer , Did you consider using community tasks to install GraalVM in runtime?
As I can see, there is a task Setup GraalVM environment that installs it a bit faster (20-25 seconds).

@haroldlbrown
Copy link
Author

Hello @bernhardvollnhofer , Did you consider using community tasks to install GraalVM in runtime?
As I can see, there is a task Setup GraalVM environment that installs it a bit faster (20-25 seconds).

Not yet, I can try it out.
I just thought that with the increasing popularity of GraalVM it could come already preinstalled.

@maxim-lobanov
Copy link
Contributor

Moved to backlog to take a look deeper. If we don't find any other issues with this tool, we will add it to the images

@nikita-bykov
Copy link
Contributor

Hello @bernhardvollnhofer, there are two Java versions for GraalVM: Java8 and Java11. Which version do you prefer?
For example: graalvm-ce-java11-linux-amd64-20.3.0 and graalvm-ce-java8-linux-amd64-20.3.0.

@haroldlbrown
Copy link
Author

Hi, @nikita-bykov. I prefer Java 11 since it has handy new features like the var keyword and is - like Java 8 - an LTS version.

@nikita-bykov
Copy link
Contributor

We have added GraalVM Community Edition & GraalVM Native Image installation to Ubuntu 20.04.
Images with it will be rolled out around next week.

@haroldlbrown
Copy link
Author

We have added GraalVM Community Edition & GraalVM Native Image installation to Ubuntu 20.04.
Images with it will be rolled out around next week.

Thank you very much. 👍 🙂

@haroldlbrown
Copy link
Author

We have added GraalVM Community Edition & GraalVM Native Image installation to Ubuntu 20.04.
Images with it will be rolled out around next week.

I have created this simple workflow:

  
name: GraalVM
on:
  push:
    branches: [ main ]
  workflow_dispatch:
jobs:
  build:
    runs-on: ubuntu-20.04
    steps:
      - uses: actions/checkout@v2
      - run: gu

I just wanted to test the GraalVM update with gu.

However, it results in this error:

/home/runner/work/_temp/e8bbd48b-e004-408a-ad34-abb8ac246978.sh: line 1: gu: command not found
Error: Process completed with exit code 127.

Am I doing something wrong?

@maxim-lobanov
Copy link
Contributor

Hello @BERVOL , image deployment is not completed yet. We have to roll back this week images due to an issue with Android NDK. The next image should be deployed early next week.

Also please pay attention that we don't add GraalVM folder to PATH because it overrides and intersects a lot of other pre-installed tools.
To start using GraalVM after image deployment, you should add the following command to your pipeline according to documentation:

build:
    runs-on: ubuntu-20.04
    steps:
      - uses: actions/checkout@v2
      - run: echo $GRAALVM_11_ROOT >> $GITHUB_PATH
      - run: gu

@miketimofeev
Copy link
Contributor

@BERVOL we've finished Ubuntu20 image deployment! GraalVM is available https://github.com/actions/virtual-environments/blob/main/images/linux/Ubuntu2004-README.md#graalvm
I'm going to close the issue, but please feel free to contact us if you have any concerns.
Thank you!

@haroldlbrown
Copy link
Author

@BERVOL we've finished Ubuntu20 image deployment! GraalVM is available https://github.com/actions/virtual-environments/blob/main/images/linux/Ubuntu2004-README.md#graalvm
I'm going to close the issue, but please feel free to contact us if you have any concerns.
Thank you!

Hi. I have just tested the gu command, but unfortunately it is still not working. It results in this error:

Run gu
  gu
  shell: /usr/bin/bash -e {0}
/home/runner/work/_temp/28c2d586-8bc2-4088-b3e7-1bb85f73919c.sh: line 1: gu: command not found
Error: Process completed with exit code 127.

This is my workflow:

name: Native Image build

on:
  push:
    branches: [ main ]
  pull_request:
    branches: [ main ]
  workflow_dispatch:

jobs:
  build:

    runs-on: ubuntu-20.04

    steps:
      - uses: actions/checkout@v2
      - uses: actions/cache@v2
        with:
          path: |
            ~/.gradle/caches
            ~/.gradle/wrapper
          key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
          restore-keys: |
            ${{ runner.os }}-gradle-
      - run: echo $GRAALVM_11_ROOT >> $GITHUB_PATH
      - run: gu

See also here: https://github.com/bervol/micronaut-poc/blob/fe4d30a0dc849e074b8f3f5b3c49ea23fa61c054/.github/workflows/native-image-build.yml

What am I doing wrong?

@miketimofeev
Copy link
Contributor

@BERVOL $GRAALVM_11_ROOT points to the root directory thus invoking gu requires adding $GRAALVM_11_ROOT/bin to the PATH. This should work:

   - run: echo $GRAALVM_11_ROOT/bin >> $GITHUB_PATH
   - run: gu

Sorry for the inconvenience, we're going to document all the variables in the readme soon #2498

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants