顯示具有 cloud 標籤的文章。 顯示所有文章
顯示具有 cloud 標籤的文章。 顯示所有文章

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 投入很驚人的資源。

2024年1月1日 星期一

使用 do-release-upgrade 把 Oracle Cloud - Ubuntu 18.04 升級至 20.04 再繼續升級到 22.04

在 2019年搶了一台 Ubuntu 18.04 後,一直在那邊做例行公事。應該近一年 apt upgrade 也沒法多升級什麼就涼在那邊,趁 2024-01-01 假期,來整理一下。

升級絕對有風險,請自行評估跟承擔,在此謹流水帳紀錄,適合我的 VM 情況不代表大家都能升。

由於之前有設定防火牆來做一些簡單的防護,這次升級時要打開 1022 port 來小心一下:

$ sudo iptables -I INPUT 1 -p tcp --dport 1022 -j ACCEPT
$ sudo service netfilter-persistent save

開始操作:

$ sudo do-release-upgrade 
...
Calculating the changes

Could not calculate the upgrade

An unresolvable problem occurred while calculating the upgrade.

This was likely caused by:
* Unofficial software packages not provided by Ubuntu
Please use the tool 'ppa-purge' from the ppa-purge
package to remove software from a Launchpad PPA and
try the upgrade again.

If none of this applies, then please report this bug using the
command 'ubuntu-bug ubuntu-release-upgrader-core' in a terminal. If
you want to investigate this yourself the log files in
'/var/log/dist-upgrade' will contain details about the upgrade.
Specifically, look at 'main.log' and 'apt.log'.

接著安裝一下:

$ sudo apt-get install ppa-purge
$ sudo do-release-upgrade 
...

又碰到問題,大概看了一下 bugs.launchpad.net/ubuntu/+source/llvm-toolchain-9/+bug/1886748 ,偷懶衝:

$ sudo apt install clang-9
$ sudo do-release-upgrade 
...
Do you want to start the upgrade? 


17 packages are going to be removed. 209 new packages are going to be 
installed. 759 packages are going to be upgraded. 

You have to download a total of 886 M. This download will take about 
1 hour 52 minutes with a 1Mbit DSL connection and about 1 day 10 
hours with a 56k modem. 

Fetching and installing the upgrade can take several hours. Once the 
download has finished, the process cannot be canceled. 

 Continue [yN]  Details [d]Y

...
System upgrade is complete.

Restart required 

To finish the upgrade, a restart is required. 
If you select 'y' the system will be restarted. 

Continue [yN] Y

所幸...連得上 XD 看來完成了 Ubuntu 20.04 了

$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 20.04.6 LTS
Release: 20.04
Codename: focal

繼續升上去!

$ sudo do-release-upgrade 
...
Reading cache

Checking package manager

Continue running under SSH? 

This session appears to be running under ssh. It is not recommended 
to perform a upgrade over ssh currently because in case of failure it 
is harder to recover. 

If you continue, an additional ssh daemon will be started at port 
'1022'. 
Do you want to continue? 

Continue [yN] Y

Starting additional sshd 

To make recovery in case of failure easier, an additional sshd will 
be started on port '1022'. If anything goes wrong with the running 
ssh you can still connect to the additional one. 


To continue please press [ENTER]

Do you want to start the upgrade? 


12 packages are going to be removed. 128 new packages are going to be 
installed. 826 packages are going to be upgraded. 

You have to download a total of 746 M. This download will take about 
2 minutes with your connection. 

Installing the upgrade can take several hours. Once the download has 
finished, the process cannot be canceled. 

 Continue [yN]  Details [d] Y

done
Processing triggers for dbus (1.12.20-2ubuntu4.1) ...
Processing triggers for libgdk-pixbuf-2.0-0:amd64 (2.42.8+dfsg-1ubuntu0.2) ...
Reading package lists... Done    
Building dependency tree          
Reading state information... Done

Processing snap replacements

refreshing snap lxd

refreshing snap oracle-cloud-agent

Searching for obsolete software
Reading state information... Done

Remove obsolete packages? 


127 packages are going to be removed. 

Removing the packages can take several hours. 

 Continue [yN]  Details [d]Y

...

System upgrade is complete.

Restart required 

To finish the upgrade, a restart is required. 
If you select 'y' the system will be restarted. 

Continue [yN] Y

再次登入:

$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 22.04.3 LTS
Release: 22.04
Codename: jammy

2018年12月9日 星期日

[Linux] dev_appserver.py ERROR module.py:1652] The PHP runtime cannot be run with the "Memcache" PECL extension installed @ Ubuntu 16.04

在 Ubuntu server 上,首推 https://cloud.google.com/sdk/downloads#linux 安裝法,不要靠 apt 套件管理,不然會踩到很多麻煩:

