Commit Graph

14 Commits

Author SHA1 Message Date
Jonathan Lebon
2f68c02e1a Vagrantfile: specify full path to using_sshfs
When running `vagrant ssh-config` from ansible, Vagrant for some reason
still wants to execute the File.write() operation, but fails to do so
because the $PWD is $topsrcdir/vagrant, in which .vagrant does not
exist.

Switch to using the absolute path.

Closes: #555
Approved by: cgwalters
2016-12-21 20:00:43 +00:00
Jonathan Lebon
12c4b5b16f vmcheck: adapt for non-vagrant hosts
This is just the final bit required to make sure the vagrant and
non-vagrant paths can work happily together. It's mostly minor fixes,
though the most major change which also affects vagrant is that we now
sync to the root home dir, rather than ~vagrant.

Closes: #524
Approved by: cgwalters
2016-11-22 17:15:20 +00:00
Colin Walters
2f9d586bdc Redo vmcheck to abstract over ssh-config, drop all building
My development environment is now using "pet" docker containers.
I use VMs for testing things that require that (like rpm-ostree).

This patch builds on work from @jlebon in
https://github.com/projectatomic/rpm-ostree/pull/509
to rework `vmcheck` such that it can work on any `ssh-config`.  By
default we expect this to be Vagrant.

However, I go a lot farther and delete the `vmbuild` code that was
trying to do builds in a container on the target VM.  I think this is
still worth pursuing at some point, but for now I think it's
reasonable to assume that the rpm-ostree developer audience uses Linux
as their host workstation and hence has containers.

(There's another important point here in that for developing lower
 level things like rpm-ostree, there's a strong push to make the VM
 disposable and not a pet)

Closes: #516
Approved by: jlebon
2016-11-16 18:14:23 +00:00
Jonathan Lebon
313a832d7c vagrant: generate ssh-config
We further split libvm from vagrant. It no longer does 'vagrant
ssh-config'. Instead, it always assumes that an ssh-config is provided.
We now have complete separation of libvm from vagrant.

We change the ansible provisioner as follows:
  - Allow passing in a VAGRANT_BOX env var to override the default
    CentOS box.
  - No longer assume that the root user account is unlocked and has a
    valid 'vagrant' password. This worked for the centos box but isn't
    sure to work on every box. Instead, we now just run ansible as the
    default vagrant user, and during provisioning set up the root
    account and generate an ssh-config so that libvm can connect
    directly as root.
  - No longer build the buildimg during provisioning. This actually
    stopped working a while ago since the default rsync is disabled. We
    can just let the buildimg get created on the first compilation. In
    practice, the bigger issue isn't creating the buildimg, but being
    able to easily update the host and buildimg pkgs.

Closes: #516
Approved by: jlebon
2016-11-16 18:14:23 +00:00
Jonathan Lebon
40a44a561c vagrant/Makefile: drop sudo and depend on buildimg
Closes: #394
Approved by: cgwalters
2016-07-15 19:14:19 +00:00
Jonathan Lebon
4c392139b5 vagrant/Makefile: add some convenience targets
dockerwait: if we're running on a freshly booted VM, we want to make
sure that docker is running before trying to spawn the container.

check: runs the same target inside the container; this is useful for
coverage analysis, where we want the same binaries to run both the `make
check` and `make vmcheck` testsuites.

clean: for convenience.

Also make sure we pass CFLAGS to both the configure (to propagate to
libhif's cmake) and the make steps. This is also of use for coverage
analysis, where we want to compile with `--coverage`.

Closes: #378
Approved by: cgwalters
2016-07-07 11:55:09 +00:00
Jonathan Lebon
4877887e49 vagrant: use sync after deploying
For some reason, the VM would sometimes take a very long time to reboot
after deploying the new commit. Adding a sync before rebooting fixes
this, though I'm not sure why the filesystem doesn't sync itself as fast
without it.

Closes: #371
Approved by: cgwalters
2016-07-05 15:26:45 +00:00
Jonathan Lebon
30881c3df0 Dockerfile.builder: update for building libhif
Now that libhif is a submodule, it means that we have to have the
buildreqs for it as well in the build img.

Closes: #371
Approved by: cgwalters
2016-07-05 15:26:45 +00:00
Jonathan Lebon
0974a22834 vagrant: use new 'booted' key to get current csum
Closes: #360
Approved by: cgwalters
2016-06-29 19:17:38 +00:00
Jonathan Lebon
4fc6dd8b97 hacking: add make vmoverlay for faster hacking
For the regular hack/build/test cycles, creating a new deployment each
time becomes overkill. We add a new `make vmoverlay` target which
directly overlays the newly built binaries on an unlocked system.

We also make rsync smarter so that we can afford to not `make clean`
everytime while still allowing the host's repo to be fully configured.

Closes: #360
Approved by: cgwalters
2016-06-29 19:17:38 +00:00
Jonathan Lebon
55e1cfeb99 buildimg: add new prereqs
Closes: #360
Approved by: cgwalters
2016-06-29 19:17:38 +00:00
Jonathan Lebon
c53d8fa9cb setup.yml: cache buildimg container
By far the longest step in provisioning a new VM is the building of the
container. This helps alleviate things a little by caching it on the
host. It's not a complete solution however. We also need to make it easy
to update an existing container.

Closes: #344
Approved by: cgwalters
2016-06-23 00:05:09 +00:00
Jonathan Lebon
4ce0a06ed5 vagrant: set up ssh for root user
From Vagrantfile:

It's just easier to have ssh set up as root from the start so that tests
don't need to sudo, which can sometimes cause issues. If we need to test
any unprivileged things, we can still just sudo back into the vagrant
user.

Closes: #344
Approved by: cgwalters
2016-06-23 00:05:09 +00:00
Jonathan Lebon
9587ab6597 vagrant: move helper files to vagrant/
These files are not only for vmcheck, but may be used as well for
setting up for development.

Closes: #344
Approved by: cgwalters
2016-06-23 00:05:09 +00:00