Skip to content

Commit

Permalink
Use per build venv
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
nirs committed Nov 20, 2024
1 parent f2fb38e commit 8068582
Showing 1 changed file with 22 additions and 11 deletions.
33 changes: 22 additions & 11 deletions .github/workflows/e2e.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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: |
Expand Down Expand Up @@ -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

0 comments on commit 8068582

Please sign in to comment.