From nobody Sat Feb 24 23:34:25 2024 X-Original-To: freebsd-virtualization@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Tj3BG0Wnmz5BqDd for ; Sat, 24 Feb 2024 23:34:30 +0000 (UTC) (envelope-from jo@durchholz.org) Received: from www382.your-server.de (www382.your-server.de [78.46.146.228]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4Tj3BD6FyVz4jby for ; Sat, 24 Feb 2024 23:34:28 +0000 (UTC) (envelope-from jo@durchholz.org) Authentication-Results: mx1.freebsd.org; dkim=pass header.d=durchholz.org header.s=default2202 header.b=VILbB4Al; dmarc=none; spf=pass (mx1.freebsd.org: domain of jo@durchholz.org designates 78.46.146.228 as permitted sender) smtp.mailfrom=jo@durchholz.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=durchholz.org; s=default2202; h=Content-Transfer-Encoding:Content-Type: In-Reply-To:References:To:Subject:From:MIME-Version:Date:Message-ID:Sender: Reply-To:Cc:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=8mZ7q57XK1/rsGYwaishqqNafm/6BBQnyKgcGU8+R/A=; b=VILbB4AlCHgLM5K8HfvCFspUPW HEDapGaJ6lPPvWP2rEma/oGBTjZbHxUPb08Kz77yag7dx/GkXYpwshgLwep6WWNbHZIomuzWFPBnA wbWq56DuHj+rQUP8DgpsLYYBPi1rh/L0D6nQE+ukL0eZy9uSpGqtNfKyIPGMHUYYsFuWd8cIlnEYR jkGF3ouvgpPXEEs6fnIdSfs3/IfHAO20eb4lNJq9fTxUyqm52U/OzdPiXCwmbZ3WkWiXk2E8Az8GA OrFBomj/tcMoyDzC6h3UIp6woGbHrT4g/VQ/EXMEHnZ/JlUV6/1GG1/Kug1MKz7Q729qFajf1yE1C GUHxlHcA==; Received: from sslproxy02.your-server.de ([78.47.166.47]) by www382.your-server.de with esmtpsa (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1re1XG-0009Wl-Bu for freebsd-virtualization@freebsd.org; Sun, 25 Feb 2024 00:34:26 +0100 Received: from [81.221.201.210] (helo=[192.168.178.48]) by sslproxy02.your-server.de with esmtpsa (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1re1XG-00380V-0Z for freebsd-virtualization@freebsd.org; Sun, 25 Feb 2024 00:34:26 +0100 Message-ID: <84e1634c-1d23-4d2a-867b-4482351da572@durchholz.org> Date: Sun, 25 Feb 2024 00:34:25 +0100 List-Id: Discussion List-Archive: https://lists.freebsd.org/archives/freebsd-virtualization List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-virtualization@freebsd.org X-BeenThere: freebsd-virtualization@freebsd.org MIME-Version: 1.0 User-Agent: Mozilla Thunderbird From: Jo Durchholz Subject: Re: Best way to have a FreeBSD VM for automated testing? Content-Language: en-US To: "freebsd-virtualization@FreeBSD.org" References: In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Authenticated-Sender: jo@durchholz.org X-Virus-Scanned: Clear (ClamAV 0.103.10/27195/Sat Feb 24 10:28:55 2024) X-Spamd-Bar: -- X-Spamd-Result: default: False [-2.48 / 15.00]; SUBJECT_ENDS_QUESTION(1.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_SHORT(-0.99)[-0.989]; R_SPF_ALLOW(-0.20)[+a]; R_DKIM_ALLOW(-0.20)[durchholz.org:s=default2202]; MIME_GOOD(-0.10)[text/plain]; XM_UA_NO_VERSION(0.01)[]; RCVD_TLS_ALL(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; ASN(0.00)[asn:24940, ipnet:78.46.0.0/15, country:DE]; RCPT_COUNT_ONE(0.00)[1]; MIME_TRACE(0.00)[0:+]; DMARC_NA(0.00)[durchholz.org]; MLMMJ_DEST(0.00)[freebsd-virtualization@freebsd.org]; HAS_X_AS(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; FROM_HAS_DN(0.00)[]; MID_RHS_MATCH_FROM(0.00)[]; RCVD_COUNT_TWO(0.00)[2]; TO_MATCH_ENVRCPT_ALL(0.00)[]; TO_DN_EQ_ADDR_ALL(0.00)[]; ARC_NA(0.00)[]; DKIM_TRACE(0.00)[durchholz.org:+] X-Rspamd-Queue-Id: 4Tj3BD6FyVz4jby TL;DR: Just my current status. On 24.02.24 22:47, John Nielsen wrote: > 1) AWS EC2 + cloud-init. The FreeBSD Project publishes AMIs for every release (again, thanks cperciva). You can launch an EC2 instance from one of those with a few clicks. You can additionally assign an IAM role to the instance to give it permission to write to an S3 bucket and drop a script in the user-data for the instance to run when it boots. The script could download the Python code to be run, run it, and upload the results to S3 all non-interactively. > > With a couple hours’ work you could adapt the stock image to add any missing dependencies and disable unneeded drivers and services to speed the boot, then snapshot that and use your custom image for future runs. > > You could also easily manage the whole thing with Terraform. Copy/paste the infrastructure as code templates and tweak the variables to get an easily repeatable system. Ah, I didn't mention that. The tests are for running locally. The overall project is for a home appliance, so no cloud. > 2) KVM + libvirt on whatever Linux host(s) you have available. The VM-IMAGES released by the Project include qcow volumes. You might need to tweak the image to do your custom script(s) at startup (though the image may also have cloud-init if your environment supports it) but qcow does support snapshots as well and the whole thing should have low boot times. That was my second approach :-) It turned out to have various roadbumps (mostly lack of knowledge/experience on my side, no doubts about that). I'm currently going back to my first approach, Vagrant, but diving into writing my own Vagrantfile. I understand that's easy enough for somebody without deep knowledge of KVM/libvirt, so I'll see. Regards, Jo