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

Add vagrant support for pouch #2168

Merged
merged 2 commits into from
Aug 30, 2018
Merged

Conversation

manlge
Copy link
Contributor

@manlge manlge commented Aug 28, 2018

Ⅰ. Describe what this PR did
Add Vagrant support for pouch.

Ⅱ. Does this pull request fix one issue?
The commit doesn't fix any issue.

Ⅲ. Why don't you add test cases (unit test/integration test)?
The commit just have scriptfile and Documents.

Ⅳ. Describe how to verify it
Install Vagrant and virtualBox

On MacOS or Linux
export POUCH_BUILD=true
vagrant up

On Windows
set POUCH_BUILD=true
vagrant up

Ⅴ. Special notes for reviews

@pouchrobot
Copy link
Collaborator

We found this is your first time to contribute to Pouch, @manlge
👏 We really appreciate it.
Just remind that you have read the contribution guide: https://github.com/alibaba/pouch/blob/master/CONTRIBUTING.md
If you didn't, you should do that first. If done, welcome again and please enjoy hacking! 🍻

@codecov-io
Copy link

codecov-io commented Aug 28, 2018

Codecov Report

Merging #2168 into master will increase coverage by 0.27%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2168      +/-   ##
==========================================
+ Coverage   64.16%   64.44%   +0.27%     
==========================================
  Files         209      209              
  Lines       16713    16723      +10     
==========================================
+ Hits        10724    10777      +53     
+ Misses       4648     4621      -27     
+ Partials     1341     1325      -16
Flag Coverage Δ
#criv1alpha1test 32.96% <ø> (+0.21%) ⬆️
#criv1alpha2test 33.57% <ø> (+0.21%) ⬆️
#integrationtest 39.41% <ø> (+0.14%) ⬆️
#unittest 23.91% <ø> (-0.02%) ⬇️
Impacted Files Coverage Δ
cri/v1alpha2/cri.go 64.03% <0%> (+0.35%) ⬆️
cri/v1alpha1/cri.go 63.4% <0%> (+0.38%) ⬆️
daemon/mgr/container.go 56.77% <0%> (+0.82%) ⬆️
daemon/containerio/container_io.go 75.69% <0%> (+1.1%) ⬆️
daemon/mgr/container_utils.go 84.33% <0%> (+1.2%) ⬆️
pkg/meta/store.go 64.06% <0%> (+1.56%) ⬆️
ctrd/image.go 78.94% <0%> (+1.75%) ⬆️
ctrd/container.go 44.73% <0%> (+2.97%) ⬆️
apis/server/exec_bridge.go 54.23% <0%> (+3.38%) ⬆️
daemon/mgr/container_exec.go 77.66% <0%> (+9.4%) ⬆️

@fuweid
Copy link
Contributor

fuweid commented Aug 28, 2018

@manlge we have the vagrantfile right. But it's located at https://github.com/alibaba/pouch/tree/master/hack/vagrant. Could you mind to help us to update it and move it into root dir of project?

@allencloud
Copy link
Collaborator

I think Vagrant file is very convenient for users. To give them a quick and direct experience, I do not think the Vagrant file should be located too deep. So I support on @manlge 's action to put it in top dir. If we still wish to locate it in a second layer of dir, I insist add a link of Vagrant file in Installation or Readme. WDYT?

@manlge
Copy link
Contributor Author

manlge commented Aug 29, 2018

@fuweid The hack/vagrant doesn't work when vagrant up

==> pouch-dev-node: Cloning into '/root/.goenv'...
==> pouch-dev-node: Downloading go1.9.1.linux-amd64.tar.gz...
==> pouch-dev-node: -> https://storage.googleapis.com/golang/go1.9.1.linux-amd64.tar.gz
==> pouch-dev-node: error: failed to download Go Linux 64bit 1.9.1.tar.gz
==> pouch-dev-node: BUILD FAILED
==> pouch-dev-node: (Ubuntu 16.04 using go-build 1.21.0)
The SSH command responded with a non-zero exit status. Vagrant
assumes that this means the command failed. The output for this command
should be in the log above. Please read the output to determine what
went wrong.

hack/vagrant just for developer, doesn't have quick start for users, So I think we can merge committed files to pouch and remove hack/vagrant directory from pouch.

VAGRANT.md Outdated

```bash
vagrant up
vagrant ssh -c "sudo su -l"

Choose a reason for hiding this comment

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

sudo -i?

Copy link
Contributor Author

@manlge manlge Aug 29, 2018

Choose a reason for hiding this comment

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

sudo su -l (L)

-l Simulate a full login. The environment is discarded except for HOME, SHELL, PATH, TERM, and USER. HOME and SHELL are modified as above. USER is
set to the target login. PATH is set to ``/bin:/usr/bin''. TERM is imported from your current environment. The invoked shell is the target
login's, and su will change directory to the target login's home directory.

Choose a reason for hiding this comment

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

sudo -i does same thing without nesting su in sudo

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm sorry, "sudo -i" is good idea. I'll change it to "sudo -i" next commit.

Vagrantfile Outdated
# configring environments for pouch
GOPATH=/root/go
apt-get install -y --no-install-recommends build-essential
wget --progress=bar:force:noscroll https://dl.google.com/go/go1.10.3.linux-amd64.tar.gz -O /tmp/go1.10.3.linux-amd64.tar.gz
Copy link
Contributor

Choose a reason for hiding this comment

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

we use go1.9.1 to build binary right now.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

OK, I'll change to go1.9.1 next commit.

    GO_VERSION=1.9.1
    GOPATH=/go
    apt-get install -y --no-install-recommends build-essential
    wget --progress=bar:force:noscroll https://dl.google.com/go/go$GO_VERSION.linux-amd64.tar.gz -O /tmp/go$GO_VERSION.linux-amd64.tar.gz
    tar xf /tmp/go$GO_VERSION.linux-amd64.tar.gz -C /opt/
    echo "export GOROOT=/opt/go" >> ~/.bashrc
    echo "export GOPATH=$GOPATH" >> ~/.bashrc
    cd /usr/bin && find /opt/go/bin -type f | xargs -n1 ln -f -s

Vagrantfile Outdated

mkdir -p $GOPATH/src/github.com/alibaba
ln -s /vagrant $GOPATH/src/github.com/alibaba/pouch
cd $GOPATH/src/github.com/alibaba/pouch && make
Copy link
Contributor

Choose a reason for hiding this comment

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

without install?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think developers sometimes just compile
The installation has been explained in VAGRANT.md

cd ~/go/src/github.com/alibaba/pouch
make DEST_DIR=/usr install
systemctl restart pouch

VAGRANT.md Outdated
## Build pouch with vagrant

```bash
export POUCH_BUILD=true # set POUCH_BUILD=true on Windows
Copy link
Contributor

Choose a reason for hiding this comment

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

you means the export xx=yy in the ubuntu on window?

Copy link
Contributor Author

@manlge manlge Aug 30, 2018

Choose a reason for hiding this comment

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

Vagrant on Windows, "export POUCH_BUILD=true" doesn't support.
Using "set POUCH_BUILD=true" to enable POUCH_BUILD

@pouchrobot pouchrobot added size/XL and removed size/M labels Aug 30, 2018
@pouchrobot
Copy link
Collaborator

@manlge Thanks for your contribution. 🍻
Please sign off in each of your commits.

Copy link
Contributor

@fuweid fuweid left a comment

Choose a reason for hiding this comment

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

LGTM

@fuweid fuweid merged commit 3c11ba1 into AliyunContainerService:master Aug 30, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants