Commit Graph

188 Commits

Author SHA1 Message Date
Victor Vieux 78008f4d4a add doc
fix tests and keep swarm id
remove duplicate on node reconnect
explicit failure

Signed-off-by: Victor Vieux <vieux@docker.com>
2016-01-11 15:59:44 -08:00
Andrea Luzzardi 56941d02a8 cluster: Support multiple event handlers.
Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
2016-01-11 15:59:44 -08:00
Alexandre Beslic 8b173fd382 Merge pull request #1569 from dongluochen/nodeManagement
Improve node management.
2016-01-07 16:14:36 -08:00
Dong Chen 7e266f18ed Name constants.
Signed-off-by: Dong Chen <dongluo.chen@docker.com>
2016-01-07 15:55:12 -08:00
Dong Chen 9a1584d508 Update integration test. Reduce pending node validation sleep interval. Each pending node has its own validation interval according to failure count. So reducing sleep interval is not increasing validation frequency for unreachable nodes.
Signed-off-by: Dong Chen <dongluo.chen@docker.com>
2016-01-05 15:56:55 -08:00
Dong Chen 52a7616d99 Add integration test for state machine.
Signed-off-by: Dong Chen <dongluo.chen@docker.com>
2016-01-05 14:59:30 -08:00
Victor Vieux 5daaecdaa1 do not save image affinity on reschedule
Signed-off-by: Victor Vieux <vieux@docker.com>
2016-01-05 10:29:45 -08:00
Victor Vieux 97f3767618 fix soft affinity reschedule
Signed-off-by: Victor Vieux <vieux@docker.com>
2016-01-05 04:58:36 -08:00
Dong Chen 995866d76c Improve node management.
1. Introduce pending state. Pending nodes need validation before moving to healthy state. Resolve issues of duplicate ID and dead node drop issues.
2. Expose error and last update time in docker info.
3. Use connect success/failure to drive state transition between healthy and unhealthy.

Signed-off-by: Dong Chen <dongluo.chen@docker.com>
2015-12-30 13:25:43 -08:00
Victor Vieux be0fce961f update code
Signed-off-by: Victor Vieux <vieux@docker.com>
2015-12-22 00:20:04 -08:00
Daniel Hiltgen dde577d154 Add token pass-thru for Authconfig
This augments the CreateContainer call to detect the AuthConfig header
and use any supplied auth for pull operations.  This will allow pulling
of protected image on to specific node during the create operation.

CLI usage example using username/password:

    # Calculate the header
    REPO_USER=yourusername
    read -s PASSWORD
    HEADER=$(echo "{\"username\":\"${REPO_USER}\",\"password\":\"${PASSWORD}\"}"|base64 -w 0 )
    unset PASSWORD
    echo HEADER=$HEADER

    # Then add the following to your ~/.docker/config.json
    "HttpHeaders": {
        "X-Registry-Auth": "<HEADER string from above>"
    }

    # Now run a private image against swarm:
    docker run --rm -it yourprivateimage:latest

CLI usage example using registry tokens: (Required engine 1.10 with new auth token support)

    REPO=yourrepo/yourimage
    REPO_USER=yourusername
    read -s PASSWORD
    AUTH_URL=https://auth.docker.io/token
    TOKEN=$(curl -s -u "${REPO_USER}:${PASSWORD}" "${AUTH_URL}?scope=repository:${REPO}:pull&service=registry.docker.io" |
        jq -r ".token")
    HEADER=$(echo "{\"registrytoken\":\"${TOKEN}\"}"|base64 -w 0 )
    echo HEADER=$HEADER

    # Update the docker config as above, but the token will expire quickly...

Signed-off-by: Daniel Hiltgen <daniel.hiltgen@docker.com>
2015-12-11 18:36:55 -08:00
Alexandre Beslic f21efa4337 Increase default TTL and heartbeat value
Increases the default ttl and heartbeat value for discovery.
Because the node will still be listed for a long period on
`docker info`, there is now a Status to know if a node is
in the healthy or unhealthy state.

