Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions .cirrus.star

This file was deleted.

68 changes: 0 additions & 68 deletions .cirrus.yml

This file was deleted.

75 changes: 75 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
name: CI

on:
merge_group:
pull_request:
push:
branches:
- main
workflow_dispatch:

permissions:
contents: read
pull-requests: read

jobs:
lint:
name: Lint
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- uses: actions/checkout@v6
- uses: actions/setup-go@v6
with:
go-version-file: go.mod
cache: true
- uses: golangci/golangci-lint-action@v9
with:
version: v2.12.0
only-new-issues: true

test-linux:
name: Test (Linux)
runs-on: ghcr.io/cirruslabs/ubuntu-runner-amd64:24.04-md
timeout-minutes: 60
steps:
- uses: actions/checkout@v6
- uses: actions/setup-go@v6
with:
go-version-file: go.mod
cache: true
- name: Check out Vetu
uses: actions/checkout@v6
with:
repository: openai/vetu
path: _vetu
- name: Build Vetu
working-directory: _vetu
run: |
go build -o "$RUNNER_TEMP/vetu" cmd/vetu/main.go

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Grant Vetu the bind-service capability

When the Linux job builds Vetu from source, this setcap replaces the old apt-installed package setup but grants only cap_net_raw and cap_net_admin. Vetu's own install instructions say the binary needs cap_net_raw,cap_net_admin,cap_net_bind_service+eip; without cap_net_bind_service, the integration tests that later run vetu run can fail when Vetu binds privileged networking service ports, even though the earlier vetu pull step succeeds.

Useful? React with 👍 / 👎.

sudo setcap cap_net_raw,cap_net_admin+eip "$RUNNER_TEMP/vetu"
echo "$RUNNER_TEMP" >> "$GITHUB_PATH"
- name: Pre-pull default Vetu image
run: vetu pull ghcr.io/cirruslabs/ubuntu-runner-amd64:latest
- name: Run tests
run: go test -v -count=1 ./...

test-macos:
name: Test (macOS)
runs-on: ghcr.io/cirruslabs/macos-runner:tahoe
timeout-minutes: 45
steps:
- uses: actions/checkout@v6
- uses: actions/setup-go@v6
with:
go-version-file: go.mod
cache: true
- name: Pre-pull default Tart image
run: tart pull ghcr.io/cirruslabs/macos-tahoe-base:latest
- name: Run tests
run: go test -timeout=20m -ldflags="-B gobuildid" -v -count=1 ./...
- name: Clean up test VMs
if: always()
run: |
tart list
rm -rf ~/.tart/vms/orchard-*
24 changes: 0 additions & 24 deletions .github/workflows/main.yml

This file was deleted.

114 changes: 114 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
name: Release

on:
push:
tags:
- "*"
workflow_dispatch:

permissions:
contents: read

jobs:
release:
name: Release Binaries
if: github.ref_type == 'tag'
runs-on: ubuntu-latest
timeout-minutes: 60
environment: publish
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
- uses: actions/setup-go@v6
with:
go-version-file: go.mod
cache: true
- name: Create release app token for this repo
id: app-token
uses: actions/create-github-app-token@1b10c78c7865c340bc4f6099eb2f838309f1e8c3 # v3.1.1
with:
app-id: ${{ secrets.RELEASE_APP_ID }}
private-key: ${{ secrets.RELEASE_APP_PRIVATE_KEY }}
permission-contents: write
- name: Create release app token for homebrew-tools
id: tap-token
uses: actions/create-github-app-token@1b10c78c7865c340bc4f6099eb2f838309f1e8c3 # v3.1.1
with:
app-id: ${{ secrets.RELEASE_APP_ID }}
private-key: ${{ secrets.RELEASE_APP_PRIVATE_KEY }}
owner: openai
repositories: homebrew-tools
permission-contents: write
permission-pull-requests: write
- name: Release
uses: goreleaser/goreleaser-action@v7
with:
distribution: goreleaser-pro
version: "~> v2"
args: release --clean
env:
GITHUB_TOKEN: ${{ steps.app-token.outputs.token }}
GORELEASER_KEY: ${{ secrets.GORELEASER_KEY }}
HOMEBREW_TAP_GITHUB_TOKEN: ${{ steps.tap-token.outputs.token }}
MACOS_NOTARY_ISSUER_ID: ${{ secrets.MACOS_NOTARY_ISSUER_ID }}
MACOS_NOTARY_KEY: ${{ secrets.MACOS_NOTARY_KEY }}
MACOS_NOTARY_KEY_ID: ${{ secrets.MACOS_NOTARY_KEY_ID }}
MACOS_SIGN_P12: ${{ secrets.MACOS_SIGN_P12 }}
MACOS_SIGN_PASSWORD: ${{ secrets.MACOS_SIGN_PASSWORD }}

