2024年10月14日 星期一

Linux 開發筆記 - 在 Ubuntu 16.04 使用 Docker Ubuntu 24.04 無法正常更新套件 (apt update)@ Ubuntu 16.04

追蹤到最後,解法應當是把 Host 端的 docker 更新來修正,但一開始很懶,只好遮住雙眼摸魚一下 XD

狀態:

```
$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 16.04 LTS
Release: 16.04
Codename: xenial

$ docker run -it ubuntu:24.04 /bin/bash
root@a0f5c64ed667:/# apt update
Get:1 http://security.ubuntu.com/ubuntu noble-security InRelease [126 kB]
Get:2 http://archive.ubuntu.com/ubuntu noble InRelease [256 kB]
Err:1 http://security.ubuntu.com/ubuntu noble-security InRelease    
  The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 871920D1991BC93C
Err:2 http://archive.ubuntu.com/ubuntu noble InRelease
  The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 871920D1991BC93C
Get:3 http://archive.ubuntu.com/ubuntu noble-updates InRelease [126 kB]
Err:3 http://archive.ubuntu.com/ubuntu noble-updates InRelease
  The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 871920D1991BC93C
Get:4 http://archive.ubuntu.com/ubuntu noble-backports InRelease [126 kB]
Err:4 http://archive.ubuntu.com/ubuntu noble-backports InRelease
  The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 871920D1991BC93C
Reading package lists... Done
W: GPG error: http://security.ubuntu.com/ubuntu noble-security InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 871920D1991BC93C
E: The repository 'http://security.ubuntu.com/ubuntu noble-security InRelease' is not signed.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
W: GPG error: http://archive.ubuntu.com/ubuntu noble InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 871920D1991BC93C
E: The repository 'http://archive.ubuntu.com/ubuntu noble InRelease' is not signed.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
W: GPG error: http://archive.ubuntu.com/ubuntu noble-updates InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 871920D1991BC93C
E: The repository 'http://archive.ubuntu.com/ubuntu noble-updates InRelease' is not signed.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
W: GPG error: http://archive.ubuntu.com/ubuntu noble-backports InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 871920D1991BC93C
E: The repository 'http://archive.ubuntu.com/ubuntu noble-backports InRelease' is not signed.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
E: Problem executing scripts APT::Update::Post-Invoke 'rm -f /var/cache/apt/archives/*.deb /var/cache/apt/archives/partial/*.deb /var/cache/apt/*.bin || true'
E: Sub-process returned an error code
```

硬解:

```
root@a0f5c64ed667:/# apt update --allow-insecure-repositories
...
```

安裝軟體:

```
root@a0f5c64ed667:/# apt install -y --allow-unauthenticated vim wget curl git tree python3-virtualenv 
...
```

結果越裝越痛苦 XD 還是回去看 Docker 官網安裝教學:docs.docker.com/engine/install/ubuntu/#install-using-the-repository 

如此就可以在 Host Ubuntu 16.04 ,正確呼喚出 docker Ubuntu 24.04 來運行,此外,也可以留意 Docker 官方文件建議的 Ubuntu OS 環境已經是 20.04 以上了

2024年10月9日 星期三

學習完畢 Google Cloud AI Study Jam 2024 - 生成式 AI 培訓計劃


就這樣一口氣把 Google Cloud AI Study Jam 2024 都扛過去了,從月初到 10/08 晚間,每天多少都有清幾則:
原本是颱風天體驗了 Path 1 ,結果就這樣馬不停蹄地把 Path 2 跟 Path 3 也給 KO 了,真的獲益良多。

近一年當中,在 AI 應用開發跟自修上,剛好上過台大李宏毅教授的 Youtube 影片:【生成式AI導論 2024】,接著也協助公司使用 OpenAI API 建置了幾個雛形和一款稍微正式的對內服務,體驗過訓練自己的 model 來做客製化應用,以及也摸索過 RAG 應用和負責協助公司導入 AI 輔助應用等等,在這樣的背景下,進行 Path 1, Path 2 和 Path 3 仍收穫滿滿,補了不少思維:
  • 對 Google AI 的發展更新為沒脫隊!只是入門門檻高 XD 
  • 研發 AI 服務時,要想想怎樣達成開發出一個負責任的 AI 
