From 29a8caae65d65f51daac85affff4bf4b1e60dea8 Mon Sep 17 00:00:00 2001 From: Nir Soffer Date: Thu, 2 May 2024 00:43:55 +0300 Subject: [PATCH] Use per build venv Create venv inside the ramen checkout directory to have fresh venv for every build. Since drenv is not installed on the runner, we need to enter the venv in any step script. I hope we can find a way to enter the venv once for the entire job, but this is good enough for now. Signed-off-by: Nir Soffer --- .github/workflows/e2e.yaml | 33 ++++++++++++++++++++++----------- 1 file changed, 22 insertions(+), 11 deletions(-) diff --git a/.github/workflows/e2e.yaml b/.github/workflows/e2e.yaml index 8fab8616a..8e26bed02 100644 --- a/.github/workflows/e2e.yaml +++ b/.github/workflows/e2e.yaml @@ -23,20 +23,22 @@ jobs: - name: Checkout Repo uses: actions/checkout@v4 - - name: Install drenv - run: pip install -e test + - name: Create virtual environment + run: | + hack/make-venv .venv - name: Setup drenv working-directory: test - run: drenv setup -v envs/regional-dr.yaml - - - name: Install ramenctl - run: pip install -e ramenctl + run: | + source ../venv + drenv setup -v envs/regional-dr.yaml - name: Delete clusters if: always() working-directory: test - run: drenv delete envs/regional-dr.yaml + run: | + source ../venv + drenv delete envs/regional-dr.yaml - name: Setup libvirt run: test/scripts/setup-libvirt @@ -48,20 +50,25 @@ jobs: max_attempts: 3 command: | cd test + source ../venv drenv start --max-workers ${{ env.MAX_WORKERS }} envs/regional-dr.yaml - name: Build ramen-operator container run: make docker-build - name: Deploy ramen - run: ramenctl deploy test/envs/regional-dr.yaml + run: | + source venv + ramenctl deploy test/envs/regional-dr.yaml - name: Configure ramen uses: nick-fields/retry@v3 with: timeout_seconds: 120 max_attempts: 3 - command: ramenctl config test/envs/regional-dr.yaml + command: | + source venv + ramenctl config test/envs/regional-dr.yaml - name: Run e2e tests run: | @@ -94,9 +101,13 @@ jobs: - name: Delete clusters if: always() working-directory: test - run: drenv delete envs/regional-dr.yaml + run: | + source ../venv + drenv delete envs/regional-dr.yaml - name: Cleanup drenv if: always() working-directory: test - run: drenv cleanup -v envs/regional-dr.yaml + run: | + source ../venv + drenv cleanup -v envs/regional-dr.yaml