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

Simplifications for CONTRIBUTING.adoc for Vagrant users #9817

Merged
merged 1 commit into from
Jul 14, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 18 additions & 22 deletions CONTRIBUTING.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ export GOPATH=$HOME/go
+
TIP: To ensure you get the latest image first run `vagrant box remove fedora_inst`. And if later on you employ a dev cluster, additionally run `vagrant box remove fedora_deps`.

6. SSH in:
6. You are now ready to edit the source, rebuild and restart OpenShift to test your changes. SSH in:

$ vagrant ssh

Expand All @@ -150,46 +150,42 @@ TIP: To ensure you get the latest image first run `vagrant box remove fedora_ins
$ cd /data/src/github.com/openshift/origin
$ make clean build

8. You are now ready to edit the source, rebuild and restart OpenShift to test your changes. At this point you may want to update your $PATH:
8. Now start the OpenShift server:

# back to /home/vagrant
$ cd
# update path to include binaries for oc, oadm, etc
# this is temporary, to make it persistent add it to .bash_profile
$ export PATH=/data/src/github.com/openshift/origin/_output/local/bin/linux/amd64:$PATH
$ sudo systemctl start openshift

Or:

9. Now start the OpenShift server:

# redirect the logs to /home/vagrant/openshift.log for easier debugging
$ sudo `which openshift` start --public-master=localhost &> openshift.log &
# must cd / to use prepopulated $KUBECONFIG
$ cd /
# redirect the logs to /home/vagrant/openshift.log for easier debugging
$ sudo `which openshift` start --public-master=localhost &> $HOME/openshift.log &
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is the openshift binary still going to be on the path since you removed the export PATH step? (not sure what the default path is like on the VM)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I believe so - I checked empirically, and also see https://github.com/openshift/vagrant-openshift/blob/master/lib/vagrant-openshift/action/install_origin.rb#L43 since a long time ago

(It's a bit grotty that the "which" is required in "sudo which openshift" - this is because secure_path in /etc/sudoers does not include the openshift binary path - hence the suggestion for newbies that they do sudo service openshift start instead)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

btw is it not systemctl start openshift? (I never use the service approach myself, i like to be able to cntrl-c things :) )

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Either works - can change it you prefer systemctl start openshift.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah but service tells you not to use service :) let's go w/ systemctl.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done. In fact this is also more consistent with the rest of the doc.


+
NOTE: This will generate three directories in /home/vagrant (openshift.local.config, openshift.local.etcd, openshift.local.volumes) as well as create the openshift.log file.
NOTE: This will generate three directories in / (openshift.local.config, openshift.local.etcd, openshift.local.volumes) as well as create the /home/vagrant/openshift.log file.

+
NOTE: By default your origin directory (on your host machine) will be mounted as a vagrant synced folder into `/data/src/github.com/openshift/origin`.


10. Deploy the private docker registry within OpenShift with the following commands:
9. Deploy the private docker registry within OpenShift with the following command:

$ sudo chmod +r openshift.local.config/master/admin.kubeconfig
$ oadm registry -n default --config=openshift.local.config/master/admin.kubeconfig
$ oadm registry


11. At this point it may be helpful to load some image streams and templates. These commands will make use of fixtures from the `openshift/origin/examples` dir:
10. At this point it may be helpful to load some image streams and templates. These commands will make use of fixtures from the `openshift/origin/examples` dir:

# load image stream
$ oc create -f /data/src/github.com/openshift/origin/examples/image-streams/image-streams-centos7.json -n openshift --config=openshift.local.config/master/admin.kubeconfig
# load image streams
$ oc create -f /data/src/github.com/openshift/origin/examples/image-streams/image-streams-centos7.json -n openshift
# load templates
$ oc create -f /data/src/github.com/openshift/origin/examples/sample-app/application-template-stibuild.json -n openshift --config=openshift.local.config/master/admin.kubeconfig
$ oc create -f /data/src/github.com/openshift/origin/examples/db-templates --config=openshift.local.config/master/admin.kubeconfig
$ oc create -f /data/src/github.com/openshift/origin/examples/sample-app/application-template-stibuild.json -n openshift
$ oc create -f /data/src/github.com/openshift/origin/examples/db-templates -n openshift


12. At this point you can open a browser on your host system and navigate to https://localhost:8443/console to view the web console.
11. At this point you can open a browser on your host system and navigate to https://localhost:8443/console to view the web console. You can log in with any username and password combination.


13. NOTE: to properly stop OpenShift and clean up, so that you can start fresh instance of OpenShift, execute:
12. NOTE: to properly stop OpenShift and clean up, so that you can start fresh instance of OpenShift, execute:

# shut down openshift
$ sudo pkill openshift
Expand Down