OpenTF (Terraform 的 fork) 改名為 OpenTofu

在「OpenTF 開張」這邊提到 Terraform 的 fork 叫做 OpenTF,現在改名為 OpenTofu:「New name for the OpenTF project #296」,同時也可以從官網看到正式加入 The Linux Foundation Projects

有幾個報導都有提到了:「Terraform fork gets renamed OpenTofu, and joins Linux Foundation」、「Terraform fork OpenTF renamed and relocated as OpenTofu」。

看了 Hacker News 上的討論,據說 cli 也會從 tf 換成 tofu...

OpenTF 開張

前陣子有提到因為 HashiCorp 沒有正面回應 (如預期的) 授權的爭議,所以決定將最後一個 open source 版本的 Terraform 給 fork 出來:「OpenTF 宣佈從 Terraform 最後一個 Open Source 版本 fork 出來」。

剛剛在 Hacker News 上看到「OpenTF repository is now public (github.com/opentffoundation)」這個,OpenTF 正式開張了。

瞄了一下 issues,初期還有蠻多雜事得處理的,但跨出第一步了,可以看看社群的能量到底有沒有超過 HashiCorp 自家的能量...

OpenTF 宣佈從 Terraform 最後一個 Open Source 版本 fork 出來

先前在「HashiCorp 將放棄 Open Source License,改採用 BSL 1.1」這邊提到的,HashiCorp 決定將所有產品線從現有的 open source license 換成非開源的 BSL 1.1 後,OpenTF 先丟出了「呼籲」希望 HashiCorp 可以撤回這個決定:「The OpenTF Manifesto」。

想當然的,HashiCorp 沒有回應,所以 OpenTF 宣佈了要把 Terraform 的最後一個 open source 版本 fork 出來:「OpenTF Announces Fork of Terraform」。

有幾個比較重要的資訊,第一個是申請 Linux Foundation 資格,希望成為 CNCF 的一環:

We completed all documents required for OpenTF to become part of the Linux Foundation with the end goal of having OpenTF as part of Cloud Native Computing Foundation.

另外一個是首頁上的 Co-signed 的部分,翻了一下有三家公司 (Spacelift、env0、Scalr) 有提出支援五年五位的 Full time engineer 的經費 (Cover the cost of 5 FTEs for at least 5 years),另外一家公司 (Sailorcloud) 則是提出支援兩年一位的經費 (Cover the cost of 1 FTE for at least 2 years)。

接下來就是看這些能量到底有多少效果了...

HashiCorp 內 scale 的方法

去日本前在 Hacker News 上看到「Squeeze the hell out of the system you have」這篇,用作者的名字翻了一下 LinkedIn,看起來講的是 HashiCorpSRE 事情:「Dan Slimmon」。

看的時候可以注意一下,文章裡面的觀點未必要認同,大多是他自己的看法或是想法,但裡面提到很多發生的事情,可以知道 HashiCorp 內目前搞了什麼東西。

從 LinkedIn 的資料可以看到他從 2019 就加入 HashiCorp 了,所以文章一開頭這邊講的同事應該就是 HashiCorp 的同事:

About a year ago, I raised a red flag with colleagues and managers about Postgres performance.

往下看可以看到他們有遇到 PostgreSQL 的效能問題,然後每次都是以 scale up (加大機器) 的方式解決,考慮到 HashiCorp 的產品線,我會猜應該是 Terraform Cloud 這個產品線遇到的狀況。

然後在後面提到的解法則是提到了 codebase 是 Rails,他們花了三個月的時候不斷的重複 profiling + optimizing,包括 SQL 與 PostgreSQL 的設定:

Two engineers (me and my colleague Ted – but mostly Ted) spent about 3 months working primarily on database performance issues. There was no silver bullet. We used our telemetry to identify heavy queries, dug into the (Rails) codebase to understand where they were coming from, and optimized or eliminated them. We also tuned a lot of Postgres settings.

