From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1.migadu.com ([2001:41d0:1008:1e59::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms1.migadu.com with LMTPS id kBapKGBLYGbcPQEAA41jLg (envelope-from ) for ; Wed, 05 Jun 2024 13:26:24 +0200 Received: from aspmx1.migadu.com ([2001:41d0:403:58f0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1.migadu.com with LMTPS id 8FLqImBLYGbY8gAA62LTzQ (envelope-from ) for ; Wed, 05 Jun 2024 13:26:24 +0200 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=fabionatali.com header.s=gm1 header.b=ek02mLL2; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1717586784; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type:resent-cc:resent-from:resent-sender: resent-message-id:in-reply-to:in-reply-to:references:references: list-id:list-help:list-unsubscribe:list-subscribe:list-post: dkim-signature; bh=p3qyxyHVaNmY0r6LNVwz+obhzpCP9WVCgI0UdLemYIg=; b=GVRW03vAXQJhKQWSqIy/lZbWH4Qmsst0c5cJXliVo/LVo5flzKG+/12+2Jmhqa03V4o7mz PMPCJ7kAid2g50ygD3T0h33ZY0D6+py0WQo9/cvm0UkJ/ikncXuOO/NYRv90ClO1/DO+j6 IY7Z10xklR5SU8rFHd5dHiTUezbesm16oGz3GbkhrhpWDR8R4eO3pK5nDpDa4z8fjbHDFp ZNuF0KQkdTHYvdsLyAr7FAiWIPvWK5gif4sDmDUR55bWsamz7uR57Mvl+Et2FfmT2q8sVZ 4wP6j0crn30kEQG8IVp9BabEQ4LWfE25Z5mhsZZAgZJoNgr5lO5ir8oBcKb9Pw== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1717586784; a=rsa-sha256; cv=none; b=KjyIvrwRGotnm7x69G0sCD+Jt1XgY5/iyXWnXglJM2bERC4s0r4QT/5F5IzN2PityH6+D8 1vqYm6zxCuTEm7h7Zvrz5o3jQIfLy4x5pMkoa9nmGtX3KB2I3wDoPF9EfMuYl6W9IhEpiK 4C1JDdqKNwKGTWgPUrhXUZJdoY70M43HeXt3CuDk8z7OntzdDgIj2B3zbdvRUioo8AF4m9 5uy4g3FTr1khDKTAKtlD89NNuJz5cImKwiqN1LlnZUahxWKXpC0RVQvoTVQURRAplxBORe RvXsUuh9m+zyia3Y5luP/ybV4DLbgOHXnNY5varwQFZqSy2YxuT2pekTsd+jag== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=fabionatali.com header.s=gm1 header.b=ek02mLL2; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 57E1D39EBB for ; Wed, 05 Jun 2024 13:26:23 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sEom7-00059U-8h; Wed, 05 Jun 2024 07:25:51 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sEom5-00058S-4r for guix-patches@gnu.org; Wed, 05 Jun 2024 07:25:49 -0400 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sEom4-0002bT-T1 for guix-patches@gnu.org; Wed, 05 Jun 2024 07:25:48 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1sEomI-00064l-QR for guix-patches@gnu.org; Wed, 05 Jun 2024 07:26:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#71254] [PATCH] services: oci-container: fix provided image is string. References: <91c850e563f05fb1fa10aea1758786dce3f79157.1716956272.git.zhengjunjie@iscas.ac.cn> In-Reply-To: <91c850e563f05fb1fa10aea1758786dce3f79157.1716956272.git.zhengjunjie@iscas.ac.cn> Resent-From: Fabio Natali Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Wed, 05 Jun 2024 11:26:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 71254 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 71254@debbugs.gnu.org Received: via spool by 71254-submit@debbugs.gnu.org id=B71254.171758672623226 (code B ref 71254); Wed, 05 Jun 2024 11:26:02 +0000 Received: (at 71254) by debbugs.gnu.org; 5 Jun 2024 11:25:26 +0000 Received: from localhost ([127.0.0.1]:53582 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sEolh-00062U-6w for submit@debbugs.gnu.org; Wed, 05 Jun 2024 07:25:26 -0400 Received: from relay1-d.mail.gandi.net ([217.70.183.193]:60169) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sEoZa-0005S4-RE for 71254@debbugs.gnu.org; Wed, 05 Jun 2024 07:12:56 -0400 Received: by mail.gandi.net (Postfix) with ESMTPSA id E4BD0240002 for <71254@debbugs.gnu.org>; Wed, 5 Jun 2024 11:12:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fabionatali.com; s=gm1; t=1717585954; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type; bh=p3qyxyHVaNmY0r6LNVwz+obhzpCP9WVCgI0UdLemYIg=; b=ek02mLL231Y3/bmn8AOroK+s0cEFk9LaF1GLvwy9zIeT0boHw4bXyN5ykvwy3IxEkIL5tZ fbQtNaiccoHdN+oCOSDjJQMR19NR7akwiJdonvD9Uf6TZn/2fWyEOCuLMwuPyfaliwjNFU kn6gditpl1V3pY1+EJBfmYdSinIqwYvlMR061UP9DWGNxxfkuM+5tROs+g9ePup+Lyx/Yb qm5G0odC+nfSczec05SDIMNLeK2u0Gk5C6aMIcr5rkprmUlWxep57WtpShtu5VObQcbXQf KmAHSzPNBucvtrS4AxXZ/0dujVRIlkox6vzsCSJdY0GIcD2LKBy6bCd58vZykw== Date: Wed, 05 Jun 2024 12:12:33 +0100 Message-ID: <87a5jzd4ny.fsf@fabionatali.com> MIME-Version: 1.0 Content-Type: text/plain X-GND-Sasl: me@fabionatali.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-to: Fabio Natali X-ACL-Warn: , Fabio Natali via Guix-patches From: Fabio Natali via Guix-patches via Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: guix-patches-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US X-Migadu-Spam-Score: -3.94 X-Spam-Score: -3.94 X-Migadu-Queue-Id: 57E1D39EBB X-Migadu-Scanner: mx11.migadu.com X-TUID: uHP9M2WbSDy4 Hi, Just a quick follow-up to mention the way I tested this. Possibly a bit convoluted, but it worked for me. Save this to `/tmp/operating-system-test.scm'. ,---- | (define-module (operating-system-test) | #:use-module (gnu) | #:use-module (gnu services admin) | #:use-module (gnu services dbus) | #:use-module (gnu services desktop) | #:use-module (gnu services docker) | #:use-module (gnu services networking) | #:export (operating-system-test)) | | (define operating-system-test | (operating-system | (host-name "host") | (timezone "Europe/London") | (locale "en_US.UTF-8") | (bootloader (bootloader-configuration | (bootloader grub-bootloader) | (targets '("/dev/vda")))) | (file-systems (cons | (file-system | (device "/dev/vda2") | (mount-point "/") | (type "ext4")) | %base-file-systems)) | | (services (cons* | (service dhcp-client-service-type) | (service docker-service-type) | (service elogind-service-type) | (service oci-container-service-type | (list | (oci-container-configuration | (image "nginx") | (provision "nginx") | (network "host")))) | %base-services)))) | | operating-system-test `---- Then run this to build a system image. ,---- | guix system image \ | --load-path=build \ | --image-size=20GB \ | --image-type=qcow2 \ | /tmp/operating-system-test.scm `---- If you are on or around '2e53fa5346bf52f6d6d26e035bc905ebd410dabb', the above command will fail with error `In procedure struct-vtable: Wrong type argument in position 1 (expecting struct): "nginx"'. Now try instead from a Guix checkout with Zheng's patch. ,---- | orig=$(./pre-inst-env guix system image \ | --load-path=build \ | --image-size=20GB \ | --image-type=qcow2 \ | /tmp/operating-system-test.scm) `---- The command will succeed, and this should be sufficient proof of the patch effectiveness. One can of course go on and test the image itself: ,---- | dest=/tmp/operating-system-media.qcow2 | cp "${orig}" "${dest}" | chown user:users "${dest}" | chmod u+w "${dest}" | qemu-system-x86_64 \ | -enable-kvm \ | -m 4096 \ | -smp 2 \ | -device e1000,netdev=net0 \ | -netdev user,id=net0,hostfwd=tcp::8080-:80 \ | -drive if=none,file="${dest}",id=myhd,index=0 \ | -device virtio-blk,drive=myhd `---- There's a bit of manual work to be done here, as in my tests the docker container doesn't start straightaway. Log in as root, wait for Docker to finish pulling the Nginx image (see `tail -f /var/log/messages' and possibly `herd restart dockerd'), then re-enable and start the Nginx service (`herd enable nginx && herd start nginx'). After that, everything should work as expected, i.e. the Docker Nginx contained in the VM answers requests from the host. Cheers, Fabio. -- Fabio Natali https://fabionatali.com