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

docker mount ownership fixes #2162

Merged
merged 8 commits into from
May 27, 2024

Conversation

Kakadus
Copy link
Collaborator

@Kakadus Kakadus commented Apr 15, 2024

This should finally close #2095 using bindfs to map the ownership to 1042. This basically fixes all open points from #2105.

Copy link
Member

@niklasmohrin niklasmohrin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If this works for everyone needing it, I am fine with merging

What does migrating to this new provision script look like? Does vagrant provision on an existing VM just work, or is vagrant destroy needed? (Just asking preemptively because this might come up after merging)

deployment/provision_vagrant_vm.sh Show resolved Hide resolved
deployment/provision_vagrant_vm.sh Outdated Show resolved Hide resolved
deployment/provision_vagrant_vm.sh Outdated Show resolved Hide resolved
Copy link
Member

@niklasmohrin niklasmohrin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did a fresh vagrant up and provision with Docker. I took the bindfs route, because OWNER was 1000 (my uid on the host). Some errors occurred, I listed them in the review comments.

After fixing them, I did another fresh run and it seems to work as expected. I get this warning on every vagrant ssh though:

fuse: mountpoint is not empty
fuse: if you are sure this is safe, use the 'nonempty' mount option

I suppose this is because we re-mount in bashrc right? If so, I am fine with leaving it


(not this PR) One thing that was annoying was that npm ci took a couple of minutes because the puppeteer chrome download failed. For future reference:

npm ERR! code 1
npm ERR! path /opt/evap/node_modules/puppeteer
npm ERR! command failed
npm ERR! command sh -c node install.js
npm ERR! ERROR: Failed to set up Chrome r115.0.5790.102! Set "PUPPETEER_SKIP_DOWNLOAD" env variable to skip download.
npm ERR! Error: read ECONNRESET
npm ERR!     at TLSWrap.onStreamRead (node:internal/stream_base_commons:218:20) {
npm ERR!   errno: -104,
npm ERR!   code: 'ECONNRESET',
npm ERR!   syscall: 'read'
npm ERR! }

This also left me without tsc and scss, so the first ./manage.py run prompted me to install those. Aborting and running npm ci again gives the same error. With PUPPETEER_SKIP_DOWNLOAD=1 npm ci, I could work again

deployment/provision_vagrant_vm.sh Show resolved Hide resolved
deployment/provision_vagrant_vm.sh Outdated Show resolved Hide resolved
@Kakadus
Copy link
Collaborator Author

Kakadus commented May 6, 2024

I suppose this is because we re-mount in bashrc right? If so, I am fine with leaving it

Yes. -o nonempty silence this error, but it not what we want (bindfs mounts it several times). We need this so that it is mounted after a vagrant halt

@Kakadus Kakadus requested a review from niklasmohrin May 6, 2024 18:57
@fekoch
Copy link
Collaborator

fekoch commented May 7, 2024

@Kakadus are there any additional requirements for this setup to work (besides what is specified in the readme)? I could not get it to work by simply using vagrant up --provider docker && vagrant provision.

If this is just an issue with my setup, I am also okay with that. It does not break my own dev setup using libvirt/sshfs. But if there are some additional requirements, we should document those.

@Kakadus
Copy link
Collaborator Author

Kakadus commented May 13, 2024

@Kakadus are there any additional requirements for this setup to work (besides what is specified in the readme)? I could not get it to work by simply using vagrant up --provider docker && vagrant provision.

If this is just an issue with my setup, I am also okay with that. It does not break my own dev setup using libvirt/sshfs. But if there are some additional requirements, we should document those.

It turned out to be a SELinux problem, unrelated to bindfs and docker (rootless)

Copy link
Member

@niklasmohrin niklasmohrin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If it works for everyone involved, we are good :)

Copy link
Member

@richardebeling richardebeling left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works for me on Ubuntu 22.04 both with docker and virtualbox. I don't like the error message about the mounting point not being empty (wrong errors are useless, spammy, send you off in the wrong direction when debugging -- imagine someone new where the setup doesn't work trying to find the actual error when they are presented with a wrong error on every SSH), but I won't block for it.

Copy link
Member

@richardebeling richardebeling left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

works for me

@Kakadus Kakadus merged commit bc85379 into e-valuation:main May 27, 2024
12 checks passed
@Kakadus Kakadus deleted the provision-docker-rootless-2 branch May 27, 2024 16:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

Discussion Dev Setup Docker
4 participants