另外一組人則是弄了 read-only replication server,把 loading 拆出去:

Two more engineers cut a path through the codebase to run certain expensive read-only queries on a replica DB. This effort bore fruit around the same time as (1), when we offloaded our single most frequent query (a SELECT triggered by polling web clients).

這兩個方法大幅降低了資料庫的 peak loading,從 90% 降到 30%:

These two efforts together reduced the maximum weekly CPU usage on the database from 90% to 30%.

可以看到都還沒用到 sharding 的技巧,目前硬體的暴力程度可以撐很久 (而且看起來是在沒有投入太多資源在 DB-related tuning 上面),快撞到的時候也還可以先用 $$ 換效能,然後投入人力開始 profiling 找問題...

Terraform 進入 1.0 版

HashiCorp 的東西都還蠻有品質的 (相較於其他的類似方案),其中有一個觀察到的特性是,如果他門把版本維持在 0.x,代表他們自己對軟體的品質與成熟度都不算滿意。

Terraform 算是他們家對於基礎建設資源管理所提出的方案 (尤其是雲端時代的資源),不過之前最頭痛的,每次升級就會發現有些基本的概念會被改掉,所以不是改改關鍵字就可以解決。

這次 Terraform 推出 1.0 版,代表了他們認為產品有一定的成熟度:「Announcing HashiCorp Terraform 1.0 General Availability」,另外在 GitHub 上面的「Release v1.0.0 · hashicorp/terraform」也可以看到:

Terraform v1.0 is an unusual release in that its primary focus is on stability, and it represents the culmination of several years of work in previous major releases to make sure that the Terraform language and internal architecture will be a suitable foundation for forthcoming additions that will remain backward compatible.

另外也可以從他們對相容性的宣示「Terraform v1.0 Compatibility Promises」看出來他們覺得架構上成熟了:

For all future minor releases with major version 1, we intend to preserve backward compatibility as described in detail in the Terraform v1.0 Compatibility Promises. The later Terraform v1.1.0 will, therefore, be the first minor release with new features that we will implement with consideration of those promises.

總算是開始進入會考慮 backward compatibility 的週期了...

各種對 AWS Managemenet Console 的抱怨...

Hacker News Daily 上看到 Reddit 上面有一篇對 AWS Management Console 的抱怨文,差不多是兩個月前開始累積的:「I am stupefied every day by the awfulness of the AWS web console」。

AWS 的主力開發因為是以 API 為主,而 AWS Management Console 能做的事情一直都少蠻多的 (看起來是一個團隊在開發,然後呼叫 API),而且的確是常常中 bug,所以會有這樣的抱怨其實不太意外...

然後就有人放火了:

[–]canadian_sysadmin 24 points 2 months ago
I see you've never used Azure...

[–]myron-semack 18 points 2 months ago
AWS’s console sucks because they don’t give a damn about UI. They are API-first.

Azure’s console sucks because they tried to make it nice but failed.

[–]ryantiger658 5 points 2 months ago
I was scrolling looking for this comment. Azures interface has made me appreciate AWS even more.

Azure 被偷戳了好幾下 XDDD 然後 GCP 也被偷戳了:

[–]edgan 1 point 2 months ago
It could br better, but it is far better than than Azure and GCP. Azure's old one was better than their new beta interface last I saw it. GCP has some interesting ideas, but the side bar centric design doesn't function well. It also tries to do too much, and is too JavaScript-y happy.

通常用 AWS 自己的 CloudFormation 或是第三方的 Terraform 管理還是比較常見的方式 (基於 Infrastructure as code 的概念),而 AWS Managemenet Console 當作是輔助,因為目前的雲端服務在設計上的確是希望你多用 API...

1Password 使用 Terraform 的案例...

看到「Terraforming 1Password」這篇以及這則 Tweet,講 1Password 導入 Terraform 將會中斷服務幾個小時:

這根本是負面宣傳 XDDD

無論是對 1Password 的技術能力,或是 Terraform 的彈性來說...