') + ')', 'gi'); if (regex.test(text)) { found = true; var frag = document.createDocumentFragment(); var parts = text.split(regex); parts.forEach(function(part, i) { if (i % 2 === 0) { frag.appendChild(document.createTextNode(part)); } else { var span = document.createElement('span'); span.className = 'userscript-highlight'; span.textContent = part; frag.appendChild(span); } }); node.parentNode.replaceChild(frag, node); } }); } else if (node.nodeType === 1 && node.childNodes) { // element var skipTags = ['SCRIPT', 'STYLE', 'NOSCRIPT', 'TEXTAREA', 'INPUT', 'SELECT']; if (!skipTags.includes(node.tagName)) { Array.from(node.childNodes).forEach(highlight); } } } highlight(document.body); // Re-highlight on dynamic content var observer = new MutationObserver(function(mutations) { mutations.forEach(function(m) { m.addedNodes.forEach(function(node) { if (node.nodeType === 1 || node.nodeType === 3) highlight(node); }); }); }); observer.observe(document.body, { childList: true, subtree: true }); })(); } } catch(__e) { console.warn('[Userscript:Highlight Search Terms]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + ', 'i'); if (__m === '*' || __re.test(location.href)) { // Strip utm_, fbclid, gclid, etc. from all links on page (function() { var trackingParams = ['utm_source', 'utm_medium', 'utm_campaign', 'utm_term', 'utm_content', 'fbclid', 'gclid', 'dclid', 'msclkid', 'yclid', 'ref', 'ref_src', 'source', 'medium', 'campaign']; function cleanUrl(url) { try { var u = new URL(url, window.location.origin); var changed = false; trackingParams.forEach(function(p) { if (u.searchParams.has(p)) { u.searchParams.delete(p); changed = true; } }); return changed ? u.toString() : url; } catch (e) { return url; } } function cleanLinks() { document.querySelectorAll('a[href]').forEach(function(a) { var clean = cleanUrl(a.href); if (clean !== a.href) a.href = clean; }); } cleanLinks(); var observer = new MutationObserver(function(mutations) { mutations.forEach(function(m) { m.addedNodes.forEach(function(node) { if (node.nodeType === 1) { if (node.tagName === 'A') cleanLinks(); node.querySelectorAll('a[href]').forEach(function(a) { var clean = cleanUrl(a.href); if (clean !== a.href) a.href = clean; }); } }); }); }); observer.observe(document.body, { childList: true, subtree: true }); })(); } } catch(__e) { console.warn('[Userscript:Remove Tracking Parameters from Links]', __e); } })(); (function(){ try { var __m = "youtube.com"; var __re = new RegExp('^' + "youtube\\.com" + ', 'i'); if (__m === '*' || __re.test(location.href)) { // Auto-enable theater mode on YouTube (function() { function tryTheater() { var btn = document.querySelector('button[aria-label="Theater mode"], ytd-player #player button[title="Theater mode"]'); if (btn && !btn.classList.contains('activated')) { btn.click(); } } // Try immediately tryTheater(); // Try after navigation (SPA) var lastUrl = location.href; setInterval(function() { if (location.href !== lastUrl) { lastUrl = location.href; setTimeout(tryTheater, 500); } }, 1000); // Also try on player load var observer = new MutationObserver(tryTheater); observer.observe(document.body, { childList: true, subtree: true }); })(); } } catch(__e) { console.warn('[Userscript:YouTube Theater Mode Default]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + ', 'i'); if (__m === '*' || __re.test(location.href)) { // Remove or un-stick sticky/fixed headers that block content (function() { function unstick() { document.querySelectorAll('header, nav, [role="banner"], .header, .navbar, .sticky, .fixed-top, [style*="position: fixed"], [style*="position:sticky"]').forEach(function(el) { if (el.style.position === 'fixed' || el.style.position === 'sticky' || getComputedStyle(el).position === 'fixed' || getComputedStyle(el).position === 'sticky') { el.style.position = 'static'; el.style.top = 'auto'; el.style.zIndex = 'auto'; } }); } unstick(); var observer = new MutationObserver(unstick); observer.observe(document.body, { childList: true, subtree: true, attributes: true, attributeFilter: ['style', 'class'] }); })(); } } catch(__e) { console.warn('[Userscript:Kill Sticky Headers]', __e); } })(); })(); Make Swarm schedule containers on the same node when they are linked together by aanand · Pull Request #972 · docker/compose · GitHub
Skip to content

Make Swarm schedule containers on the same node when they are linked together - #972

Merged
aanand merged 1 commit into
docker:masterfrom
aanand:set-host-config-at-create-time
Mar 20, 2015
Merged

Make Swarm schedule containers on the same node when they are linked together#972
aanand merged 1 commit into
docker:masterfrom
aanand:set-host-config-at-create-time

Conversation

@aanand

Copy link
Copy Markdown

... by specifying all HostConfig at create time. This is required for Swarm integration: the cluster needs to know about config like links and volumes_from at create time so that it can co-schedule containers. This is particularly important because we rely on volumes_from when recreating containers - if the old/intermediate/new containers aren't co-scheduled, they'll fail to start.

Because the ability to specify HostConfig at create time was introduced in Docker 1.4, that's our new minimum version requirement. The install docs have been updated accordingly.

@aanandaanand mentioned this pull request Feb 16, 2015
@cpuguy83

Copy link
Copy Markdown
Contributor

Looks like HostConfig on create has been available since 1.3.0 - https://github.com/docker/docker/blob/v1.3.0/daemon/create.go#L31

@dnephin

Copy link
Copy Markdown

Overall I like it.

This is going to conflict pretty heavily with #858, but it should be manageable.

Both this PR and #858 are kind of blocked on #886. Do you know if there is any word on when we'll be able to run the test suite against docker > 1.3 ?

@aanand

Copy link
Copy Markdown
Author

@cpuguy83 Interesting - looks like this wasn't made official until API version 1.15: http://docs.docker.com/reference/api/docker_remote_api/#v115

@dnephin Yeah, we really need a better setup. I'm looking into it.

@bfirshbfirsh added this to the 1.2.0 milestone Mar 2, 2015
@aanand
aanandforce-pushed the set-host-config-at-create-time branch from aabaec1 to 0d4435cCompareMarch 10, 2015 11:51
@bfirshbfirsh changed the title Specify all HostConfig at create timeMake Swarm schedule containers on the same node which are linked togetherMar 13, 2015
@bfirshbfirsh changed the title Make Swarm schedule containers on the same node which are linked togetherMake Swarm schedule containers on the same node when they are linked togetherMar 13, 2015
@aanand
aanandforce-pushed the set-host-config-at-create-time branch from 0d4435c to 1918cfbCompareMarch 13, 2015 15:48
@aanand

Copy link
Copy Markdown
Author

Rebased.

@aanand
aanandforce-pushed the set-host-config-at-create-time branch from 1918cfb to 3e5d0fbCompareMarch 13, 2015 16:59
Comment threadcompose/cli/main.py

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

minor (since it's existing), this is being done in both branches of the is/else, so it should really happen before the branch.

@dnephin

Copy link
Copy Markdown

LGTM (assuming there is still some place to run the automated test suite with the new dependency on docker 1.4.1)

@bfirsh

Copy link
Copy Markdown

@dnephin Now testing on Jenkins against multiple Docker versions! Should this not work on Docker <1.4 though? Hm. Seems like it is.

@dnephin

Copy link
Copy Markdown

@bfirsh I believe the only issue was the api version change (API_VERSION = '1.15') would require docker 1.3.x, where as wercker was on 1.2.x right? I guess my comment should have said 1.3.x, I got the version wrong.

@zk000133

Copy link
Copy Markdown

Built Docker Compose from the 'set-host-config-at-create-time' branch.
If I have any exposed ports declared in the docker-compose.yml file, Swarm will complain when doing a compose up: "unable to find a node with port xxxx available"
Scheduling single containers with bind ports on a swarm works.

@aanand
aanandforce-pushed the set-host-config-at-create-time branch 2 times, most recently from d45980a to 6f9448fCompareMarch 20, 2015 22:09
This is required for Swarm integration: the cluster needs to know
about config like `links` and `volumes_from` at create time so that it
can co-schedule containers.
Signed-off-by: Aanand Prasad <aanand.prasad@gmail.com>
@aanand
aanandforce-pushed the set-host-config-at-create-time branch from 6f9448f to eef4bc3CompareMarch 20, 2015 22:14
@aanand

Copy link
Copy Markdown
Author

I've reverted the documentation changes. The API version has changed, but 1.3 is still the minimum version. (This is largely irrelevant anyway, as we'll be making 1.6 the minimum in the next release.)

aanand added a commit that referenced this pull request Mar 20, 2015
Make Swarm schedule containers on the same node when they are linked together
@aanand
aanand merged commit 5dca6c2 into docker:masterMar 20, 2015
@aanand
aanand deleted the set-host-config-at-create-time branch March 20, 2015 22:43
yuval-k pushed a commit to yuval-k/compose that referenced this pull request Apr 10, 2015
Make Swarm schedule containers on the same node when they are linked together
Signed-off-by: Yuval Kohavi <yuval.kohavi@gmail.com>
dnephin added a commit that referenced this pull request Apr 27, 2015
modified the release notes section the first[PR #972]to[PR #1088]
infraAnchor pushed a commit to infraAnchor/compose that referenced this pull request Mar 6, 2026
Move prober metric GaugeOpts into prober.go to reduce copy-n-paste.
Signed-off-by: SuperQ superq@gmail.com
Sign up for freeto 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.

5 participants

@aanand@cpuguy83@dnephin@bfirsh@zk000133