OCI DevOpsビルド・パイプラインでのGraalVM Enterprise

このガイドでは、Oracle Cloud Infrastructure (OCI) DevOpsサービスでGraalVM Enterpriseを使用する方法について説明します。OCI DevOpsは、開発者がOCIコンピュート・プラットフォームへのソフトウェアのデリバリおよびデプロイメントを自動化できるようにする、継続的インテグレーション/継続的デリバリ(CI/CD)サービスです。

ノート: GraalVM Enterpriseは、追加コストなしでOracle Cloud Infrastructure (OCI)上で使用できます。

OCI DevOpsサービスは、ベース・コンテナ・イメージとしてOracle Linux 7を使用したビルド・ランナーを、多数のランタイムとツールとともに提供します。GraalVM Enterprise Editionがサポートされています。

GraalVM Enterprise RPMはOracle YUMリポジトリにあります。各RPMは自己完結型で、必要なすべての依存性が自動的に取り込まれます。YUMパッケージ・マネージャを使用して、DevOpsビルド・パイプラインでGraalVM Enterpriseをインストールして使用できます。

前提条件

ビルド・パイプラインを操作するには、ビルド仕様ファイルbuild-spec.ymlに文を追加し、DevOps CI/CDプラットフォームでファイルを読み取り、コマンドを1つずつ実行します。YUMパッケージ・マネージャ・コマンドは手動では実行しません。

DevOpsビルド・パイプラインでGraalVM Enterpriseをインストールして使用するには、次のようにビルド仕様ファイルを更新します:

  1. GraalVM Enterpriseをネイティブ・イメージおよびJava Development Kit (JDK)とともにインストールするコマンドを追加します:

     steps:
     - type: Command
         name: "Install GraalVM Enterprise 22.x Native Image for Java17"
         command: |
         yum -y install graalvm22-ee-17-native-image
    
  2. JAVA_HOME環境変数を設定するコマンドを追加します:

     env:
     variables:
         "JAVA_HOME" : "/usr/lib64/graalvm/graalvm22-ee-java17"
    
  3. PATH環境変数を設定するコマンドを追加します:

     env:
     variables:
         # PATH is a reserved variable and cannot be defined as a variable.
         # PATH can be changed in a build step and the change is visible in subsequent steps.
    
     steps:
     - type: Command
         name: "Set PATH Variable"
         command: |
         export PATH=$JAVA_HOME/bin:$PATH
    

次に、完全なビルド仕様ファイルの例を示します。

yum listコマンドを使用して、使用可能なすべてのGraalVM Enterprise RPMのリストを取得します。たとえば、次のコマンドを使用して、使用可能なすべてのGraalVM Enterprise 22.x JDK17コンポーネントをリストします:

yum list graalvm22-ee-17*

graalvm22-ee-17-native-image.x86_64        22.2.0-1.el7       ol7_oci_included
graalvm22-ee-17-espresso.x86_64            22.2.0-1.el7       ol7_oci_included
graalvm22-ee-17-javascript.x86_64          22.2.0-1.el7       ol7_oci_included
graalvm22-ee-17-jdk.x86_64                 22.2.0-1.el7       ol7_oci_included
graalvm22-ee-17-libpolyglot.x86_64         22.2.0-1.el7       ol7_oci_included
graalvm22-ee-17-llvm.x86_64                22.2.0-1.el7       ol7_oci_included
graalvm22-ee-17-llvm-toolchain.x86_64      22.2.0-1.el7       ol7_oci_included
graalvm22-ee-17-nodejs.x86_64              22.2.0-1.el7       ol7_oci_included
graalvm22-ee-17-polyglot.x86_64            22.2.0-1.el7       ol7_oci_included
graalvm22-ee-17-python.x86_64              22.2.0-1.el7       ol7_oci_included
graalvm22-ee-17-ruby.x86_64                22.2.0-1.el7       ol7_oci_included
graalvm22-ee-17-tools.x86_64               22.2.0-1.el7       ol7_oci_included
graalvm22-ee-17-wasm.x86_64                22.2.0-1.el7       ol7_oci_included
...

この機能を試すには、サンプル・プロジェクト: OCI DevOpsビルド・パイプラインでのGraalVM Enterpriseの使用を使用します。OCI DevOpsサービスでのGraalVM Enterpriseの設定、ビルド・パイプラインの作成、ビルド・ステージの追加などを行う方法について説明しています。