$ curl https://dl.google.com/dl/cloudsdk/channels/rapid/downloads/google-cloud-sdk-183.0.0-linux-x86_64.tar.gz | tar -xvf -
$ cd google-cloud-sdk
$ ./install.sh


裝完後,若是要運行 php-sdk 時,會踩到 php 環境問題,通常就是要指定 --php_executable_path 位置:

$ dev_appserver.py --enable_host_checking false --host 0.0.0.0 --port 8080  --php_executable_path /usr/bin/php-cgi5.6 app.yaml

只是執行時又會踩到缺套件等等的問題,裝到最後產生了 Memcache 套件問題,就要再把 Memcache 套件關閉即可:

$ php5.6 --ini
Configuration File (php.ini) Path: /etc/php/5.6/cli
Loaded Configuration File:         /etc/php/5.6/cli/php.ini
Scan for additional .ini files in: /etc/php/5.6/cli/conf.d
Additional .ini files parsed:      /etc/php/5.6/cli/conf.d/10-opcache.ini,
/etc/php/5.6/cli/conf.d/10-pdo.ini,
/etc/php/5.6/cli/conf.d/20-apcu.ini,
/etc/php/5.6/cli/conf.d/20-bcmath.ini,
/etc/php/5.6/cli/conf.d/20-calendar.ini,
/etc/php/5.6/cli/conf.d/20-ctype.ini,
/etc/php/5.6/cli/conf.d/20-exif.ini,
/etc/php/5.6/cli/conf.d/20-fileinfo.ini,
/etc/php/5.6/cli/conf.d/20-ftp.ini,
/etc/php/5.6/cli/conf.d/20-gettext.ini,
/etc/php/5.6/cli/conf.d/20-iconv.ini,
/etc/php/5.6/cli/conf.d/20-igbinary.ini,
/etc/php/5.6/cli/conf.d/20-json.ini,
/etc/php/5.6/cli/conf.d/20-memcache.ini,
/etc/php/5.6/cli/conf.d/20-msgpack.ini,
/etc/php/5.6/cli/conf.d/20-phar.ini,
/etc/php/5.6/cli/conf.d/20-posix.ini,
/etc/php/5.6/cli/conf.d/20-readline.ini,
/etc/php/5.6/cli/conf.d/20-shmop.ini,
/etc/php/5.6/cli/conf.d/20-sockets.ini,
/etc/php/5.6/cli/conf.d/20-sysvmsg.ini,
/etc/php/5.6/cli/conf.d/20-sysvsem.ini,
/etc/php/5.6/cli/conf.d/20-sysvshm.ini,
/etc/php/5.6/cli/conf.d/20-tokenizer.ini,
/etc/php/5.6/cli/conf.d/25-memcached.ini

$ sudo vim /etc/php/5.6/cli/conf.d/20-memcache.ini
; uncomment the next line to enable the module
;extension=memcache.so

$ sudo vim /etc/php/5.6/cli/conf.d/25-memcached.ini
; priority=25
;extension=memcached.so

2014年1月23日 星期四

阿里雲初體驗

AYCloud00

中國發展快速,至今共有「阿里雲」、「騰訊雲」、「沃雲」等,先來試試阿里雲吧!目前可以申請五天免費試用,並且綁在淘寶帳號,當然,最重要的金流都弄妥了。

AYCloud10

AYCloud11

申請測試需要一點時間,過程中可能會有電話照會等,作業系統共有 Aliyun linux、CentOS 、Debian、Ubuntu、Windows Server 可以選擇,此例採用 Ubuntu 12.04 64Bit,最後建立起的機器 root 帳密會用簡訊通知,最便宜的一檯是一個月 55 RMB,更多細節可直接去逛逛 http://buy.aliyun.com/。未來就只需在阿里雲網站登入->我的阿里雲 -> 管理控制台:

AYCloud02

接著從「雲服務器ECS」進去:

AYCloud03

界面面跟 AWS EC2 的配置差不多,左邊選單,點一點可以看到目前運行列表:

AYCloud04

AYCloud05

接著會顯示"遠端登入"方式:

AYCloud06

顯示硬碟資訊:

AYCloud07

對硬碟進行 snapshot:

AYCloud08

顯示製作進度:

AYCloud09

disk snapshot 做完後,可以在做鏡像管理(開啟新機器時的選擇鏡像來源):

AYCloud10

AYCloud11

至於網路方面,從臺北 ping 青島的機器,晚上大概 290 ms 的反應時間,早上約 410ms。由於免費試用網路速度最高只能拉到 5Mbps ,若願意在測試的話,可以再加錢,最多調到 200Mbs。

AYCloud12

此外,阿里雲還有提供「雲盾」服務:

AYClod12

AYCloud13

AYCloud14

AYCloud15

以上就是簡單的把玩。