在 Path 1:Beginner: Introduction to Generative AI Learning Path 過程時,開始熟悉 Google Cloud 的介面,儘管 2018 年左右就開始用 GCP ,但基於工作方式大多透靠 ansible + jenkins 完成任務,一直漠視了 Google 發展,這次使用上反而驚艷了一下,特別是 Gemini 小幫手到處都可以協助,不熟也沒關係,問!就對了。

在 Path 1 的課程就被 Google Cloud 網頁管理介面驚艷到,接著補了不少關於 負責任 AI 的思維,令人想起前陣子 OpenAI Superalignment 的事情,雖然有點直覺,但對於事件的感受還不夠強烈,在上完課後終於能比較全面體會了,好在 OpenAI 在 2024.05 成立新的安全委員會了。

在 Path 2: Intermediate: Gemini for Google Cloud Learning Path 課程,讓我感受到身為 RD / DevOps / SRE 時 AI 的靈壓,可以有以下體驗思維:
  • 站在資方角度,不需聘請有高深經驗者,僅需找資淺的聰明者(學習力強),只要能問對問題,靠 Gemini 補完工作,甚至快速累積經驗
  • 站在開發者進行 side project 角度,透過 Gemini 大方地享受一人工作模式,可以只專精或感興趣一個領域,剩下的靠 Gemini 模擬出 10-30 人力規模的新創組織,幫你把點子完善到成品
此外,在 Path 2 的各種角色使用 Gemini 工作的思維,讓人欽佩大公司的組織架構,在小公司都是全包了 Orz
  • Gemini for Application Developers
  • Gemini for Cloud Architects
  • Gemini for Data Scientists and Analysts 
  • Gemini for Network Engineers
  • Gemini for Security Engineers
  • Gemini for DevOps Engineers
  • Gemini for end-to-end SDLC
  • Develop GenAI Apps with Gemini and Streamlit
在 Path 3: Advanced: Generative AI for Developers Learning Path 的心得,就進入比較正式的原理課程,雖然看過過台大教授的 AI 導論,但還是在這波習得不少底層運作的觀念。



最後,差不多累積了兩萬分,其中 Quiz 錯了幾次,Lab 都一次通過。

2024年10月3日 星期四

體驗 Google Cloud AI Study Jam 2024: goo.gle/csj-tw-2024


看著認識的 Google 技術傳教士分享這活動,趁颱風天來體驗一下 XD 總算做完 Path 1 的學習歷程,微累,但至少可以拿到個貼紙禮物了?XD


共 25 份學習教材,完成時間約 48 小時。

在影片觀看上,可以用兩倍速吸收,旁邊又有中文字幕,很不錯。整體耗時是還可以接受,倒是透過這次了解 vertex ai 的操作介面,很佛的設定好 prompt 後,還可以匯出程式碼,這點很方便,若要說卡關的話,好像有某堂課要驗證 vertex ai studio 某操作項目時,一直失敗,後來我猜到了,他是在掃已儲存的 prompt 的比對方式是用英文作為判斷,這時要把 vertex ai studio 的操作資料改成英文 (examples) 才能被偵測成功完成該項目。

整體上就熟悉一下 Google Cloud 服務,很順,此外 Path 1 某堂課也有稍微改 code 的地方,對於工程師背景的人來說,看懂題目,很簡單就能完成的。印象中,有一題很卡,題目上只有一個 example ,要自己再想另一個填入,接著,還要再想額外一個當作 promot & Test Input 來實驗(總共想兩個新句子),大概這題一開始不順會瞬間喪失自信 XD 但撐過了就沒問題了。經過這痛苦後,也被訓練到,看題目時可以挑熟悉的語言(中文),但建議還要另開一頁用英文的再看一次,避免翻中文時,一些關鍵操作看不懂。特別是一些操作選單,英文清楚非常多。

之前一直想用 LangChain 也略知一二,但恰好教學內容提了簡單 Python Code 真不錯,醍醐灌頂。

過去已經約一年多都在用 OpenAI API 開發服務,這次體驗了 Google 牌,也才了解 PaLMGemini 和 Vertex AI 的不同,之前 PaLM 剛推出來時,同事整合會議記錄,但整體上還是有不少需要客製化的地方,很快就放棄整合,沒想到 Google NotebookLM 最近推出,狂勝,且根據 Path 1 的學習歷程,大概能體會 Google 在 Responsible AI 投入很驚人的資源。