diff --git a/.github/workflows/nix-build.yml b/.github/workflows/nix-build.yml index 08c316bce..6674bad28 100644 --- a/.github/workflows/nix-build.yml +++ b/.github/workflows/nix-build.yml @@ -5,6 +5,7 @@ on: branches: - develop - release/* + - da/qemu* pull_request: workflow_dispatch: diff --git a/Dockerfile-kubevirt b/Dockerfile-kubevirt index c6b00b667..7cb749aed 100644 --- a/Dockerfile-kubevirt +++ b/Dockerfile-kubevirt @@ -1,2 +1,2 @@ FROM scratch -ADD --chown=107:107 disk/focal.img /disk/focal.qcow2 +ADD --chown=107:107 output-cloudimg/packer-cloudimg /disk/focal.qcow2 diff --git a/Makefile b/Makefile index 2f2db8785..411e94451 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,4 @@ -# TODO (darora): we can get rid of this once we're actually building nix things on this -UPSTREAM_NIX_GIT_SHA := $(shell git rev-parse origin/release/15.6) +UPSTREAM_NIX_GIT_SHA := $(shell git rev-parse HEAD) GIT_SHA := $(shell git describe --tags --always --dirty) init: qemu-arm64-nix.pkr.hcl @@ -12,10 +11,7 @@ disk/focal-raw.img: output-cloudimg/packer-cloudimg mkdir -p disk sudo qemu-img convert -O raw output-cloudimg/packer-cloudimg disk/focal-raw.img -disk/focal.img: output-cloudimg/packer-cloudimg - sudo qemu-img convert -O qcow2 output-cloudimg/packer-cloudimg disk/focal.img - -container-disk-image: disk/focal.img +container-disk-image: output-cloudimg/packer-cloudimg docker build . -t supabase-postgres-test:$(GIT_SHA) -f ./Dockerfile-kubevirt host-disk: disk/focal-raw.img diff --git a/qemu-arm64-nix.pkr.hcl b/qemu-arm64-nix.pkr.hcl index 6ba1120e4..01a0d164c 100644 --- a/qemu-arm64-nix.pkr.hcl +++ b/qemu-arm64-nix.pkr.hcl @@ -1,38 +1,8 @@ -variable "ami" { - type = string - default = "ubuntu/images/hvm-ssd/ubuntu-focal-20.04-arm64-server-*" -} - -variable "profile" { - type = string - default = "${env("AWS_PROFILE")}" -} - -variable "ami_name" { - type = string - default = "supabase-postgres" -} - -variable "ami_regions" { - type = list(string) - default = ["ap-southeast-2"] -} - variable "ansible_arguments" { type = string default = "--skip-tags install-postgrest,install-pgbouncer,install-supabase-internal" } -variable "aws_access_key" { - type = string - default = "" -} - -variable "aws_secret_key" { - type = string - default = "" -} - variable "environment" { type = string default = "prod" @@ -42,36 +12,6 @@ variable "git_sha" { type = string } -# variable "region" { -# type = string -# } - -variable "build-vol" { - type = string - default = "xvdc" -} - -# ccache docker image details -variable "docker_user" { - type = string - default = "" -} - -variable "docker_passwd" { - type = string - default = "" -} - -variable "docker_image" { - type = string - default = "" -} - -variable "docker_image_tag" { - type = string - default = "latest" -} - locals { creator = "packer" } @@ -91,11 +31,6 @@ variable "packer-execution-id" { default = "unknown" } -variable "force-deregister" { - type = bool - default = false -} - packer { required_plugins { amazon = { @@ -132,16 +67,12 @@ source "qemu" "cloudimg" { disk_image = true disk_size = "15G" format = "qcow2" - # TODO (darora): disable backing image for qcow2 headless = true http_directory = "http" iso_checksum = "file:https://cloud-images.ubuntu.com/focal/current/SHA256SUMS" iso_url = "https://cloud-images.ubuntu.com/focal/current/focal-server-cloudimg-arm64.img" memory = 20000 qemu_binary = "qemu-system-aarch64" - qemu_img_args { - create = ["-F", "qcow2"] - } qemuargs = [ ["-machine", "virt"], ["-cpu", "host"], @@ -158,8 +89,8 @@ source "qemu" "cloudimg" { ssh_timeout = "1h" ssh_username = "ubuntu" ssh_wait_timeout = "1h" - use_backing_file = true - accelerator = "kvm" + use_backing_file = false + accelerator = "kvm" } build {