snapshot:
name: Release Binaries (Dry Run)
if: github.event_name == 'workflow_dispatch'
runs-on: ubuntu-latest
timeout-minutes: 60
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
- uses: actions/setup-go@v6
with:
go-version-file: go.mod
cache: true
- name: Release dry run
uses: goreleaser/goreleaser-action@v7
with:
distribution: goreleaser-pro
version: "~> v2"
args: release --skip=publish --snapshot --clean
- name: Upload dry-run artifacts
uses: actions/upload-artifact@v6
with:
name: orchard-snapshot
path: dist/**

docker:
name: Release Docker Image
if: github.ref_type == 'tag'
needs: release
runs-on: ubuntu-latest
timeout-minutes: 60
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v6
- uses: docker/setup-qemu-action@v4
- uses: docker/setup-buildx-action@v4
- uses: docker/login-action@v4
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ github.token }}
- name: Build and push
uses: docker/build-push-action@v7
with:
context: .
platforms: linux/amd64,linux/arm64
push: true
tags: |
ghcr.io/openai/orchard:${{ github.ref_name }}
ghcr.io/openai/orchard:latest
build-args: |
VERSION=${{ github.ref_name }}
COMMIT=${{ github.sha }}
34 changes: 20 additions & 14 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -1,24 +1,30 @@
version: 2
version: "2"

run:
timeout: 5m

linters-settings:
# Even in Rust you can get away with partial matching,
# so make sure that the linter respects the programmer's
# intent expressed in the form of "default" case.
exhaustive:
default-signifies-exhaustive: true

gosec:
excludes:
- G115

formatters:
enable-all: true
enable:
- gci
- gofmt
- gofumpt
- goimports
- golines
- swaggo

linters:
enable-all: true
default: all

settings:
# Even in Rust you can get away with partial matching,
# so make sure that the linter respects the programmer's
# intent expressed in the form of "default" case.
exhaustive:
default-signifies-exhaustive: true

gosec:
excludes:
- G115

disable:
# We don't have high-performance requirements at this moment, so sacrificing
Expand Down
36 changes: 10 additions & 26 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,36 +23,15 @@ builds:

archives:
- id: binary
format: binary
formats:
- binary
name_template: "{{ .ProjectName }}-{{ .Os }}-{{ .Arch }}"
- id: regular
name_template: "{{ .ProjectName }}-{{ .Os }}-{{ .Arch }}"

release:
prerelease: auto

nfpms:
- package_name: orchard-controller
vendor: Cirrus Labs, Inc.
homepage: https://github.com/cirruslabs/orchard
maintainer: support@cirruslabs.org
description: Orchestrator for running Tart Virtual Machines on a cluster of Apple Silicon devices
section: misc
formats:
- deb
- rpm
contents:
- src: packaging/orchard-controller.service
dst: /lib/systemd/system/orchard-controller.service
type: config
scripts:
postinstall: packaging/postinstall.sh
preremove: packaging/preremove.sh
postremove: packaging/postremove.sh

furies:
- account: cirruslabs

notarize:
macos:
- enabled: '{{ isEnvSet "MACOS_SIGN_P12" }}'
Expand All @@ -66,15 +45,20 @@ notarize:

brews:
- name: orchard
directory: Formula
ids:
- regular
repository:
owner: cirruslabs
name: homebrew-cli
owner: openai
name: homebrew-tools
Comment on lines +63 to +64

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Keep the documented Homebrew tap in sync

This moves formula publishing to openai/homebrew-tools, but the README still tells users to run brew install cirruslabs/cli/orchard. After the next release is published only to the new tap, users following the documented install path will keep getting the stale Cirrus formula instead of current Orchard; either update the install docs to the new openai/tools tap or keep publishing the old tap as well.

Useful? React with 👍 / 👎.

token: "{{ .Env.HOMEBREW_TAP_GITHUB_TOKEN }}"
branch: "orchard-{{ .Version }}"
pull_request:
enabled: true
install: |
bin.install "orchard"
generate_completions_from_executable(bin/"orchard", "completion")
caveats: See the Github repository for more information
homepage: https://github.com/cirruslabs/orchard
homepage: https://github.com/openai/orchard
description: Orchestrator for running Tart Virtual Machines on a cluster of Apple Silicon devices
skip_upload: auto
Loading
Loading