-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into refactoring/#258-Used_a_non-root_user_to_run…
…_Jupyter_in_the_Docker_Image_ai-lab
- Loading branch information
Showing
5 changed files
with
75 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,3 +3,4 @@ | |
dist | ||
__pycache__/ | ||
/TAGS | ||
.vagrant |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
home_directory = Dir.home | ||
|
||
Vagrant.configure("2") do |config| | ||
config.vm.box = "generic/ubuntu2204" | ||
config.vm.hostname = "ai-lab" | ||
config.vm.network :forwarded_port, guest: 8888, host: 8888 | ||
config.vm.network :forwarded_port, guest: 6666, host: 6666 | ||
config.vm.synced_folder "#{home_directory}", "/home/vagrant/", type: "rsync", rsync__exclude: "*", rsync__args: ["--verbose", "--archive", "--delete", "-z", "--links", "--include",".gitconfig", "--include",".git-credentials"], rsync__verbose: true | ||
config.vm.synced_folder ".", "/home/vagrant/vagrant", type: "rsync", rsync__exclude: ".git/" | ||
config.vm.synced_folder "..", "/home/vagrant/project", type: "rsync", rsync__exclude: [".build_output", ".conda_env", ".luarocks"], rsync__args: ["--verbose", "--archive", "--delete", "-z", "--links"], rsync__verbose: true | ||
|
||
config.vm.provider :libvirt do |v| | ||
v.qemu_use_session = true | ||
v.cpus = 2 | ||
v.memory = 6000 | ||
v.machine_virtual_size = 100 | ||
v.random_hostname = true | ||
v.default_prefix = config.vm.hostname + "_" | ||
end | ||
|
||
config.vm.provider "virtualbox" do |v| | ||
v.memory = 6000 | ||
v.cpus = 2 | ||
end | ||
|
||
config.trigger.before [:provision] do |trigger| | ||
trigger.run = { inline: "vagrant rsync"} | ||
end | ||
|
||
config.vm.provision "shell" do |s| | ||
s.path="provisioning/dns.sh" | ||
end | ||
|
||
config.vm.provision "shell" do |s| | ||
s.path="provisioning/install.sh" | ||
end | ||
|
||
config.vm.provision "shell" do |s| | ||
s.path="provisioning/install_poetry.sh" | ||
s.privileged=false | ||
end | ||
|
||
end | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#!/bin/bash | ||
|
||
set -euo pipefail | ||
|
||
sudo sed -i 's/DNS=.*/DNS=8.8.8.8/g' /etc/systemd/resolved.conf | ||
sudo service systemd-resolved restart | ||
sudo rm -f /etc/resolv.conf | ||
sudo ln -s /run/systemd/resolve/resolv.conf /etc/resolv.conf | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#!/bin/bash | ||
|
||
set -euo pipefail | ||
|
||
SCRIPT_DIR="$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")" | ||
|
||
apt-get update | ||
apt-get install -y --no-install-recommends software-properties-common python3.10 python3.10-venv python3.10-dev build-essential python3-pip | ||
python3.10 -m pip install virtualenv | ||
curl -L https://get.docker.com/ | bash | ||
gpasswd -a vagrant docker |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#!/bin/bash | ||
|
||
set -euo pipefail | ||
|
||
SCRIPT_DIR="$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")" | ||
|
||
curl -sSL https://install.python-poetry.org/ | python3.10 - | ||
echo 'export PATH="$HOME/.local/bin:$PATH"' >> $HOME/.bashrc | ||
echo 'export PATH="$HOME/.local/bin:$PATH"' >> $HOME/.bash_profile | ||
echo 'export PATH="$HOME/.local/bin:$PATH"' >> $HOME/.poetry_path |