2番目のargステートメントを実行できません:
<SPAN class="hljs-string">"python"</SPAN>, <SPAN class="hljs-string">"-c"</SPAN>, <SPAN class="hljs-string">"from main import foo;print(foo('hello'))"</SPAN>
Airflowオペレーターを使用してクラウドビルドをトリガーしていますPython関数。 トリガーとなるDAGとCloudBuildの両方が正常に戻ります。
要件.txtファイルをインストールする最初の引数は、CloudBuildが返したログメッセージに基づいて機能しているようです。
Requirement already satisfied: setuptools>=<SPAN class="hljs-number">40.3</SPAN><SPAN class="hljs-number">.0</SPAN> <SPAN class="hljs-keyword">in</SPAN> /usr/local/lib/python3<SPAN class="hljs-number">.7</SPAN>/site-packages (<SPAN class="hljs-keyword">from</SPAN> google-auth>=<SPAN class="hljs-number">1.2</SPAN>->gcsfs>=<SPAN class="hljs-number">0.6</SPAN><SPAN class="hljs-number">.2</SPAN>
私の関数はgcsfsパッケージを使用しています。 質問で使用した関数は、デモンストレーション用です。
Airflowを使用する前は、これをyamlファイルで機能させていました。 次のような、議論を述べるさまざまな方法を試しました。
<SPAN class="hljs-string">"args"</SPAN>:[<SPAN class="hljs-string">"-c"</SPAN>,<SPAN class="hljs-string">"pip install -V -r requirements.txt; python -c from main import foo;print(foo('hello'))"</SPAN>]しかし、今は輪になって回っています。
そのargsステートメントを機能させるための助けをいただければ幸いです。
これはDAGのCloudBuildCreateBuildOperatorです。
create_build_from_storage_body = {
<SPAN class="hljs-string">"source"</SPAN>: {
<SPAN class="hljs-string">"repoSource"</SPAN>: {
<SPAN class="hljs-string">"projectId"</SPAN>: <SPAN class="hljs-string">"dev-6767"</SPAN>,
<SPAN class="hljs-string">"repoName"</SPAN>: <SPAN class="hljs-string">"bq-pipeline"</SPAN>,
<SPAN class="hljs-string">"branchName"</SPAN>: <SPAN class="hljs-string">"master"</SPAN>,
}
},
<SPAN class="hljs-string">"steps"</SPAN>: [{
<SPAN class="hljs-string">"name"</SPAN>: <SPAN class="hljs-string">"docker.io/library/python:3.7"</SPAN>,
<SPAN class="hljs-string">"entrypoint"</SPAN>: <SPAN class="hljs-string">"/bin/bash"</SPAN>,
<SPAN class="hljs-string">"args"</SPAN>: [<SPAN class="hljs-string">"-c"</SPAN>, <SPAN class="hljs-string">"pip install -V -r requirements.txt"</SPAN>,
<SPAN class="hljs-string">"python"</SPAN>, <SPAN class="hljs-string">"-c"</SPAN>, <SPAN class="hljs-string">"from main import foo;print(foo('hello'))"</SPAN>
],
}],
}
ここの誰かが助けを提供できるかもしれませんが、私はあなたがより関連したフォーラムでより多くの成功を収めているかもしれないと思います気流。