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

wip: group RUN's, conditionalize starting of services #18

Open
wants to merge 11 commits into
base: master
Choose a base branch
from

Conversation

ibotty
Copy link

@ibotty ibotty commented Jun 24, 2016

No description provided.

@ibotty
Copy link
Author

ibotty commented Jun 24, 2016

"wip" is not the right label. It's more a "RFC". If you want to, I can localize the commits into smaller parts. I can also bring the fedora-based image up to date and let it conform to the centos-one, if so desired.

@humblec
Copy link

humblec commented Aug 12, 2016

@ibotty I apologize for the delay in getting back to you. Its really appreciated if you can make it in different PRs. so that easy to bring in the changes. Thanks !!!

@ibotty
Copy link
Author

ibotty commented Aug 12, 2016

NP. I'll rework it in the following weeks. Btw: is there a test suite available somewhere?

@humblec
Copy link

humblec commented Sep 17, 2016

@ibotty we have some internal tests, but no upstream. I will look into this. Also appreciated if you can break the commits and send PR.

@humblec humblec self-assigned this Sep 17, 2016
Copy link
Member

@MohamedAshiqrh MohamedAshiqrh left a comment

Choose a reason for hiding this comment

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

Nice Work @ibotty :-) .

var=$((var+1))
echo "$dir is not empty"
else
if ! cp -r ${dir}_bkp/* $dir
Copy link
Member

Choose a reason for hiding this comment

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

I feel we should copy only if all the directory in the list are empty. Say if they miss a volume -v /var/lib/glusterd:/var/lib/glusterd:z, In this case it will copy the default options and start the container which is not IMO is persisting the state of container. I feel It should fail in these cases and let the user notified that failed due to this directory.

Copy link
Author

Choose a reason for hiding this comment

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

Agree.


enable_start_unit_if_env() {
local unit="$1"
local env_var="$1"
Copy link
Member

Choose a reason for hiding this comment

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

Shouldn't this be $2, let me know if I am wrong.

Copy link
Author

Choose a reason for hiding this comment

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

Of course!

RUN systemctl enable gluster-setup.service

EXPOSE 2222 111 245 443 24007 2049 8080 6010 6011 6012 38465 38466 38468 38469 49152 49153 49154 49156 49157 49158 49159 49160 49161 49162
RUN yum --setopt=tsflags=nodocs -y install centos-release-gluster epel-release && \
Copy link
Member

Choose a reason for hiding this comment

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

Can you add yum --setopt=tsflags=nodocs -y update ? @humblec what do you think will we need this?

Copy link
Author

@ibotty ibotty Sep 20, 2016

Choose a reason for hiding this comment

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

AFAICT there is no consensus re yum update within Dockerfiles. (See e.g. this discussion). I tend not to include them if the base image gets updated regularly. I rely on my build triggers in that case. Note that if the image is not updated, you still have to make sure to rebuild the image. And how should you know you'll have to do that :/.

The advantage of not using yum update is reproducibility.

Copy link
Member

Choose a reason for hiding this comment

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

Agreed. So we will depend on the image rebuilds and trigger accordingly. BTW link"this discussion" points to 404 page.

Copy link
Author

Choose a reason for hiding this comment

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

I never get the github issue links right. corrected above.

openssh-server openssh-clients ntp rsync tar cronie sudo xfsprogs \
glusterfs glusterfs-server glusterfs-geo-replication && \
yum clean all && \
(cd /lib/systemd/system/sysinit.target.wants/; for i in *; do [ $i == systemd-tmpfiles-setup.service ] || rm -f $i; done) && \
Copy link
Member

Choose a reason for hiding this comment

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

I am not sure but doesn't this wipe the service files of gluster too, since its done after installation of the packages.

Copy link
Author

Choose a reason for hiding this comment

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

Well, yes. It wipes the annotation that they are to be started (if they start automatically). The unit files themselves don't reside there.

Copy link
Member

Choose a reason for hiding this comment

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

Since we copy our service file here thought everyone will be doing the same.

Copy link
Author

Choose a reason for hiding this comment

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

But that one does not get deleted. Only the unit links in xxx.wants get deleted. Maybe I am missing things.

Copy link
Member

Choose a reason for hiding this comment

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

Oh yeah my bad did not notice the "xxx.wants" there. Thanks

yum clean all && \
(cd /lib/systemd/system/sysinit.target.wants/; for i in *; do [ $i == systemd-tmpfiles-setup.service ] || rm -f $i; done) && \
rm -f /lib/systemd/system/multi-user.target.wants/* && \
rm -f /etc/systemd/system/*.wants/* && \
Copy link
Member

Choose a reason for hiding this comment

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

I like the way && is used instead of ; .

@ibotty
Copy link
Author

ibotty commented Sep 20, 2016

Sorry for not getting back. I will incorporate the comments, split it up and give it a test ride, hopefully next week.

@MohamedAshiqrh
Copy link
Member

@ibotty sure. appreciate your contribution.

@humblec
Copy link

humblec commented Mar 8, 2017

@ibotty looks like u r busy. :). Please let us know if you would like us to move on this with next iteration of this patch.

@ibotty
Copy link
Author

ibotty commented Mar 8, 2017

Oh, Sorry. Yes, I was and am busy. I did run into too many problems with lvm getting confused between host and docker container that I installed in the host directly. So it will be hard for me to dedicate time to this. Sorry for not communicating!

@humblec
Copy link

humblec commented Mar 8, 2017

@ibotty @MohamedAshiqrh we use LVM in our setup without issues among host and container. Not sure what issues you are facing in ur setup. Any way we will revisit the PR. Thanks!

@MohamedAshiqrh
Copy link
Member

@humblec @ibotty Yeah LVM has no issues in my setup. If at all you have time, can you point us what errors you faced. so that we can see how to avoid any such issues.

@ibotty
Copy link
Author

ibotty commented Mar 8, 2017

I don't have the details handy, but LVM's config files in the container and on the host were not consistent, so I got the warning about having to repair a thin pool. On the end instead of debugging that further, I installed on the host.

I would still be willing to rebase this PR, but I won't be able to test the changes. If you are interested, I will do that soon-ish.

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