2017-05-24 81 views
0

我正嘗試將我的CI構建遷移到基於高山的泊塢窗圖像。構建的在Alpine上安裝crcmod CRC32C C擴展

一部分從火力地堡testlab使用gsutil命令取回文物:

gsutil -m cp -r -U $BUCKET_DIR* $OUTPUT_DIR 

此命令失敗,因爲它不能下載的文物進行CRC校驗:

CommandException: 
Downloading this composite object requires integrity checking with CRC32c, but your crcmod installation isn't using the module's C extension, so the hash computation will likely throttle download performance. For help installing the extension, please see "gsutil help crcmod". 

To download regardless of crcmod performance or to skip slow integrity checks, see the "check_hashes" option in your boto config file. 

NOTE: It is strongly recommended that you not disable integrity checks. 
Doing so could allow data corruption to go undetected during uploading/downloading. 
CommandException: 1 file/object could not be transferred. 

gsutil help crcmod不提供如何在Alpine上安裝C擴展的說明。

我已經嘗試安裝以下軟件包,並且在安裝它們成功時,C擴展未安裝,並且仍然導致gsutil命令失敗,並出現相同的錯誤。

apk add --update --no-cache python py-pip gcc python-dev 
pip install -U crcmod 

任何線索?

回答

0

相當肯定,必須有這樣做的更好的選擇,但是這是我的解決辦法

# Install Alpine Python dependencies 
apk add --update --no-cache python python-dev gcc musl-dev 

# Compile CRC32c 
# See for more information: https://cloud.google.com/storage/docs/gsutil/addlhelp/CRC32CandInstallingcrcmod 
# 
curl -L -o crcmod.tar.gz "https://downloads.sourceforge.net/project/crcmod/crcmod/crcmod-1.7/crcmod-1.7.tar.gz" 
tar -xzf crcmod.tar.gz 
cd crcmod-1.7/ 
python setup.py install 
cd ..