Skip to content

fix(installer): treat the venv as ready only after pip has finished - #80

Open
burgulvedant wants to merge 1 commit into
intel:mainfrom
burgulvedant:burgulvedant/fix-venv-partial-install
Open

burgulvedant wants to merge 1 commit into
intel:mainfrom
burgulvedant:burgulvedant/fix-venv-partial-install

Conversation

@burgulvedant

Copy link
Copy Markdown

Why?

The installer reported .venv as done whenever ansible-playbook existed. If pip was interrupted partway, for example on an unstable network, the partly built venv was reused and the cluster install failed on a later step.

What?

After pip installs requirements.txt, the installer writes a marker file in .venv. _ensure_venv treats the venv as ready only when both ansible-playbook and the marker exist, and rebuilds it otherwise. A venv created before this change has no marker, so it runs pip once more, which does nothing when everything is already installed.

I did not use a temporary folder and a rename, as the issue suggests, because a venv's scripts contain the venv's absolute path and stop working once the folder is moved.

Test Plan

Checked the script syntax with bash -n. To reproduce, run ./es_auto_installer.sh configure, interrupt it during the pip step, and run it again. It should install the Python dependencies again instead of reporting an existing venv.

Issue

Closes #36

The installer reported .venv as done whenever ansible-playbook existed.
If pip was interrupted partway, for example on an unstable network, the
partly built venv was reused and the cluster install failed on a later step.

Write a marker file once pip has installed requirements.txt, and rebuild
the venv when the marker is missing. A venv created before this change has
no marker, so it runs pip once more, which does nothing when everything is
already installed.

Closes intel#36

Signed-off-by: Vedant Burgul <[email protected]>
@burgulvedant

Copy link
Copy Markdown
Author

@amberjain1 @Mushtaq-BGA @AhmedSeemalK could one of you approve the workflows for this PR so CI can run, and take a look when you have time? It makes the installer treat the venv as ready only after pip has finished, so an interrupted install no longer leaves a broken .venv. Happy to change anything.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

installer configure doesn't check for partial installation of components

1 participant