Non riesco a far eseguire la seconda istruzione 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>
Sto attivando una build cloud utilizzando l'operatore Airflow pitone funzione. Sia il DAG di attivazione che Cloud Build vengono restituiti correttamente.
Il primo arg per installare il file requirements.txt sembra funzionare in base al messaggio di log restituito da Cloud Build:
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>
La mia funzione sta usando il pacchetto gcsfs. La funzione che ho utilizzato nella domanda è solo dimostrativa.
Prima di utilizzare Airflow, questo funzionava in un file yaml. Ho provato diversi modi per affermare l'argomento, ad esempio:
<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>]Ma ora gira in tondo.
Apprezzerei molto qualsiasi aiuto per far funzionare questa affermazione args.
Questo è CloudBuildCreateBuildOperator dal DAG:
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>
],
}],
}
Potrebbe essere che qualcuno qui possa offrire aiuto, ma sospetto che tu possa avere più successo in un forum più correlato a Flusso d'aria .