ghcr.io/cirruslabs/macos-sequoia-base:latest for everything (#344)

This commit is contained in:
Nikolay Edigaryev 2025-09-25 18:43:53 +02:00 committed by GitHub
parent 56260e7667
commit 873efb24e7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
7 changed files with 44 additions and 30 deletions

View File

@ -3,12 +3,14 @@ package create
import (
"errors"
"fmt"
"os"
"strings"
"github.com/cirruslabs/orchard/internal/imageconstant"
"github.com/cirruslabs/orchard/internal/simplename"
"github.com/cirruslabs/orchard/pkg/client"
v1 "github.com/cirruslabs/orchard/pkg/resource/v1"
"github.com/spf13/cobra"
"os"
"strings"
)
var ErrVMFailed = errors.New("failed to create VM")
@ -38,7 +40,7 @@ func newCreateVMCommand() *cobra.Command {
Args: cobra.ExactArgs(1),
}
command.Flags().StringVar(&image, "image", "ghcr.io/cirruslabs/macos-sonoma-base:latest", "image to use")
command.Flags().StringVar(&image, "image", imageconstant.DefaultMacosImage, "image to use")
command.Flags().Uint64Var(&cpu, "cpu", 4, "number of CPUs to use")
command.Flags().Uint64Var(&memory, "memory", 8*1024, "megabytes of memory to use")
command.Flags().Uint64Var(&diskSize, "disk-size", 0, "resize the VMs disk to the specified size in GB "+

View File

@ -2,13 +2,14 @@ package controller
import (
"errors"
"net/http"
"time"
storepkg "github.com/cirruslabs/orchard/internal/controller/store"
"github.com/cirruslabs/orchard/internal/responder"
"github.com/cirruslabs/orchard/internal/simplename"
v1 "github.com/cirruslabs/orchard/pkg/resource/v1"
"github.com/gin-gonic/gin"
"net/http"
"time"
)
func (controller *Controller) createWorker(ctx *gin.Context) responder.Responder {

View File

@ -0,0 +1,3 @@
package imageconstant
const DefaultMacosImage = "ghcr.io/cirruslabs/macos-sequoia-base:latest"

View File

@ -3,7 +3,16 @@ package tests_test
import (
"context"
"fmt"
"net"
"os"
"path/filepath"
"strconv"
"strings"
"testing"
"time"
"github.com/cirruslabs/orchard/internal/controller"
"github.com/cirruslabs/orchard/internal/imageconstant"
"github.com/cirruslabs/orchard/internal/tests/devcontroller"
"github.com/cirruslabs/orchard/internal/tests/wait"
"github.com/cirruslabs/orchard/internal/worker/ondiskname"
@ -15,13 +24,6 @@ import (
"go.uber.org/zap"
"golang.org/x/crypto/ssh"
"golang.org/x/exp/slices"
"net"
"os"
"path/filepath"
"strconv"
"strings"
"testing"
"time"
)
func TestSingleVM(t *testing.T) {
@ -36,7 +38,7 @@ func TestSingleVM(t *testing.T) {
Meta: v1.Meta{
Name: "test-vm",
},
Image: "ghcr.io/cirruslabs/macos-sonoma-base:latest",
Image: imageconstant.DefaultMacosImage,
CPU: 4,
Memory: 8 * 1024,
Headless: true,
@ -109,7 +111,7 @@ func TestFailedStartupScript(t *testing.T) {
Meta: v1.Meta{
Name: "test-vm",
},
Image: "ghcr.io/cirruslabs/macos-sonoma-base:latest",
Image: imageconstant.DefaultMacosImage,
CPU: 4,
Memory: 8 * 1024,
Headless: true,
@ -147,7 +149,7 @@ func TestPortForwarding(t *testing.T) {
Meta: v1.Meta{
Name: "test-vm",
},
Image: "ghcr.io/cirruslabs/macos-sonoma-base:latest",
Image: imageconstant.DefaultMacosImage,
CPU: 4,
Memory: 8 * 1024,
Headless: true,
@ -226,7 +228,7 @@ func TestSchedulerHealthCheckingNonExistentWorker(t *testing.T) {
Meta: v1.Meta{
Name: dummyVMName,
},
Image: "ghcr.io/cirruslabs/macos-sonoma-base:latest",
Image: imageconstant.DefaultMacosImage,
CPU: 4,
Memory: 8 * 1024,
Headless: true,
@ -303,7 +305,7 @@ func TestSchedulerHealthCheckingOfflineWorker(t *testing.T) {
Meta: v1.Meta{
Name: dummyVMName,
},
Image: "ghcr.io/cirruslabs/macos-sonoma-base:latest",
Image: imageconstant.DefaultMacosImage,
CPU: 4,
Memory: 8 * 1024,
Headless: true,
@ -343,7 +345,7 @@ func TestVMGarbageCollection(t *testing.T) {
// Create on-disk Tart VM that looks like it's managed by Orchard
vmName := ondiskname.New("test", uuid.New().String(), 0).String()
_, _, err = tart.Tart(ctx, logger.Sugar(), "clone",
"ghcr.io/cirruslabs/macos-sonoma-base:latest", vmName)
imageconstant.DefaultMacosImage, vmName)
require.NoError(t, err)
// Make sure that this VM exists
@ -379,7 +381,7 @@ func TestHostDirs(t *testing.T) {
Meta: v1.Meta{
Name: vmName,
},
Image: "ghcr.io/cirruslabs/macos-sonoma-base:latest",
Image: imageconstant.DefaultMacosImage,
CPU: 4,
Memory: 8 * 1024,
Headless: true,
@ -441,7 +443,7 @@ func TestHostDirsInvalidPolicy(t *testing.T) {
Meta: v1.Meta{
Name: vmName,
},
Image: "ghcr.io/cirruslabs/macos-sonoma-base:latest",
Image: imageconstant.DefaultMacosImage,
CPU: 4,
Memory: 8 * 1024,
Headless: true,

View File

@ -2,14 +2,16 @@ package tests_test
import (
"context"
"net"
"testing"
"time"
"github.com/cirruslabs/orchard/internal/imageconstant"
"github.com/cirruslabs/orchard/internal/tests/devcontroller"
"github.com/cirruslabs/orchard/internal/tests/wait"
v1 "github.com/cirruslabs/orchard/pkg/resource/v1"
"github.com/stretchr/testify/require"
"golang.org/x/crypto/ssh"
"net"
"testing"
"time"
)
func TestIPEndpoint(t *testing.T) {
@ -21,7 +23,7 @@ func TestIPEndpoint(t *testing.T) {
Meta: v1.Meta{
Name: "test-vm",
},
Image: "ghcr.io/cirruslabs/macos-sonoma-base:latest",
Image: imageconstant.DefaultMacosImage,
CPU: 4,
Memory: 8 * 1024,
Headless: true,

View File

@ -4,7 +4,12 @@ import (
"context"
"crypto/subtle"
"fmt"
"net"
"testing"
"time"
"github.com/cirruslabs/orchard/internal/controller"
"github.com/cirruslabs/orchard/internal/imageconstant"
"github.com/cirruslabs/orchard/internal/tests/devcontroller"
"github.com/cirruslabs/orchard/internal/tests/wait"
v1 "github.com/cirruslabs/orchard/pkg/resource/v1"
@ -12,9 +17,6 @@ import (
"github.com/stretchr/testify/require"
"golang.org/x/crypto/ed25519"
"golang.org/x/crypto/ssh"
"net"
"testing"
"time"
)
func TestSSHServer(t *testing.T) {
@ -41,7 +43,7 @@ func TestSSHServer(t *testing.T) {
Meta: v1.Meta{
Name: "test-vm",
},
Image: "ghcr.io/cirruslabs/macos-sonoma-base:latest",
Image: imageconstant.DefaultMacosImage,
CPU: 4,
Memory: 8 * 1024,
Headless: true,

View File

@ -2,10 +2,12 @@ package ondiskname_test
import (
"fmt"
"testing"
"github.com/cirruslabs/orchard/internal/imageconstant"
"github.com/cirruslabs/orchard/internal/worker/ondiskname"
"github.com/google/uuid"
"github.com/stretchr/testify/require"
"testing"
)
func TestOnDiskNameFromStaticString(t *testing.T) {
@ -33,6 +35,6 @@ func TestOnDiskNameNonUUID(t *testing.T) {
}
func TestOnDiskNameNonOrchard(t *testing.T) {
_, err := ondiskname.Parse("ghcr.io/cirruslabs/macos-sonoma-base:latest")
_, err := ondiskname.Parse(imageconstant.DefaultMacosImage)
require.Error(t, err)
}