Signed-off-by: Alexandre Beslic <abronan@docker.com>
2015-12-04 17:11:33 -08:00
Victor Vieux 24fc1b6909 Merge pull request #1451 from aluzzardi/parallel-affinity-fix
Set labels for pending containers
2015-11-25 15:19:58 -08:00
Andrea Luzzardi 9310a385af Set labels for pending containers.
Fixes docker/compose#2447

Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
2015-11-25 06:56:57 -08:00
Victor Vieux d2c5446ea0 Merge pull request #1340 from jimmyxian/volume-driver
Move VolumeDriver to HostConfig
2015-10-28 15:28:53 -07:00
Dong Chen c9f3471dba add engine options for refresh interval
Signed-off-by: Dong Chen <dongluo.chen@docker.com>
2015-10-28 12:56:48 -07:00
Xian Chaobo 588c29c3cc move VolumeDriver to HostConfig
Signed-off-by: Xian Chaobo <xianchaobo@huawei.com>
2015-10-28 10:58:24 +08:00
Daniel Nephin e001980b5c Add filter by image name support to /images/json
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2015-10-27 11:00:37 -04:00
Alexandre Beslic da1f854462 Merge pull request #1310 from pwnall/image_affinity
Swarm filters support in image building
2015-10-23 14:54:33 -07:00
Victor Costan e32b3211ae Swarm filters support in image building.
When building an image (POST /build), swarm will extract filters from
buildargs. This is similar to how container creation (POST
/containers/create) extracts filters from environment variables.

Signed-off-by: Victor Costan <costan@gmail.com>
2015-10-23 14:24:42 -04:00
Alexandre Beslic 93e78ce641 Merge pull request #1314 from aluzzardi/fix-nullptr-pendingcontainer
Fix nullptr panic in pending containers.
2015-10-20 12:14:06 -07:00
Andrea Luzzardi 0399a3c60b Fix nullptr panic in pending containers.
Fixes #1289

Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
2015-10-19 13:38:06 -07:00
Victor Vieux 21d6fc5378 fix panic when createContainer returns nil,nil
Signed-off-by: Victor Vieux <vieux@docker.com>
2015-10-18 21:22:59 -07:00
Victor Vieux f9807f561c fix golint
Signed-off-by: Victor Vieux <vieux@docker.com>
2015-10-17 01:32:44 -07:00
Victor Vieux e9c486b046 refresh networks on whole cluster after create and rm
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2015-10-19 15:42:56 -07:00
Victor Vieux bef2892cee Merge pull request #1271 from jimmyxian/fix-reschedule-with-soft-affinity
Do not try retry with soft-image-affinity when have node constraint
2015-10-15 13:52:29 -07:00
Victor Vieux 6d6927d1de fix merge issue
Signed-off-by: Victor Vieux <vieux@docker.com>
2015-10-13 01:24:10 -07:00
Alexandre Beslic 1e30ce215f Merge pull request #1262 from vieux/libnetwork
add 'docker network' support
2015-10-13 11:09:27 -07:00
Andrea Luzzardi b2b32d979d scheduler now returns the list of ranked nodes rather than the top node.
Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
2015-10-09 15:32:37 -07:00
Andrea Luzzardi 7c0539c650 cluster: Fix name setting of pending containers.
Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
2015-10-09 12:54:57 -07:00
Andrea Luzzardi 24394612f5 cluster: Don't lock the scheduler when removing a container.
Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
2015-10-09 12:54:56 -07:00
Andrea Luzzardi 91279c8256 cluster: Check name uniqueness among pending containers.
Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
2015-10-09 12:54:56 -07:00
Andrea Luzzardi c64ae5168a Parallel scheduling support for Swarm driver.
Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
2015-10-09 12:54:53 -07:00
Victor Vieux 78ecf8497c Add network rm
Signed-off-by: Victor Vieux <vieux@docker.com>
2015-10-08 22:36:13 -07:00
Victor Vieux b007cae8b2 Add docker network create
Signed-off-by: Victor Vieux <vieux@docker.com>
2015-10-08 22:35:07 -07:00
Victor Vieux 8559fb0fc6 remove cluster.Network(IDOrName)
Signed-off-by: Victor Vieux <vieux@docker.com>
2015-10-08 22:35:07 -07:00
Victor Vieux e634df03a7 add 'docker network ls' support
add 'docker network inspect' suport

Signed-off-by: Victor Vieux <vieux@docker.com>
2015-10-08 22:35:07 -07:00
Xian Chaobo 315ddfeb4d do not try retry with soft-image-affinity when have node constraint
Signed-off-by: Xian Chaobo <xianchaobo@huawei.com>
2015-10-08 05:06:39 -04:00
Daniel Nephin 8abf7d32e9 Support filtering images by labels
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2015-10-02 15:45:52 -04:00
Alexandre Beslic a792519978 Merge pull request #1208 from vieux/volume_create_delete
docker volume create & docker volume delete
2015-09-23 10:45:44 -07:00
Victor Vieux 53357d88fd Merge pull request #1213 from jimmyxian/fix-import-load-return-code
Fix import/load return code
2015-09-21 17:13:07 -07:00
Victor Vieux 79d1ee4861 add volume create
Signed-off-by: Victor Vieux <vieux@docker.com>
2015-09-18 03:23:22 -07:00
Victor Vieux 440a379860 docker volume rm
Signed-off-by: Victor Vieux <vieux@docker.com>
2015-09-18 03:22:57 -07:00
Xian Chaobo 9afb7d324b fix connect event
Signed-off-by: Xian Chaobo <xianchaobo@huawei.com>
2015-09-17 05:18:42 -04:00
Xian Chaobo 5cc6e3f30c fix import/load return code
Signed-off-by: Xian Chaobo <xianchaobo@huawei.com>
2015-09-15 10:00:49 -04:00
Xian Chaobo a10a39c462 fix pull return code
Signed-off-by: Xian Chaobo <xianchaobo@huawei.com>
2015-09-10 04:10:28 -04:00
Victor Vieux 77c96908f0 add support for docker volume ls & inspect
Signed-off-by: Victor Vieux <vieux@docker.com>
2015-09-05 07:56:22 -07:00
Victor Vieux d571b7e39e Revert "prevent double starts with mesos"
This reverts commit 9a93dcf46b.

