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

Stack network stage 2 #304

Merged
merged 1 commit into from
Oct 17, 2016
Merged

Stack network stage 2 #304

merged 1 commit into from
Oct 17, 2016

Conversation

freignat91
Copy link
Contributor

@freignat91 freignat91 commented Oct 12, 2016

#280

Be able to create custom networks and associate stack services to them in order to establish private communication between services from separate stacks.

test:

  • stop amp: sudo ./swarm stop
  • pull images: ./swarm pull
  • build amp: glide cc && rm -rf vendor && glide install && make install
  • start amp: sudo ./swarm start
  • create stack test1: amp stack up test1 -f api/rpc/stack/test_samples/sample-10-1.yml
  • create stack test2: amp stack up test2 -f api/rpc/stack/test_samples/sample-10-2.yml
  • verify:
    • stack test1 and test2 are up and running using: ./swarm monitor
    • custom network "amp_net" is created, using: docker network ls
    • container test1.pinger is able to ping test2.pinger
      • docker ps | grep test1.pinger -> get the container id [containerId1]
      • docker exec -it [containerId1] sh
      • inside the container: ping test2-pinger -> should return a valid address
    • container test2.pinger is able to ping test1.pinger
      • docker ps | grep test2.pinger -> get the container id [containerId2]
      • docker exec -it [containerId2] sh
      • inside the container: ping test1-pinger -> should return a valid address

Regression tests:

  • make test

minor:

  • add volumes in service definition and in stack file (tests added in make test) add volumes/mount in stack file #299
  • add args in services definition and in stack file (tests added in make test)

Copy link
Contributor

@ndegory ndegory left a comment

Choose a reason for hiding this comment

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

small fixes, mostly in comments

})
} else if len(list) == 2 {
if strings.Index(list[0],"/") < 0 {
//create names volume
Copy link
Contributor

Choose a reason for hiding this comment

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

s/names/named

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

} else if len(list) == 2 {
if strings.Index(list[0],"/") < 0 {
//create names volume
fmt.Println("create named volume"+list[0])
Copy link
Contributor

Choose a reason for hiding this comment

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

s/volume"/volume "/

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

}
if len(list) == 1 {
//create a anonymous volume
fmt.Println("create anonymous volume")
Copy link
Contributor

Choose a reason for hiding this comment

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

you mean "implicit bind type volume?"

Copy link
Contributor Author

Choose a reason for hiding this comment

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

A volume create by the container with no name and not bind to a host directory

Copy link
Contributor

Choose a reason for hiding this comment

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

from what I see it's still bind to a host directory, it's just implicit (source is same as the target)

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, no explicite bind.

Copy link
Contributor

@generalhenry generalhenry left a comment

Choose a reason for hiding this comment

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

Tested locally

@freignat91 freignat91 force-pushed the stack-network-2 branch 4 times, most recently from 6ca352e to 0b66049 Compare October 17, 2016 16:57
@subfuzion
Copy link
Contributor

Works great! LGTM 👍

@subfuzion subfuzion merged commit e7b3413 into master Oct 17, 2016
@subfuzion subfuzion deleted the stack-network-2 branch October 17, 2016 21:17
@subfuzion subfuzion restored the stack-network-2 branch October 17, 2016 21:32
@subfuzion subfuzion deleted the stack-network-2 branch October 17, 2016 22:03
@subfuzion subfuzion added this to the 0.2.0 milestone Oct 25, 2016
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.

4 participants