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 3 #341

Merged
merged 1 commit into from
Oct 19, 2016
Merged

Stack network 3 #341

merged 1 commit into from
Oct 19, 2016

Conversation

freignat91
Copy link
Contributor

@freignat91 freignat91 commented Oct 18, 2016

related to #313
Use external network in stack, using syntaxes:

services:
  myservice:
     networks:
        anexternalnetwork
networks:
   anexternalnetwork:
     external: true

or

services:
  myservice:
     networks:
        myexternalnetwork
networks:
   myexternalnetwork:
     external:
        name: anexternalnetwwork

two tests has been added, sample-12.ym for the first syntax, sample-13.yml for the second.

test: (seems long, but fast to test in fact)

  • stop amp: sudo ./swarm stop
  • rebuild amp: make install
  • start amp: sudo ./swarm start
  • launch amplifier locally

first syntax test:

  • create stack test1: amp stack up test1 -f api/rpc/stack/test_samples/sample-12.yml
  • search test1-pinger container id: docker ps | grep test1-pinger
  • inspect the container: docker inspect [containerId]
  • see that the container is attached to amp-infra in the networks section
  • search haproxy: docker ps | grep haproxy
  • enter in HAProxy container: docker exec -it [haproxyId] sh
  • in the container verify that we can ping the service: ping ext1-pinger
  • It shows that the ext1-pinger service is well attached to the amp-infra network as an external

second syntax test:

  • create stack test2: amp stack up test2 -f api/rpc/stack/test_samples/sample-13.yml
  • search test2-pinger container id: docker ps | grep test2-pinger
  • inspect the container: docker inspect [containerId]
  • see that the container is attached to amp-infra in the networks section
  • to test the second syntax for an external network:
  • re-enter in HAProxy container: docker exec -it [haproxyId] sh
  • in the container verify that we can ping the service: ping ext2-pinger
  • It shows that the ext2-pinger service is well attached to the amp-infra network as an external

regression test:

  • make test

@freignat91 freignat91 force-pushed the stack-network-3 branch 2 times, most recently from 09feede to cf83389 Compare October 18, 2016 15:58
Copy link
Contributor

@bquenin bquenin 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 and working

Copy link
Contributor

@subfuzion subfuzion left a comment

Choose a reason for hiding this comment

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

We still have to work out the security / policy ramifications of sharing networks between stacks vs. publishing; however, this is good work that we can experiment with and evolve. Nice job! 👍

@subfuzion subfuzion merged commit fd09494 into master Oct 19, 2016
@subfuzion subfuzion deleted the stack-network-3 branch October 19, 2016 05:44
@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.

3 participants