Skip to content

Commit

Permalink
Merge pull request #31 from superfly/vagrant-disk
Browse files Browse the repository at this point in the history
Make /data disk work on any vagrant provider
  • Loading branch information
benwaffle authored Mar 14, 2024
2 parents 5a1b6ee + f357042 commit 36761c3
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 16 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
id_rsa
id_rsa
.vagrant/
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ Then, flyctl will use this remote builder for all applications deployed by the o
You probably/definitely want to use a separate vm, like vagrant. This service runs and manages its own docker service, which will maybe interfere with up the docker service on your system.

```shell
vagrant up # gets you a vm with all the tools you need
vagrant ssh # gets you onto that vm
vagrant up # gets you a vm with all the tools you need
vagrant ssh # gets you onto that vm

cd rchab # this is a folder on the vm, which is synced with the local repo and it support live updated 🎉
cd rchab # this is a folder on the vm, which is synced with the local repo and it support live updated 🎉

make run-local # run the service!
make run-local-no-auth # run the service!
```

If that all worked, the service is running 🚀
Expand Down
22 changes: 11 additions & 11 deletions Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,20 @@
Vagrant.configure("2") do |config|
# Provision /data. In production, the size is hard-coded in web.
# https://github.com/superfly/web/blob/663d025e29d52567ffb6cbe1b2d8640ac7099e46/app/graphql/mutations/ensure_machine_remote_builder.rb#L87
config.vm.provider :libvirt do |libvirt|
libvirt.storage :file, :size => '50GB'
config.vm.provision 'mount_data', type:"shell", inline: <<-SHELL
set -euo pipefail
config.vm.disk :disk, name: "data", size: '50GB'
config.vm.provision 'mount_data', type:"shell", inline: <<-SHELL
set -euo pipefail
parted /dev/vdb --script mklabel gpt
parted /dev/vdb --script mkpart primary ext4 0% 100%
lsblk
mkfs.ext4 /dev/vdb1
parted /dev/sdb --script mklabel gpt
parted /dev/sdb --script mkpart primary ext4 0% 100%
mkdir /data
mount /dev/vdb1 /data
SHELL
end
mkfs.ext4 /dev/sdb1
mkdir /data
mount /dev/sdb1 /data
SHELL

# Host-only network configuration
config.vm.network "private_network", ip: "192.168.50.10"
Expand Down

0 comments on commit 36761c3

Please sign in to comment.