두 번째 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 연산자를 사용하여 Cloud Build를 트리거합니다. 파이썬 함수. 트리거 DAG와 Cloud Build가 모두 성공적으로 반환됩니다.
requirements.txt 파일을 설치하는 첫 번째 인수는 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>
내 기능은 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>
],
}],
}
여기에있는 누군가가 도움을 줄 수 있을지 모르지만 관련 포럼에서 더 많은 성공을 거둘 수 있다고 생각합니다. 기류 .