Вызов Dremio API из Github Action завершается с ошибкой.
# For more information see: https://docs.github.com/en/actions/auto ... ing-python
name: Dremio Workflow
on:
workflow_call:
env:
dremio_url: ${{secrets.DREMIO_URL}}
dremio_pat: ${{secrets.DREMIO_PAT}}
envior: 'dev'
permissions:
contents: read
jobs:
env-set:
runs-on: ubuntu-latest
environment: PROD
steps:
- name: Check out code
uses: actions/checkout@v2
- name: Set up Python 3.11.4
uses: actions/setup-python@v3
with:
python-version: "3.11.4"
- name: Downloading requirements
run: |
python -m pip install requests
- name: Deploying against CR# ${{github.event.inputs.change_request_id}}
run: |
python .github/workflows/dremio.py --DREMIO_URL ${{secrets.DREMIO_URL}} --DREMIO_PAT ${{secrets.DREMIO_PAT}}
Интересно, что код работает локально, но не работает при действии github.
Сообщение об ошибке:
Exception occured: HTTPSConnectionPool(host='*****', port=443): Max retries exceeded with url: /api/v3/catalog/by-path/dev/report/ap/ap_file (Caused by NameResolutionError(": Failed to resolve '*****' ([Errno -5] No address associated with hostname)")) Error: Process completed with exit code 1.
Это фрагмент выполняемого кода Python:
try:
url = f"{DREMIO_URL}/by-path/{environment}/{report}/{datasubject}/{r_name}"
payload = ""
headers = {
'Authorization': f'Bearer {PAT}',
'Content-Type': 'application/json'
}
print("URL ",url)
response = requests.request("GET", url, headers=headers, data=payload)
return "Success", response.text
except Exception as e:
return "Failure", f"Exception occured: {e}"
Подробнее здесь: https://stackoverflow.com/questions/789 ... o-api-call