From patchwork Thu Feb 16 13:48:47 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dumitru Ceara X-Patchwork-Id: 1743672 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=openvswitch.org (client-ip=2605:bc80:3010::137; helo=smtp4.osuosl.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=WN9EmaUl; dkim-atps=neutral Received: from smtp4.osuosl.org (smtp4.osuosl.org [IPv6:2605:bc80:3010::137]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4PHbrs4Rpjz23j7 for ; Fri, 17 Feb 2023 00:49:01 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id 7CA76418CD; Thu, 16 Feb 2023 13:48:58 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org 7CA76418CD Authentication-Results: smtp4.osuosl.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=WN9EmaUl X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp4.osuosl.org ([127.0.0.1]) by localhost (smtp4.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id gJRNfcBWemmY; Thu, 16 Feb 2023 13:48:57 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by smtp4.osuosl.org (Postfix) with ESMTPS id 13DCE410A2; Thu, 16 Feb 2023 13:48:56 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org 13DCE410A2 Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id E0EB4C0033; Thu, 16 Feb 2023 13:48:55 +0000 (UTC) X-Original-To: ovs-dev@openvswitch.org Delivered-To: ovs-dev@lists.linuxfoundation.org Received: from smtp4.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by lists.linuxfoundation.org (Postfix) with ESMTP id 8230FC002B for ; Thu, 16 Feb 2023 13:48:54 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id 4F76741750 for ; Thu, 16 Feb 2023 13:48:54 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org 4F76741750 X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp4.osuosl.org ([127.0.0.1]) by localhost (smtp4.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id JeuiJPj3ZJyI for ; Thu, 16 Feb 2023 13:48:53 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.8.0 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org 4A1E34086F Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by smtp4.osuosl.org (Postfix) with ESMTPS id 4A1E34086F for ; Thu, 16 Feb 2023 13:48:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1676555332; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=KwCXNHa4+GVdDPBPtJnXFQld1S3TU/FslRDaoy9cPKE=; b=WN9EmaUlupmagobSkM5Q6BP/dAvspOjKqYkOkvwJHw/pW5QAhJgAZnzLJ1a8S9SV9ErocT O4emuFWxu5F/TQQuWIYDPyhgpx5TgUohYtT5WcR2xa0DiYKhDD+87omedIy+b4coN+vhxT IPeBDPfvouTw0DKwTwinf42qSh2wlmE= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-622-MYvODauxM3SNCUdrwCtz_A-1; Thu, 16 Feb 2023 08:48:51 -0500 X-MC-Unique: MYvODauxM3SNCUdrwCtz_A-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id CC8A785A588; Thu, 16 Feb 2023 13:48:50 +0000 (UTC) Received: from dceara.remote.csb (unknown [10.39.193.69]) by smtp.corp.redhat.com (Postfix) with ESMTP id 32BE7140EBF6; Thu, 16 Feb 2023 13:48:49 +0000 (UTC) From: Dumitru Ceara To: ovs-dev@openvswitch.org Date: Thu, 16 Feb 2023 14:48:47 +0100 Message-Id: <20230216134847.495137-1-dceara@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.7 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Cc: i.maximets@ovn.org Subject: [ovs-dev] [PATCH ovn] ci: ovn-kubernetes: Reduce image size. X-BeenThere: ovs-dev@openvswitch.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ovs-dev-bounces@openvswitch.org Sender: "dev" Remove some packages that we don't need in the final image (and also remove dnf cache). Also squash the container image layers in CI. This saves approximately 800MB of image size. Signed-off-by: Dumitru Ceara Acked-by: Ales Musil --- .ci/ovn-kubernetes/Dockerfile | 7 +++++-- .github/workflows/ovn-kubernetes.yml | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/.ci/ovn-kubernetes/Dockerfile b/.ci/ovn-kubernetes/Dockerfile index 722af78709..0a958cc81e 100644 --- a/.ci/ovn-kubernetes/Dockerfile +++ b/.ci/ovn-kubernetes/Dockerfile @@ -66,8 +66,7 @@ FROM fedora:37 # install needed dependencies RUN INSTALL_PKGS=" \ iptables iproute iputils hostname unbound-libs kubernetes-client kmod socat" && \ - dnf install --best --refresh -y --setopt=tsflags=nodocs $INSTALL_PKGS && \ - dnf clean all && rm -rf /var/cache/dnf/* + dnf install --best --refresh -y --setopt=tsflags=nodocs $INSTALL_PKGS RUN mkdir -p /var/run/openvswitch @@ -90,6 +89,10 @@ COPY --from=ovnkubebuilder /root/ovn-kubernetes/dist/images/ovnkube.sh /root/ COPY --from=ovnkubebuilder /root/ovn-kubernetes/dist/images/ovndb-raft-functions.sh /root/ COPY --from=ovnkubebuilder /root/ovn-kubernetes/dist/images/iptables-scripts /usr/sbin/ +# Make some room. +RUN REMOVE_PKGS="llvm-libs clang-libs" && \ + dnf remove -y $REMOVE_PKGS && dnf clean all && rm -rf /var/cache/dnf/* + LABEL io.k8s.display-name="ovn-kubernetes" \ io.k8s.description="This is a Kubernetes network plugin that provides an overlay network using OVN." \ maintainer="ovn team" diff --git a/.github/workflows/ovn-kubernetes.yml b/.github/workflows/ovn-kubernetes.yml index 8a7815f1dd..d65f0fc5c1 100644 --- a/.github/workflows/ovn-kubernetes.yml +++ b/.github/workflows/ovn-kubernetes.yml @@ -38,7 +38,7 @@ jobs: run: | docker build --build-arg OVNKUBE_COMMIT=${{ env.OVNKUBE_COMMIT }} \ --build-arg LIBOVSDB_COMMIT=${{ env.LIBOVSDB_COMMIT }} \ - -t ovn-daemonset-f:dev -f .ci/ovn-kubernetes/Dockerfile . + --squash -t ovn-daemonset-f:dev -f .ci/ovn-kubernetes/Dockerfile . mkdir /tmp/_output docker save ovn-daemonset-f:dev > /tmp/_output/image.tar