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 <nsoffer@redhat.com>
  • Loading branch information
nirs committed Oct 9, 2024
1 parent 59abd41 commit e2cfd0a
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 @@ -24,20 +24,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 --name-prefix ${{ env.NAME_PREFIX }} envs/regional-dr.yaml
run: |
source ../venv
drenv delete --name-prefix ${{ env.NAME_PREFIX }} envs/regional-dr.yaml
- name: Setup libvirt
run: test/scripts/setup-libvirt
Expand All @@ -49,20 +51,25 @@ jobs:
max_attempts: 3
command: |
cd test
source ../venv
drenv start --max-workers ${{ env.MAX_WORKERS }} --name-prefix ${{ env.NAME_PREFIX }} envs/regional-dr.yaml
- name: Build ramen-operator container
run: make docker-build

- name: Deploy ramen
run: ramenctl deploy --name-prefix ${{ env.NAME_PREFIX }} test/envs/regional-dr.yaml
run: |
source venv
ramenctl deploy --name-prefix ${{ env.NAME_PREFIX }} test/envs/regional-dr.yaml
- name: Configure ramen
uses: nick-fields/retry@v3
with:
timeout_seconds: 120
max_attempts: 3
command: ramenctl config --name-prefix ${{ env.NAME_PREFIX }} test/envs/regional-dr.yaml
command: |
source venv
ramenctl config --name-prefix ${{ env.NAME_PREFIX }} test/envs/regional-dr.yaml
- name: Run e2e tests
run: |
Expand Down Expand Up @@ -95,9 +102,13 @@ jobs:
- name: Delete clusters
if: always()
working-directory: test
run: drenv delete --name-prefix ${{ env.NAME_PREFIX }} envs/regional-dr.yaml
run: |
source ../venv
drenv delete --name-prefix ${{ env.NAME_PREFIX }} 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 e2cfd0a

Please sign in to comment.