Signed-off-by: Victor Vieux <vieux@docker.com>
2015-09-02 20:33:49 -07:00
Chanwit Kaewkasi 4cdbe875b8 Merge pull request #1155 from vieux/fix_mesos_logs
prevent double logs with mesos
2015-09-03 13:10:52 +07:00
Victor Vieux 2fb43773cf Merge pull request #1180 from abronan/clean_state
Cleanup state folder with local file persistence
2015-09-01 17:04:28 -07:00
Victor Vieux 42bb1f3f5b Merge pull request #1159 from jimmyxian/fix-tag-images
fix tag image
2015-09-01 11:25:48 -07:00
Victor Vieux 9a93dcf46b prevent double starts with mesos
Signed-off-by: Victor Vieux <vieux@docker.com>
2015-08-31 22:52:43 -07:00
Xian Chaobo 29df83a349 fix tag image
Signed-off-by: Xian Chaobo <xianchaobo@huawei.com>
2015-08-31 07:17:30 -04:00
Alexandre Beslic 6c1c83f7a3 Cleanup state folder with local file persistence (not used anymore)
Signed-off-by: Alexandre Beslic <abronan@docker.com>
2015-08-30 17:15:52 -07:00
Xian Chaobo 12e956e681 add support force remove images
Signed-off-by: Xian Chaobo <xianchaobo@huawei.com>
2015-08-19 23:09:02 -04:00
Xian Chaobo d4daee4f27 add support images -a
Signed-off-by: Xian Chaobo <xianchaobo@huawei.com>
2015-08-12 07:39:11 -04:00
Veres Lajos 0d94d7a11a typofix - https://github.com/vlajos/misspell_fixer
Signed-off-by: Veres Lajos <vlajos@gmail.com>
2015-08-07 23:06:16 +01:00
Andrea Luzzardi 3bb4373f9f Merge pull request #1111 from vieux/no_json_manual
do not generate JSON by hand
2015-08-04 15:30:30 -07:00
Xian Chaobo a3cf5b9e9c improve build
Signed-off-by: Xian Chaobo <xianchaobo@huawei.com>
2015-08-04 02:45:06 -04:00
Victor Vieux 7ec33a81b5 do not generate JSON by hand
Signed-off-by: Victor Vieux <vieux@docker.com>
2015-07-30 18:10:13 -07:00
Victor Vieux 39309f7a62 rename n to e
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2015-07-16 11:55:33 -07:00
Xian Chaobo 0037c31a95 fix func name and use extracExprs
Signed-off-by: Xian Chaobo <xianchaobo@huawei.com>
2015-07-07 11:30:26 +08:00
Xian Chaobo 05ba86d329 golint and add integration test
Signed-off-by: Xian Chaobo <xianchaobo@huawei.com>
2015-06-16 08:46:17 +08:00
Xian Chaobo 8c7c0b248b reschedule with soft image affinity
Signed-off-by: Xian Chaobo <xianchaobo@huawei.com>
2015-06-16 07:52:00 +08:00
Victor Vieux 4f688db989 disconnect on duplicate
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2015-06-11 15:09:37 -07:00
Victor Vieux c1020da636 nits
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2015-06-04 18:25:51 -07:00
Victor Vieux 4f9c9f5867 use dockerclient structs
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2015-06-04 18:25:51 -07:00
Victor Vieux 2bf6c1a529 improve docker infi with 1.7
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2015-06-04 18:25:51 -07:00
Xian Chaobo 78957d527b add load unit test
Signed-off-by: Xian Chaobo <xianchaobo@huawei.com>
2015-05-29 22:44:27 -04:00
Xian Chaobo def00ea0a0 fix load
Signed-off-by: Xian Chaobo <xianchaobo@huawei.com>
2015-05-29 22:35:27 -04:00
Xian Chaobo d7001cac97 fix import unit test
Signed-off-by: Xian Chaobo <xianchaobo@huawei.com>
2015-05-27 22:11:05 +08:00
Xian 8da3de3cc4 add import unit test
Signed-off-by: Xian <xianchaobo@huawei.com>
2015-05-27 22:11:05 +08:00
Xian Chaobo 1f20358b5d add support import
Signed-off-by: Xian Chaobo <xianchaobo@huawei.com>
2015-05-27 22:11:03 +08:00
Victor Vieux 9db6bce98b Merge pull request #823 from vieux/containers
create containers.go
2015-05-26 13:05:26 -07:00
Victor Vieux b5094bde55 create Containers type
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2015-05-26 12:01:48 -07:00
Victor Vieux 0b24992d7c Merge pull request #815 from jimmyxian/rmi_by_name
Fix image match
2015-05-26 10:43:59 -07:00
Andrea Luzzardi b4efc08dfc api: Integrate leader election.
Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
2015-05-22 21:23:34 -07:00
Victor Vieux b3222a8f11 rename Destroy ro RemoveContainer for consistency
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2015-05-20 12:53:02 -07:00
Xian Chaobo e6ce59794e merge two image match func
Signed-off-by: Xian Chaobo <xianchaobo@huawei.com>
2015-05-19 21:39:10 -04:00
Alexandre Beslic 4537b9f2ba Remove unused code
Signed-off-by: Alexandre Beslic <abronan@docker.com>
2015-05-19 12:57:43 -07:00
Alexandre Beslic f81de46ab4 Fix Consul and etcd with latest changes, use etcd v2.0.11 for integration tests, remove call to SyncCluster for now (breaks the integration tests)
Signed-off-by: Alexandre Beslic <abronan@docker.com>
2015-05-19 10:25:31 -07:00
Alexandre Beslic d5915b2a09 Merge pull request #811 from aluzzardi/node-removal
Handle Node Removal from Discovery correctly
2015-05-19 10:11:10 -07:00
Isabel Jimenez 19d51f4a1a adding environment variable option when treating flags
Signed-off-by: Isabel Jimenez <contact.isabeljimenez@gmail.com>
2015-05-18 20:16:21 -04:00
Andrea Luzzardi d7b8734e97 cluster: Handle node removal
Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
2015-05-18 13:55:13 -07:00
Andrea Luzzardi 3d6f833f6f fix --heartbeat flag.
Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
2015-05-18 13:38:15 -07:00
Andrea Luzzardi 0c72bcaf40 discovery cleanup: heartbeat is a time.Duration.
- Use a time.Duration instead of a uint64 for hb
- Flags can accept durations: --heartbeat 25s

Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
2015-05-18 13:38:14 -07:00
Andrea Luzzardi f33c03af93 discovery: Push watch errors to a channel
Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
2015-05-18 13:38:14 -07:00
Andrea Luzzardi 97984881c3 discovery: New channel based API.
- Watch() issues updates by channel rather than by callback
- Fetch() is gone
- Watch() can be stopped at any time by closing the stop channel
- Watch() is now resilient to errors and will try over and over

Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
2015-05-18 13:38:13 -07:00
Victor Vieux 4b03d7fa0c handle collision
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2015-05-18 13:35:33 -07:00
Victor Vieux faf26a62f4 fix container matching algorithm
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2015-05-15 17:57:40 -07:00
Victor Vieux 2cb0395acf remove images by name or ID, not always ID
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2015-05-14 15:22:06 -07:00
Victor Vieux 69bdf1a87b fix heartbeat default value
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2015-05-13 16:50:01 -07:00
Victor Vieux 59cd11b946 change swarm.heartbeat to swarm.discovery.heartbeat
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2015-05-13 15:48:07 -07:00
Victor Vieux 5db3a9cd0e remove options struct, yay!
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2015-05-13 15:36:30 -07:00
Victor Vieux c29404e272 add --cluster-driver and --cluster-opt
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2015-05-12 17:49:00 -07:00
Andrea Luzzardi abfe5e6f4c Add support for Swarm IDs.
- Every container that gets created through Swarm gets a Swarm ID
  assigned (as a label).
- All API operations (start, stop, ...) can be performed by using either
  the container ID or the swarm ID.

Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
2015-05-11 16:56:07 -07:00
Victor Vieux a74d00d1c5 fix name checks
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2015-05-07 15:50:34 -07:00
Andrea Luzzardi 9124f3a0c7 cluster: Improved discovery duplication error messaging.
Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
2015-05-05 19:13:57 -07:00
Victor Vieux 6eceffacf9 use cluster.ContainerConfig
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2015-04-30 11:44:25 -07:00
Victor Vieux e5f4243dad support pulling private images from docker pull
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2015-04-28 11:17:44 -07:00