From dev-return-1685-archive-asf-public=cust-asf.ponee.io@yetus.apache.org Tue Oct 15 17:40:08 2019 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [207.244.88.153]) by mx-eu-01.ponee.io (Postfix) with SMTP id 51F15180651 for ; Tue, 15 Oct 2019 19:40:08 +0200 (CEST) Received: (qmail 2287 invoked by uid 500); 15 Oct 2019 17:40:07 -0000 Mailing-List: contact dev-help@yetus.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@yetus.apache.org Delivered-To: mailing list dev@yetus.apache.org Received: (qmail 2269 invoked by uid 99); 15 Oct 2019 17:40:07 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 15 Oct 2019 17:40:07 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id 81625C14F5 for ; Tue, 15 Oct 2019 17:40:06 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -0.199 X-Spam-Level: X-Spam-Status: No, score=-0.199 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=disabled Authentication-Results: spamd1-us-west.apache.org (amavisd-new); dkim=pass (1024-bit key) header.d=clayb.net Received: from mx1-he-de.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id Ac-N-fLoPFnF for ; Tue, 15 Oct 2019 17:40:01 +0000 (UTC) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=23.83.209.62; helo=fossa.birch.relay.mailchannels.net; envelope-from=cwb@clayb.net; receiver= Received: from fossa.birch.relay.mailchannels.net (fossa.birch.relay.mailchannels.net [23.83.209.62]) by mx1-he-de.apache.org (ASF Mail Server at mx1-he-de.apache.org) with ESMTPS id 3D4437F621 for ; Tue, 15 Oct 2019 17:35:21 +0000 (UTC) X-Sender-Id: dreamhost|x-authsender|cwb@clayb.net Received: from relay.mailchannels.net (localhost [127.0.0.1]) by relay.mailchannels.net (Postfix) with ESMTP id E8BA28C0B88 for ; Tue, 15 Oct 2019 17:35:13 +0000 (UTC) Received: from pdx1-sub0-mail-a37.g.dreamhost.com (100-96-87-223.trex.outbound.svc.cluster.local [100.96.87.223]) (Authenticated sender: dreamhost) by relay.mailchannels.net (Postfix) with ESMTPA id 580268C0D3C for ; Tue, 15 Oct 2019 17:35:13 +0000 (UTC) X-Sender-Id: dreamhost|x-authsender|cwb@clayb.net Received: from pdx1-sub0-mail-a37.g.dreamhost.com ([TEMPUNAVAIL]. [64.90.62.162]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384) by 0.0.0.0:2500 (trex/5.18.5); Tue, 15 Oct 2019 17:35:13 +0000 X-MC-Relay: Neutral X-MailChannels-SenderId: dreamhost|x-authsender|cwb@clayb.net X-MailChannels-Auth-Id: dreamhost X-Minister-Ski: 2df97b88721aaa37_1571160913746_348252654 X-MC-Loop-Signature: 1571160913746:2842903603 X-MC-Ingress-Time: 1571160913746 Received: from pdx1-sub0-mail-a37.g.dreamhost.com (localhost [127.0.0.1]) by pdx1-sub0-mail-a37.g.dreamhost.com (Postfix) with ESMTP id 152EC80584 for ; Tue, 15 Oct 2019 10:35:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=clayb.net; h=date:from:to :subject:in-reply-to:message-id:references:mime-version :content-type; s=clayb.net; bh=lektx+Kr3ckdr+3IEKzJ57i15vE=; b=I VyD+3XYraZ22N8CSOqasRER39wvWz4rLdvFP0RGe92jSIO5ynkmiWs1SBMTjRqxv 0GWIrqSNEJecp5+rY/fTXu4mihwzuK0ApKJoDDps2O5u1xZ6guuN3EdVjx92k4/I JhBodUpY/h/RV+zTIGizqn69n9a/NqCUP9KOlBKICU= Received: from sussex.dreamhost.com (sussex.dreamhost.com [208.113.171.60]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: cwb@clayb.net) by pdx1-sub0-mail-a37.g.dreamhost.com (Postfix) with ESMTPSA id B04C680580 for ; Tue, 15 Oct 2019 10:35:07 -0700 (PDT) Date: Tue, 15 Oct 2019 10:35:06 -0700 (PDT) X-DH-BACKEND: pdx1-sub0-mail-a37 From: "Clay B." To: dev@yetus.apache.org Subject: Re: Using DOCKER_EXTRAARGS/DOCKER_EXTRAENVS? In-Reply-To: Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Thanks Allen! It turns out that docker build options look unmodifiable? If so, I followed the DOCKER_EXTRAENVS pattern in YETUS-919 to add a function add_docker_build_arg. Is this a reasonable approach and should I look to do any BATS testing or the like? -Clay On Wed, 9 Oct 2019, Allen Wittenauer wrote: > > >> On Oct 9, 2019, at 5:53 PM, Clay B. wrote: >> I am trying to add entries to DOCKER_EXTRAARGS from a yetus-personality script[2] (or anywhere I can) but I can not seem to affect the DOCKER_EXTRAARGS[3] actually used by the Docker test-patch code. For reference, I have moved Ratis to use Yetus 0.11.0 in my tests[4]. > > There have been a lot of recent-ish changes to abstract out some of the internal plumbing of Yetus' docker support since for a time there it was undergoing major renovation and there were a ton of edge-case bugs. As a result, there are two key functions that you need to know about to make this work: > > (name)_docker_support is something that plugins and personalities should absolutely define if they need any sort of special docker handling. Anything defined outside of that may not make it through the rabbit hole. For your particular use case, set the project name to ratis then you'll be able to define ratis_docker_support. Inside that you should be able to modify the docker bits safely and they should make it through. > > If you just need to pass an env var, use add_docker_env (variable name). That will take care of the docker -e, etc, stuff. If you want to pass a file or need to do something more complex, alas, you'll still need to do the DOCKER_EXTRAARGS work manually. You can see an example in maven.sh: > > ==== > > function maven_docker_support > { > DOCKER_EXTRAARGS+=("-v" "${HOME}/.m2:/home/${USER_NAME}/.m2") > > if [[ ${MAVEN_CUSTOM_REPOS} = true ]]; then > DOCKER_EXTRAARGS+=("-v" "${MAVEN_CUSTOM_REPOS_DIR}:${MAVEN_CUSTOM_REPOS_DIR}") > fi > > add_docker_env MAVEN_OPTS > } > > === > > Note that this is an array using += notation in order to avoid wiping it out and that each parameter is a separate entry in the array. (IFS safe!) > >> Is there a flow diagram for how Yetus loads its various shell files or a function call diagram to understand why changing something in personality_globals (or simply the personality script outside any function) would not globally affect scope for Docker pre-commit? (Or to know where I should set DOCKER_EXTRAARGS?) > > http://yetus.apache.org/documentation/0.11.0/precommit-advanced/ covers docker_support but it's not really spelled out that setting these things from outside that function generally won't work. :( Sorry. :( Definitely a doc bug. I've been rewriting the docs off and on for the past few months, so if you file a jira, I'll be sure to remember to clarify that. > >