Welcome toVigges Developer Community-Open, Learning,Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
244 views
in Technique[技术] by (71.8m points)

docker - Problems extending Airflow image for Helm

I'm using HELM to install Airflow in a Kubernetes cluster. I wanted the pods to have an additional apt dependency (sshpass) and as such, I was trying to extend the Airflow image Helm uses and add that apt dependency using Docker. My Dockerfile looks like this:

FROM apache/airflow:1.10.12-python3.6

USER root

RUN apt-get update 
    && apt-get install -y --no-install-recommends 
    sshpass 
    && apt-get autoremove -yqq --purge 
    && apt-get clean 
    && rm -rf /var/lib/apt/lists/*

USER airflow

I followed the example given by Airflow doc here: https://airflow.apache.org/docs/apache-airflow/stable/production-deployment.html#extending-the-image, but replaced the image with the one Helm uses.

I then built and published the new image, I made Helm use it by editing the values.yaml file like so:

airflow:
  ## configs for the docker image of the web/scheduler/worker
  ##
  image:
    repository: myaccount/myrepo
    tag: mytag
    ## values: Always or IfNotPresent
    pullPolicy: IfNotPresent
    pullSecret: ""

I then ran the installation command but the pods that are launched go into CrashLoopBackOff and Error states. I checked the logs of one of the pods which is:

*** installing requirements...
Collecting airflow-multi-dagrun==1.2 (from -r requirements.txt (line 1))
  Downloading https://files.pythonhosted.org/packages/af/41/e60dff951d002dbf14daf601b1323dfc48c0d24d2bc4e7d19ac72b19c3f6/airflow_multi_dagrun-1.2-py3-none-any.whl
Collecting azure-storage-blob==12.4.0 (from -r requirements.txt (line 2))
  Downloading https://files.pythonhosted.org/packages/60/dc/3c25aeab827266c019e13abc07f31b5f47d93f1b8548a417c81c89c9d021/azure_storage_blob-12.4.0-py2.py3-none-any.whl (326kB)
Collecting azure-cosmosdb-table==1.0.6 (from -r requirements.txt (line 3))
  Downloading https://files.pythonhosted.org/packages/f0/e4/15a59108883cc47460b1475aeac935e2d975b5def42f2c0a8b8fd48b3304/azure_cosmosdb_table-1.0.6-py2.py3-none-any.whl (125kB)
Collecting pandas==1.1.2 (from -r requirements.txt (line 4))
  Downloading https://files.pythonhosted.org/packages/1c/11/e1f53db0614f2721027aab297c8afd2eaf58d33d566441a97ea454541c5e/pandas-1.1.2-cp36-cp36m-manylinux1_x86_64.whl (10.5MB)
Collecting pyarrow==1.0.1 (from -r requirements.txt (line 5))
  Downloading https://files.pythonhosted.org/packages/1f/32/34b44246e671a2ba672fc2551dd3a85472ba07e58a75da1dbc655810fbfa/pyarrow-1.0.1-cp36-cp36m-manylinux2010_x86_64.whl (17.5MB)
Collecting azure-core<2.0.0,>=1.6.0 (from azure-storage-blob==12.4.0->-r requirements.txt (line 2))
  Downloading https://files.pythonhosted.org/packages/12/9e/6bb67fe85f6a89d71f50c86a0da778a5064f749a485ed9ba498067034227/azure_core-1.10.0-py2.py3-none-any.whl (125kB)
Collecting msrest>=0.6.10 (from azure-storage-blob==12.4.0->-r requirements.txt (line 2))
  Downloading https://files.pythonhosted.org/packages/fa/f5/9e315fe8cb985b0ce052b34bcb767883dc739f46fadb62f05a7e6d6eedbe/msrest-0.6.19-py2.py3-none-any.whl (84kB)
Collecting cryptography>=2.1.4 (from azure-storage-blob==12.4.0->-r requirements.txt (line 2))
  Downloading https://files.pythonhosted.org/packages/c9/de/7054df0620b5411ba45480f0261e1fb66a53f3db31b28e3aa52c026e72d9/cryptography-3.3.1-cp36-abi3-manylinux2010_x86_64.whl (2.6MB)
Collecting azure-common>=1.1.5 (from azure-cosmosdb-table==1.0.6->-r requirements.txt (line 3))
  Downloading https://files.pythonhosted.org/packages/19/2b/46ada1753c4a640bc3ad04a1e20b1a5ea52a8f18079e1b8238e536aa0c98/azure_common-1.1.26-py2.py3-none-any.whl
Collecting requests (from azure-cosmosdb-table==1.0.6->-r requirements.txt (line 3))
  Downloading https://files.pythonhosted.org/packages/29/c1/24814557f1d22c56d50280771a17307e6bf87b70727d975fd6b2ce6b014a/requests-2.25.1-py2.py3-none-any.whl (61kB)
Collecting azure-cosmosdb-nspkg>=2.0.0 (from azure-cosmosdb-table==1.0.6->-r requirements.txt (line 3))
  Downloading https://files.pythonhosted.org/packages/58/0d/1329b47e5386b0acf4e42ada2284851eff60ef3337a87e5b2dfedabbfcb1/azure_cosmosdb_nspkg-2.0.2-py2.py3-none-any.whl
Collecting python-dateutil (from azure-cosmosdb-table==1.0.6->-r requirements.txt (line 3))
  Downloading https://files.pythonhosted.org/packages/d4/70/d60450c3dd48ef87586924207ae8907090de0b306af2bce5d134d78615cb/python_dateutil-2.8.1-py2.py3-none-any.whl (227kB)
Collecting pytz>=2017.2 (from pandas==1.1.2->-r requirements.txt (line 4))
  Downloading https://files.pythonhosted.org/packages/89/06/2c2d3034b4d6bf22f2a4ae546d16925898658a33b4400cfb7e2c1e2871a3/pytz-2020.5-py2.py3-none-any.whl (510kB)
Collecting numpy>=1.15.4 (from pandas==1.1.2->-r requirements.txt (line 4))
  Downloading https://files.pythonhosted.org/packages/14/32/d3fa649ad7ec0b82737b92fefd3c4dd376b0bb23730715124569f38f3a08/numpy-1.19.5-cp36-cp36m-manylinux2010_x86_64.whl (14.8MB)
Collecting six>=1.6 (from azure-core<2.0.0,>=1.6.0->azure-storage-blob==12.4.0->-r requirements.txt (line 2))
  Downloading https://files.pythonhosted.org/packages/ee/ff/48bde5c0f013094d729fe4b0316ba2a24774b3ff1c52d924a8a4cb04078a/six-1.15.0-py2.py3-none-any.whl
Collecting certifi>=2017.4.17 (from msrest>=0.6.10->azure-storage-blob==12.4.0->-r requirements.txt (line 2))
  Downloading https://files.pythonhosted.org/packages/5e/a0/5f06e1e1d463903cf0c0eebeb751791119ed7a4b3737fdc9a77f1cdfb51f/certifi-2020.12.5-py2.py3-none-any.whl (147kB)
Collecting requests-oauthlib>=0.5.0 (from msrest>=0.6.10->azure-storage-blob==12.4.0->-r requirements.txt (line 2))
  Downloading https://files.pythonhosted.org/packages/a3/12/b92740d845ab62ea4edf04d2f4164d82532b5a0b03836d4d4e71c6f3d379/requests_oauthlib-1.3.0-py2.py3-none-any.whl
Collecting isodate>=0.6.0 (from msrest>=0.6.10->azure-storage-blob==12.4.0->-r requirements.txt (line 2))
  Downloading https://files.pythonhosted.org/packages/9b/9f/b36f7774ff5ea8e428fdcfc4bb332c39ee5b9362ddd3d40d9516a55221b2/isodate-0.6.0-py2.py3-none-any.whl (45kB)
Collecting cffi>=1.12 (from cryptography>=2.1.4->azure-storage-blob==12.4.0->-r requirements.txt (line 2))
  Downloading https://files.pythonhosted.org/packages/1c/1a/90fa7e7ee05d91d0339ef264bd8c008f57292aba4a91ec512a0bbb379d1d/cffi-1.14.4-cp36-cp36m-manylinux1_x86_64.whl (401kB)
Collecting chardet<5,>=3.0.2 (from requests->azure-cosmosdb-table==1.0.6->-r requirements.txt (line 3))
  Downloading https://files.pythonhosted.org/packages/19/c7/fa589626997dd07bd87d9269342ccb74b1720384a4d739a1872bd84fbe68/chardet-4.0.0-py2.py3-none-any.whl (178kB)
Collecting urllib3<1.27,>=1.21.1 (from requests->azure-cosmosdb-table==1.0.6->-r requirements.txt (line 3))
  Downloading https://files.pythonhosted.org/packages/f5/71/45d36a8df68f3ebb098d6861b2c017f3d094538c0fb98fa61d4dc43e69b9/urllib3-1.26.2-py2.py3-none-any.whl (136kB)
Collecting idna<3,>=2.5 (from requests->azure-cosmosdb-table==1.0.6->-r requirements.txt (line 3))
  Downloading https://files.pythonhosted.org/packages/a2/38/928ddce2273eaa564f6f50de919327bf3a00f091b5baba8dfa9460f3a8a8/idna-2.10-py2.py3-none-any.whl (58kB)
Collecting azure-nspkg>=2.0.0 (from azure-cosmosdb-nspkg>=2.0.0->azure-cosmosdb-table==1.0.6->-r requirements.txt (line 3))
  Downloading https://files.pythonhosted.org/packages/c4/0c/c562be95a9a2ed52454f598571cf300b1114d0db2aa27f5b8ed3bb9cd0c0/azure_nspkg-3.0.2-py3-none-any.whl
Collecting oauthlib>=3.0.0 (from requests-oauthlib>=0.5.0->msrest>=0.6.10->azure-storage-blob==12.4.0->-r requirements.txt (line 2))
  Downloading https://files.pythonhosted.org/packages/05/57/ce2e7a8fa7c0afb54a0581b14a65b56e62b5759dbc98e80627142b8a3704/oauthlib-3.1.0-py2.py3-none-any.whl (147kB)
Collecting pycparser (from cffi>=1.12->cryptography>=2.1.4->azure-storage-blob==12.4.0->-r requirements.txt (line 2))
  Downloading https://files.pythonhosted.org/packages/ae/e7/d9c3a176ca4b02024debf82342dab36efadfc5776f9c8db077e8f6e71821/pycparser-2.20-py2.py3-none-any.whl (112kB)
Installing collected packages: airflow-multi-dagrun, six, chardet, urllib3, idna, certifi, requests, azure-core, oauthlib, requests-oauthlib, isodate, msrest, pycparser, cffi, cryptography, azure-storage-blob, azure-common, azure-nspkg,azure-cosmosdb-nspkg, python-dateutil, azure-cosmosdb-table, pytz, numpy, pandas, pyarrow
  The script chardetect is installed in '/root/.local/bin' which is not on PATH.
  Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
  The scripts f2py, f2py3 and f2py3.6 are installed in '/root/.local/bin' which is not on PATH.
  Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
  The script plasma_store is installed in '/root/.local/bin' which is not on PATH.
  Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
Successfully installed airflow-multi-dagrun-1.2 azure-common-1.1.26 azure-core-1.10.0 azure-cosmosdb-nspkg-2.0.2 azure-cosmosdb-table-1.0.6 azure-nspkg-3.0.2 azure-storage-blob-12.4.0 certifi-2020.12.5 cffi-1.14.4 chardet-4.0.0 cryptography-3.3.1 idna-2.10 isodate-0.6.0 msrest-0.6.19 numpy-1.19.5 oauthlib-3.1.0 pandas-1.1.2 pyarrow-1.0.1 pycparser-2.20 python-dateutil-2.8.1 pytz-2020.5 requests-2.25.1 requests-oauthlib-1.3.0 six-1.15.0 urllib3-1.26.2
You are using pip version 19.0.2, however version 20.3.3 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
*** installing extra pip packages...
Requirement already satisfied: azure-storage-blob==12.4.0 in /root/.local/lib/python3.6/site-packages (12.4.0)
Requirement already satisfied: azure-core<2.0.0,>=1.6.0 in /root/.local/lib/python3.6/site-packages (from azure-storage-blob==12.4.0) (1.10.0)
Requirement already satisfied: msrest>=0.6.10 in /root/.local/lib/python3.6/site-packages (from azure-storage-blob==12.4.0) (0.6.19)
Requirement already satisfied: cryptography>=2.1.4 in /root/.local/lib/python3.6/site-packages (from azure-storage-blob==12.4.0) (3.3.1)
Requirement already satisfied: six>=1.6 in /root/.local/lib/python3.6/site-packages (from azure-core<2.0.0,>=1.6.0->azure-storage-blob==12.4.0) (1.15.0)
Requirement already satisfied: requests>=2.18.4 in /root/.local/lib/python3.6/site-packages (from azure-core<2.0.0,>=1.6.0->azure-storage-blob==12.4.0) (2.25.1)
Requirement already satisfied: requests-oauthlib>=0.5.0 in /root/.local/lib/python3.6/site-packages (from msrest>=0.6.10->azure-storage-blob==12.4.0) (1.3.0)
Requirement already satisfied: certifi>=2017.4.17 in /root/.local/lib/python3.6/site-packages (from msrest>=0.6.10->azure-storage-blob==12.4.0) (2020.12.5)
Requirement already satisfied: isodate>=0.6.0 in /root/.local/lib/python3.6/site-packages (from msrest>=0.6.10->azure-storage-blob==12.4.0) (0.6.0)
Requirement already satisfied: cffi>=1.12 in /root/.local/lib/python3.6/site-packages (from cryptography>=2.1.4->azure-storage-blob==12.4.0) (1.14.4)
Requirement already satisfied: idna<3,>=2.5 in /root/.local/lib/python3.6/site-packages (from requests>=2.18.4->azure-core<2.0.0,>=1.6.0->azure-storage-blob==12.4.0) (2.10)
Requirement already satisfied: urllib3<1.27,>=1.21.1 in /root/.local/lib/python3.6/site-packages (from requests>=2.18.4->azure-core<2.0.0,>=1.6.0->azure-storage-blob==12.4.0) (1.26.2)
Requirement already satisfied: chardet<5,>=3.0.2 in /root/.local/lib/python3.6/site-packages (from requests>=

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
等待大神答复

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to Vigges Developer Community for programmer and developer-Open, Learning and Share
...