Skip to content

Commit

Permalink
misc: Increase ulimit to 65535 for test env (#756)
Browse files Browse the repository at this point in the history
  • Loading branch information
baurine authored and breezewish committed Nov 26, 2020
1 parent 94d8dc3 commit 434f919
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 16 deletions.
24 changes: 24 additions & 0 deletions etc/manualTestEnv/_shared/Vagrantfile.partial.pubKey.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
Vagrant.configure("2") do |config|
ssh_pub_key = File.readlines("#{File.dirname(__FILE__)}/vagrant_key.pub").first.strip

config.vm.box = "hashicorp/bionic64"
config.vm.provision "shell", privileged: false, inline: <<-SHELL
sudo apt install -y zsh
sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
sudo chsh -s /usr/bin/zsh vagrant
echo #{ssh_pub_key} >> /home/vagrant/.ssh/authorized_keys
SHELL

config.vm.provision "shell", privileged: true, inline: <<-SHELL
echo "setting ulimit"
sudo echo "fs.file-max = 65535" >> /etc/sysctl.conf
sudo sysctl -p
sudo echo "* hard nofile 65535" >> /etc/security/limits.conf
sudo echo "* soft nofile 65535" >> /etc/security/limits.conf
sudo echo "root hard nofile 65535" >> /etc/security/limits.conf
sudo echo "root hard nofile 65535" >> /etc/security/limits.conf
SHELL
end

# ulimit ref: https://my.oschina.net/u/914655/blog/3067520
12 changes: 0 additions & 12 deletions etc/manualTestEnv/_shared/Vagrantfile.partial.pubKey.ruby

This file was deleted.

2 changes: 1 addition & 1 deletion etc/manualTestEnv/multiHost/Vagrantfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
load "#{File.dirname(__FILE__)}/../_shared/Vagrantfile.partial.pubKey.ruby"
load "#{File.dirname(__FILE__)}/../_shared/Vagrantfile.partial.pubKey.rb"

Vagrant.configure("2") do |config|
config.vm.provider "virtualbox" do |v|
Expand Down
2 changes: 1 addition & 1 deletion etc/manualTestEnv/multiReplica/Vagrantfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
load "#{File.dirname(__FILE__)}/../_shared/Vagrantfile.partial.pubKey.ruby"
load "#{File.dirname(__FILE__)}/../_shared/Vagrantfile.partial.pubKey.rb"

Vagrant.configure("2") do |config|
config.vm.provider "virtualbox" do |v|
Expand Down
2 changes: 1 addition & 1 deletion etc/manualTestEnv/singleHost/Vagrantfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
load "#{File.dirname(__FILE__)}/../_shared/Vagrantfile.partial.pubKey.ruby"
load "#{File.dirname(__FILE__)}/../_shared/Vagrantfile.partial.pubKey.rb"

Vagrant.configure("2") do |config|
config.vm.provider "virtualbox" do |v|
Expand Down
2 changes: 1 addition & 1 deletion etc/manualTestEnv/singleHostMultiDisk/Vagrantfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
load "#{File.dirname(__FILE__)}/../_shared/Vagrantfile.partial.pubKey.ruby"
load "#{File.dirname(__FILE__)}/../_shared/Vagrantfile.partial.pubKey.rb"

Vagrant.configure("2") do |config|
config.vm.provider "virtualbox" do |v|
Expand Down

0 comments on commit 434f919

Please sign in to comment.