Rainbow Engine

IT技術を分かりやすく簡潔にまとめることによる学習の効率化、また日常の気付きを記録に残すことを目指します。

Azure Microsoft

Azure Machine Learningで「Failed to pull Docker image」が出る原因と対処法について

投稿日:2023年4月16日 更新日:

 

<目次>

(1) Azure Machine Learningで「Failed to pull Docker image」が出る原因と対処法について
 (1-1) エラー概要
 (1-2) 原因
 (1-3) 対策

(1) Azure Machine Learningで「Failed to pull Docker image」が出る原因と対処法について

(1-1) エラー概要

Azure Machine Learningで「ml_client.create_or_update(job)」でジョブを実行したら、下記のエラーになりました。
(エラーメッセージ)
Failed to pull Docker image rainbowmlcontanerregistry.azurecr.io/azureml/azureml_af5b98a52d31bc5b17b6f7656a9567d8. This error may occur because the compute could not authenticate with the Docker registry to pull the image. If using ACR please ensure the ACR has Admin user enabled or a Managed Identity with `AcrPull` access to the ACR is assigned to the compute. If the ACR Admin user's password was changed recently it may be necessary to synchronize the workspace keys.
(図211①)

(1-2) 原因

いくつかの誘発原因が考えられますが、私の場合はMachine Learningのワークスペースを作る際に必要な「コンテナーレジストリ」の設定によって引き起こされていました。

●原因①

コンテナーレジストリ(ACR=Azure Container Registry)でadminユーザーが有効化されていないため
 

●原因②

adminユーザーが有効化されている場合でも、パスワードがMLのワークスペースと同期(sync)していないため、認証に失敗している
 
(参考)

(1-3) 対策

上記が原因である場合、原因①②の両方を対処する事で、事象が解消する可能性があります。

●原因①の対策:管理者ユーザーの有効化

・①Azure MLワークスペースに紐づく「コンテナーレジストリ」を開く。
(図231①)
・②アクセスキーの「管理ユーザー」を「有効」に変更
→パスワードが生成されます。
(図231②)
 
以上で、原因①の対策は完了です。
 

●原因②の対策:adminユーザーのパスワードがMLのワークスペースと同期させる

・①「Open Terminal」ボタンを押下
→Terminalのコンソールが開きます。
(図232⓪)
・②ログインコマンドを実行
$ az login
(図232①)

表示されたURLにアクセスし、コードを入力。
https://microsoft.com/devicelogin
(図232②)

・③サインイン
(図232③)
・④サインインが完了
(図232④)

(例)
[
  {
    "cloudName": "AzureCloud",
    "homeTenantId": "XXXXX",
    "id": " XXXXX ",
    "isDefault": true,
    "managedByTenants": [],
    "name": "rainbow-engine-dev",
    "state": "Enabled",
    "tenantId": " XXXXX ",
    "user": {
      "name": " XXXXX @ XXXXX.com",
      "type": "user"
    }
  }
]
・⑤パスワードを同期させるためのコマンドを実行
→MLワークスペースと、リソースグループのキー情報を同期させるコマンドです。
(コマンド構文)
az ml workspace sync-keys --name  --resource-group 
(例)名前はシングルクォーテーションで囲む
az ml workspace sync-keys --name 'rainbow-ml-workspace' --resource-group 'rainbow-machine-learning'
(図232⑤)
(結果例)
Waiting for the workspace keys sync.
Done.
以上で原因②の対策は完了です。

●結果確認

最後に、冒頭にエラーとなった処理をもう一度実行したところ、今度はCompleteで完了しました。
 
(図233)

余談ですが、なぜDockerの話が出てきているかというと、Machine Learningで環境を作成する際のyamlファイルを実行すると、ワークスペース内に環境が生成されますが、これが実行時にDockerコンテナにパッケージングされているためです。
 
(参考)

Adsense審査用広告コード


Adsense審査用広告コード


-Azure, Microsoft
-

執筆者:


comment

メールアドレスが公開されることはありません。 が付いている欄は必須項目です

関連記事

Azureで「subscription is not registered to use namespace ‘Microsoft.EventGrid’.」エラーが出た時の原因と対処

  <目次> (1) Azureで「subscription is not registered to use namespace ‘Microsoft.EventGrid&#8 …

no image

Outlookで「代理人アクセス」が表示されない

  <目次> (1) Outlookで「代理人アクセス」が表示されない  (1-1) 事象概要  (1-2) 原因  (1-3) 対策(Gmailの例)  (1-4) 備考:「代理人アクセス …

Azure DevOpsのPipelineの使い方をご紹介(入門編)

  <目次> (1) Azure DevOpsのPipelineの使い方をご紹介(入門編)  (1-1) 概要  (1-2) Pipeline疎通の手順 (1) Azure DevOpsのP …

AzureのAZ900の試験対策について(Microsoft Azure Fundamentals)

  <目次> (1) AzureのAZ900の試験対策について(Microsoft Azure Fundamentals)  (1-1) AZ900(Microsoft Azure Fund …

Azure FunctionsでPythonのライブラリを追加する方法(依存関係解決)

  <目次> (1) Azure FunctionsでPythonのライブラリを追加する方法(依存関係解決)  (1-1) requirement.txtの設定手順  (1-2) 補足事項 …

  • English (United States)
  • 日本語
Top