이 주제는 JMP 토론 포럼이 아닌 Python 토론 그룹에 게시되어야하는 것으로 보입니다.
게시물 링크 : (Airflow Cloud Build 연산자가 Python 기능을 실행하지 않음)
으로 셀레나 누르
https://community.jmp.com/t5/Discussions/Airflow-Cloud-Build-Operator-not-executing-python-function/mp/321460#M57150
두 번째 arg 문을 실행할 수 없습니다. "python", "-c", "from main import foo; print (foo ( 'hello'))"Airflow 연산자 python 함수를 사용하여 Cloud Build를 트리거합니다. . 트리거 DAG와 Cloud Build가 모두 성공적으로 반환됩니다. requirements.txt 파일을 설치하는 첫 번째 인수는 Cloud Build에서 반환 한 로그 메시지를 기반으로 작동하는 것으로 보입니다. Requirement already satisfy : setuptools> = 40.3.0 in /usr/local/lib/python3.7/site-packages (from google -auth> = 1.2-> gcsfs> = 0.6.2 내 함수는 gcsfs 패키지를 사용하고 있습니다. 질문에서 사용한 기능은 데모 용입니다. Airflow를 사용하기 전에 yaml 파일에서이 작업을 수행했습니다. "args": [ "-c", "pip install -V -r requirements.txt; python -c from main import foo; print (foo ( 'hello') 인수를 설명하는 여러 가지 방법을 시도했습니다. )) "]하지만 이제는 원을 그리며 돌고 있습니다. args 문이 작동하도록 도움을 주시면 감사하겠습니다. DAG의 CloudBuildCreateBuildOperator입니다. create_build_from_storage_body = { "source": { "repoSource": { "projectId": "dev-6767", "repoName": "bq-pipeline", "branchName": "master",} }, "단계": [{ "이름": "docker.io/library/python:3.7", "entrypoint": "/ bin / bash", "args": [ "-c", "pip install -V -r requirements.txt ","python ","-c ","from main import foo; print (foo ( 'hello')) "],}],}
이 메시지에는 답글이 없습니다.