-
Notifications
You must be signed in to change notification settings - Fork 1
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
OZ-560: Rename project,Added E2E tests and registration Opt In #1
Conversation
e2e/container2consul.spec.ts
Outdated
await stopDockerCompose(); | ||
await startDockerCompose(); | ||
// Pause for 5 seconds to allow nginx test containers to start | ||
await new Promise(r => setTimeout(r, 3000)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
await new Promise(r => setTimeout(r, 3000)); | |
await new Promise(r => setTimeout(r, 5000)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@kdaud is this based on your tests locally?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Setting 3000 milliseconds equates to 3 seconds, and the comment indicates that a pause of 5 minutes is required to allow the Nginx test containers to start.
README.md
Outdated
-e c2c_consul__host=localhost \ | ||
-e c2c_consul__port=8500 \ | ||
-v /var/run/docker.sock:/var/run/docker.sock \ | ||
mekomsolutions/container2sul |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we keep this Docker image name?
README.md
Outdated
[![Build Status](https://travis-ci.org/mekomsolutions/container-to-consul.svg?branch=master)](https://travis-ci.org/mekomsolutions/container-to-consul) | ||
[![codecov](https://codecov.io/gh/mekomsolutions/container-to-consul/branch/master/graph/badge.svg)](https://codecov.io/gh/mekomsolutions/container-to-consul) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are these going to work?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did you remove these lines?
README.md
Outdated
The registered ip address can be configured using a `consul.ip` label. | ||
|
||
``` | ||
docker run --rm --name containertoConsul -ti -l consul.ip=10.0.0.1 alpine ash |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's have the container named container-to-consul
if possible.
README.md
Outdated
|
||
Container-to-Consul automatically registers and deregisters nodes for any Docker container. | ||
|
||
This project is inspired by [gliderlabs registrator](https://github.com/gliderlabs/registrator). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't this based on https://github.com/benoitvidis/con-tainer2sul instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If so, it needs more emphasis.
What about:
This project is largely based on the original work done in con-tainer2sul by Benoît Vidis. While this fork includes significant changes and improvements, we would like to acknowledge the foundation provided by the original project, without which this version would not have been possible.
Please note that some files, variables, or other elements might still reference the original project name. These remnants will be updated over time as the project evolves, but their presence reflects the project's roots as
con-tainer2sul
.
README.md
Outdated
[![Build Status](https://travis-ci.org/mekomsolutions/container-to-consul.svg?branch=master)](https://travis-ci.org/mekomsolutions/container-to-consul) | ||
[![codecov](https://codecov.io/gh/mekomsolutions/container-to-consul/branch/master/graph/badge.svg)](https://codecov.io/gh/mekomsolutions/container-to-consul) | ||
|
||
Container-to-Consul automatically registers and deregisters nodes for any Docker container. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Container-to-Consul automatically registers and deregisters nodes for any Docker container. | |
Container-to-Consul automatically registers and deregisters any Docker container as HashiCorp Consul nodes. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@enyachoke the doc specifies multiple commands to be run, with different option. Can those options be used simultaneously? eg, using consul.service=myservice
and consul.tags=xyz
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes they can as used in the tests
container-to-consul/e2e/docker/test-compose.yaml
Lines 4 to 10 in 52f007b
image: nginx:1-alpine | |
labels: | |
- "consul.port=80" | |
- "consul.tags=nginx" | |
- "consul.service=nginx-register" | |
- "consul.ip=10.0.0.1" | |
- "consul.register=true" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In that case, the structure of the doc is misleading.
Why would someone want to run those commands one by one like that?
I suppose it is better to simply document what the options can do, without an example docker run --rm ...
which in fact will probably never be used.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In that case, the structure of the doc is misleading. Why would someone want to run those commands one by one like that?
I suppose it is better to simply document what the options can do, without an example
docker run --rm ...
which in fact will probably never be used.
The commands are used to explain the effect of the option and are not necessarily complete usage examples.
@enyachoke could you provide some instructions to test? |
@rbuisson This will be available after we merge see container-to-consul/.github/workflows/build.yml Lines 13 to 19 in 52f007b
|
Yes I know. So what are the instructions? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've pushed a change on the README to add some screenshots.
I've left some comments as well.
But it works!
Thanks, that's an awesome tool!
.github/workflows/build.yml
Outdated
types: [published] | ||
|
||
jobs: | ||
docker-release: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
docker-release: | |
docker-publish: |
"unit-tests": "istanbul cover _mocha -- --recursive --reporter spec --require should --require should-sinon" | ||
}, | ||
"author": "Benoît Vidis", | ||
"license": "Apache-2.0", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you add a new key for contributors:
"contributors": [ "Mekom Solutions (https://mekomsolutions.com/)" ]
README.md
Outdated
[![Build Status](https://travis-ci.org/mekomsolutions/container-to-consul.svg?branch=master)](https://travis-ci.org/mekomsolutions/container-to-consul) | ||
[![codecov](https://codecov.io/gh/mekomsolutions/container-to-consul/branch/master/graph/badge.svg)](https://codecov.io/gh/mekomsolutions/container-to-consul) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did you remove these lines?
README.md
Outdated
Running; | ||
|
||
``` | ||
docker run --name docker-nginx -d -l consul.register=true -l consul.ip=10.0.0.1 -l consul.service=nginx-service -l consul.tags=www,api -l consul.port=80 -l consul.kv.foo=bar -l consul.kv.bar=baz nginx |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
docker run --name docker-nginx -d -l consul.register=true -l consul.ip=10.0.0.1 -l consul.service=nginx-service -l consul.tags=www,api -l consul.port=80 -l consul.kv.foo=bar -l consul.kv.bar=baz nginx | |
docker run --name nginx -d \ | |
-l consul.register=true \ | |
-l consul.ip=10.0.0.1 \ | |
-l consul.service=nginx \ | |
-l consul.tags=www,api \ | |
-l consul.port=80 \ | |
-l consul.kv.foo=bar \ | |
-l consul.kv.bar=baz \ | |
nginx |
README.md
Outdated
|
||
### Deregistration | ||
|
||
To deregister the container, you can simply stop it and remove it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is removing the container necessary to deregister? I don't think so, right?
I suggest to then remove the rm
command to put it a bit after, as a note or something.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@rbuisson needs to do a final review of the PR.
This is a PR for the work in https://mekomsolutions.atlassian.net/browse/OZ-560. It introduces a number of changes to the original project;