Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3DE3E145B25 for ; Fri, 4 Apr 2025 19:19:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1743794390; cv=none; b=kSsFqtZmng4aMJelfa+uTnY7lMZcKaL7sFzh6K7rfHnJuZyE364S5vDWrWVfcmro6mcO90MfW83qP/xuJ67hA0+jxCUfnWDWiqnORpv/8jlpnMQ+cfpjPEpf8zayxfZ6z2o1RGxeBSwOGrQes/984+wvku8KK9k6t7zwMR4547g= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1743794390; c=relaxed/simple; bh=HJwvd4dRq5Z+pzG4c4EC1jsA/pSmiAJrFlT1AlkSfDY=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=RzPTBXnJD0qO239oBHk30Ee9GEG2mMLdZkDHG7EydNiSDrRXozXpGzAiBe90RNxHI2csT8ddZONwv5jroWVEoGiJqkH2mTPmIAs3ib2ishi/2JbQHZv0nZ1FgZCnwBrw+obG/LzvC125mcE7WonRm2fmyWj1a7fLw+OlD9KIfag= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=LVacPISt; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="LVacPISt" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7FDFAC4CEDD; Fri, 4 Apr 2025 19:19:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1743794389; bh=HJwvd4dRq5Z+pzG4c4EC1jsA/pSmiAJrFlT1AlkSfDY=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=LVacPIStnVlmXxdDWrySaoNOOVAR8Jz/nCcm5eLjoltA996II4Tw+z55VD5sar0wp IcvAsyYf/0JQh3wIHYdbyl1/t0lC4dsZE7Pz12OylNT2LvB2B4Rcz64ooZQcDV40cN 35IID2zrXPQA7tDKwMFuJzEz220TJ7+Acepqh6QIiB3ykZz4fmtT7UCiuG5WSytGn1 prD4/03L35T2FJCbuVqqjX56IT/pVcUfKY3sclv9xZ2oGYIAdjeYk0mUCJCFAyHkD5 M/r6XoJLQbpVUWuwWO+KmE10GsntLwc/Xr4ZbMc+0ulVODlm6Osf7/0fhRGufjBhJI 82xH3D5MFisgg== Date: Fri, 4 Apr 2025 12:19:48 -0700 From: Luis Chamberlain To: Chuck Lever Cc: kdevops@lists.linux.dev, cel@kernel.org Subject: Re: [RFC PATCH] terraform/OCI: Grab secrets from ~/.oci/config Message-ID: References: <20250403144906.1186015-1-cel@kernel.org> <7e0c498d-6838-446d-b799-276cb2dbda87@oracle.com> <2040a867-11ae-4661-b140-5a87602e1f4c@oracle.com> <5d937c89-69ca-42a5-b64a-5a76c6696658@oracle.com> <40de8f31-115d-4b4e-aa4f-1df5d3dac139@oracle.com> Precedence: bulk X-Mailing-List: kdevops@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <40de8f31-115d-4b4e-aa4f-1df5d3dac139@oracle.com> On Fri, Apr 04, 2025 at 02:35:19PM -0400, Chuck Lever wrote: > On 4/4/25 2:28 PM, Luis Chamberlain wrote: > > On Fri, Apr 04, 2025 at 02:24:37PM -0400, Chuck Lever wrote: > >> On 4/4/25 2:06 PM, Luis Chamberlain wrote: > >>> On Fri, Apr 04, 2025 at 12:10:49PM -0400, Chuck Lever wrote: > >>>> On a related topic, if we ever want to fully support running the kdevops > >>>> /control host/ in the cloud, terraform supports an authentication > >>>> mechanism that just uses the local instance's service principal, so > >>>> no extra authentication material is needed for provisioning the test > >>>> runners as separate cloud instances. Interesting to consider. > >>> > >>> Sorry I failed to understand this, what is mean by separate cloud > >>> instances? > >> > >> The usual situation is the control host (where terraform runs) is > >> outside the cloud. Like, on your workstation. I'm talking about a > >> scenario where kdevops and terraform are running on an instance in the > >> same cloud as where your target nodes are going to run. > >> > >> In that case, terraform can scoop up the service principal for that > >> instance, and use it in place of dot file authentication parameters. > >> So you don't have to maintain the dot file on the instance that is > >> running terraform, if it is already in the cloud. > > > > I see, so you first bring that cloud instance, and then use that as > > your command and control for test nodes. Does that first cloud instance > > need to be instantiated through another kdevops setup? > > No, you can create it with terraform or from the cloud console. Start it > up when you want, or leave it running. > > I'm wondering if we can get a cloud devops pipeline to trigger it when > it sees a PR against a watched repo. Haven't really thought that > through. OK well so when we add a new commit to kdevops we should ideally try to run a test if the commit is related to terraform or all commits to just verify we don't break cloud instance support. Given we already rely on dedicated github hosted servers, if such hosted servers have the credential files in place then the below would work to automatically trigger a cloud instance test. For example below could be a .github/workflows/aws.yml which would run on every single commit we submit to kdevops. This would just do a bringup and destroy. If the console creates a cloud instance, and github can get access to it as a dedicated self hosted runner, and it will persist then that guest can simply just be a bare bones guest to run ansible as the command and control center. And the example below could be used to push github actions onto the runner. Could this step be removed and have github directly do the bringup? I suspect we can rely on github docker containers which just run kdevops configs for the cloud for it, but they won't be hosted on the respective cloud of choice. Other than that, it would be nice if github integrated support for instantiating a simple guest just to be command control. Otherwise a dedicated self hosted runner outside of the cloud could just have the credentials file. The kdeops-ci repo [0] has sufficient workflow branch examples, some of which we are already using for different subsystems to trigger runs with kevops on dedicated servers. If a subsystem wanted to leverage the cloud their defconfig would just have the setup for the respective cloud of choice. For example defconfigs/linux-xfs-kpd is what se use for testing pushes to branches to the linux-kdevops/linux-xfs-kpd and only Carlos has access to push to that repo. Which dedicated self hosted runner is opaque to kdevops, but it can easily have cloud credentials to easily do bringup. I hadn't enabled the below on kdevops just because of lack of time of testing, and trying to then optimize the cost so that a super bare bones cloud istanace would be used for every kdevops commit pushed. However, that's a bit extreme of course, and we can tone it down to only commits perhaps that touch kdevops. But if that works, then by all means so would a push to a git tree as we do with linux-kdevops/linux-xfs-kpd using the examples in the branches for /linux-kdevops/kdevops-ci. [0] https://github.com/linux-kdevops/kdevops-ci name: Run kdevops on self-hosted runner for aws cloud instances on: workflow_dispatch: # Add this for manual triggering of the workflow jobs: run-kdevops: name: Run kdevops CI runs-on: [self-hosted, Linux, X64] steps: - name: Checkout repository uses: actions/checkout@v4 - name: Set CI metadata for kdevops-results-archive run: | echo "$(basename ${{ github.repository }})" > ci.trigger LOG=$(git log -1 --pretty=format:"%s") > ci.subject echo "cloud aws:" $LOG" > ci.subject # Start out pessimistic echo "not ok" > ci.result echo "Nothing to write home about." > ci.commit_extra - name: Set kdevops path run: echo "KDEVOPS_PATH=$GITHUB_WORKSPACE" >> $GITHUB_ENV - name: Configure git run: | git config --global --add safe.directory '*' git config --global user.name "kdevops" git config --global user.email "kdevops@lists.linux.dev" - name: Run kdevops make defconfig-repo run: | KDEVOPS_TREE_REF="${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }}" SHORT_PREFIX="$(echo ${KDEVOPS_TREE_REF:0:12})" make KDEVOPS_HOSTS_PREFIX="$SHORT_PREFIX" defconfig-aws - name: Run kdevops make run: | make -j$(nproc) - name: Run kdevops make bringup run: | make bringup - name: Just check the kernel run: | make uname echo "ok" > ci.result - name: Start SSH Agent if: always() # Ensure this step runs even if previous steps failed uses: webfactory/ssh-agent@v0.9.0 with: ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }} - name: Build our kdevops archive results if: always() # This ensures the step runs even if previous steps failed run: | make ci-archive - name: Upload our kdevops results archive if: always() # This ensures the step runs even if previous steps failed uses: actions/upload-artifact@v4 with: name: kdevops-ci-results path: ${{ env.KDEVOPS_PATH }}/archive/*.zip # Ensure make destroy always runs, even on failure - name: Run kdevops make destroy if: always() # This ensures the step runs even if previous steps failed run: | make destroy