Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

requirements.lock is not removed when deploying per rsync #107

Closed
ctheune opened this issue Oct 22, 2020 · 8 comments
Closed

requirements.lock is not removed when deploying per rsync #107

ctheune opened this issue Oct 22, 2020 · 8 comments
Assignees
Labels
bug Something isn't working
Milestone

Comments

@ctheune
Copy link
Member

ctheune commented Oct 22, 2020

No description provided.

@ctheune ctheune added the bug Something isn't working label Dec 10, 2020
@ctheune ctheune added this to the batou 2.3 milestone Dec 10, 2020
@ctheune
Copy link
Member Author

ctheune commented May 21, 2021

Alright. So the problem here was that we were iterating over the local top-level entries so we can blacklist some of them. However, this caused us to not delete-sync top-level elements that did not exist any longer because we never added them as sync targets.

I've rewritten the affected code to do a single rsync step and use a subclass leveraging the built-in filter to provide the blacklist.

@ctheune ctheune self-assigned this May 21, 2021
@ctheune
Copy link
Member Author

ctheune commented May 28, 2021

I have to undo this fix for because it has a major impact on how it combines with ignoring some files: pytest-dev/execnet#134

This can lead to major issues because this will consistently remove the work directory in rsync-based deployments.

@ctheune
Copy link
Member Author

ctheune commented Oct 5, 2021

I wonder whether we could do something related to #235 that would fix this, too?

@sallner
Copy link
Contributor

sallner commented Oct 8, 2021

I am still confused with the title and the actual aim of this ticket. Why should the requirements.lock be removed in any case when deploying? I thought this would pin the version to be consistent? I do understand that there might be a reason to have untracked files to be removed on the remote part (deployment) but is this the issue which should be solved here?

@ctheune
Copy link
Member Author

ctheune commented Oct 8, 2021

The problem is in this situation:

  1. you deploy using rsync while requirements.txt and requirements.lock both exist
  2. you update your requirements.txt
  3. you decide to delete the requirements.lock
  4. you deploy and the remote and still has the requirements.lock with old settings

I wonder whether we should decide that the requirements.lock must always exist and never do unclean environments at all? Not sure which drawbacks that would have.

@sallner
Copy link
Contributor

sallner commented Oct 8, 2021

I wonder whether we should decide that the requirements.txt must always exist and never do unclean environments at all? Not sure which drawbacks that would have.

I think you mean requirements.lock here, didn't you? In my opinion, the lock-file is a hard requirement for a reproducible deployment. We sometimes have version ranges in requirements.txt like batou>=2.2 which would lead to different deployments without a lock file over time. This is even more the case for dependencies, which are probably not even shown during installation.

I would vote for an error in case the lock-file is not present. At least in my workflow, it is not often, that I have to change the batou requirements very often. Is there a use-case where this is different?

@ctheune
Copy link
Member Author

ctheune commented Oct 8, 2021

Yeah, I meant requirements.lock. Fixed it in my comment.

@sallner
Copy link
Contributor

sallner commented Oct 22, 2021

It is implemented in flyingcircusio/appenv#31 but has to be copied to this project after successful merge.

ctheune added a commit that referenced this issue Oct 29, 2021
Update appenv to include changes that fixed #107
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants