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

Add restart option to Fig. #594

Merged
merged 1 commit into from
Dec 8, 2014
Merged

Add restart option to Fig. #594

merged 1 commit into from
Dec 8, 2014

Conversation

paulRbr
Copy link

@paulRbr paulRbr commented Oct 28, 2014

Hello!

I simply find this project really good, and ended up needing the restart option (Related to #478).

Since Docker 1.2 there is a restart option on docker running containers to add restart policies. I think fig options should be able to set restart policies to it's orchestrated containers.
This PR adds the option in Fig.

Let me know if there it's all ok?

@bfirsh
Copy link

bfirsh commented Oct 28, 2014

Hello! Thanks for this.

It looks like the option to start() is restart_policy not restart. I think I prefer restart in fig.yml though - it matches the docker run option.

@paulRbr paulRbr force-pushed the restart-option branch 10 times, most recently from 9d0ea1c to 7b91175 Compare October 28, 2014 22:12
@paulRbr
Copy link
Author

paulRbr commented Oct 28, 2014

Hi @bfirsh!

Indeed it's restart_policy I hadn't check with the docker-py api.
Got the modification done and left the option name to match the docker run one, hope to see this in the next release so we can use it in our project.

Cheers!

@thaJeztah
Copy link
Member

👍 @bfirsh any chance this could make it in the 1.0.1 release? Will that be at the same time as the Docker 1.3.1?

@bfirsh
Copy link

bfirsh commented Oct 29, 2014

I think we'll release 1.0.1 as a quick bugfix release as soon as dockerpty is ready. We can then put this into a larger 1.1 feature release.

@thaJeztah
Copy link
Member

Guess I'll have to be patient then, or look into compiling fig myself :)

@paulRbr
Copy link
Author

paulRbr commented Oct 29, 2014

I have to admit that I would have loved to see this in 1.0.1 too.

If we consider that Fig should be in sync with the docker releases, then this is a bug fix and not a new feature 😄

@bfirsh
Copy link

bfirsh commented Oct 29, 2014

Fig isn't in sync with Docker.

@bfirsh
Copy link

bfirsh commented Oct 29, 2014

It might make it into 1.0.1, but it's not going to be a blocker for a bugfix release, that's all.

I would quite like to make 1.0.x bug fix releases and 1.x.0 feature releases, as per semantic versioning (and how Docker does it).

@paulRbr
Copy link
Author

paulRbr commented Oct 29, 2014

Yes I thought so and agree clearly with your point.

Obviously this is a new feature for Fig. Thus should be in a 1.x.0 release.

Thanks for your work !
Em 29/10/2014 16:01, "Ben Firshman" notifications@github.com escreveu:

Fig isn't in sync with Docker.


Reply to this email directly or view it on GitHub
#594 (comment).

@bfirsh
Copy link

bfirsh commented Oct 29, 2014

Though that's not to disregard your PR. I really want this too. ;)

Currently figuring out how to get our CI system to run the damn test suite. The tests run fine locally, so I think this is okay.

if len(parts) == 2:
name, max_retry_count = parts
else:
name, = parts
Copy link

Choose a reason for hiding this comment

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

Stray comma here

Copy link
Author

Choose a reason for hiding this comment

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

Because I don't want the List but the only element inside

>>> a, = ['hello']
>>> a
'hello'
>>> a = ['hello']
>>> a
['hello']

Copy link

Choose a reason for hiding this comment

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

Oh, neat.

Copy link

Choose a reason for hiding this comment

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

name = parts[0] is much clearer. ;) Not a big deal.

Copy link
Author

Choose a reason for hiding this comment

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

Fair enough :)

@paulRbr
Copy link
Author

paulRbr commented Oct 29, 2014

I pushed force the first commit and pushed normally the second one, hope this forces the tests to run

@bfirsh
Copy link

bfirsh commented Oct 30, 2014

That worked. https://app.wercker.com/#build/5451078547c2f0c812105681 Looks like commit statuses are broken.

Thanks!

@paulRbr
Copy link
Author

paulRbr commented Oct 30, 2014

It seems the build was launch on the main changes (cc003a4) but not on my second commit of documentation (f457057).

@bfirsh
Copy link

bfirsh commented Oct 30, 2014

Oh yeah. Weird.

@paulRbr
Copy link
Author

paulRbr commented Nov 7, 2014

@bfirsh any chance to get this merged in?

@dnephin
Copy link

dnephin commented Nov 7, 2014

LGTM

@dnephin
Copy link

dnephin commented Nov 7, 2014

I'm not seeing a way to force the build, but @popox if you git commit --amend and make a whitespace change to the comment it should trigger another build I think.

@paulRbr paulRbr force-pushed the restart-option branch 2 times, most recently from 35793f1 to b9bd478 Compare November 8, 2014 09:56
@paulRbr
Copy link
Author

paulRbr commented Nov 8, 2014

@dnephin commit amending didn't do the trick, so I just squashed and rebased on master.

Signed-off-by: Paul Bonaud <paul@bonaud.fr>
@paulRbr
Copy link
Author

paulRbr commented Nov 8, 2014

The build is launched on my fork but not on the PR.

@dnephin
Copy link

dnephin commented Nov 8, 2014

Cool, works for me, looks good

@@ -142,7 +142,7 @@ dns:
- 9.9.9.9
```

### working\_dir, entrypoint, user, hostname, domainname, mem\_limit, privileged
### working\_dir, entrypoint, user, hostname, domainname, mem\_limit, privileged, restart

Each of these is a single value, analogous to its [docker run](https://docs.docker.com/reference/run/) counterpart.
Copy link
Member

Choose a reason for hiding this comment

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

Is this still true? Thinking of :max_retry here (or is that to be considered a "single" value? idk)

@thaJeztah
Copy link
Member

@dnephin is there anything needed to move this PR forward? I added two small suggestions, but apart from that, wondering if this is ready to merge?

@docteurklein
Copy link

would be great to see this merged :)

@ghost ghost mentioned this pull request Nov 26, 2014
@dnephin
Copy link

dnephin commented Dec 2, 2014

LGTM

ping @bfirsh

@dnephin dnephin added this to the 1.1.0 milestone Dec 3, 2014
@bfirsh
Copy link

bfirsh commented Dec 8, 2014

LGTM

bfirsh added a commit that referenced this pull request Dec 8, 2014
@bfirsh bfirsh merged commit e9d946b into docker:master Dec 8, 2014
@bfirsh
Copy link

bfirsh commented Dec 8, 2014

Thanks @popox!

@paulRbr paulRbr deleted the restart-option branch December 8, 2014 17:44
@bfirsh bfirsh mentioned this pull request Dec 9, 2014
@cgcgbcbc
Copy link

I wonder when this feature will be published? along with 1.1.0 milestone? I noticed that there is no due date for 1.1.0 milestone.. so is there a current walk-around besides using the HEAD version?

@bsideup
Copy link
Member

bsideup commented Dec 22, 2014

+1

Neat feature and it would be good to see it in release version ASAP

@blackrosezy
Copy link

+1

yuval-k pushed a commit to yuval-k/compose that referenced this pull request Apr 10, 2015
Add restart option to Fig.
Signed-off-by: Yuval Kohavi <yuval.kohavi@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

8 participants