Skip to content
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

1531: Parameterized Vagrantfile #1532

Merged

Conversation

creckord
Copy link
Contributor

This pull request parameterizes the Che Vagrantfile in order to be able to configure the VM through environment parameters for vagrant up.

All parameters from the Vagrantfile can be set through environment variables. The network setup has been further parameterized to support DHCP network configuration and separate host and guest port configuration. FInally, an option for more verbose progress output has been added.

The behavior of the resulting Vagrantfile is unchanged if none of the environment variables in question have been set, i.e. a plain vagrant up will behave exactly as without these changes.

creckord added 4 commits June 20, 2016 13:28
- Introduce environment variables for all settings in the Vagrantfile
- Make the synced user folder configurable via CHE_DATA environment 
variable
- Expose the final Che URL in <user folder>/.che_url

Signed-off-by: Carsten Reckord <reckord@yatta.de>
- Introduce separate parameters for the container's port and the
binding port on the host
- Allow disabling host port binding by setting the host port to -1

Signed-off-by: Carsten Reckord <reckord@yatta.de>
- Setting CHE_IP to "dhcp" configures the machine with a dynamic IP
managed by VirtualBox
- The chosen IP is resolved in the provisioning script and handed off
to docker

Signed-off-by: Carsten Reckord <reckord@yatta.de>
- Setting PROVISION_PROGRESS to "extended" outputs full progress from
docker and yum to better track overall provisioning progress
- Extended progress will additionally install the 'expect' package to 
fool yum and docker into detecting a TTY for extended progress output;
a small overhead (~2MB) for much better progress during the bulk of the
provisioning process
- Default 'vagrant up' progress stays unchanged (using '#' every 10 seconds)

Signed-off-by: Carsten Reckord <reckord@yatta.de>
@codenvy-ci
Copy link

Can one of the admins verify this patch?

@TylerJewell
Copy link

Nice improvements, especially the use of dhcp. Two things:

  1. What are these files for:
echo "${CHE_URL}" > /home/user/che/.che_url
echo "${MAPPED_PORT}" > /home/user/che/.che_host_port
  1. Can you apply this basic template to the ARTIK IDE custom assembly? We need a better way to abstract out the Dockerfile and Vagrantfile for custom assemblies, so that projects that are based off of the base Che can inherit changes made to Vagrantfile / Dockerfile base. Until that time, any time we have major restructuring to these files in the core repository, we have to propagate those changes out.

@creckord
Copy link
Contributor Author

  1. Those files are for accessing the final URL where Che will be available. /home/user/che/.che_url contains the URL for the virtual machine as reported by the "BOOTED AND REACHABLE" output. /home/user/che/.che_host_port contains the port on the host machine that is bound to the Che server. We could track those out-of-channel without these files if you prefer (by keeping track of the port parameter and by parsing the provisioning output for the IP in case of dhcp). But this way, the information is ensured to be in sync with the latest provisioning run.
  2. I'll submit a separate pull request for the ARTIK Vagrantfile. One question: This bit is intentionally silent:
echo "----------------------------------------"
echo "."
echo "ARTIK IDE: DOWNLOADING ARTIK RUNTIME SDK"
echo "           950MB: SILENT OUTPUT         "
echo "."
echo "----------------------------------------"
docker pull codenvy/artik &>/dev/null

Should I just leave it this way, or also enable (normal and extended) progress here?

@TylerJewell
Copy link

@creckord - let's go ahead and extend it so that it's consistent with normal / extended progress.

@creckord
Copy link
Contributor Author

@TylerJewell I've created ARTIK PR #69 to apply these changes.

@creckord
Copy link
Contributor Author

I confirm that I have signed the Eclipse CLA.

Not sure if there is an Eclipse URL showing the CLA status, but you can see here my committer status, which implies the CLA: https://projects.eclipse.org/user/362

@TylerJewell TylerJewell merged commit 830b44a into eclipse-che:master Jun 21, 2016
@TylerJewell
Copy link

Thanks @creckord for the great contribution.

@creckord creckord deleted the 1531-parameterized-vagrantfile branch June 21, 2016 16:29
tolusha pushed a commit that referenced this pull request Jul 5, 2016
* (#1531) Parameterize Vagrantfile

- Introduce environment variables for all settings in the Vagrantfile
- Make the synced user folder configurable via CHE_DATA environment 
variable
- Expose the final Che URL in <user folder>/.che_url

Signed-off-by: Carsten Reckord <reckord@yatta.de>

* (#1531) Vagrantfile: Configurable host and container port

- Introduce separate parameters for the container's port and the
binding port on the host
- Allow disabling host port binding by setting the host port to -1

Signed-off-by: Carsten Reckord <reckord@yatta.de>

* (#1531) Vagrantfile: Support DHCP instead of fixed IP

- Setting CHE_IP to "dhcp" configures the machine with a dynamic IP
managed by VirtualBox
- The chosen IP is resolved in the provisioning script and handed off
to docker

Signed-off-by: Carsten Reckord <reckord@yatta.de>

* (#1531) Vagrantfile: Verbose progress

- Setting PROVISION_PROGRESS to "extended" outputs full progress from
docker and yum to better track overall provisioning progress
- Extended progress will additionally install the 'expect' package to 
fool yum and docker into detecting a TTY for extended progress output;
a small overhead (~2MB) for much better progress during the bulk of the
provisioning process
- Default 'vagrant up' progress stays unchanged (using '#' every 10 seconds)

Signed-off-by: Carsten Reckord <reckord@yatta.de>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants