-
Notifications
You must be signed in to change notification settings - Fork 35
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
bootstrapping VMs and Linux containers #187
base: main
Are you sure you want to change the base?
Conversation
Note that Docker is not the only Linux container based environment where tulip-in-a-box.py can be used. E.g., I have used it on an Ubuntu 14.04 image managed by LXD. Depending on how you configure the LXD daemon, the diff --git a/extern/get-lily.sh b/extern/get-lily.sh
index 6bfcecc..df8fccb 100755
--- a/extern/get-lily.sh
+++ b/extern/get-lily.sh
@@ -1,4 +1,4 @@
curl -ksO https://www.iaik.tugraz.at/content/research/opensource/lily/lily-2008-06-19.tar.gz -o lily-200
echo '2442e15223e116a4ebf6fbab42646ee64111f286458b4393f18ac7b1a9e19c952bba91f548e0e9c323d50f29e639a5089b
shasum -a 512 -c -
-tar xzf lily-2008-06-19.tar.gz
+tar --no-same-owner -xzf lily-2008-06-19.tar.gz |
Running the image with docker run -i -t tulip:latest
source PYt/bin/activate
python -c 'import tulip; print(tulip.__version__)' where |
I created an image from the
I recommend not force pushing to this PR, but rather follow CPython development practice and reserve rebasing for the merging stage. If we decide to rebase (given that new code is introduced), we may want to squash, in order to preserve commit message information. |
@johnyf thanks for your review! I am going to rebase this branch and read the proposed changes carefully again to make sure it has not suffered bit-rot after 2 years. |
The non-generic parts of the Vagrantfile are for building and installation within a new Ubuntu 14.04 virual machine (VM). Achieving these is prerequisite to testing, i.e., the same purposes are served by part of the Travis CI configuration for TuLiP. As such, the Travis CI configuration (or rather, code for CI testing of TuLiP) should be re-used by other scripts that bootstrap VMs for general purposes. The remainder of the Vagrantfile after removing the custom install script is not worth keeping because it is approximately the same as the generic Vagrantfile obtained from `vagrant init`. [ci skip]
tulip-in-a-box.py is a small Python script that uses the Travis CI configuration in .travis.yml to install and fully test TuLiP on a Debian-like distribution. tulip-in-a-box.py requires PyYAML and a local copy of the TuLiP sourcetree which is to be installed and tested. To further automate this process, vm-bootstrap.sh is a shell script that will install Git, perform the clone, etc., and finally run tulip-in-a-box.py. Both vm-bootstrap.sh and tulip-in-a-box.py have been demonstrated on a Debian 9 (stretch) GNU/Linux instance in Google Cloud Platform (https://cloud.google.com/).
to this end, the script tulip-in-a-box.py is expanded to offer the switch `--no-sudo`, which avoids use of `sudo` in obvious cases. E.g., a non-obvious case would be `sudo` appearing somewhere deep in .travis.yml.
The last `WORKDIR` command is `WORKDIR /root/tulip-control`, so it leaves the working directory to under `tulip-control`.
to emphasize the presence of a constant.
I intend to study my notes above, because I think it may be possible to simplify them. For example, placing an image in an external service could introduce a dependency to a website interface (if configured to be automatically uploaded). Also:
|
closes #33
The changes here are under the contrib/ directory, so committing directly to
master
branch may have been welcome. Nonetheless I opened this pull request to create a place for discussion and, possibly, edits before merging changes.I decided not to create scripts that launch instances on AWS or GCP because doing so would require API keys for the respective service. Getting API keys is not much more difficult than launching a virtual machine instance and uploading vm-bootstrap.sh to it. Because vm-bootstrap.sh is intended to run without interaction and is agnostic about the cloud provider, I argue that it is a good solution to simply tell users to create a VM however they prefer and to run vm-bootstrap.sh from it.
Both vm-bootstrap.sh and tulip-in-a-box.py have been demonstrated on
t2.small
running Ubuntu 16.04 LTS (xenial) (in particular AMI IDami-cd0f5cb6
).Notes about trying vm-bootstrap.sh yourself
The final step of vm-bootstrap.sh is to run tulip-in-a-box.py from
master
branch. Therefore, it will not succeed until this PR is merged. Meanwhile, you can manually copy tulip-in-a-box.py into the VM that you are using and proceed from there.Notes about trying the Dockerfile yourself
If you have a local installation of Docker, it should suffice to checkout the
vm
branch andBeware that the Docker image
debian:stable
will be fetched if you do not already have it; the download size might be too large for very low bandwidth connections.As described in the documentation in Dockerfile, you can use the resulting image through an interactive shell, e.g.,
Related work
Vagrantfile
This pull request obsoletes contrib/Vagrantfile because vm-bootstrap.sh and tulip-in-a-box.py achieve the same ends as a shell script that was embedded within contrib/Vagrantfile. If someone wants to use Vagrant to install TuLiP from source code, then she can create a basic Vagrantfile using
vagrant init
and then modify it to read and run vm-bootstrap.sh.nessainstall
The script and instructions in contrib/nessainstall/ address the use-case of building dependencies and installing when
sudo
capabilities are not available. It is complementary to the work from this pull request.