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

Make provisioning scripts run in unprivileged mode + more #17

Merged
merged 7 commits into from
Apr 28, 2021

Conversation

MakisH
Copy link
Member

@MakisH MakisH commented Apr 28, 2021

The main goal of this PR is to solve #16 and simplify unreasonably complicated commands such as

- sudo -u ${USER} mkdir -p /home/${USER}/Desktop
- chown ${USER}:${USER} /home/${USER}/Desktop
---
+ mkdir -p ~/Desktop

or

- sudo -u ${USER} git clone --depth=1 --branch master https://github.com/precice/calculix-adapter.git
---
+ git clone --depth=1 --branch master https://github.com/precice/calculix-adapter.git

Apparently, Vagrant runs as root by default, which complicated everything, but it also provides a privileged: false mode:

- config.vm.provision "shell", path: "provisioning/install-basics.sh"
---
+ config.vm.provision "shell", path: "provisioning/install-basics.sh", privileged: false

The scripts now make much much more sense and are pretty much ready to use with any other environment (Docker, GitHub Actions, or even as installation examples).

I changed the hashbang to #!/usr/bin/env bash, as the Vagrant documentation was using that, I am using a bash feature (grouping echo commands), and it is still quite portable.

At the end of the Vagrantfile, the provisioner deletes all compiled object files in home, to save space (script cleanup.sh). We were already doing this for SU2 before. This step is commented-out by default, to facilitate development. It is mainly relevant for the packaged box.

All scripts are formatted and checked with shellcheck.

Summary:

After merging, update the website:

  • deal.II adapter: remove additional steps
  • move install-vscode.sh
  • add a note about vagrant ssh and vagrant ssh -- -Y (not related, but we don't advertise this)

@MakisH MakisH merged commit 0b444ad into develop Apr 28, 2021
@MakisH MakisH deleted the non-privileged branch April 28, 2021 07:32
@MakisH MakisH mentioned this pull request Apr 28, 2021
MakisH added a commit that referenced this pull request Apr 30, 2021
* Make provisioning scripts run in unprivileged mode + more (#17)
* Move install-vscode to home
* Enable object files clean-up by default
* Move cleanup steps to cleanup.sh
* Add GitHub action to lint shell scripts (#18)
* Add GitHub action for vagrant up + a few fixes (#19)
* Add code_aster (#20)
* Disable screensaver and screen lock (#21)
* Update README, add instructions for testing
* Add alias for config-visualizer
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.

None yet

1 participant