Show HN: 用 OCaml 启动并运行 Terraform 编排

1作者: sausagefeet9 个月前
我们是马尔科姆和乔什,两位工程师,在读了《一人公司》这本书后,想通过自力更生来创业。(如果你还没读过,这是一本关于构建可持续发展,而不是追求指数级增长的好书。)我们从未打算建立一家 Terraform 公司。我们只是想要独立性,一种生活方式的业务,最终才走到这一步。 Terrateam 是一个开源工具,用于在拉取请求中运行 Terraform 计划并应用。可以把它想象成 Terraform 编排,旨在处理大型单体仓库和灵活的工作流程。 几年前,我们试图弄清楚如何创办一家公司。我们不想要风险投资。我们想要独立性和可持续性,即使增长缓慢。这就是目标。 我们最初尝试了很多东西,Package Depot、Curl Bash,以及一个名为“Hosted Atlantis”的项目。但没有一个真正奏效。但 Terraform 却一直出现在我们的视野中。老实说,我们并不是超级粉丝。整天编写 HCL 从未让我们兴奋。但围绕 Terraform 的编排问题是不可避免的。Atlantis(默认的开源解决方案)会在单体仓库上崩溃。Terraform Cloud 昂贵且僵化。GitHub Actions 也很脆弱。我们知道这些都是真正的问题。 所以我们开始构建 Terrateam。起初,它基本上是“用 OCaml 编写的 Atlantis”,因为我喜欢用 OCaml 编写代码,并且类型系统让我在进行大型重构时充满信心。回过头来看,我们试图一次做太多事情,而且我们没有明确区分。但随着时间的推移,我们已经找到了解决方案。 Terrateam 的优势: * 单体仓库,这要归功于一个标签系统,该系统允许你使用自定义工作流程、策略和访问控制来定位基础设施的最小组成部分。我们有团队在包含成千上万个目录的庞大仓库中运行 Terrateam,标签系统可以保持运行的隔离和可管理性。 * 所有操作都在 PR 中直接运行,无需 UI。我们认为额外的仪表板是不必要的上下文切换,尽管当 PR 受到限制时,我们仍然会提供一个。 * 我们是自力更生、盈利且开源的。我们的大多数竞争对手都是闭源的,由风险投资资助,并且专注于大型企业。我们则将目标对准中端市场。这些团队需要编排,但又不想花费六位数,在预算会议上讨论它,或者让工程师去构建和维护他们自己的系统。Terraform 编排非常重要,值得付费,但不是大多数团队应该自己构建和维护的那种问题。 至于人工智能,我们还不知道它在哪里适用。今天,我们认为编排仍然是一个人类工作流程,人们会审查计划、执行策略和批准更改。也许人工智能将来会增强这一点,但我们现在的重点是使基本原理可靠。基础设施的更改应该是有意为之的。 获得关注仍然是最难的部分。我们没有庞大的营销预算。我们不是默认的开源选择,因为 Atlantis 仍然是。但我们已经构建了一些真正团队在生产中使用的东西,我们认为这里的工程和业务问题足够有趣,值得分享。 仓库:[https://github.com/terrateamio/terrateam](https://github.com/terrateamio/terrateam) 我们很乐意收到反馈,特别是来自那些尝试过自力更生构建基础设施工具、考虑过 devtools 的 GTM 或大规模使用 Terraform 的人。
查看原文
We are Malcolm and Josh, two engineers who wanted to bootstrap a business after reading the book Company of One. (If you haven&#x27;t read it, it is a great book about building something sustainable instead of chasing exponential growth.) We never set out to build a Terraform company. We just wanted independence, a lifestyle business, and ended up here.<p>Terrateam is an open source tool that runs Terraform plans and applies inside pull requests. Think of it as Terraform orchestration designed to handle large monorepos and flexible workflows.<p>A few years ago we were trying to figure out how to start a company. We did not want VC money. We wanted independence and something sustainable, even if it grew slowly. That was the goal.<p>We tried a bunch of things first, Package Depot, Curl Bash, and something called &quot;Hosted Atlantis.&quot; None of it really worked. But Terraform kept coming back into the picture. Honestly, we were not superfans. Writing HCL all day never excited us. But the orchestration problems around Terraform were unavoidable. Atlantis (the default OSS solution) would choke on monorepos. Terraform Cloud was expensive and rigid. GitHub Actions were brittle. We knew these were real pain points.<p>So we started building Terrateam. At first it was basically &quot;Atlantis in OCaml&quot; because I like writing OCaml and the type system gave me confidence in big refactors. Looking back, we tried to do too much at once and we did not differentiate clearly. But over time, we have figured it out.<p>What works well with Terrateam:<p>Monorepos, thanks to a tag system that lets you target the lowest possible piece of your infrastructure with custom workflows, policies, and access controls. We have teams running Terrateam across enormous repos with tens of thousands of directories, and the tag system keeps runs isolated and manageable Everything runs directly in PRs with no required UI. We think extra dashboards are an unnecessary context switch, although we still provide one when PRs are too constrained We are bootstrapped, for profit, and open source. Most of our competitors are closed source, VC funded, and focused on large enterprise. We are aiming at the mid-market instead. These are the teams that need orchestration, but do not want to spend six figures, talk about it in budget meetings. or divert engineers to build and maintain their own system. Terraform orchestration is important enough to pay for, but not the kind of problem most teams should be building and maintaining themselves.<p>As for AI, we do not yet know where it fits. Today we believe orchestration is still a human workflow, with people reviewing plans, enforcing policies, and approving changes. Maybe AI augments that in the future, but our focus is on making the fundamentals reliable right now. Infrastructure changes should be intentional.<p>Getting noticed is still the hardest part. We do not have a big marketing budget. We are not the default open source choice because Atlantis still is. But we have built something that real teams use in production, and we think the engineering and business problems here are interesting enough to be worth sharing.<p>Repo: <a href="https:&#x2F;&#x2F;github.com&#x2F;terrateamio&#x2F;terrateam" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;terrateamio&#x2F;terrateam</a><p>We would love feedback, especially from others who have tried to bootstrap infra tools, thought about GTM for devtools, or fought Terraform at scale.