# カスタムモデルのためのGitHub Actions

> カスタムモデルのためのGitHub Actions - カスタムモデルアクションは、GitHub CI/CDワークフローを介してDataRobotでのカスタム推論モデルとデプロイを管理します。

This Markdown file sits beside the HTML page at the same path (with a `.md` suffix). It summarizes the topic and lists links for tools and LLM context.

Companion generated at `2026-07-15T05:55:44.920612+00:00` (UTC).

## Primary page

- [カスタムモデルのためのGitHub Actions](https://docs.datarobot.com/ja/docs/classic-ui/mlops/deployment/custom-models/custom-model-workshop/custom-model-github-action.html.md): Full documentation for this topic (Markdown sidecar).

## Sections on this page

- [GitHub Actionsのクイックスタート](https://docs.datarobot.com/ja/docs/classic-ui/mlops/deployment/custom-models/custom-model-workshop/custom-model-github-action.html.md#github-actions-quickstart): In-page section heading.
- [DataRobotのコミット情報にアクセスする](https://docs.datarobot.com/ja/docs/classic-ui/mlops/deployment/custom-models/custom-model-workshop/custom-model-github-action.html.md#access-commit-information-in-DataRobot): In-page section heading.

## Documentation content

> [!NOTE] 本機能の提供について
> カスタムモデルのGitHub Actionsはプレミアム機能です。 この機能を有効にする方法については、DataRobotの担当者または管理者にお問い合わせください。

カスタムモデルのアクションは、GitHub CI/CDのワークフローを通じて、DataRobotでカスタム推論モデルとその関連デプロイを管理します。 これらのワークフローでは、モデルやデプロイを作成または削除したり、設定を変更したりできます。 YAMLファイルで定義されたメタデータにより、カスタムモデルのアクションによるモデルとデプロイの制御が可能になります。 このアクションのほとんどのYAMLファイルは、カスタムモデルのリポジトリ内の任意のフォルダーに配置できます。 YAMLは、これらのワークフローで使用されるエンティティが含まれているかどうかを判断するために、検索、収集、スキーマに対するテストが行われます。 詳細については、 [custom-models-actionリポジトリ](https://github.com/datarobot-oss/custom-models-action) を参照してください

## GitHub Actionsのクイックスタート

このクイックスタートの例では、 [datarobot-user-model repository](https://github.com/datarobot/datarobot-user-models/tree/master/model_templates/python3_sklearn) からの [Python Scikit-Learnモデルテンプレート](https://github.com/datarobot/datarobot-user-models/tree/master/model_templates) を使用します。 GitHubのカスタムモデルリポジトリからDataRobotでカスタム推論モデルとデプロイを作成するカスタムモデルアクションを設定するには、次の手順を実行します。

1. カスタムモデルのリポジトリの.github/workflowsディレクトリで、以下を含むYAMLファイル（任意のファイル名）を作成します。 123456789101112131415161718192021222324252627282930313233name:Workflow CI/CDon:pull_request:branches:[master]push:branches:[master]# Allows you to run this workflow manually from the Actions tabworkflow_dispatch:jobs:datarobot-custom-models:# Run this job on any action of a PR, but skip the job upon merging to the main branch. This# will be taken care of by the push event.if:${{ github.event.pull_request.merged != true }}runs-on:ubuntu-lateststeps:-uses:actions/checkout@v3with:fetch-depth:0-name:DataRobot Custom Models Stepid:datarobot-custom-models-stepuses:datarobot-oss/custom-models-action@v1.6.0with:api-token:${{ secrets.DATAROBOT_API_TOKEN }}webserver:https://app.datarobot.com/branch:masterallow-model-deletion:trueallow-deployment-deletion:true 次のフィールドを設定します。
2. ワークフローのYAMLファイルをコミットし、リモートにプッシュします。 この手順を完了すると、リモートへのプッシュ（またはマージされたプルリクエスト）によってアクションがトリガーされます。
3. DataRobotカスタムモデルのフォルダーに、次のYAMLを含むモデル定義YAMLファイル（たとえば、model.yaml）を追加し、モデルの特性に従ってフィールド値を更新します。 user_provided_model_id:user/model-unique-id-1target_type:Regressionsettings:name:My Awesome GitHub Model 1 [GitHub CI/CD]target_name:Grade 2014version:# Make sure this is the environment ID is in your system.# This one is the '[DataRobot] Python 3 Scikit-Learn Drop-In' environmentmodel_environment_id:5e8c889607389fe0f466c72d 次のフィールドを設定します。
4. リポジトリ内の任意のディレクトリで、次のYAMLを含むデプロイ定義YAMLファイル（任意のファイル名）を追加します。 user_provided_deployment_id:user/my-awesome-deployment-iduser_provided_model_id:user/model-unique-id-1 次のフィールドを設定します。
5. これらの変更をコミットしてリモートにプッシュし、次の操作を実行します。

> [!WARNING] 注意
> 連続してすばやく、2つのコミットを作成（または2つのプルリクエストをマージ）すると、 `ResourceNotFoundError` が発生する可能性があります。 たとえば、トレーニングデータセットでモデル定義を追加し、コミットし、リモートにプッシュします。 次に、モデル定義を直ちに削除し、コミットし、リモートにプッシュします。 トレーニングデータのアップロードアクションがモデルの削除後に開始されて、エラーが発生する可能性があります。 このシナリオを回避するには、アクションの実行が完了するまで待ってから、新しいコミットをプッシュするか、新しいプルリクエストをリモートリポジトリにマージします。

## DataRobotのコミット情報にアクセスする

ワークフローによってDataRobotでモデルとデプロイを作成すると、モデルのバージョン情報とデプロイの概要からコミット情報にアクセスできます。

**モデルバージョン情報:**
モデルレジストリ
をクリックしてから、
カスタムモデルワークショップ
をクリックします。
モデル
タブで、リストからGitHubソースのモデルをクリックしてから、
バージョン
タブをクリックします。
バージョンの管理
で、コミットを表示するバージョンをクリックします。
バージョン情報
で、
Gitコミットリファレンス
を見つけてから、コミットハッシュ（またはコミットID）をクリックして、現在のバージョンを作成したコミットを開きます。

[https://docs.datarobot.com/ja/docs/images/pp-cus-model-github2.png](https://docs.datarobot.com/ja/docs/images/pp-cus-model-github2.png)

**登録済みのモデル情報:**
モデルレジストリ
の
登録済みのモデル
タブで、リストからGitHubのモデルパッケージをクリックします。
情報
タブで、ワークフローによって提供されたモデル情報を確認し、
Gitコミットリファレンス
を見つけてから、コミットハッシュ（またはコミットID）をクリックして、現在のモデルパッケージを作成したコミットを開きます。

[https://docs.datarobot.com/ja/docs/images/pp-cus-model-github4.png](https://docs.datarobot.com/ja/docs/images/pp-cus-model-github4.png)

**デプロイの概要:**
デプロイ
インベントリで、リストからGitHubソースのデプロイをクリックします。
デプロイの
概要
タブで、ワークフローで提供されているモデル情報およびデプロイ情報を確認します。
コンテンツ
グループボックスで、
Gitコミットリファレンス
を見つけ、コミットハッシュ（またはコミットID）をクリックして、デプロイを作成したコミットを開きます。

[https://docs.datarobot.com/ja/docs/images/pp-cus-model-github1.png](https://docs.datarobot.com/ja/docs/images/pp-cus-model-github1.png)
