跳到主要內容

關於gsutil crcmod error問題

在stackoverflow上回報後,很快地收到了Mike的回覆:https://stackoverflow.com/questions/23368191/compute-engine-use-gsutil-to-download-tgz-file-has-crcmod-error

The object you're trying to download is a composite object (https://developers.google.com/storage/docs/composite-objects), which basically means it was uploaded in parallel chunks. gsutil automatically does this when uploading objects larger than 150M (a configurable threshold), to provide better performance.
Composite objects only have a crc32c checksum (no MD5), so in order to validate data integrity when downloading composite objects, gsutil needs to perform a crc32c checksum. Unfortunately, the libraries distributed with Python don't include a compiled crc32c implementation, so unless you install a compiled crc32c, gsutil will use a non-compiled Python implementation of crc32c that's quite slow. That warning is printed to let you know there's a way to fix that performance problem: Please run:
gsutil help crcmod
and follow the instructions there for installing a compiled crc32c. It's pretty easy to do it, and worth the effort.
One other note: I strongly recommend against setting check_hashes = never in your boto config file. That will disable integrity checking, which means it's possible your download could get corrupted and you wouldn't know it. You want data integrity checking enabled to ensure you're working with correct data.
Mike

此部分的問題歸因於crc32c這個套件未安裝 
透過"gsutil help crcmod"指令可以列表出各種系統的安裝方式
這點google還滿貼心的 :D

留言

這個網誌中的熱門文章

Google指令碼基本操作介紹 - Web Server篇

Google的指令碼是什麼東西呢?!原則上他就是Google的一份靜態檔案,但是透過Google的雲端服務平台的一些能力,將靜態檔案內的scriptlet片段拉到Google的後端作運算,寫起來就像在寫JavaScript(這邊說Node.js可能比較貼切,因為同為server side language)或JSP,而在scriptlet片段中,則可以操作許多Google的API服務,甚至他提供你連接JDBC的能力、URL呼叫的能力...等,宛如就是一套完整的雲端程式語言(這樣說應該不為過拉,這真是個創新!),有並駕於App Engine的氣勢喔! Google指令碼的範圍很廣,筆者也仍在摸索中,之前介紹過透過Sheet+指令碼做一個簡單的URL監控( 這裡 ),而本篇簡單介紹一下指令碼如何製作一個Web Server(嚴格說起來是Web Page拉,但是具備Server端運作功能喔!)。您將可以體驗到No-Hosting Web Server的威力! 指令碼是Google Drive的一個服務,Google將指令碼(Code)以檔案方式寄存在Drive中,類似的靜態檔案服務的應用,最近滿火紅的! 首先開啟指令碼時候,選擇"作為網路應用程式的指令碼",檔案開啟後,會有愈設定程式碼片段供編輯 程式碼片段大致上如下,是一個doGet function,Web base的指令碼需要認得doGet()作為server的進入點 如果選擇到空白專案的話,只要把doGet function建上即可 作為一個Cloud IDE,Google當然也有把Code Hint擺上來,透過簡單的提示,寫啟程是來就更容易拉! 而Web部分物件的建立主要是透過 HtmlService 這個模組來進行操作,我們利用他來output html, load static html page, load template html page..等,範例如下: Output HTML: // Script-as-app template. function doGet(e) {   return HtmlService. createHtmlOutput ("<h1>HELLO!</h1>");

透過Google Apps Script結合Google Form做即時郵件通知

體驗過Google Apps Script的功能後,也發現他結合GmailApps的模組 GmailApps的應用可以用在表單填寫完成後,做發信的通知 例如您開立了一個訂購的表單,為了要在第一時間通知商家有訂單進入 就可以直接呼叫Gmail做發信的通知,讓手持Smart Phone的我們可以很快的知道生意上門了! 下面規劃三個function,其中: onCommit():為form commit時候觸發的function,需要掛載於form commit trigger上 jsonArrToTable():目的將json array解析成為一個Table getLastRowTable():目的將整個table的回傳過濾為剩下第一筆(表頭,含有Form的欄位說明)與最後一筆(原則上就是剛剛送出的那一筆表單) 完整程式碼如下: function onCommit(){   var sheet = SpreadsheetApp.getActiveSheet();   var rows = sheet.getDataRange();   var numRows = rows.getNumRows();   var values = rows.getValues();   var content = getLastRowTable(values);   var htmlBody = "Hi Admin: <br/><br/>有訂單拉,檢查一下吧! <br/><br/>" + content + '<br/><br/>Send by Google Apps';   GmailApp.sendEmail(     " your-email-address@gmail.com ",      "Order Confirm Notice",      htmlBody,      {from: ' from-email-address@gmail.com ', htmlBody:htmlBody}   );  } function getLastRowTable(arr){  

存取docker container內的檔案

Docker既然是container概念存在,就想到應該可以透過原filesystem找到對應的container內的檔案 Google了一下,在/var/lib/docker/這個目錄底下可以找到對應的container實際存在的位置... 列印一下目錄可以發現aufs/mnt下有一堆長檔名的資料夾... 透過docker ps或是進入到docker container後,可以看得到docker的instance id 範例中是:61ba7253b842 因此進入到"/var/lib/docker/aufs/mnt/"後,後面加讓instance id後,在透過tab補字可以列出該container相關資訊 其中會包含一個有"-init"跟一個純instance id的資料夾... 列表一下這兩個資料夾 其中無"-init"的目錄存放的就是container對應的磁碟位置 測試一下檔案的存取....,切到該目錄下,touch一個檔案... 結果真的可以在container內部看到對應touch出來的檔案 透過可見的目錄位置,container與host在某個層鍍上可以互通許多東西喲... 檔案傳輸也不用再透過scp或ftp方式存取,超方便的拉!